Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Similar documents
Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CSC Discrete Math I, Spring Propositional Logic

CSE 20 DISCRETE MATH WINTER

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Tecniche di Verifica. Introduction to Propositional Logic

CSE 20 DISCRETE MATH. Fall

A statement is a sentence that is definitely either true or false but not both.

Compound Propositions

Solutions to Sample Problems for Midterm

Language of Propositional Logic

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Tautologies, Contradictions, and Contingencies

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

Definition 2. Conjunction of p and q

Propositional Logic. Spring Propositional Logic Spring / 32

CSE 20 DISCRETE MATH WINTER

Chapter 1, Section 1.1 Propositional Logic

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Boolean Logic. CS 231 Dianna Xu

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

Section 1.1: Logical Form and Logical Equivalence

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

PROPOSITIONAL CALCULUS

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Proofs. Joe Patten August 10, 2018

Comp487/587 - Boolean Formulas

Discrete Mathematics and Its Applications

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

THE LOGIC OF COMPOUND STATEMENTS

Topic 1: Propositional logic

Advanced Topics in LP and FP

Solutions to Homework I (1.1)

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

1.3 Propositional Equivalences

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Propositional Logic 1

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Logic: Propositional Logic (Part I)

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Logic and Truth Tables

Propositional Logic and Semantics

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

