Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- abstract_
expr - Replace FVar with BVar(0), shifting up all existing BVars.
- apply_
args - Apply a list of arguments to a function expression via beta reduction.
- beta_
reduce_ head - Repeatedly apply top-level beta reduction until no more is possible.
- build_
subst_ map - Build a
SubstMapfrom parallel slices of ids and replacements. - collect_
loose_ bvar_ indices - Collect the indices of all loose bound variables.
- count_
free_ occurrences - Count how many times
fvaroccurs free inexpr. - count_
lambdas - Count the number of leading lambda binders.
- count_
pis - Count the number of leading pi binders.
- expr_
contains_ fvar - Check if an expression contains any free variable in the given set.
- free_
vars - Collect the set of free
FVarIds occurring inexpr. - instantiate
- Instantiate BVar(0) with arg in body, shifting down all other BVars.
- instantiate_
many - Simultaneously substitute
BVar(0)..BVar(k-1)withargs[0]..args[k-1]. - instantiate_
tracked - Like
instantiatebut also fills inSubstStats. - is_
lambda - Check if an expression is a lambda abstraction.
- is_
whnf_ beta - Check whether
expris in weak head normal form with respect to beta. - occurs_
free - Return
trueiffvaroccurs free inexpr. - open_
binder - Replace the outermost
BVar(0)of a body withFVar(id)(open a binder). - parallel_
subst - Apply a parallel substitution: replace each
FVar(id)with the corresponding expression inmap. - parallel_
subst_ tracked - Apply a parallel substitution and collect profiling statistics.
- peel_
lambdas - Peel off
nleading lambda binders, collecting binder info. - shift_
bvars - Shift all
BVar(i)withi >= cutoffup byamount. - subst_
fvar - Substitute a single free variable with an expression.
- substitute_
fvars - Apply a substitution list (as parallel arrays) to an expression.
- try_
beta_ reduce - Apply beta-reduction once at the top level if possible.
Type Aliases§
- Subst
Map - A finite mapping from free-variable identifiers to expressions.