How does a term algebra differ from a Herbrand structure? Is it the same thing but with a subtle distinction between constant symbols and variable symbols that is not visible on the structure itself?
In Wilfrid Hodges' A Shorter Model Theory, the notion of a term algebra is introduced on page 14.
Let $L$ be any signature and $X$ a set of variables.
The domain is the set of terms in $L$ where all the variables are in $X$.
These are the equations that then define our term algebra.
$$ c^A =c \;\; \text{for each constant $c$ of $L$ }$$ $$ F^A(t) = F(t) \;\; \text{for each $n$-ary function $F$ of $L$ and $n$-tuple $t$ of elements in the domain of $A$ } $$ $$R^A \;\text{is empty} \;\; \text{for each relation symbol $R$ of $L$} $$
Then Hodges says that this definition is equivalent to the absolutely free $L$-structure with basis $X$.
I am really confused by this definition. If $A$ is our structure, then the domain of $A$ makes sense. They are finite strings of symbols where the alphabet is the language of $L$ and all the variables are in $X$.
In order to supply an interpretation for each of our constant symbols, we send them to themselves. The interpretation of every function symbol sends its arguments to the new term headed by that function. So the interpretation of each function is just what that function does syntactically.
The handling of relations doesn't make sense to me. I don't know why we picked that every relation is always false instead of being always true. I also don't know why we didn't just insist up front that $L$ has no relation symbols or simply impose no constraints on the relation symbols. Earlier in chapter, Hodges has commented explicitly on the arbitrariness of a given definition when making an arbitrary choice, so I'm wondering if I'm missing something.
The other thing that confuses me about it is how it differs from a Herbrand structure. I am only vaguely aware of what a Herbrand structure is. I have seen the definition before, but no nontrivial uses of it.
The idea in term algebras that every function's semantics are just what that function does to terms syntactically seems to be the same as with Herbrand structures.
Herbrand structures, however, do not have the equivalent of $X$, some extra variable symbols that are injected into our language, so to speak.
However, reading the definition of a term algebra carefully, it is not clear to me that a variable symbol and a constant symbol are actually treated differently by the term algebra construction. I don't think there a way to tell whether a given symbol was a constant or was a variable just by looking at the term algebra on its own.