2020 Mathematics Subject Classification: Primary: 68P05 [MSN][ZBL]
This entry discusses terms as syntactically correct expressions in a formalized language defined over a signature $\Sigma =(S,F)$ and a set of variables. For terms as informal objects in mathematical expressions, see the entry term. For expressions similar to terms but representing a truth value instead of a type $s\in S$, see the entry formulas.
Let $\Sigma =(S,F)$ be a signature. Let $X_s$ be a set of variables of sort $s\in S$ with $X_s\cap F=\emptyset$ and $X_s\cap S=\emptyset$. Furthermore, let the set of variables be defined as disjoint union $X:= \bigcup_{s\in S} X_s$. Then the set $T_s(\Sigma,X)$ of terms of sort $s$ is defined inductively as the smallest set containing all
The set $T(\Sigma,X)$ of terms is defined as $T(\Sigma,X):= \bigcup\limits_{s\in S} T_s(\Sigma,X)$.
The terms $t\in T(\Sigma,X)$ are the elements of the formalized language given by the signature $\Sigma$ and the set $X$ of variables. Supplementing the function symbols $F$ of the signature $\Sigma$ by variables serves several purposes.
For the purposes listed above, it may be necessary to identify the free variables of a term. This is done using a mapping $V\colon T(\Sigma,X) \longrightarrow 2^X$, which is inductively defined as follows:
Let $t,w\in T(\Sigma,X)$ be terms and $x\in X$ be a variable. The substitution $t[x\leftarrow w]$ of $x$ with $w$ is inductively defined as follows:
Terms $t$ without variables, i.e. $t\in T(\Sigma,\emptyset)=:T(\Sigma)$, are called ground terms. The ground terms $t$ of sort $s\in S$ are designated as $T_s(\Sigma):= t\in T_s(\Sigma,\emptyset)$. For all sets $X$ of variables and for all sorts $s\in S$, it holds $T_s(\Sigma) \subseteq T_s(\Sigma,X)$. For all sets $X$ of variables, it holds $T(\Sigma) \subseteq T(\Sigma,X)$. A term $t\in T(\Sigma,X)$ is called closed, if $V(t)= \emptyset$. It is closed, iff it is a ground term (i.e. $t\in T(\Sigma)$).
Every signature morphism $m\colon \Sigma_1\longrightarrow \Sigma_2$ for signatures $\Sigma_1=(S_1,F_1), \Sigma_2=(S_2,F_2)$ can be extended to a morphism $m'\colon T(\Sigma_1)\longrightarrow T(\Sigma_2)$ between ground terms. If the morphism $m$ can be extended to a mapping, which is defined for sets $X = \bigcup_{s\in S_1} X_s$, $X'= \bigcup_{s\in S_2} X'_s$ of variables as well with $m(x)\in X'_{m(s)}$ for $x\in X_s$, $s\in S_1$, the signature morphism $m$ can also be extended to a morphism $m^\ast\colon T(\Sigma_1,X)\longrightarrow T(\Sigma_2,X')$ between terms. Such an extension is called a translation. It replaces every function symbol $f\in F_1$ by the corresponding function symbol $\sigma(f)\in F_2$.
[EM85] | H. Ehrig, B. Mahr: "Fundamentals of Algebraic Specifications", Volume 1, Springer 1985 |
[EM90] | H. Ehrig, B. Mahr: "Fundamentals of Algebraic Specifications", Volume 2, Springer 1990 |
[M89] | B. Möller: "Algorithmische Sprachen und Methodik des Programmierens I", lecture notes, Technical University Munich 1989 |
[W90] | M. Wirsing: "Algebraic Specification", in J. van Leeuwen: "Handbook of Theoretical Computer Science", Elsevier 1990 |