UNIT-I: Propositional Logic

Similar documents
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

Compound Propositions

CSC Discrete Math I, Spring Propositional Logic

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

Propositional logic (revision) & semantic entailment. p. 1/34

EECS 1028 M: Discrete Mathematics for Engineers

Section 1.1: Logical Form and Logical Equivalence

Truth-Functional Logic

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

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

Definition 2. Conjunction of p and q

Chapter 1, Section 1.1 Propositional Logic

It is not the case that ϕ. p = It is not the case that it is snowing = It is not. r = It is not the case that Mary will go to the party =

Logic: Propositional Logic (Part I)

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Tecniche di Verifica. Introduction to Propositional Logic

Learning Goals of CS245 Logic and Computation

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

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

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

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

Propositional Logic and Semantics

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

Introduction to Sets and Logic (MATH 1190)

Math.3336: Discrete Mathematics. Propositional Equivalences

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

Propositional Languages

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

2.2: Logical Equivalence: The Laws of Logic

Language of Propositional Logic

Propositional logic ( ): Review from Mat 1348

THE LOGIC OF COMPOUND STATEMENTS

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

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

Propositional Logic Language

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

Tautologies, Contradictions, and Contingencies

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

THE LOGIC OF COMPOUND STATEMENTS

LOGIC & PROPOSITIONAL EQUIVALENCE

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

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

Inference in Propositional Logic

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

Discrete Mathematics and Applications COT3100

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

1.1 Statements and Compound Statements

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

CITS2211 Discrete Structures. Propositional Logic

1.1 Language and Logic

Advanced Topics in LP and FP

Computation and Logic Definitions

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Propositional Equivalence

1.3 Propositional Equivalences

Chapter 4: Classical Propositional Semantics

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

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

1.1 Language and Logic

Propositional Logic. Spring Propositional Logic Spring / 32

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

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

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

