pvs-common.gen 7.3 KB
Newer Older
1

Jean-Christophe's avatar
Jean-Christophe committed
2 3 4
unknown "unfinished" "\"\\0\""
unknown "untried" "\"\\0\""
valid "succeeded"
5 6
time "why3cpulimit time : %s s"

7
(*transformation "inline_trivial"*)
8
transformation "eliminate_builtin"
9 10

(* PVS does not support mutual recursion *)
11
transformation "eliminate_mutual_recursion"
12
(* though we could do better, we only use recursion on one argument *)
13 14
transformation "eliminate_non_struct_recursion"

15
transformation "eliminate_literal"
16 17
transformation "eliminate_epsilon"

18
(* PVS only has simple patterns *)
19
transformation "compile_match"
20
transformation "eliminate_projections"
21 22 23 24 25 26 27 28 29

transformation "simplify_formula"

theory BuiltIn
  syntax type   int   "int"
  syntax type   real  "real"
  syntax predicate  (=)   "(%1 = %2)"
end

30 31 32 33 34
theory HighOrd
  syntax type (->) "[%1 -> %2]"
  syntax function (@) "%1(%2)"
end

35
theory map.Map
36
  syntax function get  "%1(%2)"
37 38 39 40
  syntax function ([]) "%1(%2)"

  syntax function set    "(%1 WITH [(%2) |-> %3])"
  syntax function ([<-]) "(%1 WITH [(%2) |-> %3])"
MARCHE Claude's avatar
MARCHE Claude committed
41 42
end

43
theory Bool
44 45 46 47
  syntax type bool   "bool"

  syntax function True  "TRUE"
  syntax function False "FALSE"
48 49 50
end

theory bool.Bool
51 52 53 54 55

  syntax function andb  "(%1 AND %2)"
  syntax function orb   "(%1 OR %2)"
  syntax function xorb  "(%1 XOR %2)"
  syntax function notb  "(NOT %1)"
56
  syntax function implb "(%1 => %2)"
57 58 59 60 61 62 63 64

end

theory int.Int

  syntax function zero "0"
  syntax function one  "1"

65 66 67 68
  syntax function ( + ) "(%1 + %2)"
  syntax function ( - ) "(%1 - %2)"
  syntax function ( * ) "(%1 * %2)"
  syntax function (-_)  "(-%1)"
69 70 71 72 73 74

  syntax predicate (<=) "(%1 <= %2)"
  syntax predicate (<)  "(%1 <  %2)"
  syntax predicate (>=) "(%1 >= %2)"
  syntax predicate (>)  "(%1 >  %2)"

75 76 77 78 79 80 81
  remove prop MulComm.Comm
  remove prop MulAssoc.Assoc
  remove prop Unit_def_l
  remove prop Unit_def_r
  remove prop Inv_def_l
  remove prop Inv_def_r
  remove prop Assoc
82 83
  remove prop Mul_distr_l
  remove prop Mul_distr_r
84
  remove prop Comm
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
  remove prop Unitary
  remove prop Refl
  remove prop Trans
  remove prop Antisymm
  remove prop Total
  remove prop NonTrivialRing
  remove prop CompatOrderAdd
  remove prop CompatOrderMult
  remove prop ZeroLessOne

end

theory int.Abs

  syntax function abs "abs(%1)"

  remove prop Abs_pos

end

theory int.MinMax

  syntax function min "min(%1, %2)"
  syntax function max "max(%1, %2)"

end

theory real.Real

114 115
  syntax function zero "0"
  syntax function one  "1"
116

117 118 119 120
  syntax function ( + ) "(%1 + %2)"
  syntax function ( - ) "(%1 - %2)"
  syntax function (-_)  "(-%1)"
  syntax function ( * ) "(%1 * %2)"
121
  (* / and inv are defined in the realization *)
122

123 124 125 126
  syntax predicate (<=) "(%1 <= %2)"
  syntax predicate (<)  "(%1 <  %2)"
  syntax predicate (>=) "(%1 >= %2)"
  syntax predicate (>)  "(%1 >  %2)"
127

128 129 130 131 132 133 134
  remove prop MulComm.Comm
  remove prop MulAssoc.Assoc
  remove prop Unit_def_l
  remove prop Unit_def_r
  remove prop Inv_def_l
  remove prop Inv_def_r
  remove prop Assoc
135 136
  remove prop Mul_distr_l
  remove prop Mul_distr_r
137
  remove prop Comm
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
  remove prop Unitary
  remove prop Inverse
  remove prop NonTrivialRing
  remove prop CompatOrderAdd
  remove prop CompatOrderMult
  remove prop ZeroLessOne
  remove prop Refl
  remove prop Trans
  remove prop Antisymm
  remove prop Total
  remove prop assoc_mul_div
  remove prop assoc_div_mul
  remove prop assoc_div_div

end

154 155 156 157
theory real.MinMax
  syntax function min "min(%1, %2)"
  syntax function max "max(%1, %2)"

158 159
  remove prop Max_l
  remove prop Min_r
160 161 162 163
  remove prop Max_comm
  remove prop Min_comm
  remove prop Max_assoc
  remove prop Min_assoc
164 165
end

166 167
theory real.RealInfix

168 169 170 171
  syntax function (+.)  "(%1 + %2)"
  syntax function (-.)  "(%1 - %2)"
  syntax function (-._) "(-%1)"
  syntax function ( *.) "(%1 * %2)"
