Truth, deduction, computation lecture b

384 views

Published on

My logic lectures at SCU
Quantifiers, part 1

Published in: Education, Technology, Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
384
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Truth, deduction, computation lecture b

  1. 1. Truth, Deduction, Computation Lecture B Quantifiers, part 1 Vlad Patryshev SCU 2013
  2. 2. Folding ∨ and ∧ ● P1∨P2∨...∨Pn - associativity! ● P1∧P2∧...∧Pn - associativity! ∨1..nPi ∧1..nPi
  3. 3. In Java interface Predicate<X> { public boolean check(X x); } boolean foreach<X>(Iterable<X> xs, Predicate<X> p) { for (x: xs) if (!p.check(xs)) return false; return true; } boolean exists<X>(Iterable<X> xs, Predicate<X> p) { for (x: xs) if (p.check(xs)) return true; return false; }
  4. 4. In Scala type Predicate[X] = X => Boolean def foreach[X](xs: Iterable[X], p: Predicate[X]) = { xs.foreach(p) } boolean exists[X](xs: Iterable[X], p: Predicate[X]) { xs.exists(p) }
  5. 5. In Scala def foreach[X](xs: Iterable[X], p: X => Boolean) = xs foreach p boolean exists[X](xs: Iterable[X], p: X => Boolean) = xs exists p
  6. 6. In Logic, take 1 ● P1∨P2∨...∨Pn -> ∨1..nPi ∃i=1..nPi ● P1∧P2∧...∨Pn -> ∀i=1..nPi ∧1..nPi
  7. 7. In Logic, take 2: Example ● P1=Tet(a); P2=Small(b); P3=¬Red(c) Not much to parameterize, all formulas are different… ● P1=Tet(a); P2=Tet(b); P3=Tet(c) or: ● x1=a; x2=b; x3=c; Pi=Tet(xi) ∀i=1..nTet(xi) or ∃i=1..nTet(xi) or: ● x1=a; x2=b; x3=c; Pi=Tet(xi) (x) ∀x in {a,b,c} Tet(x) or ∃x in {a,b,c} Tet
  8. 8. In Logic, take 3 ● Can we always enumerate arguments? ● e.g. all real numbers from [0,1] We Need Variables!
  9. 9. In Logic, take 4: Introducing Variables Anything that looks like an identifier Even _ can do if we know what we mean Scala: List(1,2,3) exists (_ % 2 == 0)
  10. 10. Add Variables to Atomic Sentences <atomic> ::= <predicateName>(<arguments>) <predicateName> ::= <Capital> <predicateName> ::= <Capital><letters> <var> ::= /* choose a distinct set of words */ <name> ::= <objectName>|<var> <arguments> ::= <name>|<arguments>,<name> E.g. Left(x, a) x is a variable
  11. 11. Variables in the Exercises
  12. 12. Build Formulas with Variables ● Tet(x)∧¬Cube(y)v(Left(a,x)∧Right(y,a)) ● ∀x (Tet(x)∧(Left(a,x)∧Right(c,a)) ● ∃x Between(x,a,b) ● ∀x ∀y ∃z Between(z,x,y)
  13. 13. Bound Variables ● Tet(x)∧¬Cube(y)v(Left(a,x)∧Right(y,a)) ● ∀x (Tet(x)∧(Left(a,x)∧Right(y,a)) ● ∃x Between(x,a,b) ● ∀x ∀y ∃z Between(z,x,y)
  14. 14. Formulas with Quantifiers, formally <wff> ::= <atomic formula> <wff> ::= ¬<wff>|(<wff>) <wff> ::= <wff>v<wff>|<wff>∧<wff> <wff> ::= <wff>→<wff>|<wff>↔<wff> <wff> ::= ∀<var> <wff> // the var is bound here <wff> ::= ∃<var> <wff> // the var is bound here <sentence> ::= <wff /*where all vars are bound*/>
  15. 15. Satisfaction A wff P(x) with an unbound variable x is satisfied on a iff ⊨ P(a) E.g. a small cube satisfies the formula Cube(x) ∧ ¬ Large(x)
  16. 16. Satisfaction for Specific Formulas Formula Kind How Satisfied <atomic> find an object or objects ¬P find counterexample for P PvQ find something that satisfies at least one of P and Q P∧Q find something that satisfies P and Q ∀x P P is satisfied by all objects ∃x P we can find an object that satisfies P
  17. 17. Problems with Domain Formula Kind How Satisfied <atomic> find an object or objects ¬P find counterexample for P PvQ find something that satisfies at least one of P and Q P∧Q find something that satisfies P and Q ∀x P P is satisfied by all objects ∃x P we can find an object that satisfies P
  18. 18. Problems with Domain ● ∀x (Cube(x)∨Tet(x)) - how about 27? 28? ● ∃n (n*n > n*n*n) - how about Claire’s cat?
  19. 19. Translating Aristotelian Forms Aristotle says We write All P’s are Q’s ∀x (P(x) → Q(x)) Some P’s are Q’s ∃x (P(x) ∧ Q(x)) No P’s are Q’s ∀x (P(x) → ¬Q(x)) Some P’s are not Q’s ∃x (P(x) ∧ ¬Q(x)) How about ∃x (P(x) → Q(x)) Or, e.g., ∀y(Tet(y) → Small(y))
  20. 20. Ambiguousness with Aristotelian... ∀x (P(x) → ¬Q(x)) or ¬∃x (P(x) ∧ Q(x)) In Boolean logic, they are semantically equivalent
  21. 21. In Plain English Existential noun phrase involves “∃ x…” Universal noun phrase involves “∀ x…”
  22. 22. Reformulating Previous Exercises ● ● ∀x ∀y ∀z ((FatherOf(x,y)∧FatherOf(y,z)) → Nicer(x,y)) ∀x ∀y (¬Even(x+y) → Even(x*y))
  23. 23. That’s it for today

×