Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- abstract_
fvar - Abstract a free variable into a bound variable.
- abstract_
fvars_ ordered - Simultaneously lift all FVars from
mappingby replacing them with BVars starting atstart_level. The first entry inmappingmaps to BVar(start_level), the second to BVar(start_level+1), etc. - alpha_
eq - Check if two expressions are alpha-equivalent (identical up to bound variable renaming). This is a simple structural check — it does NOT reduce.
- close_
with_ lambdas - Abstract a list of free variables, turning them into nested lambda binders.
- close_
with_ pis - Abstract a list of free variables, turning them into nested pi binders.
- collect_
consts - Collect all constant names that appear in an expression (deduplicated).
- collect_
fvars - Collect all free variables (FVarId) occurring in
expr. - count_
bvar - Count the number of occurrences of BVar(level) in expr.
- count_
fvar - Count occurrences of a free variable
fvin an expression. - expr_
depth - Compute the syntactic depth of an expression (longest path from root to leaf).
- expr_
size - Compute the number of nodes in the expression tree.
- has_
bvar - Check if an expression contains a specific bound variable.
- has_
fvar - Check if an expression contains a specific free variable.
- instantiate
- Instantiate bound variable with a free variable.
- is_
closed - Check if an expression is closed (no free BVars at depth 0).
- is_
ground - Check whether
expris a closed term (no BVars and no FVars). - lift
- Lift (shift) all bound variable indices in
exprbyamountstarting from the givencutoff. - lower
- Lower (un-shift) all bound variable indices ≥ cutoff by
amount. - rename_
binder - Rename a bound variable (change binder name without affecting semantics).
- subst
- Substitute bound variable with an expression.
- subst_
const - Replace all occurrences of a constant name with another expression.
- subst_
fvars - Simultaneously substitute multiple free variables with expressions.