library colibrilib.bitwise_rules — module TermSizeThe size of a node, from its value, its domain of the reals and its types: the proofs of Term.size and Term.monome (the driver binds them to these functions)
module TermSize775use int.Int776use real.RealInfix777use real.FromInt778use real.Truncate779use option.Option780use colibrilib.zarith.Zbit781use colibrilib.bdd.Node782use colibrilib.ibdd.IBDD783use colibrilib.env.Env784use colibrilib.spec.Opt785use colibrilib.stda.StdA as A786use colibrilib.union_congr.UnionCongr as UC787use Term788use TermInterval789
The size of the non–negative integers of a domain: the bits of the floor of its upper bound, when its lower bound is non–negative
Valid (1.0s) (colibri2 3) (split_vc) (depth 1)let dom_size (d:env) (n:Node.t) : option int793ensures { when_some (has_size d n) result }794= match interval d n with795| None -> None796| Some u ->797match UC.get_convex_hull u with798| (Some (lo, _), Some (hi, _)) ->799let f = A.floor_z hi in800if A.le (A.of_bigint 0) lo && 0 <= f then begin801{proof…}802assert { live d -> 0 <= ienv d n <= f };803{qed}804Some (Zbit.numbits f)805end else None806| _ -> None807end808end809
Dom_genrelbitv.get_bv_size: from the value when it is known, else the least of the sizes of the domain and of the types
Valid (1.1s) (colibri2)let size (d:env) (n:Node.t) : option int813ensures { when_some (has_size d n) result }814= let t = type_size d n in815match int_value d n with816| Some v ->817if 0 <= v then begin818Some (Zbit.numbits v)819end else t820| None ->821match t, dom_size d n with822| Some a, Some b -> Some (if a <= b then a else b)823| Some a, None -> Some a824| None, o -> o825end826end827
Dom_genrelbitv.monome_int: the term of the node, of its size if it is known
Valid (62ms) (colibri2)let monome (d:env) (n:Node.t) : IBDD.t831ensures { is_term d n result }832= monome_sized d n (size d n)833end834