Normal Forms Boolean Satisfiability Sectoins 5.3 and 5.5. Prof. Sandy Irani

Similar documents
CS February 17

Standard Forms of Expression. Minterms and Maxterms

Philadelphia University Faculty of Information Technology Department of Computer Science. Computer Logic Design. By Dareen Hamoudeh.

Menu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification

Boolean algebra. June 17, Howard Huang 1

Chapter 2 Combinational Logic Circuits

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Review: Standard forms of expressions

Gate Level Minimization Map Method

DSAS Laboratory no 4. Laboratory 4. Logic forms

Spring 2010 CPE231 Digital Logic Section 1 Quiz 1-A. Convert the following numbers from the given base to the other three bases listed in the table:

Experiment 3: Logic Simplification

Lecture 4: Implementation AND, OR, NOT Gates and Complement

Computer Organization

Introduction to Boolean logic and Logical Gates

Chapter 2 Boolean algebra and Logic Gates

Simplification of Boolean Functions

S1 Teknik Telekomunikasi Fakultas Teknik Elektro FEH2H3 2016/2017

CMPE223/CMSE222 Digital Logic

Lecture 5. Chapter 2: Sections 4-7

Announcements. Chapter 2 - Part 1 1

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Synthesis of 2-level Logic Heuristic Method. Two Approaches

Gate-Level Minimization. BME208 Logic Circuits Yalçın İŞLER

Definitions. 03 Logic networks Boolean algebra. Boolean set: B 0,

ELCT201: DIGITAL LOGIC DESIGN

ECE380 Digital Logic

Chap-2 Boolean Algebra

Unit-IV Boolean Algebra

Digital Design. Chapter 4. Principles Of. Simplification of Boolean Functions

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Basic circuit analysis and design. Circuit analysis. Write algebraic expressions or make a truth table

boolean.py Documentation

Gate-Level Minimization

Boolean Logic CS.352.F12

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?

Binary logic. Dr.Abu-Arqoub

A B AB CD Objectives:

Chapter 2 Combinational

Combinational Logic & Circuits

Gate-Level Minimization

Experiment 4 Boolean Functions Implementation

CDA 3103 Computer Organization Exam 1 (Sep. 22th, 2014)

Circuit analysis summary

Digital Logic Lecture 7 Gate Level Minimization

UNIT-4 BOOLEAN LOGIC. NOT Operator Operates on single variable. It gives the complement value of variable.

Code No: R Set No. 1

Karnaugh Maps. Ioan Despi. University of New England. September 13, 2013

IT 201 Digital System Design Module II Notes

Standard Boolean Forms

01 Introduction to Digital Logic. ENGR 3410 Computer Architecture Mark L. Chang Fall 2008

QUESTION BANK FOR TEST

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY

Permutation Matrices. Permutation Matrices. Permutation Matrices. Permutation Matrices. Isomorphisms of Graphs. 19 Nov 2015

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

Code No: R Set No. 1

Gate-Level Minimization

ece5745-pla-notes.txt

ENGINEERS ACADEMY. 7. Given Boolean theorem. (a) A B A C B C A B A C. (b) AB AC BC AB BC. (c) AB AC BC A B A C B C.

1. Mark the correct statement(s)

Chapter 3 Simplification of Boolean functions

Introduction to Computer Architecture

Objectives: 1- Bolean Algebra. Eng. Ayman Metwali

2.1 Binary Logic and Gates

Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

BOOLEAN ALGEBRA. 1. State & Verify Laws by using :

Digital Logic Design. Outline

Decision Procedures in First Order Logic

Code No: R Set No. 1

Boolean Algebra. BME208 Logic Circuits Yalçın İŞLER

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

Chapter 3. Gate-Level Minimization. Outlines

To write Boolean functions in their standard Min and Max terms format. To simplify Boolean expressions using Karnaugh Map.

Gate Level Minimization

Lecture (05) Boolean Algebra and Logic Gates

PROPOSITIONAL LOGIC (2)

Code No: 07A3EC03 Set No. 1

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR Stamp / Signature of the Invigilator

