Suppose I have the following:
(do-backward-chaining the-goal)
(do-backward-chaining subgoal1)
(do-backward-chaining subgoal2)
(defrule main-goal
(the-goal ?a)
=>
(printout t "You won!" crlf)
)
(defrule support
(need-the-goal ?)
(subgoal1 ?s)
(subgoal2 ?s)
=>
(assert (the-goal ?s))
)
(defrule ground1
(need-subgoal1 ?)
=>
(assert (subgoal1 cat))
)
(defrule ground2
(need-subgoal1 ?)
=>
(assert (subgoal1 bird))
)
(defrule ground3
(need-subgoal2 ?)
=>
(assert (subgoal2 dog))
)
(defrule ground4
(need-subgoal2 ?)
=>
(assert (subgoal2 bird))
)
Is the backchaining implementation such that, if it happens to fire
"ground1" before firing "ground 2"
(thereby associating subgoal1 with cat rather than bird), and therefore
fails to fire "support" with
this match, it will then fire "ground2" and "ground4" and thereby
succeed?
When I try this example, that does indeed happen, but watching the
dribble doesn't give me
a sense of what happens in general.
Of course, ordinarily the "groundX" rules will fire with all possible
matches. What makes me
wonder is the statement in the user guide that Jess adds a "not"
condition to the LHS of these rules.
It seems to me that whether this "backtracking" will occur depends on
how much is already
bound in that added "not" condition.
Thanks,
Sidney Bailin
Knowledge Evolution, Inc.
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------