Syntax

Description of .cl- and .clq-Format:

(1) Knowledge bases in .cl-format:

Each .cl-file contains a signature and a knowledge base or a list of knowledge bases over that signature.
.cl-Syntax BNF:
  
<File> ::= <signature-part> <knowledge-base-part>
<signature-part> ::= "signature" <EOL> <variable-list>
<variable-list> ::= <variable> <EOL> | <variable> "," <variable-list>
<knowledge-base-part> ::= "conditionals" <EOL> <knowledge-base-list>
<knowledge-base-list> ::= <knowledge-base> | <knowledge-base> <EOL> <knowledge-base-list>
<knowledge-base> ::= <knowledge-base-name> "{" <EOL> <conditional-list> "}"
<conditional-list> ::= <conditional> | <conditional> "," <EOL> <conditional-list>
<conditional> ::= "(" <formula> "|" <formula> ")"
<formula> ::= <variable> 
                | "Top" 
                | "Bottom" 
                | "!"<formula>
                | <formula> "," <formula>
                | <formula> ";" <formula>
Variables are strings only containing letters (upper- and lower-case allowed).
For ease of reading and expressivity, a formula may be in parentheses "(...)".
If no parentheses is used the precedence is as follows:
1. ! (Negation)
2. , (Conjunction)
3. ; (Disjunction)
Comments are also allowed in the file, following the Java comment syntax, i.e. "//" introduces single-line comments and "/*...*/" introduces block comments.

(2) Conditionals in .clq-format:

The .clq-format is used for query files containing conditionals over a signature of a knowledge base.
Each .clq-file contains a list of conditionals using the same syntax as for .cl-files.
A knowledge base file together with a corresponding query file
<kb-file>.cl , <query-file>.clq
constitute a problem set.

The .clq-format is also used for files containing normal form conditionals (NFC) and canonical normal form conditionals (CNFC) over a generic signature {a,b}, {a,b,c}, etc.