Support for Coq 8.19.2
[why3.git] / drivers / smt-libv2.gen
blob0c4612b2f1270e0ea6aea28c7ab1a7b47e425765
1 (* Why3 driver for SMT-LIB2 syntax, excluding bit-vectors *)
3 prelude ";;; generated by SMT-LIB2 driver"
5 (*
7 Note: we do not insert any command "set-logic" because its
8 interpretation is specific to provers
10 prelude "(set-logic AUFNIRA)"
12     A  : Array
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"
24 valid "^unsat$"
26 theory BuiltIn
27   syntax type int   "Int"
28   syntax type real  "Real"
29   syntax predicate (=)  "(= %1 %2)"
31   meta "encoding:kept" type int
32   meta "encoding:ignore_polymorphism_ls" predicate (=)
33 end
35 theory Ignore
36   syntax predicate ignore'term  "true"
37   meta "encoding:ignore_polymorphism_ls" predicate ignore'term
38 end
40 theory int.Int
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
61   remove prop Inv_def_l
62   remove prop Inv_def_r
63   remove prop Assoc
64   remove prop Mul_distr_l
65   remove prop Mul_distr_r
66   remove prop Comm
67   remove prop Unitary
68   remove prop Refl
69   remove prop Trans
70   remove prop Antisymm
71   remove prop Total
72   remove prop NonTrivialRing
73   remove prop CompatOrderAdd
74   remove prop ZeroLessOne
76 end
78 theory real.Real
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
103   remove prop Assoc
104   remove prop Mul_distr_l
105   remove prop Mul_distr_r
106   remove prop Comm
107   remove prop Unitary
108   remove prop Inverse
109   remove prop Refl
110   remove prop Trans
111   remove prop Antisymm
112   remove prop Total
113   remove prop NonTrivialRing
114   remove prop CompatOrderAdd
115   remove prop ZeroLessOne
117   meta "encoding:kept" type real
121 theory real.Abs
122   syntax function abs "(ite (>= %1 0.0) %1 (- %1))"
124   remove allprops
127 theory real.MinMax
129   remove allprops
132 theory real.FromInt
133   syntax function from_int "(to_real %1)"
135   remove allprops
138 theory real.Truncate
139   syntax function truncate "(ite (>= %1 0.0) \
140                                  (to_int %1) \
141                                  (- (to_int (- %1))))"
142   syntax function floor "(to_int %1)"
143   syntax function ceil "(- (to_int (- %1)))"
145   remove allprops
148 theory Bool
149   syntax type     bool  "Bool"
150   syntax function True  "true"
151   syntax function False "false"
153   meta "algebraic:kept" type bool
156 theory bool.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)"
164 theory bool.Ite
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
171 theory real.Truncate
172   syntax function floor "(to_int %1)"
173   remove prop Floor_down
174   remove prop Floor_monotonic
178 theory HighOrd
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 (@)
188 theory bv.BV_Gen
190   (* removing well-founded properties, they cannot be useful
191      for SMT solvers, and they imply polymorphism *)
192   remove prop ult_wf
193   remove prop ugt_wf
194   remove prop slt_wf
195   remove prop sgt_wf
200 theory map.Map
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 ([<-])
212 theory map.Const
213   meta "encoding:lskept" function const
214 (*  syntax function const "(const[%t0] %1)" *)