Skip to content

Commit 6381543

Browse files
committed
current
1 parent b2a597b commit 6381543

22 files changed

Lines changed: 12714 additions & 17 deletions

OAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOAOA

Lines changed: 8466 additions & 0 deletions
Large diffs are not rendered by default.

domains/Affines.ml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,15 @@ module Affine (B : PARTITION) : FUNCTION = struct
682682
| T_var x -> (
683683
match f with
684684
| Fun f ->
685-
let env = Linexpr1.get_env f in
685+
let env0 = Linexpr1.get_env f in
686+
let env =
687+
if Environment.mem_var env0 v then env0
688+
else Environment.add env0 [| v |] [||]
689+
in
690+
let f =
691+
if Environment.mem_var env0 v then f
692+
else Linexpr1.extend_environment f env
693+
in
686694
let e = Texpr1.of_expr env (exp_to_apron e) in
687695
let f = Linexpr1.copy f in
688696
let a = Lincons1.array_make env 1 in
@@ -708,6 +716,20 @@ module Affine (B : PARTITION) : FUNCTION = struct
708716
let bwdAssign f (x, e) =
709717
{ ranking = bwdAssign_ranking f.ranking (x, e); env = f.env; vars = f.vars }
710718

719+
let of_linexpr env vars linexpr =
720+
let le =
721+
let le_env = Linexpr1.get_env linexpr in
722+
if Environment.mem_var le_env v then linexpr
723+
else
724+
let ext_env = Environment.add le_env [| v |] [||] in
725+
Linexpr1.extend_environment linexpr ext_env
726+
in
727+
{ ranking = Fun le; env; vars }
728+
729+
let of_ordinal_components env vars = function
730+
| [] -> zero env vars
731+
| l :: _ -> of_linexpr env vars l
732+
711733
let filter f _ = successor f
712734

713735
(**)

domains/DecisionTree.ml

Lines changed: 303 additions & 6 deletions
Large diffs are not rendered by default.

domains/Domain.ml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,26 @@ module type RANKING_FUNCTION = sig
2323
val bot : ?domain:B.t -> Environment.t -> var list -> t
2424
val zero : ?domain:B.t -> Environment.t -> var list -> t
2525
val top : ?domain:B.t -> Environment.t -> var list -> t
26+
val init_with_proton_hint :
27+
?domain:B.t -> source_code:string -> loop_code:string ->
28+
Environment.t -> var list -> t
2629
val domain_zero : t -> t
2730
val isLeq : kind -> t -> t -> bool
2831
val join : kind -> t -> t -> t
2932
val plus : t -> t -> t
3033
val meet : kind -> t -> t -> t
31-
val widen : ?jokers:int -> t -> t -> t
34+
35+
val widen :
36+
?jokers:int ->
37+
?program_source:string ->
38+
?loop_condition:string ->
39+
?loop_description:string ->
40+
?iteration_number:string ->
41+
?history:t list ->
42+
t ->
43+
t ->
44+
t
45+
3246
val dual_widen : t -> t -> t
3347
val defined : ?condition:expr typed -> t -> bool
3448
val partially_defined : ?condition:expr typed -> t -> bool

domains/Functions.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ module type FUNCTION = sig
3838
val reset : f -> f
3939
val predecessor : f -> f
4040
val successor : f -> f
41+
val of_linexpr : Environment.t -> var list -> Linexpr1.t -> f
42+
(** Build from ordinal components: [finite; ω^1 coeff; ω^2 coeff; ...].
43+
For non-ordinal domains, only the first element is used. *)
44+
val of_ordinal_components : Environment.t -> var list -> Linexpr1.t list -> f
4145
val bwdAssign : f -> expr typed * expr typed -> f
4246
val filter : f -> expr typed -> f
4347
val print : Format.formatter -> f -> unit

0 commit comments

Comments
 (0)