1 (* Why3 driver for SMT-LIB2 syntax, excluding bit-vectors *)
3 prelude ";;; generated by SMT-LIB2 driver"
7 Note: we do not insert any command "set-logic" because its
8 interpretation is specific to provers
10 prelude "(set-logic AUFNIRA)"
13 UF : Uninterpreted Function
14 DT : Datatypes (not needed at the end ...)
15 NIRA : NonLinear Integer Reals Arithmetic
19 (* cannot be here because case of psmt2 files: filename "%f-%t-%g.smt2" *)
21 unknown "^\\(unknown\\|sat\\|Fail\\)$" "\\1"
22 unknown "^(:reason-unknown \\([^)]*\\))$" "\\1"
23 time "why3cpulimit time : %s s"
28 syntax type real "Real"
29 syntax predicate (=) "(= %1 %2)"
31 meta "encoding:kept" type int
32 meta "encoding:ignore_polymorphism_ls" predicate (=)
36 syntax predicate ignore'term "true"
37 meta "encoding:ignore_polymorphism_ls" predicate ignore'term
42 prelude ";;; SMT-LIB2: integer arithmetic"
44 syntax function zero "0"
45 syntax function one "1"
47 syntax function (+) "(+ %1 %2)"
48 syntax function (-) "(- %1 %2)"
49 syntax function (*) "(* %1 %2)"
50 syntax function (-_) "(- %1)"
52 syntax predicate (<=) "(<= %1 %2)"
53 syntax predicate (<) "(< %1 %2)"
54 syntax predicate (>=) "(>= %1 %2)"
55 syntax predicate (>) "(> %1 %2)"
57 remove prop MulComm.Comm
58 remove prop MulAssoc.Assoc
59 remove prop Unit_def_l
60 remove prop Unit_def_r
64 remove prop Mul_distr_l
65 remove prop Mul_distr_r
72 remove prop NonTrivialRing
73 remove prop CompatOrderAdd
74 remove prop ZeroLessOne
80 prelude ";;; SMT-LIB2: real arithmetic"
82 syntax function zero "0.0"
83 syntax function one "1.0"
85 syntax function (+) "(+ %1 %2)"
86 syntax function (-) "(- %1 %2)"
87 syntax function (*) "(* %1 %2)"
88 syntax function (/) "(/ %1 %2)"
89 syntax function (-_) "(- %1)"
90 syntax function inv "(/ 1.0 %1)"
92 syntax predicate (<=) "(<= %1 %2)"
93 syntax predicate (<) "(< %1 %2)"
94 syntax predicate (>=) "(>= %1 %2)"
95 syntax predicate (>) "(> %1 %2)"
97 remove prop MulComm.Comm
98 remove prop MulAssoc.Assoc
99 remove prop Unit_def_l
100 remove prop Unit_def_r
101 remove prop Inv_def_l
102 remove prop Inv_def_r
104 remove prop Mul_distr_l
105 remove prop Mul_distr_r
113 remove prop NonTrivialRing
114 remove prop CompatOrderAdd
115 remove prop ZeroLessOne
117 meta "encoding:kept" type real
122 syntax function abs "(ite (>= %1 0.0) %1 (- %1))"
133 syntax function from_int "(to_real %1)"
139 syntax function truncate "(ite (>= %1 0.0) \
141 (- (to_int (- %1))))"
142 syntax function floor "(to_int %1)"
143 syntax function ceil "(- (to_int (- %1)))"
149 syntax type bool "Bool"
150 syntax function True "true"
151 syntax function False "false"
153 meta "algebraic:kept" type bool
157 syntax function andb "(and %1 %2)"
158 syntax function orb "(or %1 %2)"
159 syntax function xorb "(xor %1 %2)"
160 syntax function notb "(not %1)"
161 syntax function implb "(=> %1 %2)"
165 syntax function ite "(ite %1 %2 %3)"
166 meta "encoding:lskept" function ite
167 meta "encoding:ignore_polymorphism_ls" function ite
170 (* not uniformly interpreted by provers
172 syntax function floor "(to_int %1)"
173 remove prop Floor_down
174 remove prop Floor_monotonic
179 syntax type (->) "(Array %1 %2)"
180 syntax function (@) "(select %1 %2)"
182 meta "encoding:lskept" function (@)
183 meta "encoding:ignore_polymorphism_ts" type (->)
184 meta "encoding:ignore_polymorphism_ls" function (@)
190 (* removing well-founded properties, they cannot be useful
191 for SMT solvers, and they imply polymorphism *)
201 syntax function get "(select %1 %2)"
202 syntax function set "(store %1 %2 %3)"
204 meta "encoding:lskept" function get
205 meta "encoding:lskept" function set
206 meta "encoding:ignore_polymorphism_ls" function get
207 meta "encoding:ignore_polymorphism_ls" function ([])
208 meta "encoding:ignore_polymorphism_ls" function set
209 meta "encoding:ignore_polymorphism_ls" function ([<-])
213 meta "encoding:lskept" function const
214 (* syntax function const "(const[%t0] %1)" *)