EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Logic & Critical Reasoning
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
CS128 – Discrete Mathematics for Computer Science
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Let remember from the previous lesson what is Knowledge representation
EE1J2 – Discrete Maths Lecture 5
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 2 Tutorials Revision of formalisation Interpreting logical statements in NL Form and Content of an Argument.
Phil 120 week 1 About this course. Introducing the language SL. Basic syntax. Semantic definitions of the connectives in terms of their truth conditions.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
EE1J2 – Discrete Maths Lecture 4 Analysis of arguments Logical consequence Rules of deduction Rules of equivalence Formal proof of arguments See: Anderson,
The Language of Propositional Logic The Syntax and Semantics of PL.
Chapter 3 Introduction to Logic © 2008 Pearson Addison-Wesley. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
3.2 – Truth Tables and Equivalent Statements
TRUTH TABLES. Introduction Statements have truth values They are either true or false but not both Statements may be simple or compound Compound statements.
Intro to Discrete Structures
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
LDK R Logics for Data and Knowledge Representation Exercise 2: PL, ClassL, Ground ClassL.
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
1 Propositional Logic Proposition 2 Propositions can be divided into simple propositions and compound propositions. A simple (or basic) proposition is.
Normal Forms, Tautology and Satisfiability 2/3/121.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
HAWKES LEARNING Students Count. Success Matters. Copyright © 2015 by Hawkes Learning/Quant Systems, Inc. All rights reserved. Section 3.2 Truth Tables.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Chapter 7 Logic, Sets, and Counting
Chapter 3: Semantics PHIL 121: Methods of Reasoning March 13, 2013 Instructor:Karin Howe Binghamton University.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
MLS 570 Critical Thinking Reading Notes for Fogelin: Propositional Logic Fall Term 2006 North Central College.
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
CS1022 Computer Programming & Principles Lecture 1 Logic and Proof.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
CS6133 Software Specification and Verification
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
Logics for Data and Knowledge Representation
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
Outline Logic Propositional Logic Well formed formula Truth table
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional and predicate logic
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
Section 3.2: Truth Tables for Negation, Conjunction, and Disjunction
 Conjunctive Normal Form: A logic form must satisfy one of the following conditions 1) It must be a single variable (A) 2) It must be the negation of.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Logic.
DISCRETE MATHEMATICS CHAPTER I.
CHAPTER 3 Logic.
TRUTH TABLES.
CHAPTER 3 Logic.
Presentation transcript:

EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional logic – truth tables Truth tables for complex formulae Tautologies, contradictory and satisfiable formulae, logical equivalence, logical consequence

EE1J2 - Slide 2 Parse Tree for “the cat devoured the tiny mouse” The cat devoured the tiny mouse DET ADJ NOUN DET NOUN VERB NP NP VP S

