Backward Chaining
- Backward Chaining means chaining back from the goal, to apply rules
that meet the goal.
- As with Forward Chaining there are rules and WM.
- However there is also a goal stack.
- So given the rules
- if (have money) and (at coffee-shop) then (lose 75p) and
(have coffee)
- if (have water) and (have ground coffee) and (have cofee-machine)
then (have coffee)
- if (at office) and (can walk) then (at coffee-shop)
- if WM = (have money) and (at coffee-shop)
- set the goal, then apply the first rule
- if WM = (have money) and (at office) and (can walk)
- set the goal (have coffee)
- try to apply the first rule
- add (at coffee-shop) to stack
- apply third rule, and pop the stack
- apply first rule and achieve the ultimate goal
- In class exercise:
- Simulate a run of this system forward
- What data items do you need?
- Simulate a run of this system backward
- What data items are you prompted for