Search code examples
clips

How to let a user modify a fact without activating a certain rule?


I wonder if it is somehow possible to have a construct, such that a user can modify a rule without triggering a rule. So my minimal example:

(defrule A-has-B
   (A B)
=>
   (assert (A-has-B)
)

(assert (A A))

f-1 (A A)

Now, I would like to modify (A A) to (A B) without triggering the rule "A-has-B".

First I thought about something like:

(defrule A-has-B
   (A B)
   (not (exists (usercontrol on)))
=>
   (assert (A-has-B)
)

But after retracting '(usercontrol on)' the rule fires.

Maybe, somebody can tell me whether it's possible or not.


Solution

  • It is not possible to disable a pattern from being matched by a fact.