I'm not sure if flags is the appropriate term, but is there anyway to configure a swi-prolog program to not output true or false on the completion of a query, and instead simply print out another statement determined in the program?
相关问题
- Creating a SPARQL parameterized query using append
- Creating a SPARQL parameterized query using append
- How to join rules and print out outputs in prolog
- Splitting list and iterating in prolog
- Accumulating while in recursion/backtracking
相关文章
- What are the problems associated to Best First Sea
- How can I fix this circular predicate in Prolog?
- How to negate in Prolog
- Remove incorrect subsequent solutions without once
- prolog two lists are exactly the same
- Simplify Expressions in Prolog
- Check if any element's frequency is above a li
- Prolog — symetrical predicates
There is a facility for customising this kind of behaviour, but it can get quite involved. I have not played with it myself but looking at the manual and Prolog boot files might help you.
Prolog has a "top level", which is a bit of Prolog code that controls the Prolog command line and executes the goals entered on it. With SWI-Prolog, you can specify an alternative top level:
If you define
my_quiet_prolog/0
in a file loaded on startup, e.g. in your~/.plrc
file.The default top level is called
prolog/0
. The source for this, and other parts of the default Prolog environment can be found in/usr/lib/pl-5.6.36/boot
(on my Cygwin system; possibly different for you). Look attoplevel.pl
for the default top level. The messages 'Yes' and 'No' are also defined, inmessages.pl
.You could try to override the messages, or simply copy the top level and modify it to suite you.