17 Feb 2011 06:31

## equality reasoning with functions and existentials?

```I discovered powerloom the other day via a tweet

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.

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.

--
Dan Connolly
```
Attachment (,same-state.plm): application/octet-stream, 1507 bytes
```_______________________________________________
powerloom-forum mailing list
powerloom-forum <at> isi.edu
http://mailman.isi.edu/mailman/listinfo/powerloom-forum
```

17 Feb 2011 21:26

### Re: equality reasoning with functions and existentials?

```The problem is that PowerLoom's just-in-time forward inference isn't complete
enough here to pick up all that's required, and you have to run forward rules
explicitly.  When you define an "inverse" for a relation, the required rules
are created by forward inference which isn't triggered by the JIT in this
case.  As an aside, inverse relations in a logic system like PowerLoom are
redundant and generally a bad idea for performance reasons.  Also, if you
declare an inverse on one relation, you shouldn't also do it on the inverse,
since it will generate redundant rules.  I know, PowerLoom should adivse users
on that, but currently it doesn't

Anyway, after you do a "run-forward-rules" in the trace below, you get the

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")
```