Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- app_
depth - Count the nesting depth of applications.
- apply_
bvars - Apply
nBVar arguments to an expression:expr BVar(0) BVar(1) ... BVar(n-1). - arity
- Attempt to compute the arity of an expression by counting Pi binders.
- beta_
reduce_ full - Apply beta reduction repeatedly until no redex exists at the top level.
- beta_
reduce_ one - Substitute
replacementfor the outermost bound variable (BVar(0)). - binder_
depth - Count the number of leading lambda binders.
- collect_
app_ spine - Collect the spine of an application: (head, [arg1, arg2, …]).
- contains_
bvar - Check if an expression contains a specific bound variable at the given De Bruijn index.
- count_
bvar - Count occurrences of a bound variable in an expression.
- eta_
contract - Perform one step of eta contraction.
- eta_
contract_ full - Fully eta-contract an expression.
- eta_
def_ eq - Determine if two expressions are definitionally equal under eta.
- eta_
equiv - Check eta equivalence (normalize then compare).
- eta_
equiv_ depth - Check whether two expressions are eta-equivalent up to the given depth.
- eta_
expand - Perform eta expansion: given f, produce λx. f x.
- eta_
expand_ implicit - Perform eta expansion with an implicit binder.
- eta_
expand_ pi - Eta-expand a term with an explicit Pi binder.
- eta_
expand_ to - Eta-expand an expression to match a target number of lambda binders.
- eta_
expand_ with_ ty - Expand an expression to exactly
nlambda binders using eta expansion. - eta_
head - Return the “eta-head” of an expression.
- eta_
normalize - Eta-normalize an expression (recursively eta-contracting).
- eta_
normalize_ tracked - Eta-normalize and track how many contractions were performed.
- expr_
is_ closed - Check if an expression has no free variables using a recursive walk.
- expr_
structure_ desc - Produce a one-line human-readable description of an expression’s structure.
- is_
beta_ redex - Check whether an expression is a beta-redex (lambda applied to an argument).
- is_
closed - Check whether an expression is completely closed (no BVars and no FVars).
- is_
closed_ at - Check whether an expression is closed (no free BVars at depth >=
cutoff). - is_
eta_ expandable - Check whether an expression can be eta-expanded (not already a lambda).
- is_
eta_ long - Check whether an expression is in eta-long normal form.
- is_
eta_ redex - Check whether an expression is an eta-redex (λx. f x with x not free in f).
- is_
identity_ lambda - Check if a lambda body is the identity (lambda x. x).
- is_
lambda_ free - Check whether an expression has no lambdas anywhere in it.
- is_
simple_ app - Check whether an expression is a “simple” application (head is a constant).
- lam_
to_ pi - Replace all lambda binders in
exprwith pi binders (unsafe structural change). - mk_
app_ spine - Apply a sequence of arguments to a head expression.
- node_
count - Count the total number of nodes in an expression tree.
- normal_
eq - Check structural equality after full normalization.
- normalize_
full - Normalize by both eta-contracting and beta-reducing.
- outer_
lambda_ depth - Count the maximum lambda depth (outermost consecutive lambdas).
- peel_
lambdas - Peel off all leading lambdas, returning binders and body.
- peel_
pis - Collect the Pi binders of a type, returning (binders, return_type).
- pi_
depth - Count the number of leading Pi binders.
- rebuild_
lam - Rebuild a lambda from peeled binders and a body.
- rebuild_
pi - Rebuild a Pi from peeled binders and a body.
- reduce_
let - Reduce
let x := v in bodytobody[x := v]. - reduce_
lets - Fully reduce all let bindings in an expression.
- rewrite_
with_ rules - Apply a list of rewrite rules to an expression, innermost-first.
- shift_
down - Shift down bound variables (for removing a binder).
- shift_
up - Shift up bound variables (for adding a binder).
- structural_
hash - Compute a simple structural hash of an expression.
- subst_
bvar - Substitute replacement for BVar(depth) in expr.
- subst_
bvar_ shifted - Lift a substitution under
nbinders (shift the replacement up byn). - wrap_
in_ lambdas - Wrap an expression in
nidentity lambdas:λ_0. λ_1. ... expr.