-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluation.ml
33 lines (26 loc) · 954 Bytes
/
evaluation.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(*
CS 51 Final Project
MiniML -- Evaluation
*)
(* This module implements a small untyped ML-like language under
various operational semantics.
*)
open Eval_common
open Eval_distinct
open Expr
open Env
(* The trivial evaluator *)
let eval_t (exp : expr) (_env : Env.env) : Env.value =
(* coerce the expr, unchanged, into a value *)
Env.Val exp
(* The substitution model evaluator *)
let eval_s (_exp : expr) (_env : Env.env) : Env.value =
EvalCommon.generic_eval SubEval.config _exp _env
(* The dynamically-scoped environment model evaluator *)
let eval_d (_exp : expr) (_env : Env.env) : Env.value =
EvalCommon.generic_eval DynEval.config _exp _env
(* The lexically-scoped environment model evaluator *)
let eval_l (_exp : expr) (_env : Env.env) : Env.value =
EvalCommon.generic_eval LexEval.config _exp _env
(* Determines the evaluator connected to MiniML *)
let evaluate = eval_l