Boolean Algebra and Logic Gates

Chapter 3. Boolean Algebra and Digital Logic

2.6 BOOLEAN FUNCTIONS

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

211: Computer Architecture Summer 2016

Chapter 4. Combinational Logic. Dr. Abu-Arqoub

Chapter 2: Combinational Systems

NP-Complete Reductions 2

X Y Z F=X+Y+Z

2SAT Andreas Klappenecker

Design of Digital Circuits Lecture 6: Combinational Logic, Hardware Description Lang. & Verilog. Prof. Onur Mutlu ETH Zurich Spring March 2018

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Digital Logic. Copyright By NODIA & COMPANY

Mixed Integer Linear Programming

Combinational Logic Circuits Part III -Theoretical Foundations

Computer Organization and Levels of Abstraction

P -vs- NP. NP Problems. P = polynomial time. NP = non-deterministic polynomial time

Information Science 1

CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey

01 Introduction to Digital Logic. ENGR 3410 Computer Architecture Mark L. Chang Fall 2006

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Transcription:

Normal Forms Boolean Satisfiability Sectoins 5.3 and 5.5 Prof. Sandy Irani

Normal Forms for Boolean Expressions Boolean expressions can be put into standardized forms. Useful for manipulating expressions systematically or automated reasoning Disjunctive Normal Form (DNF) Sum of products of literals. Conjunctive Normal Form (CNF) Product of sums of literals

Disjunctive Normal Form DNF: Sum of products of literals The sum of minterms expressions obtained from I/O tables is an example of DNF Form: f(x, y, z) = xҧ തy z ҧ + xҧ y z ҧ + x തy z For an expression to be in DNF, the product terms are not required to be minterms. The following Boolean expressions are all in DNF form: ഥx ഥy തz + ഥx + ഥy z uxഥyz + ഥx തz + y x + y + z xyz

Disjunctive Normal Form A Boolean expression is DNF if: 1. Multiplication only applied to literals 2. Complement only applied to variables The following expressions are not DNF: (x+y)z + xҧ തy zҧ z(x+y)u xyz + തy zҧ yz + xy

Conjunctive Normal Form CNF: Product of sums of literals The following Boolean expressions are all in CNF form: (ഥx + ഥy + തz)(x + y)(ഥu + x) u( ഥy + തz )y x + ഥy + z xyz

Conjunctive Normal Form A Boolean expression is CNF if: 1. Addition only applied to literals 2. Complement only applied to variables The following expressions are not CNF: (x+y+uz)( ഥy + തz ) zҧ xy + z ( x + y )( ഥy + തz )

CNF/DNF * Which Boolean expression is neither DNF nor CNF? A) തy + z ҧ + xҧ y(തu + z)(u ҧ + z) B) z + xy + y C) yതux zҧ D) z + തux z ҧ + y

CNF/DNF We know that every Boolean function has an equivalent DNF expression (sum of minterms). Does every Boolean function have an equivalent CNF expression?...yes. Worked out in homework! Which is better CNF or DNF? Depending on the function, one or the other may be more efficient (fewer variables and terms) DNF can be easier to work with CNF is natural for expressing certain kinds of constraints

Boolean Satisfiability (SAT) Input: Boolean expression with n variables Output: Yes/No Is there a setting of the n input variables that causes the Boolean expression to evaluate to 1? f(x, y, z) = z(x + തy)( z ҧ + x) ҧ f(x, y, z) = z(x + തy)( z ҧ + x)(y ҧ + z) ҧ

Boolean Satisfiability (SAT) * Which Boolean function is not satisfiable? A) തy + zҧ y(തu + z)(u ҧ + z) B) തu + തy y(തy + z)(u ҧ + z) C) x + z y( x ҧ + തy)(y + x) D xy(x + തy)( z ҧ + x)

Boolean Satisfiability (SAT) One way to check satisfiability is by truth table: f(x, y, z) = (z+y)(x + തy)( z ҧ + x)(z+തy)(y ҧ + z) ҧ x y z f(x,y,z) 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

