-
Notifications
You must be signed in to change notification settings - Fork 8
/
imp1.mli
80 lines (55 loc) · 1.19 KB
/
imp1.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
type bool =
| True
| False
val negb : bool -> bool
type nat =
| O
| S of nat
type 'a option =
| Some of 'a
| None
type sumbool =
| Left
| Right
val add : nat -> nat -> nat
val mul : nat -> nat -> nat
val sub : nat -> nat -> nat
val bool_dec : bool -> bool -> sumbool
module Nat :
sig
val eqb : nat -> nat -> bool
val leb : nat -> nat -> bool
end
type ascii =
| Ascii of bool * bool * bool * bool * bool * bool * bool * bool
val ascii_dec : ascii -> ascii -> sumbool
type string =
| EmptyString
| String of ascii * string
val string_dec : string -> string -> sumbool
val beq_string : string -> string -> bool
type 'a total_map = string -> 'a
val t_update : 'a1 total_map -> string -> 'a1 -> string -> 'a1
type state = nat total_map
type aexp =
| ANum of nat
| AId of string
| APlus of aexp * aexp
| AMinus of aexp * aexp
| AMult of aexp * aexp
type bexp =
| BTrue
| BFalse
| BEq of aexp * aexp
| BLe of aexp * aexp
| BNot of bexp
| BAnd of bexp * bexp
val aeval : state -> aexp -> nat
val beval : state -> bexp -> bool
type com =
| CSkip
| CAss of string * aexp
| CSeq of com * com
| CIf of bexp * com * com
| CWhile of bexp * com
val ceval_step : state -> com -> nat -> state option