%----v7.2.0.1 (TPTP version.internal development number) %----Added semantic rules for %------------------------------------------------------------------------------ %----README ... this header provides important meta- and usage information %---- %----Intended uses of the various parts of the TPTP syntax are explained %----in the TPTP technical manual, linked from tptp.org. %---- %----Four kinds of separators are used, to indicate different types of rules: %---- ::= is used for regular grammar rules, for syntactic parsing. %---- :== is used for semantic grammar rules. These define specific values %---- that make semantic sense when more general syntactic rules apply. %---- ::- is used for rules that produce tokens. %---- ::: is used for rules that define character classes used in the %---- construction of tokens. %---- %----White space may occur between any two tokens. White space is not specified %----in the grammar, but there are some restrictions to ensure that the grammar %----is compatible with standard Prolog: a should be readable with %----read/1. %---- %----The syntax of comments is defined by the rule. Comments may %----occur between any two tokens, but do not act as white space. Comments %----will normally be discarded at the lexical level, but may be processed %----by systems that understand them (e.g., if the system comment convention %----is followed). %---- %----Multiple languages are defined. Depending on your need, you can implement %----just the one(s) you need. The common rules for atoms, terms, etc, come %----after the definitions of the languages, and mostly all needed for all the %----languages. %------------------------------------------------------------------------------ %----Files. Empty file is OK. ::= * ::= | %----Formula records ::= | | | | | %----Future languages may include ... english | efof | tfof | mathml | ... ::= tpi(,,). ::= ::= thf(,, ). ::= tff(,, ). ::= tcf(,, ). ::= fof(,, ). ::= cnf(,, ). ::= , | %----In derivations the annotated formulae names must be unique, so that %----parent references (see ) are unambiguous. %----Types for problems. %----Note: The previous from ... %---- ::= - %----... is now gone. Parsers may choose to be tolerant of it for backwards %----compatibility. ::= :== axiom | hypothesis | definition | assumption | lemma | theorem | corollary | conjecture | negated_conjecture | plain | type | fi_domain | fi_functors | fi_predicates | unknown %----"axiom"s are accepted, without proof. 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 intended to define symbols. They are either universally %----quantified equations, or universally quantified equivalences with an %----atomic lefthand side. They can be treated like "axiom"s. %----"assumption"s can be used like axioms, but must be discharged before a %----derivation is complete. %----"lemma"s and "theorem"s have been proven from the "axiom"s. They can be %----used like "axiom"s in problems, and a problem containing a non-redundant %----"lemma" or theorem" is ill-formed. They can also appear in derivations. %----"theorem"s are more important than "lemma"s from the user perspective. %----"conjecture"s are to be proven from the "axiom"(-like) formulae. A problem %----is solved only when all "conjecture"s are proven. %----"negated_conjecture"s are formed from negation of a "conjecture" (usually %----in a FOF to CNF conversion). %----"plain"s have no specified user semantics. %----"fi_domain", "fi_functors", and "fi_predicates" are used to record the %----domain, interpretation of functors, and interpretation of predicates, for %----a finite interpretation. %----"type" defines the type globally for one symbol; treat as $true. %----"unknown"s have unknown role, and this is an error situation. %------------------------------------------------------------------------------ %----THF formulae. ::= | | | ::= | | | ::= | | %----There's no precedence among binary connectives ::= ::= | | ::= | ::= & | & %----@ (denoting apply) is left-associative and lambda is right-associative. %----^ [X] : ^ [Y] : f @ g (where f is a and g is a %----) should be parsed as: (^ [X] : (^ [Y] : f)) @ g. %----That is, g is not in the scope of either lambda. ::= @ | @ ::= | | ::= | ::= | | | () %----All variables must be quantified ::= ::= [] : ::= | , ::= : ::= | ::= ::= ::= | | | ::= | %----Tuples can't be formulae. See TFF. FIX HERE. ::= | | | () | ::= %----Defined terms can't be formulae. See TFF. FIX HERE. ::= %----Allows first-order style in THF. ::= () | () | () ::= $ite(,, ) ::= $let(,,) ::= | [] ::= | , ::= | [] ::= ::= | , ::= | | () ::= [] | [] ::= | , ::= | | | %----Note that syntactically this allows (p @ =), but for = the first %----argument must be known to infer the type of =, so that's not %----allowed, i.e., only (= @ p). %----Arguments recurse back up to formulae (this is the THF world here) ::= %---- appears after ":", where a type is being specified %----for a term or variable. includes , %----so the syntax is very loose, but trying to be more specific about %----s (ala the semantic rule) leads to reduce/reduce %----conflicts. ::= : | () ::= | | %----Removed along with adding to , for %----TH1 polymorphic types with binary after quantification. %---- | () ::= :== | :== | | | | ( ) :== !> [] : ::= ::= | | %----Mapping is right-associative: o > o > o means o > (o > o). ::= | %----Xproduct is left-associative: o * o * o means (o * o) * o. Xproduct %----can be replaced by tuple types. ::= | %----Union is left-associative: o + o + o means (o + o) + o. ::= | %----Tuple types, e.g., [a,b,c], are allowed (by the loose syntax) as tuples. ::= ::= | () %----New material for modal logic semantics, not integrated yet :== :== | | :== $constants | $quantification | $consequence | $modalities %----The $constants, $quantification, and $consequence apply to all of the %----$modalities. Each of these may be specified only once, but not necessarily %----all in a single annotated formula. :== | :== :== $rigid | $flexible | $constant | $varying | $cumulative | $decreasing | $local | $global | $modal_system_K | $modal_system_T | $modal_system_D | $modal_system_S4 | $modal_system_S5 | $modal_axiom_K | $modal_axiom_T | $modal_axiom_B | $modal_axiom_D | $modal_axiom_4 | $modal_axiom_5 %------------------------------------------------------------------------------ %----TFF formulae. ::= | | | ::= | | | %---- up here to avoid confusion in a = b | p, for TFX. %----For plain TFF it can be in ::= | ::= ::= | ::= | ::= & | & ::= | | ::= | ::= | | | () ::= ::= [] : %----Quantified formulae bind tightly, so cannot include infix formulae ::= | , ::= | ::= : ::= | %FOR PLAIN TFF ::= ::= %FOR PLAIN TFF ::= ::= | | ::= | () :== | () ::= %---To avoid confusion in TFX mode a = b | p | ::= | () | | :== | () | | %----This is the only one that is strictly a formula, type $o ::= ::= | () :== | () ::= $ite(,,) ::= $let(,,) ::= | [] ::= | , ::= | [] ::= ::= | ::= | , ::= | | ::= | | | | () ::= [] | [] ::= | , %---- can appear only at top level. ::= : | () ::= | | | () ::= !> [] : ::= | () ::= | () ::= | | () | | ::= | , ::= ::= | %----For TFX only ::= [] ::= | , ::= ::= | () %------------------------------------------------------------------------------ %----TCF formulae. ::= | ::= | ::= ! [] : %------------------------------------------------------------------------------ %----FOF formulae. ::= | ::= | | %----Future answer variable ideas | ::= | %----Only some binary connectives are associative %----There's no precedence among binary connectives ::= %----Associative connectives & and | are in ::= | ::= | ::= & | & ::= | %---- != is equivalent to ~ = ::= %---- are in ()s or do not have a connective ::= | ::= | | () %----All variables must be quantified ::= [] : ::= | , ::= | | ::= :== | () ::= | ::= :== | () ::= %----System terms have system specific interpretations ::= %----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. Same for s. %----FOF terms. ::= | () %----Defined terms have TPTP specific interpretations ::= | ::= %----None yet | %----None yet ::= %----None yet ::= ::= | () %----System terms have system specific interpretations ::= | () %----Arguments recurse back to terms (this is the FOF world here) ::= | , %----These are terms used as arguments. Not the entry point for terms because %---- is also used as . The %----is used in , which is also used as %----. ::= | ::= | | %------------------------------------------------------------------------------ %----This section is the FOFX syntax. Not yet in use. ::= | () ::= {} | {} ::= | , %------------------------------------------------------------------------------ %----CNF formulae (variables implicitly universally quantified) ::= | () ::= | ::= | ~ | %------------------------------------------------------------------------------ %----Connectives - THF ::= | | %----TH0 quantifiers are also available in TH1 ::= !> | ?* ::= ^ | @+ | @- ::= | ::= !! | ?? | @@+ | @@- | @= %----Connectives - THF and TFF ::= << %----Connectives - TFF %----Connectives - FOF ::= ! | ? ::= <=> | => | <= | <~> | ~ | ~& ::= | & ::= ~ %----The seqent arrow ::= --> ::= := %----Types for THF and TFF ::= ::= ::= :== $oType | $o | $iType | $i | $tType | $real | $rat | $int %----$oType/$o is the Boolean type, i.e., the type of $true and $false. %----$iType/$i is non-empty type of individuals, which may be finite or %----infinite. $tType is the type of all types. $real is the type of s. %----$rat is the type of s. $int is the type of s %----and s. :== %----For all language types ::= | ::= | :== :== :== :== $true | $false :== :== $distinct | $less | $lesseq | $greater | $greatereq | $is_int | $is_rat | $box_P | $box_i | $box_int | $box | $dia_P | $dia_i | $dia_int | $dia %----$distinct means that each of it's constant arguments are pairwise !=. It %----is part of the TFF syntax. It can be used only as a fact in an axiom (not %----a conjecture), and not under any connective. ::= :== :== ::= = ::= != ::= ::= ::= ::= ::= ::= :== $uminus | $sum | $difference | $product | $quotient | $quotient_e | $quotient_t | $quotient_f | $remainder_e | $remainder_t | $remainder_f | $floor | $ceiling | $truncate | $round | $to_int | $to_rat | $to_real ::= | ::= %------------------------------------------------------------------------------ %----Formula sources ::= :== | | | unknown | [] %----Alternative sources are recorded like this, thus allowing representation %----of alternative derivations with shared parts. :== | , %----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 | ... %---- can be empty in cases when there is a justification %----for a tautologous theorem. In case when a tautology is introduced as %----a leaf, e.g., for splitting, then use an . :== [] | [] :== | , :== :== : | :== introduced() :== definition | axiom_of_choice | tautology | assumption %----This should be used to record the symbol being defined, or the function %----for the axiom of choice :== | | :== file() :== , | :== theory() :== equality | ac %----More theory names may be added in the future. The is %----used to store, e.g., which axioms of equality have been implicitly used, %----e.g., theory(equality,[rst]). Standard format still to be decided. :== creator() :== %----Useful info fields ::= , | ::= :== [] | [] :== | , :== | | %----Useful info for formula records :== | :== description() :== iquote() %----s are used for recording exactly what the system output about %----the inference step. In the future it is planned to encode this information %----in standardized forms as in each . %----Useful info for inference records :== | | | :== status() | %----These are the success status values from the SZS ontology. The most %----commonly used values are: %---- thm - Every model of the parent formulae is a model of the inferred %---- formula. Regular logical consequences. %---- cth - Every model of the parent formulae is a model of the negation of %---- the inferred formula. Used for negation of conjectures in FOF to %---- CNF conversion. %---- esa - There exists a model of the parent formulae iff there exists a %---- model of the inferred formula. Used for Skolemization steps. %----For the full hierarchy see the SZSOntology file distributed with the TPTP. :== suc | unp | sap | esa | sat | fsa | thm | eqv | tac | wec | eth | tau | wtc | wth | cax | sca | tca | wca | cup | csp | ecs | csa | cth | ceq | unc | wcc | ect | fun | uns | wuc | wct | scc | uca | noc %---- is used to record standard information associated with an %----arbitrary inference rule. The is the same as the %---- of the . The indicates %----the information being recorded in the . The %----are (loosely) set by TPTP conventions, and include esplit, sr_split, and %----discharge. :== (,) %----An lists the names of assumptions upon which this %----inferred formula depends. These must be discharged in a completed proof. :== assumptions([]) %----A record names a file in which the inference recorded here %----is recorded as a proof by refutation. :== refutation() %----A provides information about a newly introduced symbol. :== new_symbols(,[]) :== | , %----Principal symbols are predicates, functions, variables :== | %----Include directives ::= include(). ::= ,[] | ::= | , %----Non-logical data ::= | : | ::= | | | | | ::= () %----A bind() term is used to record a variable binding in an %----inference, as an element of the list. :== bind(,) ::= $thf() | $tff() | $fof() | $cnf() | $fot() ::= [] | [] ::= | , %----General purpose ::= | %----Integer names are expected to be unsigned ::= | %---- tokens do not include their outer quotes, therefore the %---- cat and the 'cat' %----are the same. Quotes must be removed from a %----if doing so produces a . Note that s %----and s are not s, so '123' and 123, and 'X' and X, %----are different. ::= ::= ::= | | %----Numbers are always interpreted as themselves, and are thus implicitly %----distinct if they have different values, e.g., 1 != 2 is an implicit axiom. %----All numbers are base 10 at the moment. ::= ::= %------------------------------------------------------------------------------ %----Rules from here on down are for defining tokens (terminal symbols) of the %----grammar, assuming they will be recognized by a lexical scanner. %----A ::- rule defines a token, a ::: rule defines a macro that is not a %----token. Usual regexp notation is used. Single characters are always placed %----in []s to disable any special meanings (for uniformity this is done to %----all characters, not only those with special meanings). %----These are tokens that appear in the syntax rules above. No rules %----defined here because they appear explicitly in the syntax rules, %----except that , , denote "|", "*", "+", respectively. %----Keywords: fof cnf thf tff include %----Punctuation: ( ) , . [ ] : %----Operators: ! ? ~ & | <=> => <= <~> ~| ~& * + %----Predicates: = != $true $false %----For lex/yacc there cannot be spaces on either side of the | here ::- | ::- [%]* ::: [/][*][*][*]*[/] ::: ([^*]*[*][*]*[^/*])*[^*]* %----Defined comments are a convention used for annotations that are used as %----additional input for systems. They look like comments, but start with %$ %----or /*$. A wily user of the syntax can notice the $ and extract information %----from the "comment" and pass that on as input to the system. They are %----analogous to pragmas in programming languages. To extract these separately %----from regular comments, the rules are: %---- ::- | %---- ::: [%]* %---- ::: [/][*][*][*]*[/] %----A string that matches both and should be %----recognized as , so put these before . %----Defined comments that are in use include: %---- TO BE ANNOUNCED %----System comments are a convention used for annotations that may used as %----additional input to a specific system. They look like comments, but start %----with %$$ or /*$$. A wily user of the syntax can notice the $$ and extract %----information from the "comment" and pass that on as input to the system. %----The specific system for which the information is intended should be %----identified after the $$, e.g., /*$$Otter 3.3: Demodulator */ %----To extract these separately from regular comments, the rules are: %---- ::- | %---- ::: [%]* %---- ::: [/][*][*][*]*[/] %----A string that matches both and should %----be recognized as , so put these before . ::- * %----s contain visible characters. \ is the escape character for %----' and \, i.e., \' is not the end of the . %----The token does not include the outer quotes, e.g., 'cat' and cat are the %----same. See for information about stripping the quotes. ::- * %---Space and visible characters upto ~, except " and \ %----s contain visible characters. \ is the escape character %----for " and \, i.e., \" is not the end of the . %----s are different from (but may be equal to) other tokens, %----e.g., "cat" is different from 'cat' and cat. Distinct objects are always %----interpreted as themselves, so if they are different they are unequal, %----e.g., "Apple" != "Microsoft" is implicit. ::- ::- ::- * ::- * %----Tokens used in syntax, and cannot be character classes ::- [|] ::- [*] ::- [+] ::- [>] ::- [<] %----Numbers. Signs are made part of the same token here. ::- (|) ::- ::- (|) ::- (|) ::- ::- ::- (|) ::- ::- ::- (|) ::- * ::- (|) ::- ::- * ::- (|) ::- ::- * %----Character classes ::: [%] ::: ["] ::: ([\40-\41\43-\133\135-\176]|[\\]["\\]) ::: ['] %---Space and visible characters upto ~, except ' and \ ::: ([\40-\46\50-\133\135-\176]|[\\]['\\]) ::: [+-] ::: [.] ::: [Ee] ::: [/] ::: [0] ::: [1-9] ::: [0-9] ::: [a-z] ::: [A-Z] ::: (|||[_]) ::: [$] ::: . %---- is any printable ASCII character, codes 32 (space) to 126 %----(tilde). does not include tabs, newlines, bells, etc. The %----use of . does not not exclude tab, so this is a bit loose. ::: [.\n] %------------------------------------------------------------------------------