Forward & backward
chaining
By
Md. Fazle Rabbi
16CSE057
4.2
Forward chaining
4.3
• Forward chaining: We start with the sentences in the
knowledge base and generate new conclusions that in
turn can allow more inferences to be made.
• data-driven
• Automatic, unconscious processing
• May do lots of work that is irrelevant to the goal
Forward chaining
4.4
• It is a down-up approach, as it moves from bottom to top.
• It is a process of making a conclusion based on known facts or
data, by starting from the initial state and reaches the goal
state.
• Forward-chaining approach is also called as data-driven as we
reach to the goal using available data.
• Forward -chaining approach is commonly used in the expert
system, such as CLIPS, business, and production rule systems.
Properties of Forward-Chaining
4.5
Forward Chaining Example
• Knowledge Base:
• If [X croaks and eats flies] Then [X is a frog]
• If [X chirps and sings] Then [X is a canary]
• If [X is a frog] Then [X is colored green]
• If [X is a canary] Then [X is colored yellow]
• [Fritz croaks and eats flies]
• Goal:
• [Fritz is colored Y]?
4.6
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
4.7
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
4.8
Forward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goal
[Fritz is colored Y]?
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
4.9
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
4.10
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
?
4.11
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
4.12
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
Goal
[Fritz is colored Y]?
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
4.13
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
4.14
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
?
4.15
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
4.16
Forward Chaining Example
If [X croaks and eats flies]
Then [X is a frog]
[Fritz croaks and eats flies]
[Fritz is a frog]
If [X is a frog]
Then [X is colored green]
[Fritz is colored green]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
[Fritz is a frog]
[Fritz is colored green]
Goal
[Fritz is colored Y]?
[Fritz is colored Y] ?
Y = green
4.17
Backward chaining
4.18
• Backward chaining: We start with something we want
to prove, find implication sentences that would allow
us to conclude it, and then attempt to establish their
premises in turn.
• goal-driven
• Where are my keys? How do I get to my next class
Backward chaining
4.19
Properties of backward chaining
• It is known as a top-down approach.
• In backward chaining, the goal is broken into
sub-goal or sub-goals to prove the facts true.
• It is called a goal-driven approach, as a list of
goals decides which rules are selected and used.
• The backward-chaining method mostly used a
depth-first search strategy for proof.
4.20
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
4.21
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
4.22
Backward Chaining Example
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
4.23
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
4.24
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
4.25
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
4.26
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
4.27
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
4.28
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
4.29
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
4.30
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
4.31
Backward Chaining Example
[Fritz is colored Y]
If [X is a frog]
Then [X is colored green]
[X is a frog]
If [X is a canary]
Then [X is colored yellow]
[X is a canary]
If [X croaks and eats flies]
Then [X is a frog]
[X croaks and eats flies]
Knowledge Base
If [X croaks and eats flies]
Then [X is a frog]
If [X chirps and sings]
Then [X is a canary]
If [X is a frog]
Then [X is colored green]
If [X is a canary]
Then [X is colored yellow]
[Fritz croaks and eats flies]
Goals
[Fritz is colored Y]?
[X is a frog]
[X is a canary]
[X croaks and eats flies]
[Fritz croaks and eats flies]
X = Fritz, Y = green
4.32
Thank you

2. forward chaning

  • 1.
  • 2.
  • 3.
    4.3 • Forward chaining:We start with the sentences in the knowledge base and generate new conclusions that in turn can allow more inferences to be made. • data-driven • Automatic, unconscious processing • May do lots of work that is irrelevant to the goal Forward chaining
  • 4.
    4.4 • It isa down-up approach, as it moves from bottom to top. • It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state. • Forward-chaining approach is also called as data-driven as we reach to the goal using available data. • Forward -chaining approach is commonly used in the expert system, such as CLIPS, business, and production rule systems. Properties of Forward-Chaining
  • 5.
    4.5 Forward Chaining Example •Knowledge Base: • If [X croaks and eats flies] Then [X is a frog] • If [X chirps and sings] Then [X is a canary] • If [X is a frog] Then [X is colored green] • If [X is a canary] Then [X is colored yellow] • [Fritz croaks and eats flies] • Goal: • [Fritz is colored Y]?
  • 6.
    4.6 Forward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]?
  • 7.
    4.7 Forward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]?
  • 8.
    4.8 Forward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goal [Fritz is colored Y]? If [X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog]
  • 9.
    4.9 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]?
  • 10.
    4.10 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]? ?
  • 11.
    4.11 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]?
  • 12.
    4.12 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] Goal [Fritz is colored Y]? If [X is a frog] Then [X is colored green] [Fritz is colored green]
  • 13.
    4.13 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]?
  • 14.
    4.14 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]? ?
  • 15.
    4.15 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]?
  • 16.
    4.16 Forward Chaining Example If[X croaks and eats flies] Then [X is a frog] [Fritz croaks and eats flies] [Fritz is a frog] If [X is a frog] Then [X is colored green] [Fritz is colored green] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] [Fritz is a frog] [Fritz is colored green] Goal [Fritz is colored Y]? [Fritz is colored Y] ? Y = green
  • 17.
  • 18.
    4.18 • Backward chaining:We start with something we want to prove, find implication sentences that would allow us to conclude it, and then attempt to establish their premises in turn. • goal-driven • Where are my keys? How do I get to my next class Backward chaining
  • 19.
    4.19 Properties of backwardchaining • It is known as a top-down approach. • In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true. • It is called a goal-driven approach, as a list of goals decides which rules are selected and used. • The backward-chaining method mostly used a depth-first search strategy for proof.
  • 20.
    4.20 Backward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]?
  • 21.
    4.21 Backward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]?
  • 22.
    4.22 Backward Chaining Example KnowledgeBase If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [Fritz is colored Y] If [X is a frog] Then [X is colored green] [X is a frog]
  • 23.
    4.23 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog]
  • 24.
    4.24 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog]
  • 25.
    4.25 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary]
  • 26.
    4.26 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary]
  • 27.
    4.27 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary]
  • 28.
    4.28 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies]
  • 29.
    4.29 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies]
  • 30.
    4.30 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies]
  • 31.
    4.31 Backward Chaining Example [Fritzis colored Y] If [X is a frog] Then [X is colored green] [X is a frog] If [X is a canary] Then [X is colored yellow] [X is a canary] If [X croaks and eats flies] Then [X is a frog] [X croaks and eats flies] Knowledge Base If [X croaks and eats flies] Then [X is a frog] If [X chirps and sings] Then [X is a canary] If [X is a frog] Then [X is colored green] If [X is a canary] Then [X is colored yellow] [Fritz croaks and eats flies] Goals [Fritz is colored Y]? [X is a frog] [X is a canary] [X croaks and eats flies] [Fritz croaks and eats flies] X = Fritz, Y = green
  • 32.