Creating a function where the output is a sentence
"Prasan Samtani" <[email protected]> Fri, 20 Jul 2007 11:32:29 -0700
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <479348D61212AC4DB31C9906F8C7028D0289D11C@EXVBE012-5.exch012.intermedia.net> |
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