[sledge] Equality.and_eq is part of the exposed interface

Summary: So trace it and check invariant on return.

Reviewed By: ngorogiannis

Differential Revision: D19221878

fbshipit-source-id: ce05da740
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent 6e01fa91d5
commit 01825598f7

@ -200,16 +200,22 @@ let close r =
pf "%a" pp_diff (r, r') ; pf "%a" pp_diff (r, r') ;
invariant r'] invariant r']
(** Exposed interface *)
let and_eq a b r = let and_eq a b r =
if not r.sat then r [%Trace.call fun {pf} -> pf "%a = %a@ %a" Term.pp a Term.pp b pp r]
;
( if not r.sat then r
else else
let a' = canon r a in let a' = canon r a in
let b' = canon r b in let b' = canon r b in
let r = extend a' r in let r = extend a' r in
let r = extend b' r in let r = extend b' r in
if Term.equal a' b' then r else close (merge a' b' r) if Term.equal a' b' then r else close (merge a' b' r) )
|>
(** Exposed interface *) [%Trace.retn fun {pf} r' ->
pf "%a" pp_diff (r, r') ;
invariant r']
let is_true {sat; rep} = let is_true {sat; rep} =
sat && Map.for_alli rep ~f:(fun ~key:a ~data:a' -> Term.equal a a') sat && Map.for_alli rep ~f:(fun ~key:a ~data:a' -> Term.equal a a')

Loading…
Cancel
Save