module Imp:sig
..end
The IMP language.
typecmp =
Imp_syntax.cmp
=
| |
Lt |
(* | less than | *) |
| |
Gt |
(* | greater than | *) |
| |
Eq |
(* | equal to | *) |
| |
Lte |
(* | less than or equal to | *) |
| |
Gte |
(* | greater than or equal to | *) |
Operators to compare integers.
typeaop =
Imp_syntax.aop
=
| |
Add |
| |
Sub |
| |
Mul |
typeaexp =
Imp_syntax.aexp
=
| |
AConst of |
| |
AVar of |
| |
AOp of |
typebexp =
Imp_syntax.bexp
=
| |
BConst of |
| |
BAnd of |
| |
BOr of |
| |
BNot of |
| |
BCmp of |
typecmd =
Imp_syntax.cmd
=
| |
CSkip |
| |
CAbort |
| |
CAssign of |
| |
CIf of |
| |
CWhile of |
| |
CSeq of |
val from_string : string -> bexp * cmd * bexp
from_string string
produces (pre, cmd, post)
, where the
first and last assertions in the program are interpreted as pre- and
post-conditions respectively.
val from_file : string -> bexp * cmd * bexp
Reads the contents of a file. See from_string
for more information.
val bexp_to_string : bexp -> string
Prints a string that represents a boolean expression.