This Page


Defines classes for parsing and compiling programs, which consist of a series of relation constraint declarations:

class ProgramSyntax(relations)[source]

Represents the abstract syntax of an entire program, which consists of a series of relation declarations.


Initializes a new program syntax structure with the given list of relation syntax objects.


Converts the program back into a raw string representation equivalent to its input text.


Compiles the entire program from its abstract syntax structure into a ProgramDeclaration.

Returns:the resulting program declaration.
Raises :a CompilationError if the program fails to statically check.
classmethod parse(text)[source]

Parses the given input text to produce a new ProgramSyntax object.

Returns:the newly created syntax structure for the entire program.
Raises :a ParsingError if the program contains any invalid syntax.