Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.

Similar presentations


Presentation on theme: "EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse."— Presentation transcript:

1 EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse trees Formalising NL statements in predicate logic Standard equivalences in predicate logic Propositional Logic revisited The Completeness Theorem

2 EE1J2 - Slide 2 DNF - Example Let p, q and r be atomic propositions Consider f = (p  (q  r))  ((p  q)  r) How do we put this in disjunctive normal form? Use the construction from the proof of the theorem.

3 EE1J2 - Slide 3 Truth table for f (p(p  (q(q  r))  ((p  q)q)  r)r) TTTTTTTTTTT TFTFFTTTTFF TTFTTTTFFTT TTFTFTTFFTF FTTTTTFTTTT FTTFFFFTTFF FTFTTTFTFTT FTFTFFFTFFF

4 EE1J2 - Slide 4 Example (continued) From row 1: (p  q  r) From row 2: (p  q  r) From row 3: (p  q  r) From row 4: (p  q  r) From row 5: (  p  q  r) From row 7: (  p  q  r) Hence the desired formula is: (p  q  r)  (p  q  r)  (p  q  r)  (p  q  r)  (  p  q  r)  (  p  q  r)

5 EE1J2 - Slide 5 Switching Circuits Connections between propositional logic and switching circuits Can think of a truth table as indicating the ‘output’ of a particular circuit once its inputs have been set to ‘On’ or ‘Off’ Now know that any desired behaviour can be obtained provided that the gates of the circuit can instantiate the connectives ,  and 

6 EE1J2 - Slide 6 nand and nor gates Most common gates are nand gates and nor gates. Their truth tables are given by Truth tables for nand and nor pqp nand qp nor q TTFF TFTF FTTF FFTT

7 EE1J2 - Slide 7 Theorem 3 Adequacy of nand and nor Theorem: The sets {nand} and {nor} are both adequate Proof {nand}: Since { ,  } is adequate, enough to show that  and  can be expressed in terms of nand. Let p and q be atomic propositions. Then:  p  p nand p and p  q  (p nand q) nand (p nand q)

8 EE1J2 - Slide 8 Proof (continued) For {nor}: It is enough to notice that:  p  p nor p p  q  (p nor p) nor (q nor q)

9 EE1J2 - Slide 9 Arithmetic Semantics of a system like arithmetic cannot be expressed in propositional logic. We’ve already discussed formulae such as (x < 5). The truth or falsehood of this formula obviously depends on the value of x

10 EE1J2 - Slide 10 The qualifiers  and  A more powerful language for describing arithmetic is provided by the introduction of the qualifiers  and . (  x) (x < 5) is clearly true (there exists an x such that x < 5 ) (  x) (x < 5) is clearly false (for all x, x < 5 )

11 EE1J2 - Slide 11 The Predicates = and < Formally, the symbols = and < are (binary) predicates, since they express properties of pairs of terms in arithmetic So, instead of x < 5 could write P(x) where P(x) denotes the property x < 5

12 EE1J2 - Slide 12 The functions + and  The symbols + and  are (binary) functions A (binary) function associates pairs of elements in the domain with single elements in the domain

13 EE1J2 - Slide 13 Predicate Logic: Syntax Predicate logic is defined in terms three types of ingredient: Symbols, Terms, and Formulae

14 EE1J2 - Slide 14 Symbols of Predicate Logic The symbols of predicate logic are Logical symbols: , , , ,  and  Brackets: (, ) Variables: x, y, z, x 0, x 1,… Constants: a, b, c,… Functions: f, g (number of arguments specified) Predicate symbols: P, Q, R,… (number of arguments specified) Contradiction formula: 

15 EE1J2 - Slide 15 Terms of Predicate Logic The terms of predicate logic are defined as follows: Any variable or constant is a term If f is an n place function and t 1,…,t n are terms, then f(t 1,…,t n ) is a term

