Decidability of the Existential Theory of Infinite Terms with Subterm Relation

We examine the problem of solving equations, inequalities, and atomic formulas built on the subterm relation in algebras of rational and infinite terms (trees). We prove that this problem is decidable for any such algebra in a finite signature S with possible new free constants. Moreover, even in presence of subterm relation, the existential theory of rational trees is the same as the existential theory of infinite trees. We leave out the easier case where S has no symbols of arity greater than one. When S has only a symbol of arity greater than one, the decision procedure is different in the two cases where the algebra of rational or infinite trees does or does not contain new free constants.