CMP.12:4.1 - Recover the expression structure and the intended observations
Identify the constructors of admitted expressions and how their parts bind and compose. Work with a parsed structure when precedence, grouping or scope matters. Trace a name occurrence to its declaration or external input under the applicable rules. If several parses remain admissible, derive what they imply for the requested observations. Agreement can settle that use. Where they differ, a language rule or supplied context may select a reading. An evaluator asked to report all permitted results must cover the alternatives. Report unresolved ambiguity when a single intended reading is needed and its selection is still open.
Specify what evaluation receives and what its user can observe. Inputs can include the expression, name bindings, stored state and external responses. Outputs can include a value, changed state, a sequence of interactions or a failure. Distinguish a language-defined error from the absence of a defined operation; a translator can be required to preserve the former without being required to assign a meaning to the latter.
For a direct interpreter, specify which observations its evaluation must produce under the source language rules. For a translation, choose the required relation between source and target observations. Equal returned values may suffice for a terminating pure expression. An interactive program may require the same ordered events. A source with several permitted behaviors may allow the target to choose among them; retaining every source possibility is a stronger requirement. Timing, memory use or a probability law belongs in this relation only when the receiving question uses it.