Skip to content

Commit f99f320

Browse files
Simplify
1 parent 022a9bc commit f99f320

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/cdomains/apron/affineEqualityDomain.apron.ml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -680,19 +680,15 @@ struct
680680

681681
let invariant t =
682682
let invariant m =
683-
let earray = Lincons1.array_make t.env (Matrix.num_rows m) in
684-
for i = 0 to (Lincons1.array_length earray -1) do
683+
let one_constraint i =
685684
let row = Matrix.get_row m i in
686685
let coeff_vars = List.map (fun x -> Coeff.s_of_mpqf @@ Vector.nth row (Environment.dim_of_var t.env x), x) (vars t) in
687686
let cst = Coeff.s_of_mpqf @@ Vector.nth row (Vector.length row - 1) in
688-
Lincons1.set_list (Lincons1.array_get earray i) coeff_vars (Some cst)
689-
done;
690-
let {lincons0_array; array_env}: Lincons1.earray = earray in
691-
Array.enum lincons0_array
692-
|> Enum.map (fun (lincons0: Lincons0.t) ->
693-
Lincons1.{lincons0; env = array_env}
694-
)
695-
|> List.of_enum
687+
let e1 = Linexpr1.make t.env in
688+
Linexpr1.set_list e1 coeff_vars (Some cst);
689+
Lincons1.make e1 EQ
690+
in
691+
List.init (Matrix.num_rows m) (one_constraint)
696692
in
697693
BatOption.map_default invariant [] t.d
698694

0 commit comments

Comments
 (0)