Jose Abel Castellanos Joo, Deepak Kapur
CS Colloquium @ University of New Mexico
jabelcastellanosjoo@unm.edu |
Definition: Given two logical formulas and such that , an interpolant for satisfies:
Applications:
contains only common symbols
because:
because:
Problem statement: Given a pair of inconsistent conjunctive formulas in the EUF theory, find the interpolating formula
Current approaches mainly rely on unsatisfiability proofs [4–7]
It finds an interpolant by eliminating uncommon symbols.
Preprocessing: Flatten formula by introducing new constants
Phase I: Elimination of uncommon constants
Phase II: Elimination of uncommon function symbols
Phase III: Elimination of uncommon symbols conditionally
Phase IV: Interpolant generation
The algorithm introduces new constants by equating each subexpression in the AST of the original input
Subterms with function symbols with produce f-equations of the form:
where each are constants
New terms preserve the common property
My implementation renames terms to work internally with particular methods to distinguish terms
This steps rewrites disequations of the form into Horn clauses of the form
This steps computes the congruence closure [2, 8, 9] of the initial set of equations an keeps as representatives of the underlying union-find data structure common terms whenever possible
There are two cases:
For all pairs of f-equations
generate a Horn clause of the form
Follow the same rule as above
If there are Horn clauses which antecedent is completely common and it contains at least an uncommon term in the consequent equation,
then use these Horn clauses to conditionally eliminate the uncommon term in other Horn clauses which contain this uncommon term
Dependency analysis can improve the possible exponential behaviour of this step by choose a right ordering of reduction
This step outputs all the common Horn clauses generated, the existing common equations, and it generates new Horn clauses by eliminating uncommon terms appearing in uncommon equations similarly to the conditional elimination approach
Additionally, the algorithm removes the constants introduced in the problem
My implementation modifies the Phase III of the original formulation
The idea is to use a separate (conditional) equivalence relation that includes the theory implied by the common equations appearing inside the antecedent of the Horn clauses produced in Phase II
Additionally, the implementation requires an explanation operator to produce Horn clauses with antecedents constructed using such operator using the original equations and the Horn clauses produced in Phase II
Linear-time algorithm for propositional Horn formulae [ 1 ]
Horn unsatisfiability with grounded equations [ 3 ]
Congruence closure with explanations [ 9 ]
Modification: only add into the equivalence relation common equations using a congruence closure with explanations to keep track of these common equations
|
|
|
|
There are four cases:
Antecedent : Common, Consequent : Common
Antecedent : Common, Consequent : Uncommon
Antecedent : Uncommon, Consequent : Common
Antecedent : Uncommon, Consequent : Uncommon
Lemma 1.
numargs is always 0 or a positive number.
Lemma 2.
Explain for the modified Gallier data structure
always returns a set of common equations
Theorem 1.
The new conditional elimination step always
produce common Horn clauses
Unsatisfiabilit proofs for conjunctive inconsistencies in the theory of EUF can be exponentially large
An unsatisfiability proof is not needed to compute the interpolant for the EUF theory
The implementation provides an additional mechanism for working with interpolating related problems
Implementation of proof visualization tool for Z3: https://github.com/typesAreSpaces/z3-proofs2latex
Implementation of the interpolation algorithm for EUF: https://github.com/typesAreSpaces/master-thesis
Implementation of sligh modification of Z3 to distinguish terms: https://github.com/typesAreSpaces/z3-interp-plus
Definition and implementation of generalized Gallier structure