7 Nov 2010 12:14
Integer instances and arithmetic
lee martie <leemartie <at> gatech.edu>
2010-11-07 11:14:55 GMT
2010-11-07 11:14:55 GMT
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(Continue reading)
RSS Feed