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

Similar documents
CSC Discrete Math I, Spring Propositional Logic

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

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

Compound Propositions

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

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Chapter 1, Section 1.1 Propositional Logic

Section 1.1: Logical Form and Logical Equivalence

Propositional Equivalence

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

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

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

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

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

DISCRETE STRUCTURES WEEK5 LECTURE1

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

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

Comp487/587 - Boolean Formulas

Propositional logic ( ): Review from Mat 1348

Proofs. Joe Patten August 10, 2018

Definition 2. Conjunction of p and q

Propositional Logic. Spring Propositional Logic Spring / 32

Review for Midterm 1. Andreas Klappenecker

Logic: Propositional Logic (Part I)

Lecture 7. Logic. Section1: Statement Logic.

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Introduction to Theoretical Computer Science

2.2: Logical Equivalence: The Laws of Logic

Propositional Logic and Semantics

Propositional Logic Language

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

Propositional Logic: Part II - Syntax & Proofs 0-0

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

PROPOSITIONAL CALCULUS

Review 1. Andreas Klappenecker

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

UNIT-I: Propositional Logic

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Truth-Functional Logic

Discrete Mathematics and Its Applications

Artificial Intelligence. Propositional logic

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CSE 20: Discrete Mathematics

Advanced Topics in LP and FP

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

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

a. ~p : if p is T, then ~p is F, and vice versa

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

Learning Goals of CS245 Logic and Computation

EECS 1028 M: Discrete Mathematics for Engineers

Inference in Propositional Logic

AMTH140 Lecture 8. Symbolic Logic

15414/614 Optional Lecture 1: Propositional Logic

Natural Deduction for Propositional Logic

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

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

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

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

Logic Overview, I. and T T T T F F F T F F F F

Propositional Logic: Models and Proofs

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

Syntax of propositional logic. Syntax tree of a formula. Semantics of propositional logic (I) Subformulas

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

THE LOGIC OF COMPOUND STATEMENTS

Discrete Structures of Computer Science Propositional Logic I

3 The Semantics of the Propositional Calculus

Logic and Propositional Calculus

Chapter 4: Classical Propositional Semantics

Propositional and Predicate Logic - II

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

PHIL12A Section answers, 16 February 2011

Discrete Mathematics and Applications COT3100

Boolean Logic. CS 231 Dianna Xu

Warm-Up Problem. Is the following true or false? 1/35

Logical Agents (I) Instructor: Tsung-Che Chiang

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

Propositional Logic. Fall () Propositional Logic Fall / 30

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

CITS2211 Discrete Structures. Propositional Logic

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

ICS141: Discrete Mathematics for Computer Science I

Digital Logic Design: a rigorous approach c

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

THE LOGIC OF COMPOUND STATEMENTS

Introduction to Decision Sciences Lecture 2

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Introduction to first-order logic:

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

