17 Feb 2011 06:31
equality reasoning with functions and existentials?
Dan Connolly <dckc <at> midwestwebsense.com>
2011-02-17 05:31:51 GMT
2011-02-17 05:31:51 GMT
I discovered powerloom the other day via a tweet http://twitter.com/danja/status/37660228791042048 It looks pretty nifty. I'm trying to tell it: state-code is unambiguous (i.e. its inverse is a function). There's a place with state-code "KS" and population 28000. There's also a place with state-code "KS" and state-bird western-meadowlark. and then ask it: Is there a place with population 28000 and state-bird western-meadowlark? The attached is my attempt. It's *almost* working, but not quite. I don't understand why not. Clues, please, anyone? -- Dan Connolly http://www.madmode.com/
_______________________________________________ powerloom-forum mailing list powerloom-forum <at> isi.edu http://mailman.isi.edu/mailman/listinfo/powerloom-forum(Continue reading)
Anyway, after you do a "run-forward-rules" in the trace below, you get the
answer you are looking for.
Hans
STELLA(99): (clear-module pl-user)
:VOID
STELLA(100): (deffunction the (?i) :-> (?x Thing))
|f|THE
STELLA(101): (defrelation state-code (?s ?c)
:axioms (inverse code-state state-code))
|r|STATE-CODE
STELLA(102): (deffunction code-state (?c ?p)
:axioms (inverse state-code code-state)) ;; this is redundant and should be avoided
|f|CODE-STATE
STELLA(103): (defrelation state-bird (?place ?birdtype))
|r|STATE-BIRD
STELLA(104): (defrelation population (?place ?pop))
|r|POPULATION
STELLA(105): (assert (exists (?x) (and (state-code (the ?x) "KS")
RSS Feed