Term algebra explained

In universal algebra and mathematical logic, a term algebra is a freely generated algebraic structure over a given signature.[1] [2] For example, in a signature consisting of a single binary operation, the term algebra over a set X of variables is exactly the free magma generated by X. Other synonyms for the notion include absolutely free algebra and anarchic algebra.[3]

From a category theory perspective, a term algebra is the initial object for the category of all X-generated algebras of the same signature, and this object, unique up to isomorphism, is called an initial algebra; it generates by homomorphic projection all algebras in the category.[4] [5]

A similar notion is that of a Herbrand universe in logic, usually used under this name in logic programming,[6] which is (absolutely freely) defined starting from the set of constants and function symbols in a set of clauses. That is, the Herbrand universe consists of all ground terms: terms that have no variables in them.

An atomic formula or atom is commonly defined as a predicate applied to a tuple of terms; a ground atom is then a predicate in which only ground terms appear. The Herbrand base is the set of all ground atoms that can be formed from predicate symbols in the original set of clauses and terms in its Herbrand universe.[7] [8] These two concepts are named after Jacques Herbrand.

Term algebras also play a role in the semantics of abstract data types, where an abstract data type declaration provides the signature of a multi-sorted algebraic structure and the term algebra is a concrete model of the abstract declaration.

Universal algebra

A type

\tau

is a set of function symbols, with each having an associated arity (i.e. number of inputs). For any non-negative integer

n

, let

\taun

denote the function symbols in

\tau

of arity

n

. A constant is a function symbol of arity 0.

Let

\tau

be a type, and let

X

be a non-empty set of symbols, representing the variable symbols. (For simplicity, assume

X

and

\tau

are disjoint.) Then the set of terms

T(X)

of type

\tau

over

X

is the set of all well-formed strings that can be constructed using the variable symbols of

X

and the constants and operations of

\tau

. Formally,

T(X)

is the smallest set such that:

X\cup\tau0\subseteqT(X)

  - each variable symbol from

X

is a term in

T(X)

, and so is each constant symbol from

\tau0

.

n\geq1

and for all function symbols

f\in\taun

and terms

t1,...,tn\inT(X)

, we have the string

f(t1,...,tn)\inT(X)

  - given

n

terms

t1,...,tn

, the application of an

n

-ary function symbol

f

to them represents again a term.

The term algebra

l{T}(X)

of type

\tau

over

X

is, in summary, the algebra of type

\tau

that maps each expression to its string representation. Formally,

l{T}(X)

is defined as follows:[9]

l{T}(X)

is

T(X)

.

f

in

\tau0

,

fl{T(X)}

is defined as the string

f

.

n\geq1

and for each n-ary function

f

in

\tau

and elements

t1,...,tn

in the domain,

fl{T(X)}(t1,...,tn)

is defined as the string

f(t1,...,tn)

.

A term algebra is called absolutely free because for any algebra

l{A}

of type

\tau

, and for any function

g:X\tol{A}

,

g

extends to a unique homomorphism

g\ast:l{T}(X)\tol{A}

, which simply evaluates each term

t\inl{T}(X)

to its corresponding value

g\ast(t)\inl{A}

. Formally, for each

t\inl{T}(X)

:

t\inX

, then

g\ast(t)=g(t)

.

t=f\in\tau0

, then

g\ast(t)=fl{A}

.

t=f(t1,...,tn)

where

f\in\taun

and

n\geq1

, then

g\ast(t)=fl{A}(g

\ast(t
1),

...,

\ast(t
g
n))
.

Example

As an example type inspired from integer arithmetic can be defined by

\tau0=\{0,1\}

,

\tau1=\{\}

,

\tau2=\{+,*\}

, and

\taui=\{\}

for each

i>2

.

The best-known algebra of type

\tau

has the natural numbers as its domain and interprets

0

,

1

,

+

, and

*

in the usual way; we refer to it as

l{A}nat

.

For the example variable set

X=\{x,y\}

, we are going to investigate the term algebra

l{T}(X)

of type

\tau

over

X

.

First, the set

T(X)

of terms of type

\tau

over

X

is considered.We use to flag its members, which otherwise may be hard to recognize due to their uncommon syntactic form.We have e.g.

{\color{red}x}\inT(X)

, since

x\inX

is a variable symbol;

{\color{red}1}\inT(X)

, since

1\in\tau0

is a constant symbol; hence

{\color{red}+x1}\inT(X)

, since

+

is a 2-ary function symbol; hence, in turn,

{\color{red}*+x1x}\inT(X)

since

*

is a 2-ary function symbol.More generally, each string in

T(X)

corresponds to a mathematical expression built from the admitted symbols and written in Polish prefix notation;for example, the term

{\color{red}*+x1x}

corresponds to the expression

(x+1)*x

in usual infix notation. No parentheses are needed to avoid ambiguities in Polish notation; e.g. the infix expression

x+(1*x)

corresponds to the term

{\color{red}+x*1x}

.

