mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-10 13:14:09 -05:00
fix(lra): proper negation for basic operators
This commit is contained in:
parent
acf99504c4
commit
2a6c224f08
2 changed files with 15 additions and 1 deletions
|
|
@ -373,6 +373,10 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
fail_with_cert si acts cert
|
fail_with_cert si acts cert
|
||||||
end
|
end
|
||||||
|
|
||||||
|
(* TODO: trivial propagations *)
|
||||||
|
|
||||||
|
(* partial checks is where we add literals from the trail to the
|
||||||
|
simplex. *)
|
||||||
let partial_check_ self si acts trail : unit =
|
let partial_check_ self si acts trail : unit =
|
||||||
Profile.with_ "lra.partial-check" @@ fun () ->
|
Profile.with_ "lra.partial-check" @@ fun () ->
|
||||||
trail
|
trail
|
||||||
|
|
@ -381,7 +385,11 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
let lit_t = SI.Lit.term lit in
|
let lit_t = SI.Lit.term lit in
|
||||||
match A.view_as_lra lit_t with
|
match A.view_as_lra lit_t with
|
||||||
| LRA_simplex_pred (v, op, q) ->
|
| LRA_simplex_pred (v, op, q) ->
|
||||||
let op = if sign then op else S_op.neg_sign op in
|
|
||||||
|
(* need to account for the literal's sign *)
|
||||||
|
let op = if sign then op else S_op.not_ op in
|
||||||
|
|
||||||
|
(* assert new constraint to Simplex *)
|
||||||
let constr = SimpSolver.Constraint.mk v op q in
|
let constr = SimpSolver.Constraint.mk v op q in
|
||||||
Log.debugf 10
|
Log.debugf 10
|
||||||
(fun k->k "(@[lra.partial-check.assert@ %a@])"
|
(fun k->k "(@[lra.partial-check.assert@ %a@])"
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,12 @@ module Op = struct
|
||||||
| Geq -> Leq
|
| Geq -> Leq
|
||||||
| Gt -> Lt
|
| Gt -> Lt
|
||||||
|
|
||||||
|
let not_ = function
|
||||||
|
| Leq -> Gt
|
||||||
|
| Lt -> Geq
|
||||||
|
| Geq -> Lt
|
||||||
|
| Gt -> Leq
|
||||||
|
|
||||||
let to_string = function
|
let to_string = function
|
||||||
| Leq -> "<="
|
| Leq -> "<="
|
||||||
| Lt -> "<"
|
| Lt -> "<"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue