On Resolution Proofs for Combinational Equivalence Checking Satrajit

Modern combinational equivalence checking (CEC) engines are complicated programs which are difficult to verify. In this paper we show how a modern CEC engine can be modified to produce a proof of equivalence when it proves a miter unsatisfiable. If the CEC engine formulates the problem as a single SAT problem (call this näıve), one can use the resolution proof of unsatisfiability as a proof of equivalence. However, a modern CEC engine does not directly invoke a SAT solver for the whole miter, but instead uses a variety of techniques such as structural hashing, detection of intermediate functional equivalences, and circuit re-writing to first simplify the problem. We show that in spite of using these simplification techniques, a CEC engine can be modified to generate a single resolution proof for the whole miter just as in the näıve case. To realize this, we interpret CEC as a sequence of synthesis steps that identify and eliminate redundancies. For each synthesis step we produce a proof fragment corresponding to that step. Taken together, these fragments form a resolution proof for the unsatisfiability of the whole miter. A particularly interesting problem arises during identification of intermediate functional equivalences using SAT: The resolution proof of unsatisfiability of the intermediate SAT problem cannot be directly used in the resolution proof for the whole miter. We present a proof lifting technique to solve this problem. 1. RESOLUTION PROOFS 1.1 Example of a resolution proof Consider the following unsatisfiable CNF SAT problem (the clauses are numbered for convenience): 1. (p ∨ a) 2. (p ∨ b) 3. (p ∨ a ∨ b) 4. (q ∨ a) 5. (q ∨ b) 6. (q ∨ a ∨ b) 7. (p ∨ q ∨ z) 8. (p ∨ q ∨ z) 9. (p ∨ q ∨ z) 10. (p ∨ q ∨ z) 11. (z) Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Copyright 200X ACM X-XXXXX-XX-X/XX/XX . $5.00. Resolution [3] provides an easy way to check that this problem is indeed unsatisfiable. One takes two clauses that contain a variable, say x, in opposite polarity and constructs the resolvent. The resolvent is the disjunction of all the literals in the two clauses excluding x and x. For example, resolving clauses 3 and 4 w.r. t to variable a produces the clause (p ∨ b ∨ q). Note that adding a resolvent to the current set of clauses does not alter satisfiability i.e. resolution is sound. Therefore, if the new set of clauses does not have a satisfying assignment, then neither does the original set of clauses. Note that the resolvent of two contradictory unit clauses (x) and (x) is the empty clause (). Thus, if a sequence of resolution steps leads to the empty clause, the original set of clauses is verified to be unsatisfiable. As an example consider the following sequence of resolutions deriving the empty clause. It is a resolution proof of unsatisfiability of the above problem: 12. (p ∨ b ∨ q) [from 3 and 4] 13. (p ∨ q) [from 5 and 12] 14. (p ∨ q ∨ a) [from 2 and 6] 15. (p ∨ q) [from 1 and 14] 16. (p ∨ q) [from 10 and 11] 17. (p ∨ q) [from 7 and 11] 18. (q) [from 13 and 16] 19. (q) [from 15 and 17] 20. () [from 18 and 19] 1.2 Deriving a resolution proof Davis and Putnam [3] provided the first complete method to generate a resolution proof for an unsatisfiable set of clauses. However, their method required exponential space, and was quickly superseded by the Davis-Putnam-LogemannLoveland (DPLL) method [4] of systematic case-splitting on variables. However, DPLL does not directly generate a resolution proof. Since most modern SAT solvers are based on DPLL, they do not directly produce a resolution proof. DPLL can be seen as a resolution scheduling system, and Zhang and Malik [14] showed how a modern SAT solver (they used zChaff [11] as an example) can be modified to generate a resolution proof for unsatisfiable instances. In order to follow the rest of the paper, it is not necessary to understand the details of Zhang and Malik’s construction. We simply assume access to a SAT solver that can generate resolution proofs of unsatisfiable instances. Figure 1: (a) Two circuits to be checked for equivalence. (b) The miter of the two circuits. 2. CEC PROOF VERIFICATION