Reputation: 738
I am trying to retract all facts of form:
(<something> task-error)
To do this I wrote the rule:
(defrule retract-task-error "retract task error"
(declare (salience -1000))
?f <- (?n task-error)
=>
(retract ?f)
)
But it does not work with error:
[PRNTUTIL2] Syntax Error: Check appropriate syntax for the first field of a pattern.
Is it ever possible to accomplish this task with CLIPS or do I need a code rearrangement to avoid matching first fields of facts?
Upvotes: 1
Views: 834
Reputation: 10757
The first field of a pattern must be a symbol. The simplest solution would probably be adding a common symbol (such as task) to the beginning of all facts and patterns which can contain task-error:
(defrule retract-task-error "retract task error"
(declare (salience -1000))
?f <- (task ?n task-error)
=>
(retract ?f)
)
Upvotes: 2