Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC411Artificial intelligence 1 Chapter 2 The Predicate Calculus Contents The Propositional Calculus The Predicate Calculus Using Inference Rules to Produce.

Similar presentations


Presentation on theme: "CSC411Artificial intelligence 1 Chapter 2 The Predicate Calculus Contents The Propositional Calculus The Predicate Calculus Using Inference Rules to Produce."— Presentation transcript:

1 CSC411Artificial intelligence 1 Chapter 2 The Predicate Calculus Contents The Propositional Calculus The Predicate Calculus Using Inference Rules to Produce Predicate Calculus Application: A Logic-Based Financial Advisor 1

2 CSC411Artificial intelligence 2 2

3 CSC411Artificial intelligence 3 3

4 CSC411Artificial intelligence 4 4

5 CSC411Artificial intelligence 5 For propositional expressions P, Q and R: 5 Proposition Equivalence

6 CSC411Artificial intelligence 6 Truth table for the operator . 6 Truth Table Truth table demonstrating the equivalence of P Æ Q and ÿ P ⁄ Q.

7 CSC411Artificial intelligence 7 7

8 CSC411Artificial intelligence 8 8

9 CSC411Artificial intelligence 9 9

10 CSC411Artificial intelligence 10

11 CSC411Artificial intelligence 11 verify_sentence algorithm 11

12 CSC411Artificial intelligence 12

13 CSC411Artificial intelligence 13

14 CSC411Artificial intelligence 14 Equivalence For predicates p and q, and variables X and Y –Xp(X)  Xp(X) –Xp(X)  Xp(X) –Xp(X)  Yp(Y) –Xp(X)  Yp(Y) –X(p(X)q(X))  Xp(X)Yq(Y)) –X(p(X)q(X))  Xp(X)Yq(Y) )

15 CSC411Artificial intelligence 15 Higher-order predicate calculi –Allows quantified predicates –E.g. (Likes) Likes(george, kate)

16 CSC411Artificial intelligence 16 A blocks world with its predicate calculate description. A rule for clear block:  X(  Y on(Y,X)  clear(X))

17 CSC411Artificial intelligence 17 Inference Logical inference – infer new correct expressions from a set of true assertions New expressions must be consistent with all previous expressions

18 CSC411Artificial intelligence 18

19 CSC411Artificial intelligence 19

20 CSC411Artificial intelligence 20

21 CSC411Artificial intelligence 21

22 CSC411Artificial intelligence 22 Unification Unification -- An algorithm (procedure) for determining the substitutions needed to make two predicate calculus expressions match Unifier -- a set of variable substitutions that make two expressions identical E.g, for expression foo(X, a, goo(Y)) ExpressionsSubstitutions  foo(fred, a goo(Z)){fred/X, Z/Y}  foo(W, a, goo(jack)){W/X, jack/Y}  foo(Z, a, goo(moo(Z))){Z/X, moo(Z)/Y}

23 CSC411Artificial intelligence 23 Unification Issues  can be simply removed  may be eliminated by replacing the variable with the constant. E.g. parent(X, tom)  parent(mary, tom) Skolem function may be used to replace a variable that depends on other variables e.g. XYparent(X,Y)  parent(X,f(X)) A variable may be replaced by any terms, but not the terms that contain it A constant cannot be replaced by any terms If a variable is bound to a constant, it my not be re-bound

24 CSC411Artificial intelligence 24 Composition of Unification Substitutions If S and S’ are two substitution sets, the the composition of S and S’, SS’, is obtained by applying S’ to the elements of S and adding the result to S E.g. Consider three sets of substitutions: {X/Y, W/Z}, {V/X},{a/V, f(b)/W} Compositing the third set with the second set: {a/X, a/V, f(b)/W} Composing this result with the first set: {a/Y, a/X, a/V, f(b)/Z, f(b)/W} Composition is associative but not commutative

25 CSC411Artificial intelligence 25 Most General Unifier (mgu) The mgu for a set of expressions is unique except for alphabetic variations E.g. Unifying p(X) and p(Y), –{fred/X, fred/Y} is an unifier, but not mgu –Both {Z/X, Z/Y} and {W/X, W/Y} are mgus.

26 CSC411Artificial intelligence 26 Unification Algorithm

27 CSC411Artificial intelligence 27 Unifying parents(X, father(X), mother(bill)) and parents(bill, father(bill), Y). Convert to List format first

28 CSC411Artificial intelligence 28 Final trace of the unification of (parents X (father X) (mother bill)) and (parents bill (father bill) Y).

29 CSC411Artificial intelligence 29 A Logic-Based Financial Advisor The advisor helps a user to decide whether to invest in a savings account, or the stock market What to invest depends on their income and the current amount they have saved Criteria: –Individuals with an inadequate savings account should always make increasing the amount saved their first priority, regardless of their income –Individuals with adequate savings account and an adequate income should consider a riskier but potentially more profitable investment in the stock market –Individuals with a lower income who already have an adequate savings account may want to consider splitting their surplus income between savings and stocks, to increase the cushion in savings while attempting to increase their income through stocks

30 CSC411Artificial intelligence 30 13 Logic System

31 CSC411Artificial intelligence 31 Advisor System Inference minsavings(X)  500*X minincome(X)  15000+(4000*X) Consider an user with three dependents, $220000 in savings, and steady income of $25000 –Add facts: 9.amount_saved(22000). 10.earnings(25000, steady). 11.dependents(3). –Conjunct 10 and 11, unify with 7 under the substitution {25000/X, 3/Y}, and use modus ponens 12.income(inadequate). –Conjunct 9 and 11, unify with 4 under the substitution {22000/X, 3/Y}, and use modus ponens 13.savings_account(adquate) –Conjuct 12 and 13, use modus ponens with 3 14.investment(combination)


Download ppt "CSC411Artificial intelligence 1 Chapter 2 The Predicate Calculus Contents The Propositional Calculus The Predicate Calculus Using Inference Rules to Produce."

Similar presentations


Ads by Google