A brief introduction to Logic. (slides from

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

software design & management Gachon University Chulyun Kim

Knowledge Representation. Propositional logic

MAT2345 Discrete Math

Proofs. Joe Patten August 10, 2018

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

15414/614 Optional Lecture 1: Propositional Logic

Natural Deduction for Propositional Logic

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

Foundation of proofs. Jim Hefferon.

We last time we began introducing equivalency laws.

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

22c:145 Artificial Intelligence

KP/Worksheets: Propositional Logic, Boolean Algebra and Computer Hardware Page 1 of 8

Artificial Intelligence

ARTIFICIAL INTELLIGENCE

More Propositional Logic Algebra: Expressive Completeness and Completeness of Equivalences. Computability and Logic

Part 1: Propositional Logic

Part Two: The Basic Components of the SOFL Specification Language

Propositional Logic 1

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic and Propositional Calculus

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional and Predicate Logic - II

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

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

CSC165 Mathematical Expression and Reasoning for Computer Science

Logical Agents. Chapter 7

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

Transcription:

1. Introduction to Logic: UNIT-I: Propositional Logic Logic: logic comprises a (formal) language for making statements about objects and reasoning about properties of these objects. Statements in a logical language are constructed according to a predefined set of formation rules (depending on the language) called syntax rules. Logic languages are used instead of natural languages as natural languages are very vast so cannot be formally described. Also, natural languages are ambiguous, context sensitive and verbose. A logical system, or a logic for short, typically consists of three things (but may consist of only the first two, or the first and third) 1. A syntax, or set of rules specifying what expressions are part of the language of the system, and how they may be combined to form more complex expressions/statements (often called formulæ). 2. A semantics, or set of rules governing the meanings or possible meanings of expressions, and how the meaning, interpretation, evaluation and truth value of complex expressions depend on the meaning or interpretation of the parts. 3. A deductive system, or set of rules governing what makes for an acceptable or endorsed pattern of reasoning within in the system 1.1. Propositional Logic: Propositional logic is the system of logic with the simplest semantics. Many of the concepts and techniques used for studying propositional logic generalize to first -order logic. In propositional logic, there are atomic assertions (or atoms, or propositional letters) and compound assertions built up from the atoms and the logical connectives, and, or, not, implication and equivalence. The atomic facts are interpreted as being either true or false. In propositional logic, once the atoms in a proposition have received an interpretation, the truth value of the proposition can be computed. Technically, this is a consequence of the fact that the set of propositions is a freely generated inductive closure. Certain propositions are true for all possible interpretations. They are called tautologies. Intuitively speaking, a tautology is a universal truth. Hence, tautologies play an important role. A proposition is a statement that can be either true or false o The sky is blue o I is a English major o x == y Not propositions: o Are you Bob? o x = 7

1.1.1. Syntax and Semantic of Propositional Logic Here we will give a purely syntactic definition of propositional logic. Statements of this language are propositional formulas. Propositional formulas are built from atoms (also known as propositional variables or elementary propositions), which are basic propositions, that are either true or false. For example o p = Today is Friday o q = Today is my birthday Atoms are combined using logic connectives (operator) into complex formulas. For example o p q = Today is Friday and today is my birthday Formally: Propositional formula: the propositional formula is inductively defined as o Every atom is a formula o If α and β are two formulas then o α is also formula (Negation / logical not denoted by or ~) o α β is also a formula (Conjunction / logical and denoted by ) o α β is also a formula (Disjunction / logical or denoted by ) o occasional we also find other connectives such as implication or conditional ( ), double implication or bi-conditional or equivalence(). Logical operators: Not( or ~) A not operation switches (negates) the truth value Symbol: or ~ p = Today is not Friday Truth table is shown is fig- Logical operators: And() An and operation is true if both operands are true Symbol: pq = Today is Friday and today is my birthday truth table is given in figure Logical operators: Or () An or operation is true if either operands are true Symbol: pq = Today is Friday or today is my birthday (or possibly both) truth table is given in figure Logical operators: Conditional() A conditional means if p then q Symbol:

pq = If today is Friday, then today is my birthday p q= pq Let p = I am elected and q = I will lower taxes I state: p q = If I am elected, then I will lower taxes Consider all possibilities Note that if p is false, then the conditional is true regardless of whether q is true or false Alternate ways of stating a conditional: o p implies q o If p, q o p only if q o p is sufficient for q o q if p o q whenever p o q is necessary for p o p only if q Logical operators: Bi-conditional() A bi-conditional means p if and only if q Symbol: Alternatively, it means (if p then q) and (if q then p) Note that a bi-conditional has the opposite truth values of the exclusive or. Let p = You take this class and q = You get a grade Then pq means You take this class if and only if you get a grade Alternatively, it means If you take this class, then you get a grade and if you get a grade then you take (took) this class Logical operators: Nand and Nor The negation of And and Or, respectively Symbols: and, respectively o Nand: p q (pq) o Nor: p q (pq) Precedence of Operator

Precedence order (from highest to lowest): o The first three are the most important This means that p q r s t yields: (p (q ( r))) (s t) Not is always performed before any other operation Translating English Sentences Example1: p = It is below freezing q = It is snowing It is below freezing and it is snowing : pq It is below freezing but not snowing: p q It is not below freezing and it is not snowing: p q It is either snowing or below freezing (or both): pq If it is below freezing, it is also snowing: p q It is either below freezing or it is snowing, but it is not snowing if it is below freezing: (pq)(p q) That it is below freezing is necessary and sufficient for it to be snowing: p q Example2: A study showed that there was a correlation between the more children ate dinners with their families and lower rate of substance abuse by those children. Conclusion: If children eat more meals with their family, they will have lower substance abuse If they have a higher substance abuse rate, then they did not eat more meals with their family Let p = Child eats more meals with family Let q = Child has less substance abuse Conclusions: If children eat more meals with their family, they will have lower substance abuse: p q If they have a higher substance abuse rate, then they did not eat more meals with their family: q p Note that p q and q p are logically equivalent Example 3: I have neither given nor received help on this exam Rephrased: I have not given nor received Let p = I have given help on this exam Let q = I have received help on this exam Translation is: pq Bit Operations: Boolean values can be represented as 1 (true) and 0 (false) A bit string is a series of Boolean values o 10110100 is eight Boolean values in one string We can then do operations on these Boolean strings o Each column is its own Boolean operation

Evaluate the following: Logical Equivalences of And

Logical Equivalences of Or p T T Identity law p F p Domination law p p p Idempotent law p q q p Commutative law (p q) r p (q r) Associative law Corollary of the Associative Law (p q) r p q r (p q) r p q r Logical Equivalences of Not ( p) p Double negation law p p T Negation law p p F Negation law DeMorgan s Law Probably the most important logical equivalence To negate pq (or pq), you flip the sign, and negate BOTH p and q Thus, (p q) p q Thus, (p q) p q p q p q pq (pq) pq pq (pq) pq T T F F T F F T F F T F F T F T T T F F F T T F F T T T F F F F T T F T T F T T Distributive: p (q r) (p q) (p r) p (q r) (p q) (p r) Absorption p (p q) p p (p q) p How to prove two propositions are equivalent? Two methods: Using truth tables Not good for long formulae Using the logical equivalences The preferred method Example: show that: ( p r) ( q r) ( p q) r Using Truth Tables

Using Logical Equivalence Example: Bill says: Sue is guilty and Fred is innocent. Sue says: If Bill is guilty, then so is Fred. Fred says: I am innocent, but at least one of the others is guilty. Let b = Bill is innocent, f = Fred is innocent, and s = Sue is innocent Statements are: o s f o b f o f ( b s) Can all of their statements be true? Show values for s, b, and f such that the equation is true

Functional completeness All the extended operators have equivalences using only the 3 basic operators (and, or, not) The extended operators: nand, nor, xor, conditional, bi-conditional Given a limited set of operators, can you write an equivalence of the 3 basic operators? If so, then that group of operators is functionally complete Functional completeness of NAND Equivalence of NOT: p p p (p p) p Equivalence of NAND (p) p Idempotent law Equivalence of AND: p q (p q) Definition of nand p p How to do a not using nands (p q) (p q) Negation of (p q) Equivalence of OR:p q (p q) DeMorgan s equivalence of OR As we can do AND and OR with NANDs, we can thus do ORs with NANDs Thus, NAND is functionally complete 1.1.2. Truth assignment of propositional formulas Let T be a truth assignment for atoms. We extend the truth assignment for formulas as Ť: { α α is a propositional formula} {0,1} by means of following rules 1 if T ( ) 0 : 0 if T ( ) 1 1 if T ( ) T ( ) 1 T ^ : 0 otherwise 1 if T ( ) 1or T ( ) 1 T V : 0 otherwise T

0 if T( ) 1or T ( ) 0 : 1otherwise 1 if T( ) T ( ) T : 0 otherwise T Coincidental Lemma: Let T 1 and T 2 be the truth assignments and let α be a propositional formula then ( A є atoms(α): T 1(A)= T 2(A)) T 1(α)= T 2(α) Example: suppose we have T (A)=1, T (B)=1 and T (C)=0 the T ((AB) C)=1. Since the set of atoms(α) associate with a formula α are finite therefore all possible truth assignments for atoms(α)can be systematically enumerated in a finite table called truth table. For example truth table of (AB) C is given by 1.1.3. Tautology, Satisfiable, Contradiction and Logical Equivalence A propositional formula α is satisfiable if and only if there exists a truth assignment T such that T (α)=1. A propositional formula α is inconsistent or contradiction or unsatisfiable or falsifiable if for all truth assignments T we have T (α)=0.( A contradiction is always false) o p p will always be false (Negation Law) A propositional formula α is valid or tautology if for all truth assignments T we have T (α)=1 (A tautology is a statement that is always true) o p p will always be true (Negation Law) A logical equivalence means that the two sides always have the same truth values o Symbol is or, o We ll use, so as not to confuse it with the bi-conditional o Some common equivalence

Relationship between above terms: α is inconsistent α is not satisfiable α is a tautology 1.1.4. Semantic consequence (entails or double turnstile): Let α and β be two propositional formulas, then β is a semantic consequence of α (α β) if and only if for all truth assignments T we have T (α)=1 T (β)=1. Satisfaction relation ( ): intuition An assignment can either satisfy or not satisfy a given formula. β means o satisfies β or o β holds at or o is a model of β is defined recursively: o p if (p) = true o φ if 2 φ. o φ 1 φ 2 if φ 1 and φ 2 o φ 1 φ 2 if φ 1 or φ 2 o φ 1 φ 2 if φ 1 implies φ 2 o φ 1 φ 2 if φ 1 iff φ 2 Example α= A( AB) and β=b, then α β T (A)=1 T (B)=1 (T (α)=1 and T (β)=1) T (A)=1 T (B)=0 T (α)=0 T (A)=0 T (B)=1 T (α)=0 T (A)=0 T (B)=0 T (α)=0

Similarly A B B A Example: Provable(turnstile): Let α and β be two propositional formulas, then β provable from α (α β) if β is provable by means of α in some specific formal system. For example : A B B A {contra positive} Lemma: Let α be propositional formula then we have Proof: suppose that α β i.e. for all truth assignments Ť we have (Ť(α)=1 implies Ť(β)=1). Then it follows that Ť( αβ)=1 and therefore Ť( ( αβ))=0. But we have Ť( ( αβ))= Ť(α β) (De Morgan s Law}. From this it follows Ť(α β)=0 for any Ť i. e. Ť(α β) is inconsistent or contradiction. Use above to prove ii) and iii) Deduction theorem for : Let α and β be two propositional formulas and let M be a set of formulas, then M {α} β M {α β} 1) Construct truth-tables showing whether the following propositions are valid theorems (tautologies) or not; if not use the truth tables to find truth values for the variables which provide a counterexample.

2) Prove following inequalities