mirror of
https://github.com/c-cube/sidekick.git
synced 2026-01-29 04:44:52 -05:00
fix(lra): refactor
This commit is contained in:
parent
a908f2b3f2
commit
0081926a50
1 changed files with 2 additions and 2 deletions
|
|
@ -293,7 +293,6 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
|
|
||||||
| Some (coeff, v), pred ->
|
| Some (coeff, v), pred ->
|
||||||
(* [c . v <= const] becomes a direct simplex constraint [v <= const/c] *)
|
(* [c . v <= const] becomes a direct simplex constraint [v <= const/c] *)
|
||||||
let negate = Q.sign coeff < 0 in
|
|
||||||
let q = Q.div le_const coeff in
|
let q = Q.div le_const coeff in
|
||||||
|
|
||||||
let op = match pred with
|
let op = match pred with
|
||||||
|
|
@ -303,7 +302,8 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
| Gt -> S_op.Gt
|
| Gt -> S_op.Gt
|
||||||
| Eq | Neq -> assert false
|
| Eq | Neq -> assert false
|
||||||
in
|
in
|
||||||
let op = if negate then S_op.neg_sign op else op in
|
(* make sure to swap sides if multiplying with a negative coeff *)
|
||||||
|
let op = if Q.(coeff < zero) then S_op.neg_sign op else op in
|
||||||
|
|
||||||
let new_t = A.mk_lra tst (LRA_simplex_pred (v, op, q)) in
|
let new_t = A.mk_lra tst (LRA_simplex_pred (v, op, q)) in
|
||||||
Log.debugf 10 (fun k->k "lra.preprocess@ :%a@ :into %a" T.pp t T.pp new_t);
|
Log.debugf 10 (fun k->k "lra.preprocess@ :%a@ :into %a" T.pp t T.pp new_t);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue