A term or is an expression of the formal language of first order logic which serves to refer to an object from the domain of discourse. Terms are built up by applying function symbols to simpler terms. That is, the set of terms is the smallest set closed under the following two conditions:
- A name (or constant) is a term;
- If t1, ..., tn are terms, and f is an n-ary function symbol, then f(t1, ..., tn) is a term;
Since a name in formal logic is essentially a 0-ary function symbol, if we allow clause 2 of the above definition to include the case n = 0 then clause 1 is unnecessary, as it is covered by the limiting case of clause 2. It is given separately here for clarity, and because some logicians prefer to separate names from other function symbols.
- In arithmetic, the numerals '20' and '17' are terms, referring to the numbers 20 and 17 respectively. '+' is a binary function symbol representing the addition function, so '20+17' is a term which refers to the number 37.
- If 'a' is a name, and 'f' is a unary function symbol, then 'f(f(f(a)))' is a term.