Discrete Structures of Computer Science Propositional Logic I

Similar documents
Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

CSC Discrete Math I, Spring Propositional Logic

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Compound Propositions

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

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

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

PROPOSITIONAL CALCULUS

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

software design & management Gachon University Chulyun Kim

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

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

2.2: Logical Equivalence: The Laws of Logic

Section 1.1 Propositional Logic. proposition : true = T (or 1) or false = F (or 0) (binary logic) the moon is made of green cheese

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

DISCRETE STRUCTURES WEEK5 LECTURE1

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both.

Introduction. Applications of discrete mathematics:

Discrete Mathematics and Applications COT3100

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

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

Propositional Logic. Spring Propositional Logic Spring / 32

Section 1.1: Logical Form and Logical Equivalence

EECS 1028 M: Discrete Mathematics for Engineers

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

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

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

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

Discrete Mathematics

MAT2345 Discrete Math

Propositional Logic 1

DISCRETE MATHEMATICS BA202

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

ARTIFICIAL INTELLIGENCE

Learning Goals of CS245 Logic and Computation

Today s Topic: Propositional Logic

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

Propositional Logic. Fall () Propositional Logic Fall / 30

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

The statement calculus and logic

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Chapter 5: Section 5-1 Mathematical Logic

Chapter 4: Classical Propositional Semantics

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

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.

The Foundations: Logic and Proofs. Part I

Chapter 1, Section 1.1 Propositional Logic

AMTH140 Lecture 8. Symbolic Logic

Maryam Al-Towailb (KSU) Discrete Mathematics and Its Applications Math. Rules Math. of1101 Inference 1 / 13

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

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

Logic and Truth Tables

Math Assignment 2 Solutions - Spring Jaimos F Skriletz Provide definitions for the following:

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

Introduction Propositional Logic

Logic. Def. A Proposition is a statement that is either true or false.

Definition 2. Conjunction of p and q

ANALYSIS EXERCISE 1 SOLUTIONS

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

Proofs. Joe Patten August 10, 2018

Discrete Structures for Computer Science

Equivalence and Implication

PS10.3 Logical implications

GEOMETRY. Chapter 2: LOGIC. Name: Teacher: Pd:

We last time we began introducing equivalency laws.

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

Logic. Propositional Logic: Syntax

Boolean Logic. CS 231 Dianna Xu

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

Chapter 1: The Logic of Compound Statements. January 7, 2008

15414/614 Optional Lecture 1: Propositional Logic

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

Propositional Languages

Lecture 02: Propositional Logic

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

PHI Propositional Logic Lecture 2. Truth Tables

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

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

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

CSE 240 Logic and Discrete Mathematics

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

ECOM Discrete Mathematics

Logic and Proofs. (A brief summary)

1.1 Language and Logic

Propositional Calculus. Problems. Propositional Calculus 3&4. 1&2 Propositional Calculus. Johnson will leave the cabinet, and we ll lose the election.

Discrete Mathematics and Its Applications

1.1 Language and Logic

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

CSE 20 DISCRETE MATH. Fall

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

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

Logic: Propositional Logic (Part I)

Propositional logic ( ): Review from Mat 1348

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

Chapter 1: Formal Logic

Propositional Equivalence

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Transcription:

Discrete Structures of Computer Science Propositional Logic I Gazihan Alankuş (Based on original slides by Brahim Hnich) July 26, 2012

1 Use of Logic 2 Statements 3 Logic Connectives 4 Truth Tables

Use of Logic In mathematics:

Use of Logic In mathematics: Give precise meaning to statements

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments Provide use of correct reasoning

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments Provide use of correct reasoning Natural language can be very ambiguous

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments Provide use of correct reasoning Natural language can be very ambiguous He ate the cookies on the couch

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments Provide use of correct reasoning Natural language can be very ambiguous He ate the cookies on the couch This is good soup

Use of Logic In mathematics: Give precise meaning to statements Distinguish between valid and invalid arguments Provide use of correct reasoning Natural language can be very ambiguous He ate the cookies on the couch This is good soup You could do with a new automobile. How about a test drive?

Use of Logic In computing:

Use of Logic In computing: Design new data/knowledge from existing facts

Use of Logic In computing: Design new data/knowledge from existing facts Design of computer circuits

Use of Logic In computing: Design new data/knowledge from existing facts Design of computer circuits Construction of computer programs

Use of Logic In computing: Design new data/knowledge from existing facts Design of computer circuits Construction of computer programs Verification of correctness of programs and circuit design

Use of Logic In computing: Design new data/knowledge from existing facts Design of computer circuits Construction of computer programs Verification of correctness of programs and circuit design Specification

Statements(propositions) Propositional logic deals with statements and their truth values

Statements(propositions) Propositional logic deals with statements and their truth values A statement is a declarative sentence that can be true or false

Statements(propositions) Propositional logic deals with statements and their truth values A statement is a declarative sentence that can be true or false Truth values are TRUE (T or 1) and FALSE (F or 0)

Example Statements 1 + 1 = 2 (statement, T)

Example Statements 1 + 1 = 2 (statement, T) The moon is made of cheese (statement, F)

Example Statements 1 + 1 = 2 (statement, T) The moon is made of cheese (statement, F) Go home! (no statement, imperative)

