TITLE: Is equivalence of functions built from nested exponentiations a decidable problem?
QUESTION [11 upvotes]: Let $\mathcal{E}$ be the minimal set of symbolic expressions (without any predefined meaning) such that

The symbol $x$ is in $\mathcal{E}$, and 
If expressions $P,Q\in\mathcal{E}$, then the superscript expression $(P)^{(Q)}\in \mathcal{E}$.

For every expression $S\in\mathcal{E}$, define the interpretation of $S$ as the function $\mathbb{R}^+\to\mathbb{R}^+$ given by $x\mapsto S$, where each occurrence of $x$ in $S$ is considered as the function parameter, and superscript expressions are considered as exponentiations. Note that we concern ourselves only with positive values of $x$.
We can make an observation that interpretations of two structurally distinct expressions can be the same function, e.g. the expressions 
$$\left((x)^{(x)}\right)^{\left((x)^{(x)}\right)},\ \left((x)^{\left((x)^{(x)}\right)}\right)^{(x)}$$
 both have the same function $x\mapsto x^{x^{x+1}}$ as their interpretation.

Questions: 

Is there an algorithm that for every pair of expressions from $\mathcal{E}$ can decide whether they have the same interpretation? 
If yes, can we give an explicit example of such algorithm?

REPLY [6 votes]: This is a justification of the algorithm suggested in Dan Turetsky's comment.
Every expression in $E$ reduces to an expression in $E'$ which is the minumum language such that $x\in E'$ and $x^{(p_1*\dots*p_n)}\in E'$ whenever $p_1,\dots,p_n\in E'$. Let us define a linear order on $E'$ as follows.
First, every expression in $E'$ has a level, which is the maximum number of nested exponentiations. More precisely, the level of $x$ is 0, and the level of $x^{(p_1*\dots*p_n)}$ is the maximum of the levels of $p_i$'s plus one. Let $E_n$ denote the set of expresions of level at most $n$.
We define our linear order on $E_n$ by induction. First of all, $x$ is the minimal element of our order. Let $f,g\in E_n$ and $f,g\ne x$. Then $f=x^{p_1*\dots*p_m}$ and $g=x^{q_1*\dots*q_k}$ where $p_i$'s and $q_j$'s are from $E_{n-1}$. Let us sort $p_i$'s and $q_j$'s in non-ascending order with respect to the (already defined) linear order on $E_{n-1}$. Then we say that $f>g$ iff the sequence $(p_i)$ is lexocographically bigger than $(q_j)$, i.e. $p_l>q_l$ where $l$ is the first index of mismatch (or $(q_j)$ is an initial subsegment of $(p_i)$). Clearly this definition is consistent with its previous stage, so we have a well-defined linear order on $E'$. This order is easy to compute.
I claim that, if $f>g$ in this linear order, then $f$ dominates $g$ at infinity, i.e. $f(x)>g(x)$ for all sufficiently large $x\in\mathbb R_+$. Moreover, $f$ dominates $g^a$ for any $a\in\mathbb N$. The latter claim is easy to prove by induction. Indeed, $x^x$ dominates $x^a$, and the induction step goes as follows. Let $f=x^{p_1*\dots*p_m}$ and $g=x^{q_1*\dots*q_k}$ and $f>g$. We need to prove that  $f$ dominates $g^a$, or, equivalently, that the product $p_1\dots p_m$ dominates $aq_1\dots q_k$. By removing common initial terms we may assume that $p_1>q_1$ in our order. (If all $q_j$'s cancel out completely, it remains to prove that $p_1$ dominates the constant $a$ and this is trivial.) Now by induction hypothesis, $p_1$ dominates $q_1^{k+1}$, which dominates $q_1^2q_2\dots q_k$, which dominates $aq_1\dots q_k$, q.e.d.