§ Interpolants: Vibes
§ Implication based definition
- Let A(p,q) and B(q,r) be propositional formulae (where p,q are vectors of variables) such that A⟹B.
- Then, there exists a formula C(q) such that A(p,q)⟹C(q) and C(q)⟹B(q,r).
- So, the "crux" of why A implies B lies in C.
- One can ask: why is this useful? and how does one compute such an object? and why does sucn an object even exist?
§ Existence proof for interpolant
- Choose a particular A(p,q) and B(q,r) such that A(p,q)⟹B(q,r), We are trying to build an interpolant C(q).
- For example, suppose a,b,c are variables, and the assignment M(a,b,c) be a↦1, b↦0, and c↦1. ( M for model).
- Let F(M(a,bc))) be a formula that is true when the values of variables in a is equal to M(a,b,c).
- Then F(A(a,b,c))≡a∧¬b∧c.
- That is, it's the formula that's true when the values of a,b,c match the assignment M(a,b,c).
- Now, we will try to build an interpolant C(q).
- TODO: this needs a bit more thought.
§ Contradiction of Conjunction Viewpoint
- Let A(p,q)∧B(q,r) be unsatisfiable.
- Then, interpolation implies that there exists a formula C(q), such that A(p,q)⟹C(q) and C(q)∧B(q) is UNSAT.
- This tells us that "unsat core" of A and B actually lives in C.
§ Proof that implication interpolant implies conjunction unsat interpolant
- We can phrase that A(p,q)∧B(q,r) being UNSAT as saying that ¬(¬A∨¬B) in UNSAT, or that ¬A∨¬B as being TAUTO, or that A⟹¬B.
- We can apply interpolation to tell us that there is a formula such that A(p,q)⟹C(q) such that C(q)⟹¬B.
- Reversing the logic, we can see that C(q)∧B(q,r) must be UNSAT.
- Roughly, we use the fact that A⟹B is a tautology implies that whenever A is true, B must be true. This means that A⟹¬Bis UNSAT, which is the same as ¬A∨¬B being unsat, which is the same as ¬(A∧B) being UNSAT.
- I would appreciate a more direct way of seeing this fact!
§ Interpolant as telling us which clause is refuting
- From the UNSAT perspective, we know that (A(p,q)∧B(q,r)) is UNSAT.
- We can think of the interpolant C(q) as telling us why the unsat happened.
- Recall that C(q) is such that (i) A(p,q)⟹C(q) and (ii) C(q)∧B(q) is UNSAT.
- (i) implies ¬C(q)⟹¬A(p,q).
- (ii) implies ¬(C(q)∧B(q)) is a tautology, or ¬C(q)∨¬B(q), or C(q)⟹¬B(q).
- So, consider a model M. We know that M¬⊨A∧B.
- Let's now test what value C(q) ought to have given the two above constraints.
§ Case 1: contradiction from clause in A
- Suppose the contradiction arose from a clause in A.
- We must have M⊨A(p,q)⟹C(q). This imposes no conditions on A(p,q) since A(p,q) is false, and thus the formula will be true regardless of C(q).
- We must also have M¬⊨C(q)∧B(q,r).
- For this to happen regardless of B(q,r), we must have C(q)=0 in M.
- See that this also agrees with M⊨¬C(q)⟹¬A(p,q). So we can think of this as telling us to "label" M with C(q)=0 when the failure in M¬⊨A∧Barises from A.
§ Case 2: contradiction from clause in B.
- Suppose the contradiction arose from a clause in B.
- We must have M⊨A(p,q)⟹C(q). For this to be true regardless of the truth value of [[A(p,q)]]M, we must choose C(q)=1.
- We must also have M¬⊨C(q)∧B(q,r). This will hold because [[B(q,r)]]M=0, regardless of C(q).
- See that this also agrees with M⊨C(q)⟹¬B(p,q). So we can think of this as telling us to "label" M with C(q)=1 when the failure in M¬⊨A∧Barises from B.
§ Recipe for exponential sized C
- Combining the two above, we can see that C is really a labelling function, that labels for an UNSAT clause A∧B, and for an arbitrary model M, whether M¬⊨A∧B because of A or because of B.
- If it's because of A, then [[C]]=F, and otherwise it's because of B, so [[C]]M=T.
- This gives us a recipe to write a C down.
- Create a clause of the form ∀m∈M,(A(M)=0⟹F)∧(B(M)=0⟹T).
- This may not look propositional since we are quantifying over models.
- However, the set of models is finite, so we can build a gigantic (exponential in the number of variables) disjunct over all models, and create a huge clause.
- For example, if we want to know that we are in a model [x1↦T,x2↦F], we can literally write the expression x1=T∧x2=F, or in more shorthand, x1∧¬x2.
- This gives us an algorithm to compute an exponential sized interpolant, so we now know that interpolants always exist!
§ Linear time algorithm for computing interpolants
- We now want an algorithm that gives us smaller interpolants.
- Note that this algorithm is linear in the size of the refutation proof , which could be exponentially large!
- The idea is to use the fact that the interpolant tells us which clause is refuting.
- So, recall from above that we have that (i) ¬C(q)⟹¬A(p,q), and that (ii) C(q)⟹¬B(q,r).
- Next, see that in a resolution proof, we can walk a resolution proof "backwards" to figure out which clause gave rise to a contradiction.
- We will build a C(q) by performing induction on the resolution proof, maintaining (i) and (ii) as invariants of the clauses we have seen so far.
§ Using clause from A
- If we are using a clause Ai of A, then the associated term for the interpolant will be I(Ai)≡0. The idea is that if the UNSAT for a particular model M came from Ai, then we must have that the interpolant I(Ai) has value 0 from the previous analysis. In this case, we know for sure that the UNSAT came from Ai, and thus the interpolant is just 0.
§ Using clause from B
- By the exact same argument, if we use clause Bi of B, then the associated term for the interpolant will be I(Bi)≡1.
§ Resolving, both from A.
- Suppose we resolve two clauses Ai,Aj Now, if the contradiction came from either Ai or Aj, then this part of the resolution is the cause of UNSAT.
- Now see that I(Resolv(Ai,Aj)) should be 0 if the UNSAT came from A, and I(Resolve(Ai,Aj)) should be 1if the UNSAT came from B.
- But if this part of the resolution is the cause of UNSAT, then we will have either I(Ai)=0 or I(Aj)=0. In either of theses cases, the UNSAT came from A.
- So, we need I(Resolv(Ai,Aj))=0. To achieve this, we set I(Resolv(Ai,Aj))=I(Ai)∧I(Aj).
- Or, in less terse terms, "if I(Ai) or I(Aj) is 0, then so is I(Resolv(Ai,Aj))". Convert that to a formula.
§ Resolving, both from B.
- Suppose we resolve two clauses Bi,Bj Now, if the contradiction came from either Bi or Bj, then this part of the resolution is the cause of UNSAT.
- Now see that I(Resolv(Bi,Bj)) should be 0 if the UNSAT came from A, and I(Resolve(Bi,Bj)) should be 1if the UNSAT came from B.
- But if this part of the resolution is the cause of UNSAT, then we will have either I(Bi)=0 or I(Bj)=0. In either of theses cases, the UNSAT came from B.
- So, we need I(Resolv(Bi,Bj))=1. To achieve this, we set I(Resolv(Ai,Aj))=I(Bi)∨I(Bj).
- Or, in less terse terms, "if I(Bi) or I(Bj) is 1, then so is I(Resolv(Bi,Bj))". Convert that to a formula.
§ Resolving, one from A, one from B
- In very similar fashion, we build a resolvent of I(Resolv(Ai,Bj)).
- If we have resolved with x∈Ai and ¬x∈Bi, and suppose that the resolvent lead to a UNSAT.
- Now, we see that x=F, then the contradiction came from Ai, and so we must use the interpolant I(Ai) in this case.
- Similarly, if x=T, then the contradiction came from Bi, and we must use the interpolant I(Bj) in this case.
- Putting this together, we see that we want the formula (¬x⟹I(Ai))∧(x⟹I(Bi)).
§ Interpolant as "forward image"
- Thinking once again from the UNSAT perspective, suppose that we are trying to prove that all executions are good.
- Actually, I realized I don't understand this. will come back to it.