A first order language on real numbers has a symbol of binary function $g: R \times R \rightarrow R$. The theory over this language needs to have a function $q$ which is interpreted as $q = \sum g(x_1, x_2)$ over all the domain of the function $g$. More generally, the theory has to have a function $q$ which depends on all the values of the function $g$. How would this function $q$ look in the signature? Its arity is not known: it depends on the model. Do I need to introduce another language to express this function $q$?
Edit 1: Can we even express recursion over an unordered set of real numbers? May be, the values of the function $g$ have to be ordered somehow?
Edit 2: Suppose, I need a function which assigns a unique order number to each element of a finite set. Can this function be defined in logic somehow?