172 173
  syntax function (/.)  "real@Real.infix_sl(%1, %2)"
  syntax function inv   "real@Real.inv(%1)"
174

175 176 177 178
  syntax predicate (<=.) "(%1 <= %2)"
  syntax predicate (<.)  "(%1 <  %2)"
  syntax predicate (>=.) "(%1 >= %2)"
  syntax predicate (>.)  "(%1 >  %2)"
179 180 181 182 183

end

theory real.Abs

184
  syntax function abs "abs(%1)"
185 186 187 188 189 190 191 192

  remove prop Abs_le
  remove prop Abs_pos

end

theory real.FromInt

193
  syntax function from_int "(%1 :: real)"
194 195 196 197 198 199 200 201 202 203

  remove prop Zero
  remove prop One
  remove prop Add
  remove prop Sub
  remove prop Mul
  remove prop Neg

end

Jean-Christophe's avatar
Jean-Christophe committed
204 205 206 207 208 209 210 211 212 213 214
theory real.PowerReal

  syntax function pow "(%1 ^ %2)"

  remove prop Pow_x_zero
  remove prop Pow_x_one
  remove prop Pow_one_y

end

(***
215 216
theory real.Square

217
  syntax function sqrt "SQRT(%1)"
218 219 220 221 222

end

theory real.ExpLog

223 224
  syntax function exp "EXP(%1)"
  syntax function log "LOG(%1)"
225 226 227 228 229

end

theory real.Trigonometry

230 231
  syntax function cos "COS(%1)"
  syntax function sin "SIN(%1)"
232 233 234

  syntax function pi "PI"

235
  syntax function tan "TAN(%1)"
236 237

end
Jean-Christophe's avatar
Jean-Christophe committed
238
***)
Jean-Christophe's avatar
Jean-Christophe committed
239

240 241 242 243 244 245 246 247 248 249 250
theory option.Option
  syntax type option "lift[%1]"

  syntax function None "bottom"
  syntax function Some "up(%1)"
end

theory list.List

  syntax type list "list[%1]"

251
  syntax function Nil  "(null :: %t0)"
252 253 254 255 256 257 258 259 260 261 262 263
  syntax function Cons "cons(%1, %2)"

end

theory list.Length
  syntax function length "length(%1)"
  remove prop Length_nonnegative
  remove prop Length_nil
end

theory list.Mem
  syntax predicate mem "member(%1, %2)"
264

265 266 267 268 269 270 271 272 273 274 275 276 277
end

theory list.Nth
  syntax function nth
    "IF 0 <= %1 AND %1 < length(%2) THEN up(nth(%2, %1)) ELSE bottom ENDIF"
end

theory list.Append
  syntax function (++) "append(%1, %2)"

  remove prop Append_assoc
  remove prop Append_l_nil
  remove prop Append_length
Jean-Christophe's avatar
Jean-Christophe committed
278 279 280
  (* FIXME? the following are not part of PVS prelude *)
  remove prop mem_append
  remove prop mem_decomp
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
end

theory list.Reverse
  syntax function reverse "reverse(%1)"
end

theory set.Set
  syntax type set "set[%1]"

  syntax predicate mem "member(%1, %2)"
  remove prop      extensionality

  syntax predicate subset "subset?(%1, %2)"
  remove prop      subset_trans

  syntax function  empty    "(emptyset :: %t0)"
  syntax predicate is_empty "empty?(%1)"
298
  remove prop      is_empty_empty
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318

  syntax function add "add(%1, %2)"
  syntax function singleton "singleton(%1)"

  syntax function remove "remove(%1, %2)"
  remove prop     subset_remove

  syntax function union "union(%1, %2)"

  syntax function inter "intersection(%1, %2)"

  syntax function diff "difference(%1, %2)"
  remove prop     subset_diff

  (* TODO: choose *)

  syntax function all "fullset"
end

theory set.Fset
319
  syntax type fset "finite_set[%1]"
320 321 322 323 324 325 326 327 328

  syntax predicate mem "member(%1, %2)"
  remove prop      extensionality

  syntax predicate subset "subset?(%1, %2)"
  remove prop      subset_trans

  syntax function  empty    "(emptyset :: %t0)"
  syntax predicate is_empty "empty?(%1)"
329 330
  remove prop      is_empty_empty
  remove prop      empty_is_empty
331 332

  syntax function add "add(%1, %2)"
333
  remove prop     add_def
334 335 336
  syntax function singleton "singleton(%1)"

  syntax function remove "remove(%1, %2)"
337
  remove prop     remove_def
338 339 340
  remove prop     subset_remove

  syntax function union "union(%1, %2)"
341
  remove prop     union_def
342 343

  syntax function inter "intersection(%1, %2)"
344
  remove prop     inter_def
345 346

  syntax function diff "difference(%1, %2)"
347
  remove prop     diff_def
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362
  remove prop     subset_diff

  (* TODO: choose *)

  syntax function cardinal "Card(%1)"
  remove prop     cardinal_nonneg
  remove prop     cardinal_empty
  remove prop     cardinal_add
  remove prop     cardinal_remove
  remove prop     cardinal_subset
  remove prop     cardinal1

  (* TODO: nth *)
end

Jean-Christophe's avatar
Jean-Christophe committed
363 364 365
(* this file has an extension .aux rather than .gen
   since it should not be distributed *)
import "pvs-realizations.aux"