© Hindawi Publishing Corp. COMPLEXITY OF TERMS, COMPOSITION, AND HYPERSUBSTITUTION

We consider four useful measures of the complexity of a term: the maximum depth (usually called the depth), the minimum depth, the variable count, and the operation count. For each of these, we produce a formula for the complexity of the composition Smn(s,t1,…,tn) in terms of the complexity of the inputs s, t1,…, tn. As a corollary, we also obtain formulas for the complexity of σˆ[t] in terms of the complexity of t when t is a compound term and σ is a hypersubstitution. We then apply these formulas to the theory of M-solid varieties, examining the k-normalization chains of a variety with respect to the four complexity measures.

1. Introduction.Let τ = (n i ) i∈I be a type of algebras with operation symbols f i of arity n i indexed by some set I. Let X = {x 1 ,x 2 ,x 3 ,...} be a countably infinite alphabet of variables and let X n = {x 1 ,...,x n } be an n-element alphabet.The n-ary terms of type τ are defined inductively as follows: (i) the variables x 1 ,...,x n are n-ary terms; (ii) if f i is an n i -ary operation symbol and t 1 ,...,t n i are n-ary terms, then f i (t 1 ,...,t n i ) is an n-ary term.We will denote by W τ (X n ) the set of n-ary terms of type τ, that is, the smallest set which contains the variables x 1 ,...,x n and which is closed under the finite application of (ii).It follows from this definition that any n-ary term is also k-ary for every k ≥ n.The set W τ (X) = ∞ n=1 W τ (X n ) is the set of all terms of type τ.
When the type τ is finitary, that is, when we have a finite number of operation symbols each of finite arity, we can represent each term of type τ by a tree diagram.Such trees have many applications in computer science, linguistics, and other fields.For such applications, it is important to measure the complexity of a term or a tree.The most commonly used measurement is that of the depth of a term (or dually, that of the height of a tree), and the method of algebraic induction often used in proofs about terms is based on this depth.But there are also several other natural complexity measures we can use.
In this paper, we examine the behaviour of various complexity measures under two mappings defined on sets of terms.The first such mapping is the operation of composition or superposition of terms, which plays an important role in universal algebra [5], clone theory [1,7], and computer science [5,6].This is actually a family of operations: for each m and n in N, the composition mapping S n m maps one n-ary term and n m-ary terms onto an m-ary term as follows.We define by the following steps, for s ∈ W τ (X n ), t 1 ,...,t n ∈ W τ (X m ) and f , an operation symbol of arity r , (i ).This operation is important in clone theory [1,7], where the heterogeneous (multibased) algebra with the variables as nullary operations, is called the full-term clone of type τ.
(For technical reasons we usually exclude nullary terms, although it is possible to include them.) We also consider mappings called hypersubstitutions on the set of all terms of a given type τ.A hypersubstitution σ of type τ is a mapping which assigns to each operation symbol f i of type τ an n i -ary term σ (f i ) of type τ.Any such mapping σ induces a unique mapping σ on the set of all terms of type τ, given by the following inductive definition:

.,t n i ).
The induced mapping σ is also often referred to as a hypersubstitution of type τ or as the extension of the hypersubstitution σ .Note that the second part of this definition uses the composition operation, making hypersubstitutions a special example of the use of the composition.We can define a binary operation • h on the set Hyp(τ) of all hypersubstitutions of type τ by letting σ 1 • h σ 2 be the hypersubstitution which maps each fundamental operation symbol f i to the term σ1 [σ 2 (f i )].The set Hyp(τ) of all hypersubstitutions of type τ is closed under this associative binary operation.This set Hyp(τ) is then a monoid with the identity hypersubstitution σ id , which maps every f i to f i (x 1 ,...,x n i ), acting as an identity element.Now, let M be any submonoid of Hyp(τ).An identity u ≈ v of a variety V is called an M-hyperidentity of V if for every hypersubstitution σ ∈ M, the identity σ When M is the whole monoid Hyp(τ), an Mhyperidentity is called a hyperidentity and an M-solid variety is called a solid variety.
In the next section, we define four useful measurements of the complexity of a term.For each, we produce a formula for the complexity of the composition S n m (s, t 1 ,...,t n ) in terms of the complexity of the inputs s, t 1 ,...,t n .As a corollary, we also obtain formulas for the complexity of σ [t] in terms of the complexity of t when t is a compound term and σ is a hypersubstitution.In the final section, we give an application of these formulas to the theory of M-solid varieties.We examine the chains obtained by taking the k-normalizations of a given variety V , as defined in [4], and show that under suitable choices of a monoid N, each variety of this chain is (M ∩ N)-solid when the variety V is M-solid.This can be used to produce infinite chains of (M ∩ N)-solid varieties of any type.