To give some counter-examples, we have e.g.

{\color{red}z}\not\inT(X)

, since

z

is neither an admitted variable symbol nor an admitted constant symbol;

{\color{red}3}\not\inT(X)

, for the same reason,

{\color{red}+1}\not\inT(X)

, since

+

is a 2-ary function symbol, but is used here with only one argument term (viz.

{\color{red}1}

).

Now that the term set

T(X)

is established, we consider the term algebra

l{T}(X)

of type

\tau

over

X

.This algebra uses

T(X)

as its domain, on which addition and multiplication need to be defined.The addition function

+l{T(X)}

takes two terms

p

and

q

and returns the term

{\color{red}+}pq

; similarly, the multiplication function

*l{T(X)}

maps given terms

p

and

q

to the term

{\color{red}*}pq

.For example,

*l{T(X)}({\color{red}+x1},{\color{red}x})

evaluates to the term

{\color{red}*+x1x}

.Informally, the operations

+l{T(X)}

and

*l{T(X)}

are both "sluggards" in that they just record what computation should be done, rather than doing it.

As an example for unique extendability of a homomorphism consider

g:X\tol{A}nat

defined by

g(x)=7

and

g(y)=3

.Informally,

g

defines an assignment of values to variable symbols, and once this is done, every term from

T(X)

can be evaluated in a unique way in

l{A}nat

.For example,

\begin{array}{lll} &g*({\color{red}+x1})\\ =&g*({\color{red}x})+g*({\color{red}1})&sinceg*isahomomorphism\\ =&g({\color{red}x})+g*({\color{red}1})&sinceg*coincidesonXwithg\\ =&7+g*({\color{red}1})&bydefinitionofg\\ =&7+1&sinceg*isahomomorphism\\ =&8&accordingtothewell-knownarithmeticalrulesinl{A}nat\\ \end{array}

In a similar way, one obtains

g*({\color{red}*+x1x})=...=8*g({\color{red}x})=...=56

.

Herbrand base

See main article: Herbrand interpretation and Herbrand structure. The signature σ of a language is a triple <O,&thinsp;F,&thinsp;P> consisting of the alphabet of constants O, function symbols F, and predicates P. The Herbrand base[10] of a signature σ consists of all ground atoms of σ: of all formulas of the form R(t1, ..., tn), where t1, ..., tn are terms containing no variables (i.e. elements of the Herbrand universe) and R is an n-ary relation symbol (i.e. predicate). In the case of logic with equality, it also contains all equations of the form t1&thinsp;=&thinsp;t2, where t1 and t2 contain no variables.

Decidability

Term algebras can be shown decidable using quantifier elimination. The complexity of the decision problem is in NONELEMENTARY because binary constructors are injective and thus pairing functions.[11]

See also

Further reading

Notes and References

  1. Book: Wilfrid Hodges. A Shorter Model Theory. limited. 1997. Cambridge University Press. 0-521-58713-1. 14.
  2. Book: Franz Baader. Tobias Nipkow. Tobias Nipkow. Term Rewriting and All That. 1998. Cambridge University Press. 0-521-77920-0. 49. Franz Baader.
  3. Book: Klaus Denecke. Shelly L. Wismath. Universal Algebra and Coalgebra. 2009. World Scientific. 978-981-283-745-5. 21–23.
  4. Book: T.H. Tse. A Unifying Framework for Structured Analysis and Design Models: An Approach Using Initial Algebra Semantics and Category Theory. 2010. Cambridge University Press. 978-0-511-56989-0. 46–47. 10.1017/CBO9780511569890. T.H. Tse.
  5. Book: Walter Alexandre. Carnielli. Itala M. L.. D'Ottaviano. Itala D'Ottaviano. Advances in Contemporary Logic and Computer Science: Proceedings of the Eleventh Brazilian Conference on Mathematical Logic, May 6-10, 1996, Salvador, Bahia, Brazil. https://books.google.com/books?id=tEU9OcjwhXUC&pg=PA9. 18 April 2011. 1999. American Mathematical Society. 978-0-8218-1364-5. 9. The mathematical structure of logical syntax. Jean-Yves Béziau. Jean-Yves Béziau.
  6. Book: Dirk van Dalen. Logic and Structure. 2004. Springer. 978-3-540-20879-2. 108.
  7. Book: M. Ben-Ari. Mathematical Logic for Computer Science. 2001. Springer. 978-1-85233-319-5. 148–150.
  8. Book: Monroe Newborn. Automated Theorem Proving: Theory and Practice. 2001. Springer. 978-0-387-95075-4. 43.
  9. Book: Stanley Burris; H. P. Sankappanavar. A Course in Universal Algebra. 1981. Springer. 978-1-4613-8132-7. 68–69, 71.
  10. Rogelio Davila. Answer Set Programming Overview.
  11. Jeanne Ferrante; Charles W. Rackoff (1979). The Computational Complexity of Logical Theories. Springer, Chapter 8, Theorem 1.2.