EE1J2 - Slide 3 Syntax of Propositional Logic The formal language of propositional logic is much much simpler than NL The valid sentences of propositional logic are called formulae (or, well-formed formulae First stage is to define the basic symbols of the language

EE1J2 - Slide 4 NameSymbolDescription Propositional variables p, q, r, p 0, p 1, p 2,… ‘atomic propositions’, not amenable to further analysis negation  not conjunction  and disjunction  or implication  if…then… Contradiction  Brackets(, ) Symbols of Propositional Logic

EE1J2 - Slide 5 Formal Language Definition of Propositional Logic 1.Each propositional variable is a formula, and contradiction  is a formula 2.If f and g are formulae then (f),  f, f  g, f  g, f  g are also formulae 3.A sequence of symbols is a formula if and only if it can be derived using 1 and 2

EE1J2 - Slide 6 Parsing in Propositional Logic Consider S = ((p  (q  r))  ((p  (  q))  ((  q)  (  r)))) To tell whether or not this is a well-formed formula in Propositional Logic we need to find a parse First note that S can be written as S    

EE1J2 - Slide 7 Parsing in PL (continued) S = ((p  (q  r))  ((p  (  q))  ((  q)  (  r)))) 1.S    , where:  = (p  (q  r))  = ((p  (  q))  ((  q)  (  r))) 2.Next note that   p   and   q  r 3.Finally,    , where   p   and    q and   ,   q and    r

EE1J2 - Slide 8 Parse Tree for S = ((p  (q  r))  ((p  (  q))  ((  q)  (  r)))) q r p p q q r          S (p  (q  r)) (p  (  q))  ((  q)  (  r)) (q  r) (p  (  q)) ((  q)  (  r)) (  q) (  r)

EE1J2 - Slide 9 Parse Tree for S = ((p  (q  r))  ((p  (  q))  ((  q)  (  r)))) q r p p q q r         

EE1J2 - Slide 10 Construction of a Parse Tree Once brackets have been inserted, parse tree can normally be constructed Alternatively, apply the following procedure:

EE1J2 - Slide 11 Constuction of Parse Tree 1.Number the brackets ( 1 ( 2 p  ( 3 q  r) 4 ) 5  ( 6 ( 7 p  ( 8  q) 9 ) 10  ( 11 ( 12  q) 13  ( 14  r) 15 ) 16 ) 17 ) 18 2.Draw an initial ‘dummy node’

EE1J2 - Slide 12 Construction of Parse Tree 2.Suppose we are at a particular node in the tree 1.Move to the right to the next bracket 2.If ‘(‘, form a new downward edge to the right of any existing children. Go to the new node at the end of the new edge. 3.If ‘)’, backtrack to the previous node

EE1J2 - Slide 13 Construction of a Parse Tree ,4 1 2,5 3,4 1 2,5 3, ,5 3,4 6 7 And so on…. See Truss, example 2.1 for the complete construction ( 1 ( 2 p  ( 3 q  r) 4 ) 5  ( 6 ( 7 p  ( 8  q) 9 ) 10  ( 11 ( 12  q) 13  ( 14  r) 15 ) 16 ) 17 ) 18

EE1J2 - Slide 14 Example (from last lecture) (a  c  p  m)  ((  m   a)  p)  ((  l   p)  (  a  m)) First add brackets to remove ambiguity: (((a  l)  p )  m)  (((  m   a)  p)  ((  l   p)  (  a  m)))

EE1J2 - Slide 15 Semantics of Propositional Logic The truth (T) or falsehood (F) of a formula in propositional logic can be determined once the truth values of the atomic formulae are known A truth table shows the truth values of a complex formula given all possible combinations of truth values of its atomic formulae

EE1J2 - Slide 16 Truth Table for  Truth table for  p pp TF FT

EE1J2 - Slide 17 Truth Tables for , , and  Truth tables for , , and  pq p  qp  qp  q TTTTT TFFTF FTFTT FFFFT

EE1J2 - Slide 18 Truth Table for ‘  ’ The truth table for the ‘  ’ symbol needs some thought [Truss, p 54]. If q is true and p is true, then the assertion p  q is intuitively true If q is false and p is true, then the assertion p  q is intuitively false For the two cases where p is false, the argument is that the implication “if p then q” is true by default, since if p is false then no further action is required

EE1J2 - Slide 19 Truth Table for a Complex Formula Consider the formula (p  q)  ((p  q)  q) Extract all of the possible sub-formulae p  q p  q (p  q)  q (p  q)  ( (p  q)  q) Construct a truth table, with columns for p and q, and each of the complex ‘sub’-formulae listed above

EE1J2 - Slide 20 Truth Table for a Complex Formula Truth table for (p  q)  ((p  q)  q) pq pqpqpqpq(p  q)  q(p  q)  ( (p  q)  q) TTTTTT TFTFFF FTTFTT FFFFFT

EE1J2 - Slide 21 ‘Abbreviated’ truth tables As number of atomic propositions increases, number of rows in table increases As complexity of formula increases, number of columns in the truth table increases Tables become cumbersome Solution to second problem is ‘abbreviated’ truth tables Display truth value for a sub-formula under the last connective used in its formation

EE1J2 - Slide 22 Abbreviated truth table (1) Abbreviated truth table for (p  q)  ((p  q)  q) (p  q)  ((p  q)  T T T T T T F T F F F T F T T F F F F F

EE1J2 - Slide 23 Abbreviated truth table (2) Abbreviated truth table for (p  q)  ((p  q)  q) (p  q)  ((p  q)  TTT TTT T TTF TFF F FTT FFT T FFF FFF F

EE1J2 - Slide 24 Abbreviated truth table (3) Abbreviated truth table for (p  q)  ((p  q)  q) (p  q)  ((p  q)  TTTTTTTTT TTFFTFFFF FTTTFFTTT FFFTFFFFF

EE1J2 - Slide 25 Second Example

EE1J2 - Slide 26 Some special formulae Tautologies Contradictory formulae Satisfiable formulae Logically equivalent formulae Logical consequence

EE1J2 - Slide 27 Tautologies A formula f which is true for all possible truth values of its atomic propositions is called a tautology, (or said to be valid) If f is a tautology, write ⊨ f Example: the formula (p  q)   ((  p)  (  q)) is a tautology

EE1J2 - Slide 28 Truth table for tautology (p  q)  ((  p)  (  q)) Truth table for (p  q)  ((  p)  (  q)) (p  q)  ((  p)  (( q)) TTTTTFTFFT TFFTFFTTTF FFTTFTFTFT FFFTFTFTTF

EE1J2 - Slide 29 Contradictory and Satisfiable Formulae Let f be a formula, then f is contradictory if it is false for all assignments of truth values to its atomic propositions f is satisfiable if it is true for at least one assignment of truth values to its atomic propositions

EE1J2 - Slide 30 Consequences… It follows that: f is contradictory if and only if  f is a tautology, f is satisfiable if and only if it is not contradictory

EE1J2 - Slide 31 Logical Equivalence Two formulae f and g are logically equivalent if they have the same truth table

EE1J2 - Slide 32 Logical Consequence Let  be a set of formulae and f a formula f is a logical consequence of  if for any assignment of truth values to atomic propositions for which all of the members of  true, f is also true If f is a logical consequence of , write  ⊨ f Note: this is consistent with ⊨ f when f is a tautology This is important! It is the basis of formalisation of arguments

EE1J2 - Slide 33 Summary of Lecture 3 Parse trees revised Construction of parse trees Semantics of propositional logic – truth tables Truth tables for complex formulae, abbreviated truth tables Tautologies, contradictory and satisfiable formulae, logical equivalence, logical consequence