https://github.com/jmid/3countermach
An implementation of Plotkin's 3 Counter Machine
https://github.com/jmid/3countermach
Last synced: 10 months ago
JSON representation
An implementation of Plotkin's 3 Counter Machine
- Host: GitHub
- URL: https://github.com/jmid/3countermach
- Owner: jmid
- Created: 2015-01-29T22:30:37.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-29T22:54:54.000Z (almost 11 years ago)
- Last Synced: 2025-01-29T11:27:26.603Z (12 months ago)
- Language: OCaml
- Size: 102 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
3 Counter Machine interpreter
=============================
This is an OCaml implementation of the 3 Counter Machine from
Sec.1.3.2 of Plotkin's lecture notes on structural operational
semantics [http://homepages.inf.ed.ac.uk/gdp/publications/SOS.ps].
To build:
---------
$ make
To run:
-------
To interpret the program tests/test5-double.3cm with input 5, just run:
$ ./main.byte -input 5 tests/test5-double.3cm
Opening file "tests/test5-double.3cm"
Program:
1: zero x 6 else 2
2: dec x
3: inc y
4: inc y
5: zero x 6 else 2
6: stop
Running with input 5
Result: 10
There is also an option "-trace" to trace the execution.