Re: Tried to bind |V|?x to NULL value.

"Martin Baldan" <[email protected]> Sun, 3 Aug 2008 18:20:24 +0200
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
On Sun, Aug 3, 2008 at 5:21 AM, Thomas Russ <[email protected]> wrote:
>
> OK.  The main thing that is going on is that PowerLoom doesn't really like
> to do extremely open-ended reasoning, and the rule that you have formulated
> is very open ended.  It says, essentially, that everything in the universe
> is the friend of everything else.  That would give a really large result,
> and PowerLoom doesn't like to attempt to reason if things are that open
> ended.

> So, a slightly better formulation might be to introduce additional concepts
> like person:
>
> (defconcept person)
>
> and then write a rule that applies only to people:
>
> (assert (forall (?x ?y) (=> (and (person ?x) (person ?y))
>                            (friend ?x ?y))))
>

Awesome, thanks!!  :)

All I had to do, then, is to define a concept, like "person" or
"something" and then every time I define a new object, assert that the
concept applies to the object. I tried it in the stable version and
also downloaded the pl snapshot, as you suggested. Here's the little
plm file I saved from the powerloom interface:
-------------

;;; -*- Mode: Lisp; Package: STELLA; Syntax: COMMON-LISP; Base: 10 -*-

(CL:IN-PACKAGE "STELLA")

(DEFMODULE "/PL-KERNEL-KB/PL-USER/FRIENDS"
  :INCLUDES ("PL-USER"))

(IN-MODULE "/PL-KERNEL-KB/PL-USER/FRIENDS")

(IN-DIALECT :KIF)

(DEFRELATION FRIEND (?X ?Y))
(DEFRELATION CLOSE-FRIEND (?X ?Y))
(DEFCONCEPT SOMETHING)
(DEFCONCEPT PERSON)
(ASSERT (forall (?x1 ?x2)
           (<= (FRIEND ?x1 ?x2)
               (CLOSE-FRIEND ?x1 ?x2))))
(ASSERT (forall (?x1)
           (<= (SOMETHING ?x1)
               (PERSON ?x1))))
(ASSERT (PERSON ALICE))
(ASSERT (PERSON BOB))
(ASSERT (CLOSE-FRIEND ALICE BOB))

-------------------
Now, here's a little problem I had with the "why" feature (both in
pl-3.2.0 and 3.2.21-snapshot). No big deal, but ... maybe I should ask
in another thread. Anyway, here it goes:

----------
PL-USER |= (load "/home/martin_net/Desktop/cosas/powerloom/powerloom/friends-1")


PL-USER |= (in-module "FRIENDS")


FRIENDS |= (ask (friend alice bob))

TRUE

FRIENDS |= (set-feature justifications)

|l|(:JUSTIFICATIONS :EMIT-THINKING-DOTS :JUST-IN-TIME-INFERENCE)

FRIENDS |= (ask (friend alice bob))

TRUE

FRIENDS |= (why)

1 (FRIEND ALICE BOB)
    follows

-------------

I expected it to say that (friend alice bob) came from the assertion
(close-friend alice bob) and the assertion  (forall (?x1 ?x2)   (<=
(FRIEND ?x1 ?x2)  (CLOSE-FRIEND ?x1 ?x2))).
What's the problem here?

Regards,