Boolean Satisfiability (SAT) If a Boolean expression has 200 vairables, exhaustively searching the truth table could require as many as 2 200 function evaluations. 1 nanosecond per evaluation:.over a billion years!

Why is SAT Imporant? The language of Boolean logic can be used to express many important and practical computational problems. Efficient algorithm for SAT Efficient algorithm for all of those problems

Example Application of SAT Will use Boolean satisfiability to express a scheduling problem. If we can solve SAT, then we can solve the scheduling problem. Scheduling Classes: Input: Set of classes Set of time slots Constraints: certain pairs of classes can not be assigned to the same time slot Output: Is there a way to schedule all the classes that does not violate any of the constraints?

I: input to the scheduling problem n: number of classes k: number of time slots Pairs (j,k) class j and k can not be schedule during the same time Boolean Expression E. E is satisfiable if and only if there is a feasible schedule for I

Example Application of SAT For example: 5 Classes {A, B, C, D, E} 2 Time slots These pairs of classes can not be scheduled during the same time: (A, B), (C, D), (D, E), (B, E), (A, D) Boolean Variables: x A1, x B1, x C1, x D1, x E1, x A2, x B2, x C2, x D2, x E2 x C2 = 1 if class C is scheduled during time slot 2

Example Application of SAT Boolean Variables: x A1, x B1, x C1, x D1, x E1, x A2, x B2, x C2, x D2, x E2 x C2 = 1 if class C is scheduled during time slot 2 Create a Boolean expression that is a product of terms Each term represents a constraint: Boolean expression is satisfiable There is an assignment to variables in which every term equals 1 There is a schedule of the classes that satisfies all the constraints

Example Application of SAT Boolean Variables: x A1, x B1, x C1, x D1, x E1, x A2, x B2, x C2, x D2, x E2 x C2 = 1 if class C is scheduled during time slot 2 Boolean assignment must represent a valid schedule: Each class must be scheduled in exactly one time slot. For example, for class D: (x D1 + x D2 )( x D1 + x D2 ) D must be scheduled in at least one time slot D can not be scheduled in both time slots

Example Application of SAT Boolean Variables: x A1, x B1, x C1, x D1, x E1, x A2, x B2, x C2, x D2, x E2 x C2 = 1 if class C is scheduled during time slot 2 Constraint (D, E) means that D and E can not be scheduled in the same time slot: ( x D1 + x E1 )( x D2 + x E2 ) D and E can not both be scheduled in time slot 1 D and E can not both be scheduled in time slot 2

Put all the constraints together in one big product: x A1 + x A2 x A1 + x A2 x B1 + x B2 x B1 + x B2 x C1 + x C2 x C1 + x C2 x D1 + x D2 x D1 + x D2 (x E1 + x E2 )( x E1 + x E2 ) Each class scheduled in exactly one time slot. ( x A1 + x B1 )( x A2 + x B2 ) x C1 + x D1 x C2 + x D2 ( x D1 + x E1 )( x D2 + x E2 )( x B1 + x E1 )( x B2 + x E2 ) ( x A1 + x D1 )( x A2 + x D2 ) For constraints: (A, B), (C, D), (D, E), (B, E), (A, D) Note: this is a CNF expression.

Example Application of SAT * For example: 5 Classes {A, B, C, D, E} 2 Time slots These pairs of classes can not be scheduled during the same time: (A, B), (C, D), (D, E), (B, E), (A, D) Which assignment will cause the Boolean expression to evaluate to 1? A) x A1, x B2, x C1, x D2, x E1 = 1 x A2, x B1, x C2, x D1, x E2 = 0 B) x A1, x A2, x C1, x D2, x E1 = 1 x B1, x B2, x C2, x D1, x E2 = 0 C) x A1, x B2, x C1, x D1, x E1 = 1 x A2, x B1, x C2, x D2, x E2 = 0 D) x A1, x C1, x D1, x E1 = 1 x A2, x B1, x B2, x C2, x D2, x E2 = 0