i have a problem with a rule match in Clips, in particular i can't understand why this rule doesn't actives!.
I have a module called REASONING where i defined a fact with this deftemplate
(deftemplate planning (slot value (allowed-values start stop)))
.
First time i focus on this module i assert this fact with this rule
(defrule start-reasoning
(declare (salience 90))
(not (planning))
=>
(assert (planning (value start)))
)
Nextly, this fact will be never retract but only modified its slot. In the same module where i defined planning i have an other rule, where it's changed value from start to stop.
(defrule plan-done
(declare (salience 60))
?<-(planning(value start)
=>
(modify ?p (value stop))
)
This is the last rule activated by this module. After that Clips execute a pop-focus. Now when it's the turn to get focus again on this module, i find
(planning (value stop))
f-4839 (explore-memory (pos-r 2) (pos-c 5) (direction west)(action turnleft)
(param1 nil) (param2 nil) (param3 nil) (open-depth 0) (ident 0))
f-4843 (planning (value stop))
f-4845 (exec (step 0)(action turnleft)(param1 nil)(param2 nil) (param3 nil))
f-5029 (exec (step 1)(action turnright)(param1 nil)(param2 nil)(param3 nil))
So i expect that rule written under must be actived but it doesn't happen! The condition to change again slot value it's inside module PLAN_MANAGER, whereby i can active no other rules inside REASONING until Clips doesn't exec focus on PLAN_MANAGER.
(defrule go-to-plan-manager
(declare (salience 90))
(planning (value stop))
=>
(focus PLAN_MANAGER)
)
The strange thing it's that if i call matches function i obtain this output.
>(matches go-to-plan-manager)
Matches for Pattern 1
f-4843
Activations
None
Anybody can help me to understand why CLIPS doesn't puts in agenda go-to-plan-manager ? Where i'm wrong?