Digitaalsüsteemide verifitseerimise kursus1 Formal verification: SAT SAT applied in equivalence checking.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

Interactive Configuration
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Great Theoretical Ideas in Computer Science.
Lecture 23. Subset Sum is NPC
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
The Theory of NP-Completeness
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: Property checking Property checking.
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
CS21 Decidability and Tractability
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
Boolean Matching in Logic Synthesis. Equivalence of Functions Equivalence of two functions defined under l Negation of input variables l Permutation of.
SAT Algorithms in EDA Applications Mukul R. Prasad Dept. of Electrical Engineering & Computer Sciences University of California-Berkeley EE219B Seminar.
ECE Synthesis & Verification, Lecture 17 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Technology.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 ≤ L 2 means: For some polynomial time computable map r : x: x L 1 iff r(x)
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Quantified Formulas - Decision Procedure Daniel Kroening, Ofer Strichman Presented by Changki Hong 07 NOV 08.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
Digitaalsüsteemide verifitseerimise kursus1 Exercises Binary decision diagrams ROBDD generation. Shannon expansion Finding an optimal ordering Dynamic.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
1 SAT SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
L is in NP means: There is a language L’ in P and a polynomial p so that L1 ≤ L2 means: For some polynomial time computable map r :  x: x  L1 iff.
Inference and search for the propositional satisfiability problem
Introduction to Discrete Mathematics
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Hard Problems Introduction to NP
(xy)(yz)(xz)(zy)
Logic Synthesis CNF Satisfiability.
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
SAT-Based Area Recovery in Technology Mapping
NP-Completeness Proofs
ECE 667 Synthesis and Verification of Digital Circuits
Decision Procedures An Algorithmic Point of View
NP-Complete Problems.
Canonical Computation without Canonical Data Structure
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Canonical Computation without Canonical Data Structure
SAT-based Methods: Logic Synthesis and Technology Mapping
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

Digitaalsüsteemide verifitseerimise kursus1 Formal verification: SAT SAT applied in equivalence checking

Digitaalsüsteemide verifitseerimise kursus2 Equivalence Checking Two principal approaches: Transform implementation and spec ( reference implementation) to a canonical form Search for an input assignment that would distinguish the responses of the implementation and reference implementation. SAT applied for the latter

Digitaalsüsteemide verifitseerimise kursus3 Satisfiability aka SAT SAT: Boolean function is satisfiable if there exists a variable assignment for which the function is TRUE

Digitaalsüsteemide verifitseerimise kursus4 Equivalence checking with SAT Equivalence Checking can be reduced to SAT: d = f  g Iff d is satisfiable then f and g are NOT equivalent.

Digitaalsüsteemide verifitseerimise kursus5 Miter circuit Specification (reference implementation) Implementation SAT?

Digitaalsüsteemide verifitseerimise kursus6 Satisfiability aka SAT SAT is transformed to CNF (i.e. product of sums). Sums are called terms. If terms have max 2 literals then 2-SAT 2-SAT solved in a polynomial time  3-SAT is an NP complete task

Digitaalsüsteemide verifitseerimise kursus7 Satisfiability aka SAT Is this CNF satisfiable? Yes: a = 1, b = 0, c = 0! Worst case: 2 n combinations to try

Digitaalsüsteemide verifitseerimise kursus8 Some terminology If x in the formula alwaysin one phase (i.e. always inverted or always noninverted then x is unate. If x in the formula in both phases then x is binate. Term having just one literal called unit term.

Digitaalsüsteemide verifitseerimise kursus9 Resolvent-algorithm Resolvent: f = (x+A)(¬x+B) = (x +A)(¬x+B)(A+B) Consensus: f = xC + ¬xD = xC + ¬xD + CD Since SAT is in CNF we use resolvent.

Digitaalsüsteemide verifitseerimise kursus10 Resolvent-algorithm 1.Choose another variable x. 2.If x is unate, apply unate rule. 3.If x is unit term, apply unit term rule. 4.If x is unate, solve resolvent of x. 5.Repeat the steps until all resolvents solved. 6.If the result is 1, then function satisfiable; otherwise not satisfiable (unit term).

Digitaalsüsteemide verifitseerimise kursus11 Resolvent-algorithm example a binate terms resolvent solved

Digitaalsüsteemide verifitseerimise kursus12 Resolvent-algorithm: summary Resolvent-algorithm mathematically elegant but Designed for small SAT problems In the worst case 2 n resolvents to solve In order to solve complex SAT instances, search based algorithms needed

Digitaalsüsteemide verifitseerimise kursus13 Search-based SAT

Digitaalsüsteemide verifitseerimise kursus14 SolveSAT() input: a formula output: SAT or UNSAT forever { state = select_branch(); // choose and assign a variable if (state == EXHAUSTED) return UNSAT; result = infer(); // infer variable values if ( result == SAT) return SAT; else if (result == UNSAT) backtrack(); // backtrack to a prior decision else // result == INDETERMINATE continue; // need further assignment } Search-based SAT

Digitaalsüsteemide verifitseerimise kursus15 Implication Graph Directed acyclic graph: Nodes labeled by variable names, followed by the rank of the decision Variables preceded by minus were assigned 0, not preceded by minus were assigned 1 Directed arcs show from which assignments what new assignments imply Decision nodes (grey) and implication nodes (white)

Digitaalsüsteemide verifitseerimise kursus16 decisions: k = 1, j = 1, a = 0, b = 1. reach a conflict: x = 1 ja x = 0! learning: add a new term (¬e + h + ¬d) Implication Graph

Digitaalsüsteemide verifitseerimise kursus17 It implies that c = 0; the function is simplified: Since e is a unit term then e = 1; first decision: a = 1 If we choose b=1, then conflict! Two possibilities to handle this: 1) Invert the last decision (backtrack) 2) Add a new term (learning): Implication Graph Example

Digitaalsüsteemide verifitseerimise kursus18 Equivalence checking with SAT Equivalence Checking can be reduced to SAT: d = f  g Iff d is satisfiable then f and g are NOT equivalent.

Digitaalsüsteemide verifitseerimise kursus19 Miter circuit Specification (reference implementation) Implementation SAT?

Digitaalsüsteemide verifitseerimise kursus20 SAT for schematics: characteristic formula Build CNFs corresponding to logic gates using logic implication: a  b = ¬a + b ab abab

Digitaalsüsteemide verifitseerimise kursus21 Implications for describing the AND gate: ¬a  ¬c & ¬b  ¬c & ¬c  ¬a  ¬b Characteristic formula for AND in CNF: (a+ ¬c) (b+ ¬c) (c+ ¬a+ ¬b) & a b c SAT for schematics: characteristic formula

Digitaalsüsteemide verifitseerimise kursus22 Implications for describing the OR-gate: a  c & b  c & c  a  b Characteristic formula for OR in CNF: (¬a + c) (¬b + c) (¬c + a + b) 1 a b c SAT for schematics: characteristic formula

Digitaalsüsteemide verifitseerimise kursus23 Characteristic formula for a schematic: (a+¬d)(b+¬d)(d+¬a+¬b)(¬c+¬e)(c+e)(¬d+f)(¬e+f)(¬f+d+e) 1 c e f & a b d SAT for schematics: characteristic formula