Display program code

ram_simulator.pl : Simulates a Random Access Machine
Simulates a Random Access Machine (RAM) that is an abstract machine consisting of memory cells (mem), program instructions (prog) and a program instruction counter (prog_counter).
The instruction pointed to by the prog_counter is executed, thereby accessing the memory and updating the prog_counter.

How to use:
The memory cell with label L and value V is represented as mem(L,V). The program counter pointing to P is represented as prog_counter(P).
A program instruction has the form prog(L,L1, Instr, Dest): prog_counter(P) selects the instruction for which L=P. After executing the instruction prog_counter is set to L1 by default. Instr and Dest specify the instruction and destination.
[For more please consider DETAILS in the comment.]

See also:
(1) John E. Savage. Models of Computation: Exploring the Power of Computing. Addisson-Wesley, ISBN 0-201-89539-0, 1998.
(2) http://en.wikipedia.org/wiki/Random_Access_Machine

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

Select example query: 

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007