[sledge] Check is_unsat of stem in Sh.simplify

Reviewed By: jvillard

Differential Revision: D25756579

fbshipit-source-id: c248db51e
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent cecd3db59f
commit 8ff88bf22f

@ -9,6 +9,9 @@
open Fol open Fol
(** enable stronger unsat checking during normalization *)
let strong_unsat = false
[@@@warning "+9"] [@@@warning "+9"]
type seg = {loc: Term.t; bas: Term.t; len: Term.t; siz: Term.t; cnt: Term.t} type seg = {loc: Term.t; bas: Term.t; len: Term.t; siz: Term.t; cnt: Term.t}
@ -794,8 +797,12 @@ let rec simplify_ us rev_xss survived ancestor_subst q =
(* opt: ctx already normalized so just preserve it *) (* opt: ctx already normalized so just preserve it *)
{(norm subst {q with djns= emp.djns; ctx= emp.ctx}) with ctx= q.ctx} {(norm subst {q with djns= emp.djns; ctx= emp.ctx}) with ctx= q.ctx}
in in
if strong_unsat && is_unsat stem then false_ stem.us
else
(* recursively simplify subformulas *) (* recursively simplify subformulas *)
let survived = Var.Set.union survived (fv (elim_exists stem.xs stem)) in let survived =
Var.Set.union survived (fv (elim_exists stem.xs stem))
in
let q = let q =
starN starN
( stem ( stem
@ -813,8 +820,8 @@ let rec simplify_ us rev_xss survived ancestor_subst q =
assert (Var.Set.disjoint removed (Context.fv q.ctx)) ; assert (Var.Set.disjoint removed (Context.fv q.ctx)) ;
Var.Set.diff removed (fv ~ignore_ctx:() (elim_exists q.xs q)) ) Var.Set.diff removed (fv ~ignore_ctx:() (elim_exists q.xs q)) )
in in
(* removed may not contain all variables stem_subst has solutions for, (* removed may not contain all variables stem_subst has solutions
so the equations in [ removed. stem_subst] that are not for, so the equations in [ removed. stem_subst] that are not
universally valid need to be re-conjoined since they have alredy universally valid need to be re-conjoined since they have alredy
been normalized out *) been normalized out *)
let keep, removed, _ = let keep, removed, _ =

Loading…
Cancel
Save