You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letset (ask: Q.ask) (x,l) iv=Base.set ask x i v, l
791
+
letmakelx=Base.make l x, l
792
+
letlength (_,l) =Some l
793
+
794
+
letmove_if_affected?(replace_with_const=false)_x__= x
795
+
letmapf (x, l):t = (Base.map f x, l)
796
+
letfold_leftfa (x, l) =Base.fold_left f a x
797
+
letfold_left2fa (x, l) (y, l) =Base.fold_left2 f a x y
798
+
letget_vars_in_e_=[]
799
+
800
+
letsmart_join__= join
801
+
letsmart_widen__= widen
802
+
letsmart_leq__= leq
803
+
804
+
(* It is not necessary to do a least-upper bound between the old and the new length here. *)
805
+
(* Any array can only be declared in one location. The value for newl that we get there is *)
806
+
(* the one obtained by abstractly evaluating the size expression at this location for the *)
807
+
(* current state. If newl leq l this means that we somehow know more about the expression *)
808
+
(* determining the size now (e.g. because of narrowing), but this holds for all the times *)
809
+
(* the declaration is visited. *)
810
+
letupdate_lengthnewl (x, l) = (x, newl)
811
+
812
+
letprintXmlf (x,y) =
813
+
BatPrintf.fprintf f "<value>\n<map>\n<key>\n%s\n</key>\n%a<key>\n%s\n</key>\n%a</map>\n</value>\n" (XmlUtil.escape (Base.name ())) Base.printXml x "length"Idx.printXml y
letbinop_to_t'oppoptopu= binop_to_t opp (I.binop_to_t opt opu)
844
+
letunop_to_t'oppoptopu= unop_to_t opp (I.unop_to_t opt opu)
704
845
705
846
(* Simply call appropriate function for component that is not None *)
706
-
letgetax (e,i) = unop (funx ->
707
-
if e =`Topthen
708
-
let e' =BatOption.map_default (funx -> `Lifted (Cil.kintegerCilint (Cilfacade.ptrdiff_ikind ()) x)) (`Top) (Idx.to_int i) in
709
-
P.get a x (e', i)
710
-
else
711
-
P.get a x (e, i)
712
-
) (funx -> T.get a x (e,i)) x
713
-
letset (ask:Q.ask) xia= unop_to_t (funx -> P.set ask x i a) (funx -> T.set ask x i a) x
714
-
let length = unop P.length T.length
715
-
let get_vars_in_e = unop P.get_vars_in_e T.get_vars_in_e
716
-
letmapf= unop_to_t (P.map f) (T.map f)
717
-
letfold_leftfs= unop (P.fold_left f s) (T.fold_left f s)
718
-
letfold_left2fs= binop (P.fold_left2 f s) (T.fold_left2 f s)
719
-
letmove_if_affected?(replace_with_const=false) (ask:Q.ask) xvf= unop_to_t (funx -> P.move_if_affected ~replace_with_const:replace_with_const ask x v f) (funx -> T.move_if_affected ~replace_with_const:replace_with_const ask x v f) x
720
-
letsmart_joinfg= binop_to_t (P.smart_join f g) (T.smart_join f g)
721
-
letsmart_widenfg= binop_to_t (P.smart_widen f g) (T.smart_widen f g)
722
-
letsmart_leqfg= binop (P.smart_leq f g) (T.smart_leq f g)
723
-
letupdate_lengthnewlx= unop_to_t (P.update_length newl) (T.update_length newl) x
847
+
letgetax (e,i) = unop' (funx ->
848
+
if e =`Topthen
849
+
let e' =BatOption.map_default (funx -> `Lifted (Cil.kintegerCilint (Cilfacade.ptrdiff_ikind ()) x)) (`Top) (Idx.to_int i) in
850
+
P.get a x (e', i)
851
+
else
852
+
P.get a x (e, i)
853
+
) (funx -> T.get a x (e,i)) (funx -> U.get a x (e,i)) x
854
+
letset (ask:Q.ask) xia= unop_to_t' (funx -> P.set ask x i a) (funx -> T.set ask x i a) (funx -> U.set ask x i a) x
855
+
let length = unop' P.length T.length U.length
856
+
letmapf= unop_to_t' (P.map f) (T.map f) (U.map f)
857
+
letfold_leftfs= unop' (P.fold_left f s) (T.fold_left f s) (U.fold_left f s)
858
+
letfold_left2fs= binop' (P.fold_left2 f s) (T.fold_left2 f s) (U.fold_left2 f s)
859
+
860
+
letmove_if_affected?(replace_with_const=false) (ask:Q.ask) xvf= unop_to_t' (funx -> P.move_if_affected ~replace_with_const:replace_with_const ask x v f) (funx -> T.move_if_affected ~replace_with_const:replace_with_const ask x v f)
861
+
(funx -> U.move_if_affected ~replace_with_const:replace_with_const ask x v f) x
862
+
let get_vars_in_e = unop' P.get_vars_in_e T.get_vars_in_e U.get_vars_in_e
863
+
letsmart_joinfg= binop_to_t' (P.smart_join f g) (T.smart_join f g) (U.smart_join f g)
864
+
letsmart_widenfg= binop_to_t' (P.smart_widen f g) (T.smart_widen f g) (U.smart_widen f g)
865
+
letsmart_leqfg= binop' (P.smart_leq f g) (T.smart_leq f g) (U.smart_leq f g)
866
+
letupdate_lengthnewlx= unop_to_t' (P.update_length newl) (T.update_length newl) (U.update_length newl) x
724
867
725
868
(* Functions that make use of the configuration flag *)
0 commit comments