Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.

Similar presentations


Presentation on theme: "1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes."— Presentation transcript:

1 1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes under the condition of “fair using”.

2 2 Original author of the slides: Vadim Bulitko University of Alberta http://www.cs.ualberta.ca/~bulitko/W04 Modified by T. Andrew Yang (yang@uhcl.edu)yang@uhcl.edu

3 3 The Plan Up to date we have considered an informal introduction to predicate logic We will introduce predicate logic formally today and dwell on subtle moments

4 4 Predicate Logic (simplified) Boolean variables –P, Q, R, …can be T/F –E.g., P=“5 is a prime number” Connectives: –&, v, , , ~ Domain variables –A,B,C,…draw values from a domain sets –E.g., j is a variable over integer numbers Predicates: –P(X 1,…,X N ),…map from domain inputs to T/F –E.g., P(j) = “j is a prime number” Quantifiers: –For all , Exists  –E.g., [  j prime(j)] = “any prime number” Statements/formulae: –Atomic, unit, negated, conjunctive, …, universally/existentially quantified –E.g., [  j [even(j) & ~equal(j,2)  ~prime(j) ]] = “no even numbers are prime except 2”

5 5 Def : Well-formed Formulae A well-formed formula/sentence (wff) is a construction defined recursively: –Any Boolean variable is a wff –Any predicate is a wff –For any wff X, ~(X) is a wff –Two wffs parenthesized and connected by v,&, ,  form a wff. –For any wff X and a domain variable k:  k (X) is a wff  k (X) is a wff Here X is within the scope of  k (or  k)

6 6 Find wffs…  x [man(X)  mortal(x)] ~[  x [man(x) & lives-forever(x)]]  x [man(x)  ~lives-forever(x)]

7 7 Def : Interpretations Interpretation for a wff  : –Assigns T/F values to all Boolean variables –Defines a domain set for each domain variable –Defines all predicates Example: consider wff  = (  j prime(j)) & P –A possible interpretation: Boolean variable P=T Domain variable j runs over integer numbers Predicate prime(x) holds iff x is a prime number

8 8 Model / Countermodel Formula  holds given an interpretation I: –  is satisfied by I –Then  is satisfiable –Then I is a model for  Formula  doesn’t hold given I: –  is not satisfied (or falsified) by I –Then I is a countermodel for 

9 9 Tautologies & Contradictions Formula  holds under any interpretation I –  is valid –  is a tautology Formula  doesn’t hold under any I –  is a contradiction –  is unsatisfiable

10 10 Example Define –Predicate P(X) as “person X drinks beer” Consider –  x  y [P(x)  P(y)] –“There exists a person such that if he/she drinks beer then everyone drinks beer” True or false?

11 11 Contingencies  holds under any interpretation  tautology  does NOT hold under any interpretation  contradiction What if  holds under some interpretations but not other? Then  is a contingency

12 12 Classify… P & Q P & ~P P v ~P  x P(x)  x ((P(x)  Q(x)) & P(x))  Q(x)  x (P(x) v ~P(x))  (P(x) & ~P(x))

13 13 Implicit Quantifiers If x > 2 then x 2 > 4 Textbook: p.84 –  real numbers x, if x>2 then x 2 > 4 More formally: –  x [x>2   y square(x,y) & y>4] –where predicates square(a,b) and c>d are defined over the set of real numbers Implicit quantifiers

14 14 Domain Functions Consider the last statement again:  real numbers x, if x>2 then x 2 > 4 Is it a wff? No! Why? –Well x 2 is not a predicate and is not a variable –It is a domain function (square)! We have not formally introduced domain functions But we will use them anyway for the sake of: –Simplicity –Consistency with the text book

15 15 Evaluating Formulae Boolean variables –Interpretation directly Predicate with variables : Likes(x) –Use the assignment of x and the semantics of Likes() Universally quantified formula :  x P(x) –Evaluates to true iff P(x) holds on all possible values of x Existentially quantified formulae :  x P(x) –Evaluates to true iff P(x) holds on at least one possible value of x

16 16 Examples Consider formula S:  x (x 2 > x) Assume the standard algebraic interpretation Suppose the domain set for variable x is {2,3,4} Does S hold or not? –Yes : 4>2, 9>3, 16>4 Suppose the domain set for variable x is the set of real numbers Does S hold or not? –No : ~(0 > 0)

