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