Consider a finite set $A$, called the set of constants, and a set $S$ of binary or unary operations over $A$, $S=\{\theta_1,\theta_2,\dots\theta_n\}$, such that $\theta_i:A\rightarrow A$ or $\theta_i:A\times A\rightarrow A$.
Now, a finite formula (i.e. a word which makes sense) constructed with elements from $A$ and $S$ will look like a tree with internal nodes labeled by some $\theta_i$ and all the leaves labeled by elements of $A$.
Suppose that there exists an evaluation function $\Phi$ which takes a formula as an input and gives a real number as an output.
Given two formulas $\lambda$ and $\mu$, I'd like to say that the "distance" between them is $|\Phi(\lambda)-\Phi(\mu)|$.
My question is this: does this define a metric on the space of formulas? And would it be possible to define it explicitly via the strings which define the formulas instead of using the function $\Phi$?