System Simulation and Cooperative Problem-solving on a Prolog Basis