An open API service indexing awesome lists of open source software.

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

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.