Common — library colibrilib.union_congr — module Export

The interface of OCaml

The functions that stage2/union.ml calls, their contracts restated: they are all total.

807
module Export
808
use int.Int
809
use real.RealInfix
810
use real.FromInt
811
use real.Abs
812
use real.Truncate
813
use option.Option
814
use list.List
815
use set.Set as S
816
use colibrilib.bound.Bound
817
use colibrilib.spec.Sound
818
use colibrilib.spec.Opt
819
use colibrilib.dv.Dv
820
use colibrilib.dv.RealSets
821
use colibrilib.q.Real as Real
822
use colibrilib.stdq.StdQ as Q
823
use colibrilib.stda.StdA as A
824
use colibrilib.union.Union
825
use colibrilib.congruence.Congruence as C
826
use real.Square
827
use real.MinMax
828
use UnionCongr
829
Valid (34ms) (colibri2)
830
let
reals
() : t
831
ensures { exact mem (fun _ -> true) result }
832
= UnionCongr.reals ()
833
Valid (49ms) (colibri2)
834
let
integers
() : t
835
ensures { exact mem (fun x -> Real.is_integer x) result }
836
= UnionCongr.integers ()
837
Valid (32ms) (colibri2)
838
let
singleton
(q: A.t) : t
839
ensures { exact mem (fun x -> x = A.real q) result }
840
= UnionCongr.singleton q
841
Valid (40ms) (colibri2)
842
let
zero
() : t
843
ensures { exact mem (fun x -> x = 0.0) result }
844
= UnionCongr.zero ()
845
Valid (39ms) (colibri2)
846
let
of_congruence
(c: C.t) : t
847
ensures { exact mem (fun x -> C.member x c) result }
848
= UnionCongr.of_congruence c
849
Valid (38ms) (colibri2)
850
let
gt
(q: A.t) : t
851
ensures { exact mem (fun x -> A.real q <. x) result }
852
= UnionCongr.gt q
853
Valid (48ms) (colibri2)
854
let
ge
(q: A.t) : t
855
ensures { exact mem (fun x -> A.real q <=. x) result }
856
= UnionCongr.ge q
857
Valid (48ms) (colibri2)
858
let
lt
(q: A.t) : t
859
ensures { exact mem (fun x -> x <. A.real q) result }
860
= UnionCongr.lt q
861
Valid (37ms) (colibri2)
862
let
le
(q: A.t) : t
863
ensures { exact mem (fun x -> x <=. A.real q) result }
864
= UnionCongr.le q
865
Valid (42ms) (colibri2)
866
let
gt'
(t: t) : t
867
ensures { sound_rel mem (>.) t result }
868
= UnionCongr.gt' t
869
Valid (40ms) (colibri2)
870
let
ge'
(t: t) : t
871
ensures { sound_rel mem (>=.) t result }
872
= UnionCongr.ge' t
873
Valid (41ms) (colibri2)
874
let
lt'
(t: t) : t
875
ensures { sound_rel mem (<.) t result }
876
= UnionCongr.lt' t
877
Valid (49ms) (colibri2)
878
let
le'
(t: t) : t
879
ensures { sound_rel mem (<=.) t result }
880
= UnionCongr.le' t
881
Valid (42ms) (colibri2)
882
let
mem_a
(x: A.t) (t: t) : bool
883
ensures { result <-> mem (A.real x) t }
884
= UnionCongr.mem_a x t
885
Valid (36ms) (colibri2)
886
let
is_integer
(t: t) : bool
887
ensures { result -> forall x. mem x t -> Real.is_integer x }
888
= UnionCongr.is_integer t
889
Valid (35ms) (colibri2)
890
let
is_reals
(t: t) : bool
891
ensures { result -> forall x. mem x t }
892
= UnionCongr.is_reals t
893
Valid (43ms) (colibri2)
894
let
is_singleton
(t: t) : option A.t
895
ensures { match result with
896
| Some q -> forall x. mem x t -> x = A.real q
897
| None -> true end }
898
= UnionCongr.is_singleton t
899
Valid (45ms) (colibri2)
900
let
is_included
(a b: t) : bool
901
ensures { result -> forall x. mem x a -> mem x b }
902
= UnionCongr.is_included a b
903
Valid (47ms) (colibri2)
904
let
is_distinct
(a b: t) : bool
905
ensures { result -> forall x. mem x a -> not (mem x b) }
906
= UnionCongr.is_distinct a b
907
Valid (41ms) (colibri2)
908
let
reduce_integers
(t: t) : option t
909
ensures { restrict mem (fun x -> Real.is_integer x) t result }
910
= UnionCongr.reduce_integers t
911
Valid (40ms) (colibri2)
912
let
inter
(a b: t) : option t
913
ensures { restrict mem (fun x -> mem x b) a result }
914
= UnionCongr.inter a b
915
Valid (42ms) (colibri2)
916
let
union
(a b: t) : t
917
ensures { forall x. mem x a \/ mem x b -> mem x result }
918
= UnionCongr.union a b
919
Valid (40ms) (colibri2)
920
let
except
(t: t) (q: A.t) : option t
921
ensures { restrict mem (fun x -> x <> A.real q) t result }
922
= UnionCongr.except t q
923
Valid (46ms) (colibri2)
924
let
complement
(t: t) : option t
925
ensures { forall x. not (mem x t) ->
926
match result with None -> false | Some r -> mem x r end }
927
= UnionCongr.complement t
928
Valid (55ms) (colibri2)
929
let
diff
(a b: t) : option t
930
ensures { restrict mem (fun x -> not (mem x b)) a result }
931
= UnionCongr.diff a b
932
Valid (52ms) (colibri2)
933
let
from_convex_hull
(h: Make.convex_hull) : option t
934
ensures { match result with
935
| Some r -> forall x. Make.in_hull x h -> mem x r
936
| None -> forall x. not (Make.in_hull x h) end }
937
= UnionCongr.from_convex_hull h
938
Valid (48ms) (colibri2)
939
let
get_convex_hull
(t: t) : Make.convex_hull
940
ensures { forall x. mem x t -> Make.in_hull x result }
941
= UnionCongr.get_convex_hull t
942
Valid (46ms) (colibri2)
943
let
enlarge
(big: A.t -> bool) (down up: A.t -> A.t) (t: t) : t
944
ensures { forall x. mem x t -> mem x result }
945
= UnionCongr.enlarge big down up t
946
Valid (54ms) (colibri2)
947
let
neg
(t: t) : t
948
ensures { sound1 mem (fun x -> -. x) t result }
949
= UnionCongr.neg t
950
Valid (46ms) (colibri2)
951
let
add
(a b: t) : t
952
ensures { sound2 mem (fun x y -> x +. y) a b result }
953
= UnionCongr.add a b
954
Valid (31ms) (colibri2)
955
let
minus
(a b: t) : t
956
ensures { sound2 mem (fun x y -> x -. y) a b result }
957
= UnionCongr.minus a b
958
Valid (44ms) (colibri2)
959
let
add_cst
(q: A.t) (t: t) : t
960
ensures { sound1 mem (fun x -> x +. A.real q) t result }
961
= UnionCongr.add_cst q t
962
Valid (46ms) (colibri2)
963
let
mult_cst
(q: A.t) (t: t) : t
964
ensures { sound1 mem (fun x -> A.real q *. x) t result }
965
= UnionCongr.mult_cst q t
966
Valid (42ms) (colibri2)
967
let
mul
(a b: t) : t
968
ensures { sound2 mem (fun x y -> x *. y) a b result }
969
= UnionCongr.mul a b
970
Valid (55ms) (colibri2)
971
let
inv
(t: t) : t
972
ensures { sound1 mem (fun x -> 1.0 /. x) t result }
973
= UnionCongr.inv t
974
Valid (41ms) (colibri2)
975
let
div
(a b: t) : t
976
ensures { sound2 mem (fun x y -> x /. y) a b result }
977
= UnionCongr.div a b
978
Valid (39ms) (colibri2)
979
let
mul_backward
(r: t) (into: option t) (b: t) : C.backward t
980
ensures { match result with
981
| C.R res -> forall x y. (match into with Some i -> mem x i | None -> true end) ->
982
mem y b -> mem (x *. y) r -> mem x res
983
| C.Top -> true end }
984
= UnionCongr.mul_backward r into b
985
Valid (44ms) (colibri2)
986
let
ceil
(t: t) : t
987
ensures { sound1 mem (fun x -> from_int (Truncate.ceil x)) t result }
988
= UnionCongr.ceil t
989
Valid (43ms) (colibri2)
990
let
floor
(t: t) : t
991
ensures { sound1 mem (fun x -> from_int (Truncate.floor x)) t result }
992
= UnionCongr.floor t
993
Valid (51ms) (colibri2)
994
let
truncate
(t: t) : t
995
ensures { sound1 mem (fun x -> from_int (Truncate.truncate x)) t result }
996
= UnionCongr.truncate t
997
Valid (57ms) (colibri2)
998
let
relu
(t: t) : t
999
ensures { sound1 mem (fun x -> max 0.0 x) t result }
1000
= UnionCongr.relu t
1001
Valid (54ms) (colibri2)
1002
let
abs_forward
(t: t) : t
1003
ensures { sound1 mem (fun x -> abs x) t result }
1004
= UnionCongr.abs_forward t
1005
Valid (44ms) (colibri2)
1006
let
abs_backward
(t: t) : t
1007
ensures { preimage1 mem (fun x -> abs x) t result }
1008
= UnionCongr.abs_backward t
1009
Valid (42ms) (colibri2)
1010
let
square_backward
(into: option t) (t: t) : option t
1011
ensures { forall x. (match into with Some i -> mem x i | None -> true end) ->
1012
mem (x *. x) t -> match result with None -> false | Some r -> mem x r end }
1013
= UnionCongr.square_backward into t
1014
Valid (49ms) (colibri2)
1015
let
div_e_forward
(a b: t) : t
1016
ensures { sound2 mem (fun x y -> from_int (Real.div_e x y)) a b result }
1017
= UnionCongr.div_e_forward a b
1018
Valid (43ms) (colibri2)
1019
let
div_f_forward
(a b: t) : t
1020
ensures { sound2 mem (fun x y -> from_int (Real.div_f x y)) a b result }
1021
= UnionCongr.div_f_forward a b
1022
Valid (41ms) (colibri2)
1023
let
div_t_forward
(a b: t) : t
1024
ensures { sound2 mem (fun x y -> from_int (Real.div_t x y)) a b result }
1025
= UnionCongr.div_t_forward a b
1026
Valid (34ms) (colibri2)
1027
let
mod_e_forward
(a b: t) : t
1028
ensures { sound2 mem (fun x y -> Real.mod_e x y) a b result }
1029
= UnionCongr.mod_e_forward a b
1030
Valid (36ms) (colibri2)
1031
let
mod_f_forward
(a b: t) : t
1032
ensures { sound2 mem (fun x y -> Real.mod_f x y) a b result }
1033
= UnionCongr.mod_f_forward a b
1034
Valid (41ms) (colibri2)
1035
let
mod_t_forward
(a b: t) : t
1036
ensures { sound2 mem (fun x y -> Real.mod_t x y) a b result }
1037
= UnionCongr.mod_t_forward a b
1038
Valid (40ms) (colibri2)
1039
let
mod_e_backward_num
(num den mod_: t) : option t
1040
ensures { back2 mem (fun x y -> Real.mod_e x y) num den mod_ result }
1041
= UnionCongr.mod_e_backward_num num den mod_
1042
Valid (38ms) (colibri2)
1043
let
mod_f_backward_num
(num den mod_: t) : option t
1044
ensures { back2 mem (fun x y -> Real.mod_f x y) num den mod_ result }
1045
= UnionCongr.mod_f_backward_num num den mod_
1046
Valid (40ms) (colibri2)
1047
let
mod_t_backward_num
(num den mod_: t) : option t
1048
ensures { back2 mem (fun x y -> Real.mod_t x y) num den mod_ result }
1049
= UnionCongr.mod_t_backward_num num den mod_
1050
end