package rfsm

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Syntax = Syntax
module Value = Value
type env = Value.t Env.t

The type of dynamic environments, mapping identifiers to values.

val mk_env : unit -> env

mk_env () should return a new, empty dynamic environment

val upd_env : Syntax.lval -> Value.t -> env -> env

upd_env l v env should return the environment obtained by adding the binding (l,v) to env. If l is already bound in env, the associated value is updated.

Evaluators

exception Illegal_expr of Syntax.expr
val eval_expr : env -> Syntax.expr -> Value.t

eval_expr env e should return the value obtained by evaluating expression e in environment env. Should raise Illegal_expr in case of failure.

val eval_bool : env -> Syntax.expr -> bool

eval_bool env e should return the boolean value obtained by evaluating expression e in environment env. Should raise Illegal_expr if e does not denote a boolean value or in case of failure.

Printing

val pp_env : Stdlib.Format.formatter -> env -> unit

pp_env fmt env should print a readable representation of environment env on formatter fmt.

OCaml

Innovation. Community. Security.