240 likes | 754 Views
Implication Truth Table. If α is true, then β must be true for the implication to be true If α is false, then we have no information about β β might be true or false without affecting the implication β is not necessarily true
E N D
Implication Truth Table • If α is true, then β must be true for the implication to be true • If α is false, then we have no information about β • β might be true or false without affecting the implication • β is not necessarily true • If implication is true and α is true, then β must be true (Modus Ponens) ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 1
Universal Implication • x = { , , } • All purple mushrooms are poisonous • x Purple(x) Mushroom(x) Poisonous(x) • Universal: all three implications are true • is purple and a mushroom is poisonous • is purple and a mushroom is poisonous • is purple and a mushroom is poisonous • But the first one is the only one where the premise is true, therefore the only one where we know the consequent is true (Modus Ponens) • Otherwise, we don’t know whether x is poisonous ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 2
Existential Implication • x = { , , } • Some purple mushrooms are poisonous • x Purple(x) Mushroom(x) Poisonous(x) • Existential: at least one implication is true • is purple and a mushroom is poisonous • is purple and a mushroom is poisonous • is purple and a mushroom is poisonous • But all those where the premise is false are true • The existential implication doesn’t give us any information ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 3
Existential Conjunction • x = { , , } • Some purple mushrooms are poisonous • x Purple(x) Mushroom(x) Poisonous(x) • Existential: at least one statement is true • is purple and a mushroom and is poisonous • is purple and a mushroom and is poisonous • is purple and a mushroom and is poisonous • The first statement is true, the other two are false • The existential quantifier is satisfied • The situation is consistent with our original meaning ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 4
Universal Conjunction • x = { , , } • All purple mushrooms are poisonous • x Purple(x) Mushroom(x) Poisonous(x) • Universal: all three statements are true • is purple and a mushroom and is poisonous • is purple and a mushroom and is poisonous • is purple and a mushroom and is poisonous • “Everything is a poisonous purple mushroom” • This is false, and not the original meaning of our sentence ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 5
Summary • Universal quantifier • Usually used with to create universal rules • Using it with makes blanket statements about all objects in the world • Existential quantifier • Usually used with to list properties of an object • Using it with creates sentences that do not say much ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 6
The Purple Mushrooms • There are exactly two purple mushrooms • x yz Purple(x) Mushroom(x) Purple(y) Mushroom(y) (x=y) Purple(z) Mushroom(z) (x=z) (y=z) • Statement will be true for at least one value of x and y and for all values of z • In other words, the implication is always true • If the premise is true • x is a purple mushroom and y is a different purple mushroom and z is a third purple mushroom • Then the consequent is true (z is x or y) and there are only two purple mushrooms ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 7
The Purple Mushrooms • There are exactly two purple mushrooms • x yz Purple(x) Mushroom(x) Purple(y) Mushroom(y) (x=y) Purple(z) Mushroom(z) (x=z) (y=z) • Statement will be true for at least one value of x and y and for all values of z • If the premise is false • The implication is true but the consequent may be true (if z is the same as x or y, regardless of whether they are purple mushrooms) or false (otherwise) ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 8
The Purple Mushrooms • There are exactly two purple mushrooms • x yz Purple(x) Mushroom(x) Purple(y) Mushroom(y) (x=y) Purple(z) Mushroom(z) (x=z) (y=z) • With this sentence, only two purple mushrooms can exist • If the premise is true, there are two purple mushrooms in existence • If the premise is false, there is zero, one or two purple mushrooms • The cases with zero and one do not contradict the original sentence because more mushrooms can exist • There can never be three or more • The original meaning of the sentence is satisfied ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 9
Unification • Given sentences p and q, is empty • Scan p and q left to right • If they disagree on terms r and s • If r is a variable • If s is a complex term and r occurs in s • Fail • Else • Add r/s to • Else if s is a variable (but r is a complex term) • If s occurs in r • Fail • Else • Add s/r to • Else (both r and s are complex term) • Apply unification to r and s ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 10
Unification Rules • Function symbols and predicate symbols unify with function symbols and predicate symbols that have identical names and number of arguments • Constant symbols can only unify with identical constant symbols • Variables can unify with other variables, constant symbols, or function symbols • Variables cannot unify with a term in which that variable occurs. • x cannot unify with P(x), as that leads to P(P(P(P(…P(x)…)))) • That is an occur check error ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 11
Unification Examples • p = Parents(x, Father(x), Mother(Bob))q = Parents(Bob, Father(Bob), y) • Consider first term of each sentence • r = Parents(x, Father(x), Mother(Bob)) • s = Parents(Bob, Father(Bob), y) • Disagreement • r and s are predicate symbols with identical names and number of arguments, so unification is possible • Unify arguments • r = x, s = Bob, x/Bob • r = Father(Bob), s = Father(Bob), no substitution • r = Mother(Bob), s = y, y/Mother(Bob) • = {x/Bob, y/Mother(Bob)} ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 12
Unification Examples • p = Parents(x, Father(x), Mother(Bob))q = Parents(Bob, Father(y), z) • Unify arguments • r = x, s = Bob, x/Bob • r = Father(Bob), s = Father(y), y/Bob • r = Mother(Bob), s = z, z/Mother(Bob) • = {x/Bob, y/Bob, z/Mother(Bob)} ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 13
Unification Examples • p = Parents(x, Father(x), Mother(Jane))q = Parents(Bob, Father(y), Mother(y)) • Unify arguments • r = x, s = Bob, x/Bob • r = Father(Bob), s = Father(y), y/Bob • r = Mother(Jane), s = Mother(Bob), Fail • Fail ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 14
Unification Exercises • p = Parents(x, Father(x), Mother(x))q = Parents(Bob, SpermDonor(y), Mother(Bob)) • Fail • p = Parents(x, Father(x), Mother(x))q = Parents(Anakin, Mother(Anakin)) • Fail • p = Parents(Bob, x, Mother(y))q = Parents(Bob, Father(y), Mother(Bob)) • {x/Father(Bob), y/Bob} • p = Parents(Bob, x, Mother(y))q = Parents(Bob, Father(x), Mother(Bob)) • Fail ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 15
Generalized Modus Ponens • Modus Ponens • (α β), αβ • Generalized Modus Ponens • p1’, p2’,…, pn’, (p1 p2 … pn q) SUBST(, q) • Combine And-Introduction, Universal Elimination, and Modus Ponens • Need Unification algorithm to find that unifies (p1’, …, pn’) and (p1 … pn) ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 16
Generalized Modus Ponens • Inference with Propositionalization • Generates a lot of useless substitutions • Complete but semidecidable • Inference with Generalized Modus Ponens • Only generates substitutions that are needed to infer new facts • Use forward and backward chaining • Complete with Horn clauses • Linear time with Horn clauses ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 17
Inference Example • FOL KB • x Dog(x) Own(Bob,x) Brown(x) • Dog(Fido), Dog(Barky), Dog(Dogbert), Dog(Princess), Dog(Lassie), Dog(K-9) • Own(Bob,Fido) • Inference with Propositionalization • Universal Instantiation: Dog(Fido) Own(Bob,Fido) Brown(Fido)Dog(Barky) Own(Bob,Barky) Brown(Barky)Dog(Dogbert) Own(Bob,Dogbert) Brown(Dogbert)Dog(Princess) Own(Bob,Princess) Brown(Princess)Dog(Lassie) Own(Bob,Lassie) Brown(Lassie)Dog(K-9) Own(Bob,K-9) Brown(K-9) • And-Introduction: Dog(Fido) Own(Bob,Fido) • Modus Ponens: Brown(Fido) ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 18
Inference Example • FOL KB • x Dog(x) Own(Bob,x) Brown(x) • Dog(Fido), Dog(Barky), Dog(Dogbert), Dog(Princess), Dog(Lassie), Dog(K-9) • Own(Bob,Fido) • Inference with Generalized Modus Ponens • Dog(Fido), Own(Bob,Fido), Dog(x) Own(Bob,x) Brown(x) • Unification: = {x/Fido} • Brown(Fido) ECE457 Applied Artificial Intelligence R. Khoury (2007) Page 19