-
Notifications
You must be signed in to change notification settings - Fork 0
/
imp2.mli
58 lines (41 loc) · 902 Bytes
/
imp2.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
val negb : bool -> bool
type 'a option =
| Some of 'a
| None
val add : int -> int -> int
val mul : int -> int -> int
val sub : int -> int -> int
module Nat :
sig
val eqb : int -> int -> bool
val leb : int -> int -> bool
end
type id =
int
(* singleton inductive, whose constructor was Id *)
val beq_id : id -> id -> bool
type 'a total_map = id -> 'a
val t_update : 'a1 total_map -> id -> 'a1 -> id -> 'a1
type state = int total_map
type aexp =
| ANum of int
| AId of id
| 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 -> int
val beval : state -> bexp -> bool
type com =
| CSkip
| CAss of id * aexp
| CSeq of com * com
| CIf of bexp * com * com
| CWhile of bexp * com
val ceval_step : state -> com -> int -> state option