QuLog is a higher-order logic/functional/string processing language with an imperative rule language sitting on top, defining actions. QuLog's action rules are used to program multi-threaded communicating agent behaviour. Its declarative subset is used for the agent's belief store. The language is flexibly typed and allows a combination of compile time and run-time type checking.
It is a fully integrated in that function calls can appear as or inside arguments to relation calls, and relational queries can be used as guards of function rules. It has sets as a separate data type from lists with set <-> list convertors. Both can be created using Trm::Query comprehension expressions.
Sets are manipulated using union, intersection and difference operators. Lists are manipulated as in Prolog but also using non-deterministic pattern matching. Similar pattern matching is used for string processing as a precursor to DCG parsing. An 'in' primitive can be used to access elements of sets, lists and characters in strings.
QuLog supports type safe meta-level programming to complement its type safe higher order programming.
As mentioned above, using its action rules and action primitives multi-threaded message communicating agent applications can be created with the agents communicating using the companion Pedro publish/subscribe and destination addressed communications server. Such an agent application can also receive and send MQTT notifications routed via an MQTT publish/subscribe server.
Debugging is done by putting a watch on any number of relations, functions and actions. This invisibly transforms their code to display each call, the input and output bindings of the unification or match of the call with each rule that can be used, and optiionally the instantiated body of the rule before it is used. An unwatch command reverses the code transformation.
A tutorial introduction to the QuLog declarative subset is included in the tutorial sub-directory. A formal systax using extended BNF grammar rules is given in the file qulog_grammar.txt. An example QuLog program qlexamples.qlg is given in the examples/introduction directory.
Finally, the teleor extension allows program files to be consulted containing TeleoR procedures as well as QuLog rules. This extension includes a generic agent shell that can be launched to execute calls to TeleoR procedures as tasks. It can be configured by including specially named QuLog action procedures and relations in your program file, as explained in the toolsRM.pdf document in the tutorial directory.
To support use of TeleoR robotic agent programs with robots and simulations that use ROS, there is an example Python program in the ROS directory that will act as an interface between our Pedro inter-agent and inter-process communications server and an invocation of ROS. This program and information on how to modify it for a particular ROS architecture, are in the examples/ROS directory of the QuLog distrbution.
QuLog has some predefined constructor types. These usually have a name such as write_type__ and there constructors and atom values often end with underscore, for example the constructor q_ and the atom nl_ of the write_type__ system type. We recommend you do not use a trailing underscore in any of your own type definitions.
Table of Contents | Overview of QuLog | Getting Started | Syntax | Built-ins | Standard Operators | Index |