package alba
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=203ee151ce793a977b2d3e66f8b3a0cd7a82cc7f15550c63d88cb30c71eb5f95
md5=64367c393f80ca784f88d07155da4fb0
doc/alba.core/Alba_core/Gamma_holes/index.html
Module Alba_core.Gamma_holes
Source
Gamma_holes
is a context with holes which can be filled later. A hole is a local unnamed variable with a type (i.e. an assumption that an element with this type exists), initially without value. Later on the value can be provided.
bound_number idx gh
Return the number of the bound variable at idx
.
Precondition:
is_bound idx gh
variable_of_bound i gh
Compute the variable corresponding to the i
th bound variable.
Precondition:
i < count_bounds gh
unfilled_holes cnt0 term gh
List of unfilled holes in term
starting at level cnt0
.
The returned list contains the De Bruijn levels of the unfilled holes.
Precondition:
cnt0 <= count gh
expand term gh
Replace all holes in term
with its values, if available.
is_expanded term gh
Is the term term
expanded i.e. does it not contain any filled holes?
term_of_term_n tn gh
Lift the term tn
into the context and expand it.
fill_hole idx value gh
Fill the hole at idx
with value
. In case that value
is a function abstraction appearing in a function position and the flag beta_reduce
is set, do a beta reduction.
Preconditions:
is_unfilled idx gh
fill_hole idx value gh
Fill the hole at idx
with value
.
Preconditions:
is_hole idx gh
not (has_value idx gh)
is_expanded value gh
push_bound name is_typed gh
adds a bound variable to the context. The bound variable can be later used to construct binders like Pi (arg_tp, res_tp, info
or Lambda (arg_tp, exp, info
. is_typed
is used to construct the binder.
push_local name typ gh
is synonym for push_bound name true gh
type_of_variable idx gh
Return the expanded type of the variable idx
.
pi nbounds result_tp gh
Compute a product type with result_tp
using the last nbounds
bound variables.
all (a: A) (b: B) ... : RT
Preconditions:
nbounds <= count_bounds gh
lambda nbounds exp gh
Compute a function term with the inner expression exp
using the last nbounds
bound variables.
\ (a: A) (b: B) ... := exp
Preconditions:
nbounds <= count_bounds gh