Skip to content

Commit abb5336

Browse files
committed
Constrain Expr's signature in Expr_raw
1 parent ad886a0 commit abb5336

File tree

2 files changed

+128
-39
lines changed

2 files changed

+128
-39
lines changed

src/smtml/Expr_raw.ml

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/smtml/expr_raw.ml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
include (
2+
Expr :
3+
sig
4+
type t = expr Hc.hash_consed
5+
6+
and expr = private
7+
| Val of Value.t
8+
| Ptr of
9+
{ base : int32
10+
; offset : t
11+
}
12+
| Symbol of Symbol.t
13+
| List of t list
14+
| App of Symbol.t * t list
15+
| Unop of Ty.t * Ty.Unop.t * t
16+
| Binop of Ty.t * Ty.Binop.t * t * t
17+
| Triop of Ty.t * Ty.Triop.t * t * t * t
18+
| Relop of Ty.t * Ty.Relop.t * t * t
19+
| Cvtop of Ty.t * Ty.Cvtop.t * t
20+
| Naryop of Ty.t * Ty.Naryop.t * t list
21+
| Extract of t * int * int
22+
| Concat of t * t
23+
| Binder of Binder.t * t list * t
24+
25+
val view : t -> expr
26+
27+
val hash : t -> int
28+
29+
val equal : t -> t -> bool
30+
31+
val compare : t -> t -> int
32+
33+
val ty : t -> Ty.t
34+
35+
val is_symbolic : t -> bool
36+
37+
val get_symbols : t list -> Symbol.t list
38+
39+
val negate_relop : t -> t
40+
41+
val pp : t Fmt.t
42+
43+
val pp_smt : t list Fmt.t
44+
45+
val pp_list : t list Fmt.t
46+
47+
val to_string : t -> string
48+
49+
val value : Value.t -> t
50+
51+
val ptr : int32 -> t -> t
52+
53+
val list : t list -> t
54+
55+
val symbol : Symbol.t -> t
56+
57+
val app : Symbol.t -> t list -> t
58+
59+
val binder : Binder.t -> t list -> t -> t
60+
61+
val let_in : t list -> t -> t
62+
63+
val forall : t list -> t -> t
64+
65+
val exists : t list -> t -> t
66+
67+
val raw_unop : Ty.t -> Ty.Unop.t -> t -> t
68+
69+
val raw_binop : Ty.t -> Ty.Binop.t -> t -> t -> t
70+
71+
val raw_triop : Ty.t -> Ty.Triop.t -> t -> t -> t -> t
72+
73+
val raw_relop : Ty.t -> Ty.Relop.t -> t -> t -> t
74+
75+
val raw_cvtop : Ty.t -> Ty.Cvtop.t -> t -> t
76+
77+
val raw_naryop : Ty.t -> Ty.Naryop.t -> t list -> t
78+
79+
val raw_extract : t -> high:int -> low:int -> t
80+
81+
val raw_concat : t -> t -> t
82+
83+
module Bool : sig
84+
val true_ : t
85+
86+
val false_ : t
87+
88+
val v : bool -> t
89+
end
90+
end )
91+
92+
let unop = raw_unop
93+
94+
let binop = raw_binop
95+
96+
let triop = raw_triop
97+
98+
let relop = raw_relop
99+
100+
let cvtop = raw_cvtop
101+
102+
let naryop = raw_naryop
103+
104+
let extract ~high ~low = raw_extract ~high ~low
105+
106+
let concat = raw_concat
107+
108+
let simplify = Fun.id
109+
110+
module Bool = struct
111+
let true_ = Bool.true_
112+
113+
let false_ = Bool.false_
114+
115+
let v = Bool.v
116+
117+
let not a = raw_unop Ty_bool Not a
118+
119+
let equal a b = raw_relop Ty_bool Eq a b
120+
121+
let distinct a b = raw_relop Ty_bool Ne a b
122+
123+
let and_ a b = raw_binop Ty_bool And a b
124+
125+
let or_ a b = raw_binop Ty_bool Or a b
126+
127+
let ite a b c = raw_triop Ty_bool Ite a b c
128+
end

0 commit comments

Comments
 (0)