A brief introduction to Logic. (slides from

2.2: Logical Equivalence: The Laws of Logic

Propositional Languages

We last time we began introducing equivalency laws.

THE LOGIC OF COMPOUND STATEMENTS

Propositional logic ( ): Review from Mat 1348

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

EECS 1028 M: Discrete Mathematics for Engineers

Truth-Functional Logic

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

15414/614 Optional Lecture 1: Propositional Logic

The statement calculus and logic

Propositional Logic:

Math.3336: Discrete Mathematics. Propositional Equivalences

Inference in Propositional Logic

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Propositional Logic. Logical Expressions. Logic Minimization. CNF and DNF. Algebraic Laws for Logical Expressions CSC 173

UNIT-I: Propositional Logic

DISCRETE STRUCTURES WEEK5 LECTURE1

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

ECE473 Lecture 15: Propositional Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Propositional Logic. Fall () Propositional Logic Fall / 30

02 Propositional Logic

software design & management Gachon University Chulyun Kim

Chapter 4: Classical Propositional Semantics

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

~ p is always false. Based on the basic truth table for disjunction, if q is true then p ~

The Foundations: Logic and Proofs. Part I

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Logic and Proofs. (A brief summary)

Critical Reading of Optimization Methods for Logical Inference [1]

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Logic and Inferences

CS156: The Calculus of Computation

1 Propositional Logic

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

EECS 1028 M: Discrete Mathematics for Engineers

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

C241 Homework Assignment 4

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

1 Propositional Logic

Propositional logic II.

Logic and Truth Tables

Transcription:

Propositional Logic Winter 2012

Propositional Logic: Section 1.1 Proposition A proposition is a declarative sentence that is either true or false. Which ones of the following sentences are propositions? Ottawa is the capital of Canada. Buenos Aires is the capital of Brazil. 2 + 2 = 4 2 + 2 = 5 if it rains, we don t need to bring an umbrella. x + 2 = 4 x + y = z When does the bus come? Do the right thing.

Propositional Logic: Section 1.1 Propositional variable and connectives We use letters p, q, r,... to denote propositional variables (variables that represent propositions). We can form new propositions from existing propositions using logical operators or connectives. These new propositions are called compound propositions. Summary of connectives: name nickname symbol negation NOT conjunction AND disjunction OR exclusive-or XOR implication implies biconditional if and only if

Propositional Logic: Section 1.1 Meaning of connectives p q p p q p q p q p q p q T T F T T F T T T F F F T T F F F T T F T T T F F F T F F F T T WARNING: Implication (p q) causes confusion, specially in line 3: F T is true. One way to remember is that the rule to be obeyed is if the premise p is true then the consequence q must be true. The only truth assignment that falsifies this is p = T and q = F.

Propositional Logic: Section 1.1 Truth tables for compound propositions Construct the truth table for the compound proposition: (p q) (p q) p q q p q p q (p q) (p q) T T F T F T F T F F F T

Propositional Equivalences: Section 1.2 Propositional Equivalences A basic step is math is to replace a statement with another with the same truth value (equivalent). This is also useful in order to reason about sentences. Negate the following phrase: Miguel has a cell phone and he has a laptop computer. p= Miguel has a cell phone q= Miguel has a laptop computer. The phrase above is written as (p q). Its negation is (p q), which is logically equivalent to p q. (De Morgan s law) This negation therefore translates to: Miguel does not have a cell phone or he does not have a laptop computer.

Propositional Equivalences: Section 1.2 Truth assignments, tautologies and satisfiability Definition Let X be a set of propositions. A truth assignment (to X) is a function τ : X {true, false} that assigns to each propositional variable a truth value. (A truth assignment corresponds to one row of the truth table) If the truth value of a compound proposition under truth assignment τ is true, we say that τ satisfies P, otherwise we say that τ falsifies P. A compound proposition P is a tautology if every truth assignment satisfies P, i.e. all entries of its truth table are true. A compound proposition P is satisfiable if there is a truth assignment that satisfies P ; that is, at least one entry of its truth table is true. A compound proposition P is unsatisfiable (or a contradiction) if it is not satisfiable; that is, all entries of its truth table are false.

Propositional Equivalences: Section 1.2 Examples: tautology, satisfiable, unsatisfiable For each of the following compound propositions determine if it is a tautology, satisfiable or unsatisfiable: (p q) p q p q r ( p q r) (p q) ( p q)

Propositional Equivalences: Section 1.2 Logical implication and logical equivalence Definition A compound proposition p logically implies a compound proposition q (denoted p q) if p q is a tautology. Two compound propositions p and q are logically equivalent (denoted p q, or p q ) if p q is a tautology. Theorem Two compound propositions p and q are logically equivalent if and only if p logically implies q and q logically implies p. In other words: two compound propositions are logically equivalent if and only if they have the same truth table.

Propositional Equivalences: Section 1.2 Logically equivalent compound propositions Using truth tables to prove that (p q) and p q are logically equivalent, i.e. (p q) p q p q p p q p q T T F T T T F F F F F T T T T F F T T T What is the problem with this approach?

Propositional Equivalences: Section 1.2 Truth tables versus logical equivalences Truth tables grow exponentially with the number of propositional variables! A truth table with n variables has 2 n rows. Truth tables are practical for small number of variables, but if you have, say, 7 variables, the truth table would have 128 rows! Instead, we can prove that two compound propositions are logically equivalent by using known logical equivalences ( equivalence laws ).

Propositional Equivalences: Section 1.2 Summary of important logical equivalences I Note T is the compound composition that is always true, and F is the compound composition that is always false.

Propositional Equivalences: Section 1.2 Summary of important logical equivalences II Rosen, page 24-25.

Propositional Equivalences: Section 1.2 Proving new logical equivalences Use known logical equivalences to prove the following: 1 Prove that (p q) p q. 2 Prove that (p q) (p q) is a tautology.

Normal forms for compound propositions Normal forms for compound propositions A literal is a propositional variable or the negation of a propositional variable. A term is a literal or the conjunction (and) of two or more literals. A clause is a literal or the disjunction (or) of two or more literals. Definition A compound proposition is in disjunctive normal form (DNF) if it is a term or a disjunction of two or more terms. (i.e. an OR of ANDs). A compound proposition is in conjunctive normal form (CNF) if it is a clause or a conjunction of two or more clauses. (i.e. and AND of ORs)

Normal forms for compound propositions Disjunctive normal form (DNF) x y z x y x z 1 F F F T 2 F F T T 3 F T F F 4 F T T T 5 T F F F 6 T F T F 7 T T F F 8 T T T F The formula is satisfied by the truth assignment in row 1 or by the truth assignment in row 2 or by the truth assignment in row 4. So, its DNF is : ( x y z) ( x y z) ( x y z)

Normal forms for compound propositions Conjunctive normal form (CNF) x y z x y x z 1 F F F T 2 F F T T 3 F T F F 4 F T T T 5 T F F F 6 T F T F 7 T T F F 8 T T T F The formula is not satisfied by the truth assignment in row 3 and in row 5 and in row 6 and in row 7 and in row 8. So:, it is log. equiv. to: ( x y z) (x y z) (x y z) (x y z) (x y z) apply DeMorgan s law to obtain its CNF: (x y z) ( x y z) ( x y z) ( x y z) ( x y z)

Boolean functions and digital circuits Boolean functions and the design of digital circuits Let B = {false, true} (or B = {0, 1}). A function f : B n B is called a boolean function of degree n. Definition A compound proposition P with propositions x 1, x 2,..., x n represents a Boolean function f with arguments x 1, x 2,..., x n if for any truth assignment τ, τ satisfies P if and only if f(τ(x 1 ), τ(x 2 ),..., τ(x n )) = true. Theorem Let P be a compound proposition that represents a boolean function f. Then, a compound proposition Q also represents f if and only if Q is logically equivalent to P.

Boolean functions and digital circuits Complete set of connectives (functionally complete) Theorem Every boolean formula can be represented by a compound proposition that uses only connectives {,, } (i.e. {,, } is functionally complete ). Proof: use DNF or CNF! This is the basis of circuit design: In digital circuit design, we are given a functional specification of the circuit and we need to construct a hardware implementation. functional specification = number n of inputs + number m of outputs + describe outputs for each set of inputs (i.e. m boolean functions!) Hardware implementation uses logical gates: or-gates, and-gates, inverters. The functional specification corresponds to m boolean functions which we can represent by m compound propositions that uses only {,, }, that is, its hardware implementation uses inverters, and-gates and or-gates.

Boolean functions and digital circuits Boolean functions and digital circuits Consider the boolean function represented by x y x z. Give a digital circuit that computes it, using only {,, }. This is always possible since {,, } is functionally complete (e.g. use DNF or CNF). Give a digital circuit that computes it, using only {, }. This is always possible, since {, } is functionally complete: Proof: Since {,, } is functionally complete, it is enough to show how to express x y using only {, }: (x y) ( x y) Give a digital circuit that computes it, using only {, }. Prove that {, } is functionally complete.