Integer instances and arithmetic
lee martie <[email protected]> Sun, 07 Nov 2010 06:14:55 -0500
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
I am trying to create instances of type integer and increment these instances by some amount. I have found a work around to do this but would be very appreciative for a simpler solution if one exists or pointers to Powerloom features I am overlooking. I found that I could not accomplish defining an integer instance with "(assert (INTEGER x))". I am using the following workaround: (deffunction intVar ((?x thing)) :-> (?y integer)) . I also have a need to increment an integer instance by some amount. I found that: (assert (=(intVar g) 0)) (assert (=(intVar g) (+ (intVar g) 1))) will not map "g" to "1" . I am instead incrementing "g" by executing: (assert-from-query (retrieve all (+ (intVar g) 1 ?x)) :pattern (setofall (?x Integer) (=(intVar g) ?x) ) ) Thanks for your help and time. Lee Martie [email protected]