by dbenson@[EMAIL PROTECTED]
Oct 1, 2007 at 07:45 PM
On Sep 26, 1:00 pm, stainboy <jakub.p...@[EMAIL PROTECTED]
> wrote:
....
>
> type var = string;
> datatype exp =
> N of int
> | V of var;
>
> type value = int;
> type state = var -> value;
>
> fun expSem
> (N i)(s) = i
> | expSem (V v)(s:state) = s v;
>
> what mean: (N i)(s) = i
> also:
> (V v)(s:state) = s v;
>
First, lets clean up a little:
fun expSem (N i)(s) = i
| expSem (V v)(s:state) = s v;
so the full expression to be evaluated is
expSem (N i)(s)
for the N datatype constructor and
expSem (V v)(s:state)
for the V datatype constructor.