Predicate Logic …

Predicate Logic …

predicate logic … a predicate (relation) – is a function that maps its arguments to the truth values 0 or 1 known example: less then (symbol <), for arguments 5 and 8 we have 5<8 is true, and 8<5 is false they can be written as infix like <, or letter(s), for lecture 14: predicate logic example R(x,y) or mother(x,y) of#45# ece#627,#winter#‘13# 2# of#45# predicate logic predicate logic … … in propositional logic, the preposition Every peach is fuzzy predicate logic is not a replacement for propositional is represented by a single symbol p, logic but an extension or refinement of it in predicate logic, the statement is shown in finer detail - with universal quantifier ( ∀ x)(peach(x) ⊃ fuzzy(x)) ece#627,#winter#‘13# 3# of#45# ece#627,#winter#‘13#€ € 4# of#45# predicate logic predicate logic … … - with existential quantifier - with both quantifiers ~( ∃ x)(peach(x) ∧ ~fuzzy(x)) ( ∀ x)( ∃ y)(integer(x) ⊃ (prime(y) ∧ x<y) € € € € € € ece#627,#winter#‘13# 5# of#45# ece#627,#winter#‘13# 6# of#45# predicate logic predicate logic … … order of quantifiers while … ( ∀ x)( ∃ y) ( man(x) ∧ dept(x,account) ⊃ ( ∃ y)( ∀ x) ( man(x) ∧ dept(x,account) ⊃ (woman(y) ∧ hometown(y,Boston) ∧ married(x,y)) ) (woman(y) ∧ hometown(y,Boston) ∧ married(x,y)) ) € € € € € € € € € € € € ece#627,#winter#‘13# 7# of#45# ece#627,#winter#‘13# 8# of#45# predicate logic predicate logic formation rules formation rules vocabulary contains symbols for constants and a term is either a constant (2 or a, b, c, …), a variables, parenthesis, Boolean operators, and variable (x, y or x0, x1, x2, …), or a function or an symbols for quantifiers, functions and predicates operator symbol applied to its arguments, each of which is itself a term all of them are combined according to three rules for example: f(x), 2+2 ece#627,#winter#‘13# 9# of#45# ece#627,#winter#‘13# 10# of#45# predicate logic predicate logic formation rules formation rules an atom is either a single letter (p) representing a formula is either an atom, a formula preceded by preposition or a predicate symbol (P, Q, R, …) applied ~, any two formulas A and B together with any two- to its arguments, each of which is itself a term place Boolean operator op in the combination (A op B), or any formula A and any variable x in either of for example: P(f(x), 2+2), Q(7) the combinations ( ∃ x)A or ( ∀ x)A € € ece#627,#winter#‘13# 11# of#45# ece#627,#winter#‘13# 12# of#45# predicate logic predicate logic formulas - examples formulas - examples (P(f(x),2+2) ⊃ Q(7)) John is tall ~(P(f(x),2+2) ⊃ Q(7)) T(j) ( ∀ y)~(P(f(x),2+2) ⊃ Q(7)) John is taller than Bill TR(j,b) ( ∃ x)( ∀ y)~(P(f(x),2+2)€ ⊃ Q(7)) Everybody sleeps € ∀ x (S(x)) the occurrence€ of x in f(x) is€ bound by the quantifier ( ∃ x), Somebody likes David the quantifier€ € ( ∀ y) has not effect€ on the formula, y does not occur as an argument of any function/predicate ∃ x [L(x,d)] € € ece#627,#winter#‘13#€ 13# of#45# ece#627,#winter#‘13# 14# of#45# € predicate logic predicate logic formulas - examples rules of inference There are happy people ∃ x H(x) rule of inference - Some books are interesting is to preserve truth, if we start with formulas that are ∃x [B(x) ∧ I(x)] true, the result of performing a rule of inference on Some books are€ interesting and some are easy to read them must also be true ∃ x [B(x) ∧ I(x)] ∧ ∃ x [B(x) ∧ E(x)] No books €are good € ∀x [B(x)→ ¬ G(x)] € € € € € ece#627,#winter#‘13# 15# of#45# ece#627,#winter#‘13# 16# of#45# € € predicate logic predicate logic rules of inference rules of inference issue of equivalence: the rule for relating the quantifiers ( ∀ x)(peach(x) ⊃ fuzzy(x)) ~( ∃ x)(peach(x) ∧ ~fuzzy(x)) ( ∃ x)A is equivalent to ~( ∀ x)~A ( ∀ x)A is equivalent to ~( ∃ x)~A if these€ formulas were€ represented by p and q, there would€ be no way to €prove p ≡ q, but the rules of € € predicate logic can show the equivalence € € € ece#627,#winter#‘13# 17# of#45# ece#627,#winter#‘13# 18# of#45# predicate logic predicate logic rules of inference rules of inference so, the first rule: and ~( ∃ x)~(peach(x) ⊃ fuzzy(x)) ~( ∃ x)(peach(x) ∧ ~fuzzy(x)) knowing, that ~(p ∧ ~q), then this shows 1st formula implies 2nd, if we use the inverse € € of rules€ to show the €2nd implies 1st – then both formulas are equivalent ~( ∃ x)~~(peach(x) ∧ ~fuzzy(x)) € € € ece#627,#winter#‘13# 19# of#45# ece#627,#winter#‘13# 20# of#45# predicate logic predicate logic rules of inference rules of inference Modus ponens: Hypothetical syllogism: from p and p ⊃ q, derive q from p ⊃ q and q ⊃ r, derive p ⊃ r Modus tollens: Disjunctive syllogism: from€ ~q and p ⊃ q, derive ~p € from p ∨ € q and ~p, derive€ p € € ece#627,#winter#‘13# 21# of#45# ece#627,#winter#‘13# 22# of#45# predicate logic predicate logic rules of inference rules of inference Conjunction: Subtraction: from p and q, derive p ∧ q from p ∧ q, derive p Addition: (extra conjuncts may be thrown away) from p, derive€ p ∨ q € (any formula may be added to a disjunction) € ece#627,#winter#‘13# 23# of#45# ece#627,#winter#‘13# 24# of#45# predicate logic predicate logic equivalences equivalences Idempotency: Associativity: p ∧ p is equivalent to p, and p ∧ (q ∧ r) is equivalent to (p ∧ q) ∧ r, and p ∨ p is equivalent to p p ∨ (q ∨ r) is equivalent to (p ∨ q) ∨ r Commutativity:€ Distributivity:€ € € € € p ∧ q is equivalent to q ∧ p, and € € p ∧ (q ∨ r) is equivalent€ to€ (p ∧ q) ∨ (p ∧ r), and p ∨ q is equivalent to q ∨ p p ∨ (q ∧ r) is equivalent to (p ∨ q) ∧ (p ∨ r) € € € € € € € ece#627,#winter#‘13# 25# of#45# ece#627,#winter#‘13# 26# of#45# € € € € € € € predicate logic predicate logic equivalences equivalences Absorption: De Morgans laws: p ∧ (p ∨ q) is equivalent to p, and ~(p ∧ q) is equivalent to ~p ∨ ~q, and p ∨ (p ∧ q) is equivalent to p ~(p ∨ q) is equivalent to ~p ∧ ~q Double€ negation:€ € € € € p is equivalent to ~~p € € ece#627,#winter#‘13# 27# of#45# ece#627,#winter#‘13# 28# of#45# predicate logic predicate logic rules for quantifiers rules for quantifiers if A is an atom, then all occurrences of a variable in A are said to be free if a formula C was derived form a formula A by preceding A with either ( ∀ x) or ( ∃ x), then all free if a formula C was derived from formulas A and B by occurrences of x in A are said to be bound in C, combining them with Boolean operators, then all occurrences of variables that are free in A and B are all free occurrences€ of other€ variables in A remain free also free in C in C ece#627,#winter#‘13# 29# of#45# ece#627,#winter#‘13# 30# of#45# predicate logic predicate logic rules for quantifiers rules for quantifiers rules for dealing with variables depend on which let Φ(x) be a formula with one or more free occurrences are free and bound and which variables occurrences of a variable x, then Φ(t) is the result of must be renamed to avoid name clashes with other substituting every free occurrence of x in Φ with t variables ece#627,#winter#‘13# 31# of#45# ece#627,#winter#‘13# 32# of#45# predicate logic predicate logic rules of quantifier negation rules of quantifier (in)dependence ( ∃ x)A ⇔ ~( ∀ x)~A (∀ x)( ∀ y)A(x,y) ⇔ ( ∀ y)( ∀ x)A(x,y) (∀ x)A ⇔ ~( ∃ x)~A ( ∃ x)( ∃ y)A(x,y) ⇔ ( ∃ y)( ∃ x)A(x,y) ~( ∃ x)A ⇔ ( ∀ x)~A ( ∃ x)(∀ y)A(x,y) ⇒ ( ∀ y)( ∃ x)A(x,y) € € ~(∀ €x)A ⇔ ( ∃ x)~A € € € € € € € € € € € € € € € € € € € € € € € € ece#627,#winter#‘13# 33# of#45# ece#627,#winter#‘13# 34# of#45# predicate logic predicate logic rules of quantifier movement rules of quantifier movement example: A→ (∀ x)(B(x)) ⇔ (∀ x)(A→ B(x)) A→ ( ∃ x)(B(x)) ⇔ ( ∃ x)(A→ B(x)) ( ∃ x)(P(x)) → ( ∀ y)(Q(y)) ⇔ ( ∀ y)[( ∃ x)(P(x)) → (Q(y))] ( ∀ x)(B(x))→ A ⇔ ( ∃ x)(B(x)→ A) ⇔ ( ∀ y)( ∀ x)[(P(x)) → (Q(y))] € € ( ∃ x)(B(x))€ €→ A ⇔ € (∀ x)(B(x)→ A) € € € € € € € € € € € € € € € € € € € € € € € € € € ece#627,#winter#‘13# 35# of#45# ece#627,#winter#‘13# 36# of#45# predicate logic predicate logic rules for quantifiers: permissible substitutions rules for quantifiers: permissible substitutions universal instantiation: dropping quantifiers: from ( ∀ x)Φ(x), derive Φ(c) where c is any constant if the variable x does not occur free in Φ, then from ( ∀ x)Φ(x) derive Φ, and from ( ∃ x)Φ(x) derive existential generalization: € from Φ(c), where c is any constant, derive ( ∃ x)Φ(x) adding quantifiers: provided that every occurrence of x in Φ(x) is free € from Φ derive ( ∀ x)Φ €or derive ( ∃ x)Φ, where x is any variable € € € ece#627,#winter#‘13# 37# of#45# ece#627,#winter#‘13# 38# of#45# predicate logic typed predicate logic rules for quantifiers: permissible substitutions … substituting equal for equals: this form is a purely syntactic extension of untyped for any terms s and t where s=t, derive Φ(t) from logic – its semantic identical to untyped logic, as well Φ(s), provided that all free occurrences of variables in as ever theorem and proof t remain free in Φ(t) the only difference – addition of a type label after the quantifier – x:N - (label is a monadic predicate - n(x)) ece#627,#winter#‘13# 39# of#45# ece#627,#winter#‘13# 40# of#45# typed predicate logic typed predicate logic … … for knowledge representation typed logic has the Universal: ( ∀ x:N)Φ(x) ≡ ( ∀ x)(n(x) ⊃ Φ(x)) advantage of being more concise and readable it can support rules of inference based on inheritance Existential: ( ∃ x:N)Φ(x) ≡ ( ∃ x)(n(x) ∧ Φ(x)) (they do not make logic more expressive, they € € € € shorten some proofs) € € € € ece#627,#winter#‘13# 41# of#45# ece#627,#winter#‘13# 42# of#45# typed predicate logic typed predicate logic … … with a string of multiple quantifiers of the same kind for untyped … and with the same type label, it is permissible to factor out the common quantifier and type label ( ∀ x)(number(x) ⊃ ( ∀ y)(number(y) ⊃ ( ∀ x,y,x:Number) ((x < y ∧ y < z) ⊃ x < z) ( ∀ z)(number(z) ⊃ € ((x€ < y ∧ y < z) ⊃ x < z) ))) € € € € € € € € € ece#627,#winter#‘13# 43# of#45# ece#627,#winter#‘13# 44# of#45# typed predicate logic … Untyped formula as a special case of a typed one Universal: ( ∀ x:T)Φ(x) ≡ ( ∀ x)(T(x) ⊃ Φ(x)) ≡ ( ∀ x) Φ(x) Existential:€ ( ∃ x:T)€ €Φ (x) ≡ ( ∃€ x)(T(x) ∧ Φ(x)) € € ≡ ( ∃ x) Φ(x) € € € € ece#627,#winter#‘13# 45# of#45# € € .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us