Q1

A) Consider the following production system:

The user inputs the facts: The fruit has no seed, a 7 cm diameter, smelling skin, orange color. Establish by forward chaining and backward chaining that the fruit is a citrus fruit.

Sol:

Initial Facts:

Goal:


1. Forward Chaining

In forward chaining, we start with the known facts and continuously apply the rules until we reach our goal.

Iteration 1:

Iteration 2:

Iteration 3:

Conclusion: The goal citrus fruit has been successfully established.


2. Backward Chaining

In backward chaining, we start with the goal and work backward, setting sub-goals to see if they can be supported by the initial facts.

Main Goal: Prove citrus fruit

Attempt Sub-goal 1: Prove fruit is lemon

Attempt Sub-goal 2: Prove fruit is orange

Conclusion: Because all three prerequisites for Rule 9 (perfumed, color is orange, and size is medium) have been evaluated as True, the sub-goal fruit is orange is proven True. Because "fruit is orange" is True, it satisfies the OR condition in Rule 5, successfully proving the ultimate goal: citrus fruit.


B) Use the Resolution Algorithm to prove that "Alice is successful" based on the following story:

  1. Everyone who works hard and gets a promotion is successful.

  2. Everyone who is dedicated or talented can work hard.

  3. Alice is talented but not dedicated.

  4. Everyone who is talented gets a promotion.

  5. Prove that Alice is successful.

Sol

To prove that "Alice is successful" using the Resolution Algorithm, we must first translate the story into First-Order Logic, convert those statements into Conjunctive Normal Form (CNF) clauses, negate our goal, and then resolve the clauses to find a contradiction (an empty clause).

1. Define the Predicates

2. Translate to First-Order Logic

  1. Everyone who works hard and gets a promotion is successful:

    x((W(x)P(x))S(x))

  2. Everyone who is dedicated or talented can work hard:

    x((D(x)T(x))W(x))

  3. Alice is talented but not dedicated:

    T(a)¬D(a)

  4. Everyone who is talented gets a promotion:

    x(T(x)P(x))

Goal to prove: S(a) (Alice is successful)

3. Convert to Conjunctive Normal Form (CNF)

We remove implications () using the rule AB¬AB, and distribute to form standalone clauses.

4. Resolution Steps

Now we perform resolution on our set of clauses {C1, C2, C3, C4, C5, C6, C7} to derive a contradiction (an empty clause, often denoted as or ).

Conclusion

By negating the goal (¬S(a)) and using the resolution algorithm, we reached a logical contradiction (the empty clause). Therefore, the original premise must be true. Alice is successful.


C) Translate the following statements into predicate logic:

a. Every student who studies passes the exam.

b. Mathematics and Physics are subjects.

c. Anything that is taught by a teacher is a subject.

d. Alice studies Mathematics and has passed the exam.

e. Bob studies everything that Alice studies.

Sol

Constants:

Predicates:


a. Every student who studies passes the exam.

x((Student(x)Studies(x))Passes(x,e))

b. Mathematics and Physics are subjects.

Subject(m)Subject(p)

c. Anything that is taught by a teacher is a subject.

x(y(Teacher(y)Teaches(y,x))Subject(x))

(Alternatively: xy((Teacher(y)Teaches(y,x))Subject(x)))

d. Alice studies Mathematics and has passed the exam.

Studies(a,m)Passes(a,e)

e. Bob studies everything that Alice studies.

x(Studies(a,x)Studies(b,x))