4.10 Programs

A QuLog program comprises a sequence of:

  • type definitions,
  • type macros,
  • type declarations,
  • relation definitions,
  • action definitions, and
  • function definitions.

A TeleoR program additionally includes TeleoR procedures.

To start this section we briefly discuss types and given some simple examples of types. A more detailed discussion of types and modes is given in Types.

They may appear in any order except that all the rules for a particular relation, action or function must be contiguous. A type declaration for a relation, action, function or procedure does not need to be given immediately before its code. The rules of a TeleoR procedure are all included inside {...} braces following the procedure head.

An important constraint is that each type definition, type declaration, relation, action and function rule must begin at the left end of a new line. If one needs to be continued over more than one line all but the first line must be indented from the left end by at least one space or tab. Fullstop terminators may be given at the end of each definition, declaration or rule but is not needed. It is the text starting at the extreme left end of a line after one or more newlines that terminates the previous program statement.

TeleoR procedures must also begin at the left end of a line but inside the {...} there are more relaxed layout constraints. Each TeleoR rule can start anywhere on a new line. The parser can use the rule syntax to determine that it is the start of a new rule. Again fullstop terminators may be given at the end of each rule but are ignored.

We refer the reader to Listing of Builtin Types for examples of type definitions and declarations.


On This Site