%----Version 3.1.1.13c (TPTP version.internal development number) %----Intended uses of the various parts of the TPTP syntax are explained %----in the TPTP technical manual, linked from www.tptp.org. %----See the entries regarding text that can be discarded before %----tokenizing for this syntax. %----White space is almost irrelevant, but, for the Prolog people, all tokens %----consisting of non-alphanumeric characters shuold be followed bya space. %----Files. Empty file is OK. ::= * ::= | | | %----Formula records ::= | | | %----Future languages may include ... english | efof | tfof | mathml | ... ::= fof(,,). ::= cnf(,,). ::= | , | ,, %----Types for problems. %----Note: The previous from ... %---- ::= - %----... is now gone. Parsers may choose to be tolerant of it for backwards %----compatibility. ::= :== axiom | hypothesis | definition | lemma | theorem | conjecture | lemma_conjecture | negated_conjecture | plain | unknown %----"axiom"s are accepted, without proof, as a basis for proving "conjecture"s %----and "lemma_conjecture"s in FOF problems. In CNF problems "axiom"s are %----accepted as part of the set whose satisfiability has to be established. %----There is no guarantee that the axioms of a problem are consistent. %----"hypothesis"s are assumed to be true for a particular problem, and are %----used like "axiom"s. %----"definition"s are used to define symbols, and are used like "axiom"s. %----"lemma"s and "theorem"s have been proven from the "axiom"s, can be used %----like "axiom"s, but are redundant wrt the "axiom"s. "lemma" is used as the %----role of proven "lemma_conjecture"s, and "theorem" is used as the role of %----proven "conjecture"s, in output. A problem containing a "lemma" or %----"theorem" that is not redundant wrt the "axiom"s is ill-formed. "theorem"s %----are more important than "lemma"s from the user perspective. %----"conjecture"s occur in only FOF problems, and are to all be proven from %----the "axiom"(-like) formulae. A problem is solved only when all %----"conjecture"s are proven. %----"lemma_conjecture"s are expected to be provable, and may be useful to %----prove, while proving "conjecture"s. %----"negated_conjecture"s ocuur in only CNF problems, and are formed from %----negation of a "conjecture" in a FOF to CNF conversion. %----"plain"s have no special user semantics, and can be used like "axiom"s. %----"unknown"s have unknown role, and this is an error situation. %----FOF formulae. All formulae must be closed. ::= | ::= | %----Only some binary connectives are associative %----There's no precedence amoung binary connectives ::= ::= <=> | => | <= | <~> | ~ | ~& %----Associative connectives & and | are in ::= | ::= * ::= ::= & * ::= & %---- are in ()s or do not have a at the %----top level. ::= | | () | ::= [] : ::= ! | ? %----! is universal quantification and ? is existential. Syntactically, the %----quantification is the left operand of :, and the is %----the right operand. Although : is a binary operator syntactically, it is %----not a , and thus a is a %----. %----Universal example: ! [X,Y] : ((p(X) & p(Y)) => q(X,Y)). %----Existential example: ? [X,Y] : (p(X) & p(Y)) & ~ q(X,Y). %----Quantifiers have higher precedence than binary connectives, so in %----the existential example the quantifier applies to only (p(X) & p(Y)). ::= | , %----Future variables may have sorts and existential counting %----Unary connectives bind more tightly than binary ::= ::= ~ %----CNF formulae (variables implicitly universally quantified) ::= () | ::= * ::= ::= | ~ %----Atoms ( is not used currently) ::= | | ::= %----A looks like a , but really we mean %---- ::= | () %---- ::= %---- ::= %----Using removes a reduce/reduce ambiguity in lex/yacc. ::= | , ::= $true | $false | = | != %----Some systems still interprete equal/2 as equality. The use of equal/2 %----for other purposes is therefore discouraged. Please refrain from either %----use. Use infix '=' for equality. Note: != is equivalent %----to ~ = %----More defined atoms may be added in the future. ::= %----s are used for evaluable predicates that are available %----in particular tools. The predicate names are not controlled by the %----TPTP syntax, so use with due care. The same is true for s. %----Terms ::= | ::= | | ::= | () ::= ::= %----s and s are always interpreted as themselves ::= | ::= | () ::= ::= ::= %----Formula sources ::= :== | | | unknown %----Only a can be a , i.e., derived formulae can be %----identified by a or an :== | :== inference(,, []) :== %----Examples are deduction | modus_tollens | modus_ponens | rewrite | % resolution | paramodulation | factorization | % cnf_conversion | cnf_refutation | ... :== | , :== :== theory() :== equality | ac %----More theory names may be added in the future. :== : | :== introduced() :== definition | axiom_of_choice | tautology %----This should be used to record the symbol being defined, or the function %----for the axiom of choice :== , | :== | | :== file(,) :== | unknown :== creator() :== :== , | %----File name and Useful Info fields ::= ::= :== [] | [] :== | , :== | | %----Useful info for formula records :== | :== description() :== iquote() %----Useful info for inference records :== | :== status() %----These are the status values from the SZS ontology :== tau | tac | eqv | thm | sat | cax | noc | csa | cth | ceq | unc | uns | sab | sam | sar | sap | csp | csr | csm | csb :== (,) :== refutation() %----Useful info for creators is just %----Include directives ::= include(). ::= | ,[] ::= | , %----General purpose ::= | ::= [] | [] ::= | () ::= | , %----The following are reserved s: unknown file inference creator ::= | ::= | ::= %----All numbers are implicitly distinct ::= | ::= | %------------------------------------------------------------------------------ %----Rules from here on down are for defining tokens (terminal symbols) %----of the grammar, assuming they will be recognized by a lexical scanner. %----Usual regexp notation is used mostly, as in grep, lex, awk, sed, etc. %----[ ] denotes a selection of ONE of the enclosed characters; e.g. %----[0-9] means one digit. Inside [ ], special meanings are disabled; %----e.g., [.] is a period whereas . is any character except a newline. %----[^abc] means any character EXCEPT a, b, or c. [\^] matches a caret. %----[\\] matches a backslash. See lex/flex documentation for details. %----For uniformity and safety, [ ] is placed around single characters even %----when not necessary. %----A ::- rule defines a token. %----A ::: rule defines a macro that is not a token. %----"..." means the definition is imprecise and manual coding is needed. %----"% $$" provides semantic information, and explains "...". ::: [0-9] ::: [a-z] ::: [A-Z] ::: (|||[_]) ::: (.|\n) ::: [$][$] ::- [|] ... % $$ token for is VLINE, conflicts with meta-symbol, hard-coded. ::- (|) ::- [+-] ::- * ::- [.]* ::- * ::- * ::- * %----System Comments are used for system specific annotation of anything. %----They look like comments (see next), so by default they are discarded. %----However, a wily user of the syntax can notice the $$ and store/extract %----information from the "comment". %----System specific annotations should begin $$, then identify the system, %----followed by a :, e.g., /* $$ Otter 3.3: Demodulator */ %----Comments. These may be retained for non-logical purposes. Comments %----can occur only between annotated formulae (see ), but %----it seems likely that people will put them elsewhere and simply %----strip them before tokenising. % $$ A string that matches both and should be % $$ recognized as . ::- | ::- | ::: [%][ ]*.* ::: [/][*][ ]*([^*]*[*][*]*[^/*])*[^*]*[*][*]*[/] % $$ Approximately, [/][*][ ]**[*][/] % $$ Correct regexp ends at FIRST [*][/] % $$ See comment for below. ::: [%].* ::: [/][*]([^*]*[*][*]*[^/*])*[^*]*[*][*]*[/] % $$ Approximately, [/][*]*[*][/] % $$ Correct regexp ends at FIRST [*][/] % $$ BEWARE: lex will end at the LAST [*][/] in the whole file if you let it. % $$ and must contain only "printing ASCII", % $$ which includes space, and consists of ASCII codes 40-126 decimal. ::- [']([^\\']|[\\][']|[\\][\\])*['] % $$ ['].*['] would be OK except for escape sequences. % $$ \ is used as the escape character for ' and \ in ; % $$ i.e., \' is backslash-quote and \\ is backslash-backslash. % $$ For input and output in TPTP syntax the \ is present. %----All s are implicitly unequal; ~("a" = "b"). ::- ["]([^\\"]|[\\]["]|[\\][\\])*["] % $$ ["].*["] would be OK except for escape sequences. % $$ \ is used as the escape character for " and \ in ; % $$ i.e., \" is backslash-quote and \\ is backslash-backslash. % $$ For input and output in TPTP syntax the \ is present. %------------------------------------------------------------------------------ %----If you are writing a new TPTP parser, you do not need to parse the old %----style TPTP formulae, i.e., ignore from here on down. %----Old style TPTP clauses and formulae ::= * ::= | | ::= input_formula(,,). ::= * ::= | | ::= input_clause(,,). %----Old style TPTP CNF ::= [] | [*] ::= , ::= ::= ++ | --