Module fungi_lang::dynamics[][src]

Syntax for dynamic, evaluation-time structures.

Notably, some of these syntantic forms are absent from programs written by the programmer; rather, they only arise dynamically, from running these programs, and in some cases, by using Adapton engine.

However, since they are common to multiple operational semantics (eval and reduce), we separate these dynamic structures from any one particular evaluation semantics.

For practical reasons, these AST structures still must be mentioned in the static structure. Namely, the Exp::HostEval form holds a function over these types, providing a "trapdoor" for libraries to extend the core evaluation rules below with custom ones (e.g., for standard library primitives, such as vectors). See also: The ExpTerm type.

Structs

EnvRec

Enums

Env

TODO-Sometime: Prune the environments (using free variables as filters)

ExpTerm

Terminal expressions (a la CBPV), but in environment-passing style, where (closed) lambda terms have closing environments.

NameTmVal

Name Term Values. The value forms (name and lambda) for the Name Term sub-language (STLC + names).

RtVal

Run-time values. Compare to ast::Val.

Functions

close_val

Given a closing environment and an ast value (with zero or more variables) producing a closed, run-time value.

close_val_rec

See close_val

engine_name_of_ast_name

Name conversion. Convert an ast name into a run-time (adapton library) name.

env_emp
env_find
env_push
nametm_eval

Evaluate a name term, dynamically (see also: normal module)

nametm_eval_rec

Evaluate a name term, dynamically (see also: normal module)

nametm_of_nametmval

Convert a name term value back into (the same) name term

nametm_subst

Substitute a name term value for a free variable in another term

nametm_subst_rec

Substitute a name term value for a free variable in another term

proj_namespace_name

project/pattern-match the name of namespace, defined as the sub-term M in the following nameterm (lambda) form:

ret

Wrapper for Ret constructor.

Type Definitions

RtValRec

Run-time values