Annotated Formulae

The TPTP contains problems in first-order (FOF) and clause normal form (CNF), monomorphic and polymorphic typed first-order form (TFF, which includes the extended first-order form (TXF)), monomorphic and polymorphic typed higher-order form (THF), dependently typed monomorphic and polymorphic typed higher-order form (DHF), and non-classical typed first-order (NXF) and higher-order (NHF) forms. Interpreted arithmetic types and symbols are supported in all the typed logics.

TPTP problems and TSTP solutions are built from annotated formulae of the form

    language(name,role,formula,source,useful_info).

The languages supported are cnf, fof, tff, and thf.

The role gives the user semantics of the formula, one of axiom, hypothesis, definition, assumption, lemma, theorem, corollary, conjecture, negated_conjecture, plain, type, interpretation, logic, and unknown.

The useful_info field of an annotated formula is optional, and if it is not used then the source field becomes optional. The source field is used to record where the annotated formula came from, and is most commonly a file record or an inference record. A file record stores the name of the file from which the annotated formula was read, and optionally the name of the annotated formula as it occurs in that file - this might be different from the name of the annotated formula itself, e.g., if an ATP systems reads an annotated formula, renames it, and then prints it out. An inference record stores information about an inferred formula. The useful_info field of an annotated formula is a list of arbitrary useful information formatted as Prolog terms, as required for user applications.

Logical Formulae
In a formula, terms and atoms follow Prolog conventions - functions and predicates start with a lowercase letter or are 'single quoted', and variables start with an uppercase letter. Symbols may be overloaded with different arity signatures, and are treated as different symbols. The language also supports interpreted symbols that are either defined symbols that start with a $, or are composed of non-alphabetic characters. Defined symbols come in two varieties: TPTP defined predicates and functors, whose interpretation is specified by the TPTP language, and system defined predicates and functors, whose interpretation is ATP system specific. The defined predicates and functors recognized so far are listed below.

The logical connectives in the classical TPTP languages are !>, ?*, @+, @-, ^, !, ?, @, ~, |, &, =>, <=, <=>, and <~>, for Pi, Sigma, choice (indefinite description), definite description, lambda abstraction, universal quantification, existential quantification, function application, negation, disjunction, conjunction, implication, reverse implication, equivalence, and non-equivalence (XOR). Equality and inequality are expressed as the infix predicates = and !=. Quantified formulae are written in the form
    Quantifier [Variables] :  Formula
In all except the CNF language, every variable in a Formula must be bound by a preceding quantification with adequate scope. Negation has higher precedence than quantification, which in turn has higher precedence than the binary connectives. No precedence is specified between the binary connectives; brackets are used to ensure the correct association. See the section on non-classical logics for information about the non-classical connectives.

Types
The typed languages (TFF, TXF, THF, DHF, NXF, NHF) support types and type declarations (all the details are in the section on
types and type declarations). Symbols are declared before their use, with type signatures that specify the types of their arguments and result. Two TPTP defined types are available, $i for individuals, and $o for booleans. User defined types can be introduced as being of the "type" $tType. In the first-order languages, a signature of the form (t1 * ... * tn) > r is the type of an n-ary symbol, where the i-th argument is of type ti and the result type is r. If r is $o then the symbol is a predicate. Variables are given their type by a :type suffix. Equality is ad hoc polymorphic over all types. A useful feature of TFF is default typing for symbols that are not explicitly declared: predicates default to ($i,...,$i) > $o, and functions default to ($i,...,$i) > $i. This allows TFF to effectively degenerate to untyped FOF. The typed extended first-order form (TXF) augments TFF with FOOL constructs: formulae of type $o as terms; variables of type $o as formulae; tuples; conditional (if-then-else) expressions; and let (let-defn-in) expressions. The typed higher-order form (THF) includes type declarations in curried form, lambda-terms with a binder symbol ^ for lambda, explicit application with @, and quantification over variables of any type. A curried type signature has the form t1 > ... > tn > r. THF does not admit default typing - all symbol types must be declared before use. The polymorphic languages use a !> to quantify over types, producing types signatures of the form !> [T:$tType] : (t1 * ... * tn) > r and !> [T:$tType] : t1 > ... > tn > r. where any ti or r can be the type T. When using polymorphic symbols the concrete type(s) must be provided as the first arguments in the use.

Defined Symbols
The defined symbols are:

Conditional and Let Expressions
The THF and TXF languages have conditional and let expressions.

Examples
An example CNF problem is PUZ003-1. An example FOF problem is PUZ001+1. An example TFF problem is PUZ031_1. An example TXF problem is PUZ081_8. An example THF problem is PUZ081^1. An example DHF problem is DAT346^1. An example NXF problem is PUZ001_10. An example NHF problem is PHI003^8.