> Your understanding is correct. If you reverse the order of ground1 and

> ground2 in the input file, you'll make ground1 fire first. This will
> cause (need-subgoal2 cat) to be asserted. This matches the
> need-subgoal2 patterns of ground3 and ground4, and one of them fires
> (ground4). Now you're stuck with (subgoal1 cat) and (subgoal2 bird)
> and nothing else happens.
>
> I guess the best way to look at this is to say that (from Jess'
> perspective) the groundX rules are incomplete. They match all
> need-subgoal facts, but they only provide specific ones; i.e., ground3

> and 4 could be replaced by
>
> (defrule ground3-4
>   (need-subgoal2 ?x&bird|dog)
>   =>
>   (assert (subgoal2 ?x)))

Ernest - Isn't this synonymous with my ground3 and ground4 rules taken
together? I don't quite see how it helps.

Or maybe you're not saying it helps, but just pointing out the implicit
meaning of my pair of rules (ground3 and ground4) and how it doesn't
account for the case of (need-subgoal2 cat). Since I'm thinking from
a Prolog point of view, allowing the programmer this incompleteness
is precisely the value of backtracking. I guess we're saying the same
thing in two different ways.

I know that this issue of controlling superfluous firings is a real
headache. Since the issue boils down to deciding which matches may still

be useful and which aren't, it seems application-dependent.

My intuition is that the desired behavior cannot be achieved by Jess
itself without (in effect) implementing an additional data structure
that represents the attempt to achieve a goal (that is, a pattern
for which backchaining is enabled). Implementing such a structure
explicitly (and the algorithms to go with it) is not a horrendous task,
but how it would co-exist with Rete I'm not sure. It's probably
safer to implement a version that is formulated at the user level
in terms of current Jess constructs, and then perhaps "internalize"
it into Jess itself.

So ... Since I need this type of backtracking behavior in my
application,
if I can figure out how to do it in a way that seems portable, I will
send it over for your consideration.

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]
---------------------------------------------------------------------

Reply via email to