The thing is that the query window in the studio executes a slightly different query, something like (Query, \false; \true),
which has to do with the peculiarities of the Java interface.
The query window is used mostly to get the explanations. As an
query-answer interface to Ergo the query window is quite awkward.
For interactive queries you should use the studio listener or the ErgoAI shell command window
(what you called "XSB shell"; XSB shell is quite different: it
takes only Prolog commands).
--
--- michael
--
You received this message because you are subscribed to the Google Groups "ErgoAI and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-XSB-for...@coherentknowledge.com.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-XSB-forum/bc471733-2d1f-4b45-9118-01c53180482cn%40coherentknowledge.com.
@!{print_implementations(?Type)} !-
implementations(?Type, ?Classes),
?Class \in ?Classes,
writeln(?Class)@\io,
!.
should work for that particular query.
--
--- michael
I thought you wanted the query to give only one answer. Otherwise, why did you use once{...}?
If you want all classes to be printed then
@!{print_implementations3(?Type)} !-
implementations(?Type, ?Classes),
( ?Class \in ?Classes,
writeln(?Class)@\io,
\false
; \true
).
Note that you are trying to play with non-logical side effects (writing) here, so the solution is also not declarative, ie,
a fail-loop like in Prolog. This fail loop is not needed in order
to get the answers to the query itself (which is just yes/no
here).
--
--- michael