library colibrilib.sign_product — module SPTThe maps of colibri2 from nodes to powers (Node.PT)
module SPT267use int.Int268use list.List269use option.Option270use colibrilib.ring.Atom271use SAssoc272273type t274275function bindings (m:t) : list binding276277axiom bindings_sorted: forall m. sorted (bindings m)278279function get (k:Atom.t) (m:t) : option power = assoc k (bindings m)280281val is_empty (m:t) : bool282ensures { result <-> bindings m = Nil }283284val find_opt (k:Atom.t) (m:t) : option power285ensures { result = get k m }286287val remove (k:Atom.t) (m:t) : t288ensures { forall k'. get k' result = if k' = k then None else get k' m }289
Node.PT.slow_merge
val merge (f: Atom.t -> option power -> option power -> option power) (m1 m2:t) : t292requires { forall k. f k None None = None }293ensures { forall k. get k result = f k (get k m1) (get k m2) }294295val map (f: power -> power) (m:t) : t296ensures { forall k. get k result = match get k m with297| None -> None | Some v -> Some (f v) end }298
Node.PT.to_list
val to_list (m:t) : list binding301ensures { result = bindings m }302end303