Example Statements 1 + 1 = 2 (statement, T) The moon is made of cheese (statement, F) Go home! (no statement, imperative) What a beautiful garden (not statement, exclamation)

Example Statements 1 + 1 = 2 (statement, T) The moon is made of cheese (statement, F) Go home! (no statement, imperative) What a beautiful garden (not statement, exclamation) Alice said: What a beautiful garden! (statement, depends on Alice)

Example Statements 1 + 1 = 2 (statement, T) The moon is made of cheese (statement, F) Go home! (no statement, imperative) What a beautiful garden (not statement, exclamation) Alice said: What a beautiful garden! (statement, depends on Alice) y + 1 = 2 (not statement, uncertain)

Compound Statements Simplest statements are called primitive statements

Compound Statements Simplest statements are called primitive statements We shall use propositional variables to denote primitive statements, p, q, r,...

Compound Statements Simplest statements are called primitive statements We shall use propositional variables to denote primitive statements, p, q, r,... We cannot decide the truth value of a primitive statement. This is not what logic does

Compound Statements Simplest statements are called primitive statements We shall use propositional variables to denote primitive statements, p, q, r,... We cannot decide the truth value of a primitive statement. This is not what logic does Instead we combine primitive statements by means of logic connectives into compound statements or formulas and look how the truth value of a compound statement depends on the truth values of the primitive statements it includes.

Compound Statements Simplest statements are called primitive statements We shall use propositional variables to denote primitive statements, p, q, r,... We cannot decide the truth value of a primitive statement. This is not what logic does Instead we combine primitive statements by means of logic connectives into compound statements or formulas and look how the truth value of a compound statement depends on the truth values of the primitive statements it includes. We will denote compound statements by Θ, Ψ,...

Logic connectives negation (not, ) It is not true that at least one politician was honest

Logic connectives negation (not, ) It is not true that at least one politician was honest conjunction (and, ) In this room there is a lady, and in the other room there is a tiger

Logic connectives negation (not, ) It is not true that at least one politician was honest conjunction (and, ) In this room there is a lady, and in the other room there is a tiger disjunction (or, ) This is a matter of death or life!

Logic Connectives implication (if... then..., ) If it rains, then we get wet

Logic Connectives implication (if... then..., ) If it rains, then we get wet exclusive or (either... or..., ) Either there is a tiger in this room, or a lady

Logic Connectives implication (if... then..., ) If it rains, then we get wet exclusive or (either... or..., ) Either there is a tiger in this room, or a lady equivalence (if and only if, ) There is a lady in this room if and only if there is a tiger in the other room!

Truth Tables Truth tables is a way to specify the exact truth value of a compound statement through the values of primitive statements involved

Truth Table of Negation Unary connective p p F (0) T (1) T (1) F (0) p: Today is Monday p: Today is not Monday

Truth Table of Conjunction Binary connective p q p q 0 0 0 0 1 0 1 0 0 1 1 1 p: Today is Monday q: It is raining p q: Today is Monday and it is raining

Truth Table of Disjunction Binary connective p q p q 0 0 0 0 1 1 1 0 1 1 1 1 p: Today is Friday q: Today is Saturday p q: Today is Friday or Saturday

Truth Table of exclusive or Binary connective p q p q 0 0 0 0 1 1 1 0 1 1 1 0 p q: You can follow the rules or be disqualified

Truth Table of implication Binary connective p q p q 0 0 1 0 1 1 1 0 0 1 1 1 p q: If black is white, then we we live in Antartica

Implication as a promise Note that logical implication does not assume any causal connection. Implication can be thought of as a promise, and it is true if the promise is kept. If I am elected, then I will lower taxes He is not elected and taxes are not lowered He is not elected and taxes are lowered He is elected and taxes are not lowered He is elected and taxes are lowered promise kept! promise kept! promise broken! promise kept!

Playing with implication Parts of implication p q p: can be viewed as a hypothesis, antecedent, premise q: can be viewed as a conclusion or consequence if p then q q follows from p a necessary condition for p is q if p, q p implies q a sufficient condition for q is p p is sufficient for q p only if q q if p q whenever p

Playing with implication Converse, contrapositive, and inverse p q: If it is raining then the home team wins Contrapositive q p If the home team does not win, then it is not raining Converse q p If the home team wins, then it is raining Inverse p q If it is not raining, then the home team does not win

Truth Table of equivalence Binary connective p q p q 0 0 1 0 1 0 1 0 0 1 1 1 p q: You pass this if and only if you work hard p q: You can take the flight if and only if you buy a ticket

Tautologies Tautology is a compound statement (formula) that is true for all combinations of truth values of its propositional variables p p p p p p 0 1 1 1 0 1

Tautologies Tautology is a compound statement (formula) that is true for all combinations of truth values of its propositional variables (p q) (q p) p q p q q p (p q) (q p) 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 1 1 1

Contradictions Contradiction is a compound statement (formula) that is false for all combinations of truth values of its propositional variables p p p p p p 0 1 0 1 0 0

Contradictions Contradiction is a compound statement (formula) that is false for all combinations of truth values of its propositional variables (p q) (p q) p q (p q) (p q) 0 0 0 0 1 0 1 0 0 1 1 0

Example Construct the truth table of the following compound statement p (p q)

Example Construct the truth table of the following compound statement p (p q) p q q p q p (p q) 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1