https://github.com/csb6/wp
Guarded Command Language and Weakest Precondition tools
https://github.com/csb6/wp
Last synced: 5 months ago
JSON representation
Guarded Command Language and Weakest Precondition tools
- Host: GitHub
- URL: https://github.com/csb6/wp
- Owner: csb6
- License: gpl-3.0
- Created: 2024-06-01T03:01:54.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T00:59:26.000Z (about 2 years ago)
- Last Synced: 2025-07-19T14:24:25.830Z (12 months ago)
- Language: Standard ML
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WP
Parser, interpreter, and tools for working with the [Guarded Command Language](https://en.wikipedia.org/wiki/Guarded_Command_Language) (GCL) described in *A Discipline of Programming* by Edsger Dijkstra and the
corresponding [system of predicate transformers](https://en.wikipedia.org/wiki/Predicate_transformer_semantics).
## Build requirements
- [SML of New Jersey](https://www.smlnj.org) (SML/NJ)
- ML-Lex (distributed alongside SML/NJ)
- ML-Yacc (distributed alongside SML/NJ)
## Usage
### Parser
`driver.sml` is the main entry point for running the parser. From the shell, run:
sml gcl/gcl.cm gcl_parser/gcl_parser.cm driver.sml
Once the SML/NJ REPL launches, GCL files can be parsed by calling the `Driver.parse` function. For example:
Driver.parse "examples/skip.gcl";
This will parse and typecheck the given GCL source file.
### Weakest precondition tool
`wp.sml` is the main entry point for running the tool. From the shell, run:
sml gcl/gcl.cm wp.sml
Once the SML/NJ REPL launches, the functions in `wp.sml` can be called.