[sledge] Improve Equality.extend

Reviewed By: jvillard

Differential Revision: D20192872

fbshipit-source-id: a853d8c4e
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent 0fc2769a65
commit 5d429ea075

@ -444,17 +444,19 @@ let rec canon r a =
|> |>
[%Trace.retn fun {pf} -> pf "%a" Term.pp] [%Trace.retn fun {pf} -> pf "%a" Term.pp]
(** add a term to the carrier *) let rec extend_ a r =
let rec extend a r =
match classify a with match classify a with
| Interpreted | Simplified -> Term.fold ~f:extend a ~init:r | Interpreted | Simplified -> Term.fold ~f:extend_ a ~init:r
| Uninterpreted -> ( | Uninterpreted -> (
match Subst.extend a r.rep with match Subst.extend a r with
| Some rep -> Term.fold ~f:extend a ~init:{r with rep} | Some r -> Term.fold ~f:extend_ a ~init:r
| None -> r ) | None -> r )
| Atomic -> r | Atomic -> r
let extend a r = extend a r |> check invariant (** add a term to the carrier *)
let extend a r =
let rep = extend_ a r.rep in
if rep == r.rep then r else {r with rep} |> check invariant
let merge us a b r = let merge us a b r =
[%Trace.call fun {pf} -> pf "%a@ %a@ %a" Term.pp a Term.pp b pp r] [%Trace.call fun {pf} -> pf "%a@ %a@ %a" Term.pp a Term.pp b pp r]

Loading…
Cancel
Save