Complexity of terms.
To illustrate the various ways complexity of terms can be measured, we begin with an example.Throughout, we identify terms with the trees used to draw them.
Example 2.1.Let τ be of type (3) with one ternary operation symbol f .Consider the term t = f (x 1 ,f (x 2 ,x 2 ,x 3 ),f (f (x 3 ,x 3 ,x 2 ), x 1 ,x 2 )).There are several numbers we can associate with t, each measuring a different aspect of how complex this term is as follows: (i) the length of the longest path (from root to vertex) in t is 3; (ii) the length of the shortest path (from root to vertex) in t is 1; (iii) the total number of occurrences of variable symbols in t is 9; (iv) the number of distinct variables occurring in t is 3; (v) the number of occurrences of an operation symbol in t is 4.

Definition 2.2. (a)
The maximum depth of a term t, which we denote by maxdepth(t), is the length of the longest path from the root to a vertex in the tree.This is often called the depth of the tree.It is defined inductively by The minimum depth of a term t, denoted by mindepth(t), is the length of the shortest path from the root to a vertex in the tree and is defined inductively by

.,t n i ).
(c) The variable count of a term t, denoted by vb(t), is the total number of occurrences of variables in t (including multiplicities).This can be defined inductively by The operation-symbol count of a term t, denoted by op(t), is the total number of occurrences of operation symbols in t and is inductively defined by In all of these examples, we have a mapping c : W τ (X) → N from the set of all terms of type τ to the set of natural numbers (including 0), which assigns to each term t a complexity number c(t).We refer to such a function as a complexity mapping or a cost function.
Before we can give our formulas for the complexity of a composed term, we need some subsidiary definitions and notation.Our complexity functions all measure the global complexity of a term, but we also need to consider how complex a term is with respect to a certain variable.That is, we also need to measure, for each variable x j , both how many times it occurs in t and the maximum and minimum depth at which it occurs.For any term t ∈ W τ (X n ), let var(t) be the set of all variables occurring in the term t.Definition 2.3.Let t ∈ W τ (X n ) be an n-ary term.For each variable x k , we define the maximum depth maxdepth k (t) with respect to k of term t inductively as follows: (i Analogously, we define the minimum depth with respect to k for any term t and any variable x k .Definition 2.4.Let t ∈ W τ (X n ) be an n-ary term.For each variable x k , we define the minimum depth mindepth k (t) with respect to k of term t inductively as follows: (i The definitions for maxdepth and maxdepth k are the same as those used in [2], where they were referred to as depth formulas.It was also shown there that these mappings satisfy the equality for any n-ary term t.It is easy to verify that an analogous equality holds for mindepth and mindepth k .We also need a function that counts the number of occurrences of a specific variable x k in a term t.Definition 2.5.Let t ∈ W τ (X n ) be an n-ary term.For each variable x k , we define the x k -variable count vb k (t) of t inductively as follows: ( 3. Complexity of composition and hypersubstitution.Now we are ready to give our complexity theorems.We remark that formula (b) for maxdepth was given by Denecke et al. in [2].
Proof.For convenience, we denote the term S n m (s, t 1 ,...,t n ) by w.We proceed throughout by induction on the structure of the term s, that is, on the maxdepth of s.
(a) If s is a variable x k for some 1 ≤ k ≤ n, then S n m (s, t 1 ,...,t n ) = t k and thus mindepth(S n m (s, t 1 ,...,t n )) = mindepth(t k ).Also we have mindepth j (s) = 0 for all 1 ≤ j ≤ n and x k is the only variable to occur in s, so our formula gives min mindepth j (s) The proof in (a) for mindepth can be modified by replacing min by max throughout, to obtain a proof for maxdepth, as given in [2].
(c  (3.4)(d) If s is a variable x k for some 1 ≤ k ≤ n, then op(S n m (s, t 1 ,...,t n )) = op(t k ).Also we have op(s) = 0 and vb j (s) = 0 for all 1 ≤ j ≠ k ≤ n, so our formula gives Using the fact that the hypersubstitution σ [t] is defined using composition, we have the following corollary.Corollary 3.2.Let t be a composite term of the form t = f (t 1 ,...,t n ), where f is an n-ary operation symbol.Let σ be a hypersubstitution of type τ.Then, (a) maxdepth( σ

M-Solid varieties.
In this section, we give an application of our formulas for complexity of compositions and hypersubstitutions to the study of M-solid varieties.We consider the so-called k-normalizations N k (V ) of a given variety V , defined by Denecke et al. [3] and Denecke and Wismath [4].In particular, we describe the M-solidity of these varieties in terms of the M-solidity of V .
We begin with some notation needed to discuss the k-normalization of a variety.For any variety V of a fixed type τ, we denote by IdV the set of all identities of type τ satisfied by V , and for any set Σ of identities of type τ, we denote by Mod Σ the variety of all algebras of type τ which satisfy all the identities in Σ.Now let V be a variety of type τ and let k be a natural number, k ≥ 0. Let c be one of the four complexity functions defined in Section 2. We define the k-normalization of V , with respect to the complexity function c, to be the variety The properties of these varieties, and of the operator N c k for k ≥ 0, have been studied for c = mindepth in [3] and for c = maxdepth in [4].
Our goal now is to examine the M-solidity properties of the varieties N c k (V ).Suppose that we start with an M-solid variety V of type τ for some monoid M of hypersubstitutions of type τ.What can be said about the M-solidity of the variety It suffices to consider an identity u ≈ v from the defining basis for N c k (V ), that is, we may assume that u ≈ v is an identity of V with the property that both c(u) and c(v) are greater than or equal to k.
) are also greater than or equal to k.In general, then, we need to compare the complexity of a term t with the complexity of σ [t] and would like to be able to show that c( σ [t]) ≥ c(t).However, this is not always the case as the following example shows.
(b) Now let τ = (2, 2) with two binary symbols f and g.Let t = f (f (x,y), g(x, y)), and let σ be the hypersubstitution which maps f onto the term f (x 2 ,x 2 ) and g onto the variable x 1 .Then, although t has mindepth = 2, the term σ [t] = f (x, x) has mindepth of 1.
Although not all hypersubstitutions σ have the property that σ [t] has a complexity greater than or equal to the complexity of t, there are conditions we can put on σ to ensure this property.For our complexity functions, two properties of hypersubstitutions turn out to be important, namely, regularity and pre-hypersubstitutions.A hypersubstitution σ ∈ Hyp(τ) is called regular if for every i ∈ I, all the variables x 1 ,...,x n i occur in the term σ (f i ).The set Reg(τ) of all regular hypersubstitutions of type τ forms a submonoid of Hyp(τ), and a variety which is M-solid for this submonoid M is called regular-solid.A prehypersubstitution of type τ is a hypersubstitution σ with the property that for every operation symbol f i of the type, σ (f i ) is not a variable.The set Pre(τ) of all pre-hypersubstitutions of type τ forms a submonoid of Hyp(τ), and a variety which is M-solid for this monoid is said to be presolid.Proof.We prove all of the four claims by induction on the structure of the term t.In all cases, when t is a variable x, we have σ [t] = x = t, and both σ [t] and t have the same complexity.
Inductively, let t = f i (t 1 ,...,t n i ) for some n i -ary operation symbol f i of type τ so that σ ).Now we apply the formulas from Corollary 3.2 to this.Note that when σ is regular, we have x j ∈ var(σ (f i )), maxdepth j (σ (f i )) ≥ 1, and vb j (σ (f i )) ≥ 1 for all 1 ≤ j ≤ n i , and also have op(σ (f i )) ≥ 1.
(a) For c = maxdepth we have maxdepth σ  Since any term of an arity k is also n-ary for any n ≥ k, this gives the descending chain of varieties A ar k (V ) ≥ A ar k+1 (V ), all containing V .The solidity of these varieties was related to another type of solidity, called n-solidity of a variety.

Call for Papers
As a multidisciplinary field, financial engineering is becoming increasingly important in today's economic and financial world, especially in areas such as portfolio management, asset valuation and prediction, fraud detection, and credit risk management.For example, in a credit risk context, the recently approved Basel II guidelines advise financial institutions to build comprehensible credit risk models in order to optimize their capital allocation policy.Computational methods are being intensively studied and applied to improve the quality of the financial decisions that need to be made.Until now, computational methods and models are central to the analysis of economic and financial decisions.
However, more and more researchers have found that the financial environment is not ruled by mathematical distributions or statistical models.In such situations, some attempts have also been made to develop financial engineering models using intelligent computing approaches.For example, an artificial neural network (ANN) is a nonparametric estimation technique which does not make any distributional assumptions regarding the underlying asset.Instead, ANN approach develops a model using sets of unknown parameters and lets the optimization routine seek the best fitting parameters to obtain the desired results.The main aim of this special issue is not to merely illustrate the superior performance of a new intelligent computational method, but also to demonstrate how it can be used effectively in a financial engineering environment to improve and facilitate financial decision making.In this sense, the submissions should especially address how the results of estimated computational models (e.g., ANN, support vector machines, evolutionary algorithm, and fuzzy models) can be used to develop intelligent, easy-to-use, and/or comprehensible computational systems (e.g., decision support systems, agent-based system, and web-based systems) This special issue will include (but not be limited to) the following topics: • Computational methods: artificial intelligence, neural networks, evolutionary algorithms, fuzzy inference, hybrid learning, ensemble learning, cooperative learning, multiagent learning s) vb t j .

1 •
vb t j by induction and regularity = n i j=1 vb t j = vb(t).

•
Application fields: asset valuation and prediction, asset allocation and portfolio selection, bankruptcy prediction, fraud detection, credit risk management • Implementation aspects: decision support systems, expert systems, information systems, intelligent agents, web service, monitoring, deployment, implementation