Re: Creating a function where the output is asentence

"Prasan Samtani" <[email protected]> Fri, 20 Jul 2007 12:06:25 -0700
Newsgroups gmane.comp.ai.powerloom
Message-ID <479348D61212AC4DB31C9906F8C7028D0289D14C@EXVBE012-5.exch012.intermedia.net>
I think I've figured it out...

(defrelation sp-statement-info ((?s sp-statement) (?i PROPOSITION)))	
...
(assert (sp-statement-info sk1 (car-color car1 green)))
...
(retrieve (sp-statement-info sk1 ?i))

|= (retrieve (sp-statement-info sk1 ?i))
There is 1 solution so far:
  #1: ?I=(= (CAR-COLOR CAR1) GREEN)

Sorry for the needless posts..

--Prasan

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Prasan Samtani
Sent: Friday, July 20, 2007 11:39 AM
To: [email protected]
Subject: Re: [PowerLoom Forum] Creating a function where the output is
asentence

I just realized I made a horrible mistake, the relation name is
car-color, not color. But the question still applies, except the error
now says that there are too many arguments in the proposition.

-----Original Message-----
From: Prasan Samtani 
Sent: Friday, July 20, 2007 11:32 AM
To: [email protected]
Subject: Creating a function where the output is a sentence

I'm trying to create a function that has a sentence as its output value,
but I keep running into an error that says I have a relation in a
function position. The relevant code is posted below, and the error and
specific question follows it.

------------------------------------------------------------
;; Taxonomy of speech acts
(defconcept speech-act)
	(defconcept sp-statement ((?s speech-act)))
		(defconcept stmt-assert ((?s sp-statement)))
		(defconcept stmt-reassert ((?s sp-statement)))
		(defconcept stmt-other ((?s sp-statement)))
...

;; A statement speech-act contains arbitrary information
;; I'm assuming there's something wrong with the below statement?
(deffunction sp-statement-info ((?s sp-statement)) :-> (?i SENTENCE))
...

(defconcept color)
(defconcept car)
(deffunction car-color ((?a car)) :-> (?c color))
(assert (and 	(color red)
				(color yellow)
				(color green)
				(car car1)))

(assert (and	(stmt-assert sk1)
				(act-speaker sk1 player)
				(act-ratified-receiver sk1 Pierre)
				(act-receiver sk1 John)))

;; Throws an error at this statement
(assert (sp-statement-info sk1 (color car1 green)))		
------------------------------------------------------------

The error I get is:
|= (assert (sp-statement-info sk1 (color car1 green)))
ERROR: Relation `COLOR' found in function position..
   Error occurred while parsing the proposition:
   (SP-STATEMENT-INFO @SK1 (COLOR @CAR1 @GREEN))

How would I go about creating a function that has an arbitrary sentence
as its output?

Thanks,
Prasan

_______________________________________________
powerloom-forum mailing list
[email protected]
http://mailman.isi.edu/mailman/listinfo/powerloom-forum