Today is not a good day ... :~)
I want to express the following:
All A objects always depend on exactly one B (Assoc-per-class below)
So I say:
IF (such a fact as above exists)
(there is an A)
(there is no dependency at A ... pointing to whereever ...)
(there is no B where the dependency above points to)
THEN
create an A and a dependency A -> B
The IsClass method is a little cumbersome replacement for the CLIPS
(is-a ?class) feature. Works OK otherwise.
(defrule dep-per-class
(Assoc-per-class (class ?class) (child-class ?child-class))
(IMObject (OBJECT ?p&:(call ?p IsClass ?class)))
(not (and (IMAssociation (dependent ?p) (antecedent ?c))
(IMObject (OBJECT ?c&:(call ?c IsClass ?child-class)))))
=>
[...]
)
Now is there a logical mistake in my rule?
What happens is that this rule keeps on firing and I get lots of B's
attached to the A (actually I have to ^C it):
FIRE 3 dep-per-class f-88, f-181,,
FIRE 7 dep-per-class f-88, f-181, f-192,
FIRE 11 dep-per-class f-88, f-181, f-200,
FIRE 15 dep-per-class f-88, f-181, f-208,
FIRE 19 dep-per-class f-88, f-181, f-216,
FIRE 23 dep-per-class f-88, f-181, f-224,
FIRE 27 dep-per-class f-88, f-181, f-232,
FIRE 31 dep-per-class f-88, f-181, f-240,
FIRE 35 dep-per-class f-88, f-181, f-248,
FIRE 3 is OK, I think, but the other ones?
Thanks a lot in adavance,
tge
--
Thomas Gentsch
---------------------------------------------------------------------
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]
---------------------------------------------------------------------