Now that we have the basic building blocks of a language, we need to specify the syntax of the language. That is, we need to say how we can use the building blocks to form more complex expressions. Our definitions will be recursive, which will (a) insure that we could construct an infinite number of distinct expressions even if we began with finite building blocks, and (b) enable us to prove things about expressions in a language by using mathematical induction. More on this a little later in the course.
So here is the definition of a term (Leary's Definition 1.3.1, p. 11):
Definition: If
is a language, a term of
is a nonempty finite string
of symbols from
such that either:
This is pretty straightforward. We have two base cases of terms, namely variables and constant symbols. And then we can recursively build more terms by using function symbols: an
-ary function symbol whose argument places are filled by
terms (not necessarily distinct) will also be a term.
Notice that in the official language, we don't use parentheses and commas; we construct a term simply by stringing the appropriate number of terms after a function symbol. However, for perspicuousness, we will usually use parentheses and commas in the familiar way. Thus
will be regarded as just a longer version of the canonical form
. Similarly,
will be regarded as a longer version of the canonical
. The parentheses and commas make things easier to read, but they aren't necessary since the official version is also unambiguous.