Common — library colibrilib.models — module VarModel

bdd.Var: no key gets a variable (keys is empty, so of_key never returns). A model of partial: of_key may not return, it is the only way to get a variable from a key.

1257
module VarModel
1258
use int.Int
1259
use mach.int.Int63
1260
use set.Set
1261
use colibrilib.bdd.Key
1262
use mach.c.C as C
1263
1264
constant
keys
: set Key.t =
1265
Set.add (Key.Index (0:int63)) (Set.add (Key.Index (1:int63)) (Set.singleton (Key.Index (2:int63))))
1266
1267
function
key_of_var
(x: int63) : Key.t = Key.Index x
1268
function
var_of_key
(k: Key.t) : int63 =
1269
match k with Key.Index i -> i | _ -> (0: int63) end
1270
Valid (17ms) (colibri2)
1271
let partial
of_key
(k: Key.t) : int63
1272
ensures { Set.mem k keys /\ result = var_of_key k }
1273
= C.c_assert false; absurd
1274
Valid (18ms) (colibri2)
1275
let
to_key
(x: int63) : Key.t
1276
requires { Set.mem (key_of_var x) keys }
1277
ensures { result = key_of_var x }
1278
= Key.Index x
1279
1280
clone colibrilib.bdd.Var {… begin (* cloned colibrilib.bdd.Var *) Valid (10ms) (colibri2) lemma
Var.bij1
Valid (16ms) (colibri2) lemma
Var.bij2
Valid (39ms) (colibri2) lemma
Var.small_indexes
let
Var.index
int63 : int63 let
Var.var
t int63 bool : int63 end
}
with
1281
constant keys = keys, function key_of_var = key_of_var,
1282
function var_of_key = var_of_key, val of_key = of_key, val to_key = to_key,
1283
lemma bij1, lemma bij2, lemma small_indexes
1284
end