Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- app
- Shorthand: create an application.
- bvar
- Shorthand: create a bound variable.
- collect_
consts - Collect all constant names referenced in an expression.
- collect_
fvars - Collect all free variables in an expression.
- count_
lambdas - Count the number of leading lambdas.
- count_
pis - Count the number of leading Pi binders.
- decompose_
lam - Decompose a Lam expression into
(binder_info, domain, body). - decompose_
let - Decompose a Let expression into
(type, value, body). - decompose_
pi - Decompose a Pi expression into
(binder_info, domain, codomain). - decompose_
proj - Decompose a Proj expression into
(struct_name, field_index, value). - expr_
weight - Compute the “weight” of an expression (rough size metric).
- for_
each_ expr - Traverse every sub-expression, calling
fon each. - get_
app_ args - Extract all arguments from a chain of applications.
- get_
app_ fn - Extract the function head from a chain of applications.
- get_
app_ fn_ args - Decompose an expression into its head function and arguments.
- get_
app_ num_ args - Get the number of arguments in an application chain.
- get_
bvar_ idx - Extract the BVar index from a BVar expression.
- get_
const_ levels - Extract the universe levels from a Const expression.
- get_
const_ name - Extract the name from a Const expression.
- get_
fvar_ id - Extract the FVarId from an FVar expression.
- get_
nth_ arg - Get the
n-th argument in an application chain (0-indexed). - get_
sort_ level - Extract the level from a Sort expression.
- has_
any_ fvar - Check if an expression contains any free variables.
- has_
fvar - Check if an expression contains a specific free variable.
- has_
level_ mvar - Check if an expression has universe level metavariables.
- has_
level_ param - Check if an expression contains any level parameters.
- has_
loose_ bvar - Check if an expression has a specific loose bound variable at
level. - has_
loose_ bvar_ ge - Check if an expression has a loose bound variable with index >=
depth. - has_
loose_ bvars - Check if an expression has any loose bound variables.
- is_app
- Check if the expression is an App.
- is_
app_ of - Check if the head of an application is a constant with a specific name.
- is_
app_ of_ fvar - Check if
eis an application of FVarid. - is_bvar
- Check if the expression is a BVar.
- is_
const - Check if the expression is a Const.
- is_fvar
- Check if the expression is an FVar.
- is_
lambda - Check if the expression is a lambda abstraction.
- is_let
- Check if the expression is a Let.
- is_
literal - Check if the expression is a Literal.
- is_pi
- Check if the expression is a Pi type.
- is_proj
- Check if the expression is a Proj.
- is_prop
- Check if the expression is
Sort(Level::Zero)(i.e.Prop). - is_
simple - Check if an expression is “simple” (atomic: no subexpressions).
- is_sort
- Check if the expression is a
Sort. - is_
type0 - Check if the expression is
Sort(Level::Succ(Level::Zero))(i.e.Type 0). - lam
- Shorthand: create a lambda.
- level_
has_ mvar - Check if a level has metavariables.
- lift_
loose_ bvars - Lift (shift) loose bound variables by
n. - mk_app
- Construct an application from a function and a list of arguments.
- mk_
app_ range - Construct an application from a function and a range of arguments.
- mk_
arrow - Build a non-dependent arrow type:
a → b. - mk_
lam_ n - Build a nested Lam abstraction from a list of binders and a body.
- mk_pi_n
- Build a nested Pi type from a list of binders and a return type.
- mk_prop
- Build
Sort 0(Prop). - mk_type
- Build
Sort (u + 1)(Type u). - mk_
type0 - Build
Sort 1(Type 0). - occurs_
const - Check if a constant name occurs anywhere in an expression.
- pi
- Shorthand: create a pi type.
- prop
- Shorthand:
Prop=Sort 0. - replace_
expr - Replace sub-expressions using a callback.
- sort
- Shorthand:
Sort(Level::zero()). - strip_
lambdas - Get the body after stripping
nleading lambdas. - strip_
pis - Get the body after stripping
nleading Pis. - type0
- Shorthand:
Type 0=Sort 1. - var
- Shorthand: create a constant expression.