Qu-Prolog Home Page
Qu-Prolog is an extended Prolog designed primarily as a prototyping
language and tactic language for interactive theorem provers. It is the
implementation language for the Ergo
Qu-Prolog provides support for symbolic computation on notations
which appear in mathematics and in specification languages such as Z.
Highlights include support for arbitrary quantifiers with parallel
bindings and optional typing information, and support for higher-order
notations such as function-valued expressions. The unification
algorithm is correspondingly extended to support these features.
Qu-Prolog is multi-threaded and provided high-level communication
between threads, processes and machines.Together, these features
a simple, yet powerful mechanism for agent programming.
Distinctive features of Qu-Prolog include:
- a separate type of Prolog variable to represent object-level
- support for quantified terms;
- notations for substitution application;
- an implicit parameter mechanism --- a modal logic programming
capability whose practical effect is to provide a form of backtrackable
- support for efficient higher-order programming;
- support for logic programming of interactive applications by
enabling query processing to extend across multiple queries
as variants of read and write that provide access to Prolog variables
across multiple input and output events);
- management of goal delays;
- multiple threads;
- high-level symbolic communication between threads, processes and
machines in a uniform way;
- a heap garbage collector;
- a dynamic database garbage collector; and
- indexing on the dynamic database.
Assuming all and lambda has been declared as a
quantifier (e.g. op(500, quant, all)) and x and y
have been declared as object variable prefixes (e.g. obvar_prefix([x,y])
) then the following are valid Qu-Prolog terms.
- all x A - a quantified term whose quantifier is
whose bound variable is x, and whose body is A .
- all x:nats A - same as above but with a term attached to
the bound variable - typically used to add types.
- all [x:nats, y:nats] A - same as above but with a
parallel binding for two object variables.
- !!integral(A,B) x f(x) - a quantified term whose
quantifer is not a declared atom (the !! is a quantifier
- [A/x, B/y]C - a substitution term - all free
occurrences of x and y in C are
respectively replaced by A and B.
- (lambda x A)(B) - a compound term whose functor is a
- F(A) - a compound term whose functor is a variable.
Any goal can be delayed using delay_until/2 and Qu-Prolog can
generate both unification delays and not-free-in delays during
unification. Users can access the delays with get_delays/1.
A thread is created with the goal thread_fork(ThreadID, ThreadGoal)
that starts executing the goal ThreadGoal in a new
named ThreadID. Threads are controlled with calls to
predicates such as thread_yield, thread_sleep, thread_wait_on_goal
Qu-Prolog uses the Pedro subscription/notification server for interprocess communication. Qu-Prolog threads can
subscribe to messages of a particular pattern and send notifications.
Pedro also provides peer-to-peer messages and so
Qu-Prolog threads can communicate using symbolic addresses that are similar
to email addresses. The following are examples of the use of symbolic
There is also a message_choice predicate that provides
powerful message buffer searching.
- Term ->> ThreadID - sends Term to the
thread named ThreadID on the same process.
- Term ->> ThreadID:ProcessName - same as
above but sent to a thread on the named process.
- Term ->> ThreadID:ProcessName@MachineAddress
- same as above but sent to the given machine.
- Term <<- Address - read the next message from the
- Term <<= Address - search the message buffer for a
message that unifies with Term and whose address unifies with
Qu-Prolog is provided free for any non-comercial use and runs on Unix
and Linux machines. The release comes with the above manuals and
New Release: Qu-Prolog 9.6 Date:12/05/15
- Added better support for writing strings
Download Qu-Prolog 9.6: Qu-Prolog 9.6
Release: Qu-Prolog 9.5 Date:13/10/14
- Minor modifications and bug fixes.
Download Qu-Prolog 9.5: Qu-Prolog 9.5
Release: Qu-Prolog 9.1 Date:23/08/11
- Slight modification to better support Pedro 1.9 for communications.
Download Qu-Prolog 9.1: Qu-Prolog 9.1
Download Qu-Prolog for Windows installer: QuProlog9.1_setup.exe
Release: Qu-Prolog 9.0 Date:14/07/11
- Qu-Prolog ported to Windows (at last!)
- Bug fixes + minor improvements
Download Qu-Prolog 9.0: Qu-Prolog 9.0
Download Qu-Prolog for Windows installer: QuProlog_setup.exe
Release: Qu-Prolog 8.12 Date:24/11/10
Thanks again to Paulo Moura for various suggestions and bug reports.
- Added timers - see create_timer in manual.
- Added gettimeofday - get time as a float.
- Added absolute_file_name - file expansion.
- Compiler can now cope with spaces in filename.
- Command line editing/history/completion added (using rlwrap).
- Bug fixes + minor improvements
Download Qu-Prolog 8.12: Qu-Prolog
Release: Qu-Prolog 8.11 Date:18/06/10
NOTE:Qu-Prolog 8.11 requires Pedro 1.5 or greater for communications because of the change of connection protocol.
Thanks to Paulo Moura for various suggestions and bug reports.
- Added two different timers to thread_wait_on_goal. One will cause the call to fail after a given timeout if it hasn't already succeeded. The other rechecks the goal at least as often as the specified timeout.
- Changed protocol for Pedro connections in order to better determine machine names in a variety of network setups.
- improving ISO compatibility
- bug fixes
Download Qu-Prolog 8.11: Qu-Prolog
Release: Qu-Prolog 8.10 Date:01/12/09
(Thanks to Rhys Weatherley for suggestions for the 64 bit port and
to Ulrich Neumerkel for help with setup_call_cleanup and other suggestions.)
- Port to 64bit
- setup_call_cleanup added
- bug fixes
Download Qu-Prolog 8.10: Qu-Prolog
Release: Qu-Prolog 8.9
- Minor improvements in efficiency
- CHR (Constraint Handling Rules) added
Download Qu-Prolog 8.9: Qu-Prolog
Release: Qu-Prolog 8.8
- Improved efficiency for object trail
- ip_array_get_entries added
Download Qu-Prolog 8.8: Qu-Prolog
Release: Qu-Prolog 8.7
Download Qu-Prolog 8.7: Qu-Prolog
Release: Qu-Prolog 8.6
- Fix make clean
- Fix string escape bug
Download Qu-Prolog 8.6: Qu-Prolog
Release: Qu-Prolog 8.5
- Uses new pedro connection protocol - needs at least pedro-0.8
- More efficient lookup of IP address and machine name.
Download Qu-Prolog 8.5: Qu-Prolog
Release: Qu-Prolog 8.3
Download Qu-Prolog 8.3: Qu-Prolog
Release: Qu-Prolog 8.2
- bug fix in message_choice
Download Qu-Prolog 8.2: Qu-Prolog
Release: Qu-Prolog 8.1
- -g initial-goal option added to the interpreter - initial-goal
is executed before the interpreter starts.
Download Qu-Prolog 8.1: Qu-Prolog
Release: Qu-Prolog 8.0
- Elvin and ICM communication has been replaced by Pedro communication.
Download Qu-Prolog 8.0: Qu-Prolog
Release: Qu-Prolog 7.4
Download Qu-Prolog 7.4: Qu-Prolog
Release: Qu-Prolog 7.2
- Bugs fixed.
- icm_connected and icm_ping added
Download Qu-Prolog 7.2: Qu-Prolog
Release: Qu-Prolog 7.1
- Bugs for MACOSX users fixed.
- Hash table added.
Download Qu-Prolog 7.1: Qu-Prolog
Release: Qu-Prolog 7.0
- Floating point numbers added (finally!).
- Extension to thread_wait_on_goal to allow waits on specific predicates
Download Qu-Prolog 7.0: Qu-Prolog
Release: Qu-Prolog 6.7
- The use of Qu-Prolog terms in Elvin subscriptions added.
- Some minor problems fixed
Download Qu-Prolog 6.7: Qu-Prolog
Release: Qu-Prolog 6.5
- QT GUI added - provides GUI support for MacOSX users (and an alternative
for Linux users).
- Some minor problems with make files fixed
Download Qu-Prolog 6.5: Qu-Prolog
Release: Qu-Prolog 6.4
(Thanks to Paulo Moura for suggestions and bug reports.)
- Elvin discovery added
- increased compatibility with ISO standard
- predicates declared as dynamic that appear in a file being
compiled are compiled as dymamic predicates rather than producing an
- some bug fixes
Download Qu-Prolog 6.4: Qu-Prolog
Release: Qu-Prolog 6.3
Download Qu-Prolog 6.3: Qu-Prolog 6.3
- Elvin subscription/notification communication added.
Release: Qu-Prolog 6.2
Apart from the modified Tcl/Tk interpreter, Qu-Prolog 6.2 will run on
MacOSX - see the INSTALL file for details.
- better use of C++ standard classes - now compiles under gcc 3
- simplified thread scheduler and thread blocking management.
- reworking of message classes - by providing a message base class
we are now better able to support other communication models
Download Qu-Prolog 6.2: Qu-Prolog 6.2
For more information about Qu-Prolog, contact the Peter Robinson at:
Feedback on any aspect is also welcome.