Alzint — An interpreter for AL(ℤ) programs
Source code: alzint.pl
You need Scryer Prolog to run
it.
AL(ℤ) stands for Assignment Language over Integers. It is a
Turing
complete programming language supporting variable
assignments, loops and conditions.
Alzint is an interpreter for AL(ℤ) programs, written in
Prolog. Alzint lets you run AL(ℤ) programs. It also supports
single-stepping and reverse execution of AL(ℤ) programs.
This means that previous steps of the execution can
be undone and later repeated.
To run an AL(ℤ) program with Alzint, use run(+File):
?- run("ex1.txt").
For single-stepping, use step(+File):
?- step("ex1.txt").
When single-stepping through an AL(ℤ) program, you press:
- c to continue with the next statement
- r to run the program without further interruption
- u to undo the preceding step (reverse execution)
- q to quit
Example files
are ex1.txt, ex2.txt and
ex3.txt.
A transcript of running ex3.txt: ex3.log
If you are interested in more interpreters and compilers in
Prolog, also check out Thinking in
States and Lisprolog.
Acknowledgments: Many thanks
to Christian
Fermüller for spawning my interest in AL(ℤ) and countless
other topics in theoretical computer science.
Main page