library colibrilib.union_congr — module ExportThe functions that stage2/union.ml calls, their contracts restated: they are all total.
module Export807use int.Int808use real.RealInfix809use real.FromInt810use real.Abs811use real.Truncate812use option.Option813use list.List814use set.Set as S815use colibrilib.bound.Bound816use colibrilib.spec.Sound817use colibrilib.spec.Opt818use colibrilib.dv.Dv819use colibrilib.dv.RealSets820use colibrilib.q.Real as Real821use colibrilib.stdq.StdQ as Q822use colibrilib.stda.StdA as A823use colibrilib.union.Union824use colibrilib.congruence.Congruence as C825use real.Square826use real.MinMax827use UnionCongr828Valid (34ms) (colibri2)829let reals () : t830ensures { exact mem (fun _ -> true) result }831= UnionCongr.reals ()832Valid (49ms) (colibri2)833let integers () : t834ensures { exact mem (fun x -> Real.is_integer x) result }835= UnionCongr.integers ()836Valid (32ms) (colibri2)837let singleton (q: A.t) : t838ensures { exact mem (fun x -> x = A.real q) result }839= UnionCongr.singleton q840Valid (40ms) (colibri2)841let zero () : t842ensures { exact mem (fun x -> x = 0.0) result }843= UnionCongr.zero ()844Valid (39ms) (colibri2)845let of_congruence (c: C.t) : t846ensures { exact mem (fun x -> C.member x c) result }847= UnionCongr.of_congruence c848Valid (38ms) (colibri2)849let gt (q: A.t) : t850ensures { exact mem (fun x -> A.real q <. x) result }851= UnionCongr.gt q852Valid (48ms) (colibri2)853let ge (q: A.t) : t854ensures { exact mem (fun x -> A.real q <=. x) result }855= UnionCongr.ge q856Valid (48ms) (colibri2)857let lt (q: A.t) : t858ensures { exact mem (fun x -> x <. A.real q) result }859= UnionCongr.lt q860Valid (37ms) (colibri2)861let le (q: A.t) : t862ensures { exact mem (fun x -> x <=. A.real q) result }863= UnionCongr.le q864Valid (42ms) (colibri2)865let gt' (t: t) : t866ensures { sound_rel mem (>.) t result }867= UnionCongr.gt' t868Valid (40ms) (colibri2)869let ge' (t: t) : t870ensures { sound_rel mem (>=.) t result }871= UnionCongr.ge' t872Valid (41ms) (colibri2)873let lt' (t: t) : t874ensures { sound_rel mem (<.) t result }875= UnionCongr.lt' t876Valid (49ms) (colibri2)877let le' (t: t) : t878ensures { sound_rel mem (<=.) t result }879= UnionCongr.le' t880Valid (42ms) (colibri2)881let mem_a (x: A.t) (t: t) : bool882ensures { result <-> mem (A.real x) t }883= UnionCongr.mem_a x t884Valid (36ms) (colibri2)885let is_integer (t: t) : bool886ensures { result -> forall x. mem x t -> Real.is_integer x }887= UnionCongr.is_integer t888Valid (35ms) (colibri2)889let is_reals (t: t) : bool890ensures { result -> forall x. mem x t }891= UnionCongr.is_reals t892Valid (43ms) (colibri2)893let is_singleton (t: t) : option A.t894ensures { match result with895| Some q -> forall x. mem x t -> x = A.real q896| None -> true end }897= UnionCongr.is_singleton t898Valid (45ms) (colibri2)899let is_included (a b: t) : bool900ensures { result -> forall x. mem x a -> mem x b }901= UnionCongr.is_included a b902Valid (47ms) (colibri2)903let is_distinct (a b: t) : bool904ensures { result -> forall x. mem x a -> not (mem x b) }905= UnionCongr.is_distinct a b906Valid (41ms) (colibri2)907let reduce_integers (t: t) : option t908ensures { restrict mem (fun x -> Real.is_integer x) t result }909= UnionCongr.reduce_integers t910Valid (40ms) (colibri2)911let inter (a b: t) : option t912ensures { restrict mem (fun x -> mem x b) a result }913= UnionCongr.inter a b914Valid (42ms) (colibri2)915let union (a b: t) : t916ensures { forall x. mem x a \/ mem x b -> mem x result }917= UnionCongr.union a b918Valid (40ms) (colibri2)919let except (t: t) (q: A.t) : option t920ensures { restrict mem (fun x -> x <> A.real q) t result }921= UnionCongr.except t q922Valid (46ms) (colibri2)923let complement (t: t) : option t924ensures { forall x. not (mem x t) ->925match result with None -> false | Some r -> mem x r end }926= UnionCongr.complement t927Valid (55ms) (colibri2)928let diff (a b: t) : option t929ensures { restrict mem (fun x -> not (mem x b)) a result }930= UnionCongr.diff a b931Valid (52ms) (colibri2)932let from_convex_hull (h: Make.convex_hull) : option t933ensures { match result with934| Some r -> forall x. Make.in_hull x h -> mem x r935| None -> forall x. not (Make.in_hull x h) end }936= UnionCongr.from_convex_hull h937Valid (48ms) (colibri2)938let get_convex_hull (t: t) : Make.convex_hull939ensures { forall x. mem x t -> Make.in_hull x result }940= UnionCongr.get_convex_hull t941Valid (46ms) (colibri2)942let enlarge (big: A.t -> bool) (down up: A.t -> A.t) (t: t) : t943ensures { forall x. mem x t -> mem x result }944= UnionCongr.enlarge big down up t945Valid (54ms) (colibri2)946let neg (t: t) : t947ensures { sound1 mem (fun x -> -. x) t result }948= UnionCongr.neg t949Valid (46ms) (colibri2)950let add (a b: t) : t951ensures { sound2 mem (fun x y -> x +. y) a b result }952= UnionCongr.add a b953Valid (31ms) (colibri2)954let minus (a b: t) : t955ensures { sound2 mem (fun x y -> x -. y) a b result }956= UnionCongr.minus a b957Valid (44ms) (colibri2)958let add_cst (q: A.t) (t: t) : t959ensures { sound1 mem (fun x -> x +. A.real q) t result }960= UnionCongr.add_cst q t961Valid (46ms) (colibri2)962let mult_cst (q: A.t) (t: t) : t963ensures { sound1 mem (fun x -> A.real q *. x) t result }964= UnionCongr.mult_cst q t965Valid (42ms) (colibri2)966let mul (a b: t) : t967ensures { sound2 mem (fun x y -> x *. y) a b result }968= UnionCongr.mul a b969Valid (55ms) (colibri2)970let inv (t: t) : t971ensures { sound1 mem (fun x -> 1.0 /. x) t result }972= UnionCongr.inv t973Valid (41ms) (colibri2)974let div (a b: t) : t975ensures { sound2 mem (fun x y -> x /. y) a b result }976= UnionCongr.div a b977Valid (39ms) (colibri2)978let mul_backward (r: t) (into: option t) (b: t) : C.backward t979ensures { match result with980| C.R res -> forall x y. (match into with Some i -> mem x i | None -> true end) ->981mem y b -> mem (x *. y) r -> mem x res982| C.Top -> true end }983= UnionCongr.mul_backward r into b984Valid (44ms) (colibri2)985let ceil (t: t) : t986ensures { sound1 mem (fun x -> from_int (Truncate.ceil x)) t result }987= UnionCongr.ceil t988Valid (43ms) (colibri2)989let floor (t: t) : t990ensures { sound1 mem (fun x -> from_int (Truncate.floor x)) t result }991= UnionCongr.floor t992Valid (51ms) (colibri2)993let truncate (t: t) : t994ensures { sound1 mem (fun x -> from_int (Truncate.truncate x)) t result }995= UnionCongr.truncate t996Valid (57ms) (colibri2)997let relu (t: t) : t998ensures { sound1 mem (fun x -> max 0.0 x) t result }999= UnionCongr.relu t1000Valid (54ms) (colibri2)1001let abs_forward (t: t) : t1002ensures { sound1 mem (fun x -> abs x) t result }1003= UnionCongr.abs_forward t1004Valid (44ms) (colibri2)1005let abs_backward (t: t) : t1006ensures { preimage1 mem (fun x -> abs x) t result }1007= UnionCongr.abs_backward t1008Valid (42ms) (colibri2)1009let square_backward (into: option t) (t: t) : option t1010ensures { forall x. (match into with Some i -> mem x i | None -> true end) ->1011mem (x *. x) t -> match result with None -> false | Some r -> mem x r end }1012= UnionCongr.square_backward into t1013Valid (49ms) (colibri2)1014let div_e_forward (a b: t) : t1015ensures { sound2 mem (fun x y -> from_int (Real.div_e x y)) a b result }1016= UnionCongr.div_e_forward a b1017Valid (43ms) (colibri2)1018let div_f_forward (a b: t) : t1019ensures { sound2 mem (fun x y -> from_int (Real.div_f x y)) a b result }1020= UnionCongr.div_f_forward a b1021Valid (41ms) (colibri2)1022let div_t_forward (a b: t) : t1023ensures { sound2 mem (fun x y -> from_int (Real.div_t x y)) a b result }1024= UnionCongr.div_t_forward a b1025Valid (34ms) (colibri2)1026let mod_e_forward (a b: t) : t1027ensures { sound2 mem (fun x y -> Real.mod_e x y) a b result }1028= UnionCongr.mod_e_forward a b1029Valid (36ms) (colibri2)1030let mod_f_forward (a b: t) : t1031ensures { sound2 mem (fun x y -> Real.mod_f x y) a b result }1032= UnionCongr.mod_f_forward a b1033Valid (41ms) (colibri2)1034let mod_t_forward (a b: t) : t1035ensures { sound2 mem (fun x y -> Real.mod_t x y) a b result }1036= UnionCongr.mod_t_forward a b1037Valid (40ms) (colibri2)1038let mod_e_backward_num (num den mod_: t) : option t1039ensures { back2 mem (fun x y -> Real.mod_e x y) num den mod_ result }1040= UnionCongr.mod_e_backward_num num den mod_1041Valid (38ms) (colibri2)1042let mod_f_backward_num (num den mod_: t) : option t1043ensures { back2 mem (fun x y -> Real.mod_f x y) num den mod_ result }1044= UnionCongr.mod_f_backward_num num den mod_1045Valid (40ms) (colibri2)1046let mod_t_backward_num (num den mod_: t) : option t1047ensures { back2 mem (fun x y -> Real.mod_t x y) num den mod_ result }1048= UnionCongr.mod_t_backward_num num den mod_1049end1050