2.1.3: Terms and Formulas
Once a first-order language \(\Lang L\) is given, we can define expressions built up from the basic vocabulary of \(\Lang L\) . These include in particular terms and formulas .
The set of terms \(\Trm[L]\) of \(\Lang L\) is defined inductively by:
- Every variable is a term.
- Every constant symbol of \(\Lang L\) is a term.
- If \(f\) is an \(n\) -place function symbol and \(t_1\) , …, \(t_n\) are terms, then \(\Atom{f}{t_1, \ldots, t_n}\) is a term.
- Nothing else is a term.
A term containing no variables is a closed term .
The constant symbols appear in our specification of the language and the terms as a separate category of symbols, but they could instead have been included as zero-place function symbols. We could then do without the second clause in the definition of terms. We just have to understand \(\Atom{f}{t_1, \ldots, t_n}\) as just \(f\) by itself if \(n = 0\) .
The set of formulas \(\Frm[L]\) of the language \(\Lang L\) is defined inductively as follows:
- \(\lfalse\) is an atomic formula.
- If \(R\) is an \(n\) -place predicate symbol of \(\Lang L\) and \(t_1\) , …, \(t_n\) are terms of \(\Lang L\) , then \(\Atom{R}{t_1,\ldots, t_n}\) is an atomic formula.
- If \(t_1\) and \(t_2\) are terms of \(\Lang L\) , then \(\Atom{\eq[][]}{t_1, t_2}\) is an atomic formula.
- If \(A\) is a formula, then \(\lnot A\) is formula.
- If \(A\) and \(B\) are formulas, then \((A \land B)\) is a formula.
- If \(A\) and \(B\) are formulas, then \((A \lor B)\) is a formula.
- If \(A\) and \(B\) are formulas, then \((A \lif B)\) is a formula.
- If \(A\) is a formula and \(x\) is a variable , then \(\lforall{x}{A}\) is a formula .
- If \(A\) is a formula and \(x\) is a variable , then \(\lexists{x}{A}\) is a formula .
- Nothing else is a formula .
The definitions of the set of terms and that of formulas are inductive definitions . Essentially, we construct the set of formulas in infinitely many stages. In the initial stage, we pronounce all atomic formulas to be formulas; this corresponds to the first few cases of the definition, i.e., the cases for \(\lfalse\) , \(\Atom{R}{t_1,\dots,t_n}\) and \(\Atom{\eq[][]}{t_1,t_2}\) . “Atomic formula” thus means any formula of this form.
The other cases of the definition give rules for constructing new formulas out of formulas already constructed. At the second stage, we can use them to construct formulas out of atomic formulas. At the third stage, we construct new formulas from the atomic formulas and those obtained in the second stage, and so on. A formula is anything that is eventually constructed at such a stage, and nothing else.
By convention, we write \(\eq[][]\) between its arguments and leave out the parentheses: \(\eq[t_1][t_2]\) is an abbreviation for \(\Atom{\eq[][]}{t_1,t_2}\) . Moreover, \(\lnot \Atom{\eq[][]}{t_1,t_2}\) is abbreviated as \(\eqN[t_1][t_2]\) . When writing a formula \((B \ast C)\) constructed from \(B\) , \(C\) using a two-place connective \(\ast\) , we will often leave out the outermost pair of parentheses and write simply \(B \ast C\) .
Some logic texts require that the variable \(x\) must occur in \(A\) in order for \(\lexists{x}{A}\) and \(\lforall{x}{A}\) to count as formulas . Nothing bad happens if you don’t require this, and it makes things easier.
Formulas constructed using the defined operators are to be understood as follows:
- \(\ltrue\) abbreviates \(\lnot\lfalse\) .
- \(A \liff B\) abbreviates \((A \lif B) \land (B \lif A)\) .
If we work in a language for a specific application, we will often write two-place predicate symbols and function symbols between the respective terms, e.g., \(t_1 < t_2\) and \((t_1 + t_2)\) in the language of arithmetic and \(t_1 \in t_2\) in the language of set theory. The successor function in the language of arithmetic is even written conventionally after its argument: \(t'\) . Officially, however, these are just conventional abbreviations for \(\Atom{\Obj A^2_0}{t_1, t_2}\) , \(\Obj f^2_0(t_1, t_2)\) , \(\Atom{\Obj A^2_0}{t_1, t_2}\) and \(f^1_0(t)\) , respectively.
The symbol \(\ident\) expresses syntactic identity between strings of symbols, i.e., \(A \ident B\) iff \(A\) and \(B\) are strings of symbols of the same length and which contain the same symbol in each place.
The \(\ident\) symbol may be flanked by strings obtained by concatenation, e.g., \(A \ident (B \lor C)\) means: the string of symbols \(A\) is the same string as the one obtained by concatenating an opening parenthesis, the string \(B\) , the \(\lor\) symbol, the string \(C\) , and a closing parenthesis, in this order. If this is the case, then we know that the first symbol of \(A\) is an opening parenthesis, \(A\) contains \(B\) as a substring (starting at the second symbol), that substring is followed by \(\lor\) , etc.