17 17 Examples Consider formula S:  x (x 2 > x) Assume the standard algebraic interpretation Suppose the domain set for variable x is {2,3,4} Does S hold or not? –Yes : 4>2 Suppose the domain set for variable x is the set of real numbers Does S hold or not? Suppose the domain set for variable x is the segment [0,1] Does S hold or not? –No : all numbers between 0 and 1 have their squares not greater than the number itself

18 18 Summary GIVEN a particular interpretation To show that a  -quantified formula holds: –Exhaust all possibilities – show that all examples satisfy the formula To show that a  -quantified formula does NOT hold: –Find a falsifying example To show that a  -quantified formula holds: –Find a satisfying example To show that a  -quantified formula does NOT hold: –Exhaust all possibilities and show that all examples falsify the formula

19 19 Summary How about classifying a formula: –Tautology / Contradiction / Contingency Contingencies are, perhaps, the easiest: –Need to find a model and a counter-model Tautologies / contradictions: –Need to show that all possible interpretations satisfy/falsify the formula –More difficult

20 20 Special cases : finite domains Suppose you have a formula over a single variable x If the domain of variable x is finite: {x 1,…,x N } Then  x P(x) is equivalent to: P(x 1 ) & … & P(x N ) And  x P(x) is equivalent to: P(x 1 ) v … v P(x N )

21 21 Satisfying  /  statements To show that  x P(x) we need to: –Prove that every x satisfies P(x) To show that  x P(x) we need to: –Prove that there exists at least one x that satisfies P(x)

22 22 De Morgan again… To show that ~(  x P(x)) we need to: –Prove that not every x satisfies P(x) –In other words, we need to find at least one x that does not satisfy P(X) –But that is the same as proving that  x ~P(x) Therefore: ~(  x P(x))  x (~P(x)) are logically equivalent De Morgan’s law for quantifiers

23 23 And again… To show that ~(  x P(x)) we need to: –Prove that there does not exists a single x satisfies P(x) –In other words, we need to show that all x do not satisfy P(X) –But that is the same as proving that  x ~P(x) Therefore: ~(  x P(x))  x (~P(x)) are logically equivalent De Morgan’s law for quantifiers

24 24 Examples Statement: –“Everyone snoozes in this class” Negation: –“Not every one snoozes in this class” –“There is someone who doesn’t snooze in this class” A common mistake: –“Everyone does NOT snooze in this class”

25 25 Examples Statement: –“Professors don’t make much money” Negation: –“There is a professor who makes much money” A common mistake: –“Professors make much money”

26 26 Examples Statement: –There is a secret agent who appeals to all women Negation: –For every secret agent there is a woman that the agent doesn’t appeal to A common mistake: –There is a secret agent who doesn’t appeal to all women

27 27 In the nutshell… When negating a quantified formula: –Quantifier 1 x 1 … Quantifier N x N P(x 1,..,x N ) Do this: –Change all  to  –Change all  to  –Negate the innermost formula P(…)

28 28 Vacuous Truth of UQS Suppose I say: “Presently, all men on the moon are happy” Is it true or false? Think of it this way: –  x [OnTheMoon(x)  Happy(x)] So, is it true or false? –The internal implication is always vacuously true for there is presently no man on the Moon –Thus, the entire statement holds for any x The entire statement holds

29 29 Logical Implication In propositional logic formula A logically implies formula B iff: –Every interpretation that satisfies A also satisfies B In predicate logic? –The same!

30 30 Validity of Arguments Hence validity of arguments is defined in the same way The difference is: –in predicate logic it is not always possible to go through all interpretations to prove that A logically implies B Why? –The number of interpretations can be infinite

31 31 Inference Rules Thus, proving arguments with inference rules becomes the method of choice We can also derive new inference rules for our toolbox

32 32 Universal Instantiation Consider a universally quantified statement: –  x  D [P(x)] Suppose you have a particular x 0  D What can you say about P(x 0 )? –It holds! Why? –Because predicate P(…) holds for all members of set D –Example: “mortal Socrates” argument

33 33 Universal Modus Ponens Propositional modus ponens P  Q P Thus, Q Universal modus ponens  x [P(x)  Q(x)] P(a) Thus, Q(a)

34 34 Diagrams for Validity (p. 104) Diagrams can sometimes be used to: –support a validity of an argument –or, show that an argument is invalid Diagrams are not a formal proof! Use them to illustrate your reasoning ONLY Examples: Modus Ponens mortal human SocratesSocrates

35 35 Questions?


Download ppt "1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes."

Similar presentations


Ads by Google