library colibrilib.bdd — module NodeHmodule NodeH232
Stay abstract: Node.H with lists as values
use map.Map233use Node234use list.List235use list.Length236use option.Option237use mach.int.Int63238use int.Int239240type t 'a = abstract mutable { mutable contents: Node.t -> list 'a }241242val create (_n: int63) : t 'a243ensures { forall k. result.contents k = Nil }244
Node.H.add_change (fun a -> [a]) (fun b a -> a :: b) h n x
val add_cons (h: t 'a) (n: Node.t) (x: 'a) : unit247writes { h }248ensures { h.contents = Map.set (old h.contents) n (Cons x (old h.contents n)) }249
A binding with the shortest non–empty list (the Node.H.fold of get_var_less_shift in bddbitv.ml)
val fold_min (h: t 'a) : option (Node.t, int, list 'a)253ensures { match result with254| None -> forall k. h.contents k = Nil255| Some (n, len, l) -> l = h.contents n /\ l <> Nil /\ len = length l /\256(forall k. h.contents k <> Nil -> len <= length (h.contents k))257end }258end259