Accessing instantiated variable in call predicate

Emanuele Bastianelli <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAMMJy4DJq45wk452ObSTFgkjTXWxi7f+UvaSAgcNDLpkW5F6sg@mail.gmail.com>
Hi to all,

i've just started using 'call' predicate, and i was wondering how i can
access the variable that are instantiated in the predicate that is passed
to the 'call' predicate as variable.
For example, this is my case. I've this predicate:

getAtom(Sent) :- s(LogicForm,Sent,[]), call(LogicForm).

Now, LogicForm indeed represent the logic form of the analyzed sentence.
Through the predicate 'call', I execute the query represented by the logic
form on my KB. Again, the logic form represent a predicate, as:

to(chair,A)

where A is the variable that will be instantiated with the value I need to
retrieve.
Then, how can i access that value starting from the getAtom predicate? All
that I can get is the instatiation of the variable LogicForm, as

LogicForm = to(chair, chair_1)

while* *I want to get just the chair_1 atom instance.

Thank you.
EB
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.