A brief introduction to Logic. (slides from

LING 106. Knowledge of Meaning Lecture 3-1 Yimei Xiang Feb 6, Propositional logic

CS156: The Calculus of Computation

Chapter 11: Automated Proof Systems (1)

Propositional Logic. Yimei Xiang 11 February format strictly follow the laws and never skip any step.

1 Propositional Logic

Transcription:

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

Propositions A proposition is a declarative sentence that is either true or false (but not both). Examples: College Station is the capital of the USA. There are fewer politicians in College Station than in Washington, D.C. 1+1=2 2+2=5 2

Propositional Variables A variable that represents propositions is called a propositional variable. For example: p, q, r,... [Propositional variables in logic play the same role as numerical variables in arithmetic.] 3

Propositional Logic The area of logic that deals with propositions is called propositional logic. In addition to propositional variables, we have logical connectives (or operators) such as not (for negation), and (for conjunction), or (for disjunction), exclusive or (for exclusive disjunction), conditional (for implication), and biconditional. 4

Formation Tree Each logical connective is enclosed in parentheses, except for the negation connective. Thus, we can associate a unique binary tree to each proposition, called the formation tree. The formation tree contains all subformulas of a formula, starting with the formula at its root and breaking it down into its subformulas until you reach the propositional variables at its leafs. 5

Formation Tree A formation tree of a proposition p has a root labeled with p and satisfies the following rules: T1. Each leaf is an occurrence of a propositional variable in p. T2. Each internal node with a single successor is labeled by a subformula q of p and has q as a successor. T3. Each internal node with two successors is labeled by a subformula axb of p with X in {,,,, } and has a as a left successor and b as a right successor. 6

Example The formation tree of the formula ((a b) c) is given by ((a b) c) Ω ΩZ Z (a b) c J a b c 7

Assigning Meanings to Formulas We know that each formula corresponds to a unique binary tree. We can evaluate the formula by - giving each propositional variable a truth value - defining the meaning of each logical connective - propagate the truth values from the leafs to the root in a unique way, so that we get an unambiguous evaluation of each formula. 8

Semantics Let B={t,f}. Assign to each connective x a function Mx: B->B that determines the semantics of x. y if P M (P ) f t t f is false. P Q M (P, Q) M (P, Q) M (P, Q) M (P, Q) M (P, Q) f f f f f t t f t f t t t f t f f t t f f t t t t f t t 9

Summary Informally, we can summarize the meaning of the connectives in words as follows: 1. The and connective (a b) is true if and only if both a and b are true. 2. The or connective (a b) is true if and only if at least one of a, b is true. 3. The exclusive or (a b) is true if and only if precisely one of a, b is true. 4. The implication (a b) is false if and only if the premise a is true and the conclusion b is false. 5. The biconditional (a b) is true if and only if the truth values of a and b are the same. 10

Equivalences and Applications 11

Remarks In our formal introduction of propositional logic, we used a strict syntactic structure with full parenthesizing (except negations). From now on, we will be more relaxed about the syntax and allow to drop enclosing parentheses. This can introduce ambiguity, which is resolved by introducing operator precedence rules (from highest to lowest): 1) negation, 2) and, 3) or & xor, 4) conditional, 5) biconditional 12

Tautologies A proposition p is called a tautology if and only if in a truth table it always evaluates to true regardless of the assignment of truth values to its variables. Example: p p p p F T T T F T 13

Example of a Tautology p q p p q p q ( p q) (p q) F F T T T T F T T T T T T F F F F T T T F T T T Roughly speaking, this means that p q has the same meaning as p q. 14

Logical Equivalence Two propositions p and q are called logically equivalent if and only if p q is a tautology. We write p q if and only if p and q are logically equivalent. We have shown that ( p q) (p q). In general, we can use truth tables to establish logical equivalences. 15

De Morgan s Laws (1) Theorem: (p q) p q. Proof: We can use a truth table: p q (p q) (p q) p q p q F F F T T T T F T F T T F T T F F T F T T T T T F F F F 16

De Morgan s Laws (2) Theorem: (p q) p q Proof: Use truth table, as before. See Example 2 on page 26 of our textbook. 17

Commutative, Associative, and Distributive Laws Commutative laws: p _ q q _ p p ^ q q ^ p Associative laws: (p _ q) _ r p _ (q _ r) (p ^ q) ^ r p ^ (q ^ r) Distributive laws: p _ (q ^ r) (p _ q) ^ (p _ r) p ^ (q _ r) (p ^ q) _ (p ^ r) 18

Double Negation Law We have ( p) p p p ( p) F T F T F T 19

Logical Equivalences You find many more logical equivalences listed in Table 6 on page 27. You should very carefully study these laws. 20

Logical Equivalences in Action Let us show that (p q) p ^ q are logically equivalent without using truth tables. (p q) ( p _ q) (previous result) ( p) ^ q (de Morgan) p ^ q (double negation law) [Arguments using laws of logic are more desirable than truth tables unless the number of propositional variables is tiny.] 21