[sledge] Strengthen Context.solve_for_vars on uninterpreted functions

Summary:
Context.solve_for_vars returns a solution substitution consisting of
oriented equalities that are implied by the given context. It is
logically valid to express these equations using terms that are
normalized with respect to the solution substitution itself. This diff
normalizes uninterpreted terms with the solution substitution when
extending it. This preserves the logical strength of the solutions,
and strengthens other purely syntactic operations on the substitution,
such as Context.Subst.is_valid_eq.

Reviewed By: jvillard

Differential Revision: D25756582

fbshipit-source-id: cd997c46b
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 5c5a1cc581
commit 81f77cf7bd

@ -178,7 +178,7 @@ end = struct
ks fv(τ) = . *)
let partition_valid xs s =
[%trace]
~call:(fun {pf} -> pf "@ %a@ %a" Var.Set.pp_xs xs pp s)
~call:(fun {pf} -> pf "@ @[%a@ %a@]" Var.Set.pp_xs xs pp s)
~retn:(fun {pf} (t, ks, u) ->
pf "%a@ %a@ %a" pp t Var.Set.pp_xs ks pp u )
@@ fun () ->
@ -1010,6 +1010,8 @@ let solve_uninterp_eqs us (cls, subst) =
in
let subst =
List.fold cls_xs subst ~f:(fun trm_xs subst ->
let trm_xs = Subst.subst_ subst trm_xs in
let rep_us = Subst.subst_ subst rep_us in
Subst.compose1 ~key:trm_xs ~data:rep_us subst )
in
(cls, subst)

Loading…
Cancel
Save