16 EE1J2 - Slide 16 Formulae of Predicate Logic If R is an n place predicate and t 1,…,t n are terms, then R(t 1,…,t n ) is a formula (called an atomic formula  is a formula If A and B are formulae, then so are  A, A  B, A  B, A  B, (  x)(A), (  x)(A)

17 EE1J2 - Slide 17 Parse Tree: Formulae Suppose P is a unary predicate (i.e. a predicate that has one argument), S is the successor function from arithmetic, which associates each natural number with the next biggest natural number (I.e. S(n)=n+1 ) n is a variable. Consider the formula P(0)  {(  n)(P(n)  P(S(n)))}  (  n)P(n)

18 EE1J2 - Slide 18 Parse Tree for Formula   nn P(n)P(n) P(0)P(0) nn  P(n)P(n) P(sn) Parse tree for the predicate logic formula P(0)  {(  n)(P(n)  P(S(n)))}  (  n)P(n). The tree shows how the formula is built up from atomic formulae

19 EE1J2 - Slide 19 Formalising ‘NL’ statements in Predicate Logic “Everyone in the room spoke French or German” In propositional logic look for atomic propositions In predicate logic look for predicates

20 EE1J2 - Slide 20 Identification of predicates Everyone in the room spoke French or German Three predicates: R(x) : x was a person in the room F(x) : x spoke French G(x) : x spoke German

21 EE1J2 - Slide 21 Formalisation Re-state natural language statement in a form closer to predicate logic: For every x, if x was a person in the room, then x spoke French or x spoke German Formally: (  x)(P(x)  (F(x)  G(x)))

22 EE1J2 - Slide 22 Another example: “Everyone in the room spoke French or German” becomes: (  x)(P(x)  (F(x)  G(x))) “Someone in the room spoke French or German” becomes: (  x)(P(x)  (F(x)  G(x)))

23 EE1J2 - Slide 23 The Scope of a Quantifier In a formula (  x)(  ) or (  x)(  ), the formula  is called the scope of the quantifier  x or  x The variable x is bound if it falls immediately to the right of  or , or within the scope of the qualifier  x or  x If a variable is not bound, then it is free A formula with no free variables is called a sentence

24 EE1J2 - Slide 24 Example Consider the formula {(  x)(P(x,y))}  Q(x,y) First two occurrences of the variable x are bound and the third is free All occurrences of y are free This formula is not a sentence

25 EE1J2 - Slide 25 Example (  x)(x = y  x 2 +x < 5  x < 5)  x = 5y 2 The variable x occurs 6 times: - First 5 are bound, last is free - All occurrences of y and z are free - Bound occurrences of x can be substituted by other symbols (not y or z, though) - y and z cannot be substituted Hence, original formula is equivalent to (  a)(a = y  a 2 +a < 5  a < 5)  x = 5y 2

26 EE1J2 - Slide 26 Semantics in Predicate Logic Two formulae f and g in predicate logic are said to be logically equivalent if for any interpretation, f is true if and only g is true. In this case we write f  g. This is not rigorous, but will do for now!

27 EE1J2 - Slide 27 Some equivalences f and g are formulae in predicate logic x and y are variables such that x does not occur bound in f or at all in g y does not occur at all in f or g Then:  x(f(x))   x(  f(x)),  x(f(x))   x(  f(x)) (  xf )  g  (  x f  g), (  x f)  g   x (f  g)

28 EE1J2 - Slide 28 More equivalences… (  xf )  g  (  x f  g), (  x f)  g   x (f  g) (  xf )  g   x( f  g), and (  xf )  g   x( f  g) f  (  xg)   x( f  g), and f  (  xg)   x( f  g)  xf(x)   yf(y),  xf(x)   yf(y)

29 EE1J2 - Slide 29 Proofs of equivalences  x(f(x))   x(  f(x)) Suppose  x(f(x)) Then it is not true that f(x) holds for all x Therefore there must be at least one x for which it does not hold, i.e. for which f(x) is false Or, formally,  x(  f(x)) Conversely, suppose  x(  f(x)).

30 EE1J2 - Slide 30 Proof (continued)  x(f(x))   x(  f(x)) suppose  x(  f(x)) Then there exists an x such that f(x) is false So it is not true that f(x) holds for all x …which is the meaning of  x(f(x))

31 EE1J2 - Slide 31 Analysis of Arguments in Propositional Logic So far, our analysis of the ‘soundness’ of an argument is based on logical consequence: Given an argument in NL, First identify the set  of formulae which are premises Then identify the formula f which is the consequence Then demonstrate that  ⊨ f (or not)

32 EE1J2 - Slide 32 Method We have two techniques to prove or disprove logical consequence: Proof by contradiction: To show that  ⊨ f is true, assume there is a truth function such that each formula in  is true and f is false. Deduce that one of the formulae in  must be false – contradiction! Proof by counter-example: To show that  ⊨ f is false, find a truth function such that each formula in  is true but f is false

33 EE1J2 - Slide 33 ‘Syntactic’ Proof ‘Logical Consequence’ is defined in terms of the semantics of Propositional Logic An alternative definition of the soundness of an argument might be based solely on the syntax of Propositional Logic Closer to the intuitive notion of proof

34 EE1J2 - Slide 34 Proofs in Propositional Logic In mathematics, a proof is a sequence of steps, each of which is: Self-evident (or axiomatic), or An explicitly stated assumption, or Deduced from previous steps by sound logical reasoning

35 EE1J2 - Slide 35 Completeness Theorem for Propositional Logic If  is a set of formulae in Propositional Logic, and f is a formula in Propositional Logic, then  ⊨ f if and only if  ⊢ f f is a logical consequence of  if and only if f is provable from 

36 EE1J2 - Slide 36 Summary of Lecture 6 Limitations of propositional logic Introduction to predicate logic Formalising NL statements in predicate logic Standard equivalences in predicate logic Propositional Logic revisited The Completeness Theorem


Download ppt "EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse."

Similar presentations


Ads by Google