next up previous
Next: Types and membership Up: Formalizing Type Theory Previous: Terms

Evaluation

Inductive Definition

The terms of Nuprl denote data, programs and types; but programs and types can be data too. So we must say how to evaluate every term. There are many ways to approach this mathematically. We can give a denotational semantics, or a reduction (rewrite) semantics, or a structural operational semantics or something else. We choose to base the account on inductively defined relations and partial functions in the style of [13,35,39,43], sometimes called ``natural semantics''. We use a lazy evaluator [1,13,35].

We define first a relation ``evaluates to,'' $t evals\_to t'$.Then we define val as a map

\begin{displaymath}
val:\{x:term \vert \exists t:term x evals\_to t\}\rightarrow term.\end{displaymath}

We give some cases of the evaluation relation to illustrate the method.



Properties of Evaluation

We can prove rather easily these properties of evaluation.

Theorem:

1.
$t evals\_to t' \& t evals\_to t''$ implies t'=t''. (deterministic)
2.
$t evals\_to t'$ implies t' is a value. (value producing)

3.
If t is a value then $t evals\_to t$. (idempotent)



Evaluation fragments

In order to allow for the addition of new operators in a systematic way, we index the evaluation process by the operator name. So the actual evaluation relation has the form $t evals\_to_{op}(f) \,
t'$ where f is a parameter. We just gave these fragments for some of the operators. The evaluation relation is then defined as

Definition: $t evals\_to t'$ iff $t \
evals\_to_{opname(t)} (evals\_to) t'$


next up previous
Next: Types and membership Up: Formalizing Type Theory Previous: Terms
Karla Consroe
5/13/1998