pub struct Sem<'a> {
pub k: &'a mut Kernel,
pub st: &'a mut State,
}Expand description
The engine: the kernel (environment, stores, well-known names) and the session state.
Fields§
§k: &'a mut Kernel§st: &'a mut StateImplementations§
Source§impl Sem<'_>
impl Sem<'_>
Sourcepub fn is_def_eq_within(
&mut self,
t: V,
s: V,
steps: u32,
) -> KResult<Option<bool>>
pub fn is_def_eq_within( &mut self, t: V, s: V, steps: u32, ) -> KResult<Option<bool>>
t ≡ s, if it is decided within steps conversion steps and the checker’s resources;
None if not. An attempt is speculation: running out — of steps, or of recursion depth,
which a step does not bound — leaves it undecided, never declined, and nothing is learned
from it but what it proved along the way.
Sourcepub fn proof_positions(&mut self, ty: V) -> KResult<u64>
pub fn proof_positions(&mut self, ty: V) -> KResult<u64>
The positions of a Π telescope whose binder types are propositions.
Source§impl Sem<'_>
impl Sem<'_>
Source§impl Sem<'_>
impl Sem<'_>
Sourcepub fn signature(
&mut self,
c: NameId,
ls: LevelsId,
) -> KResult<Option<Signature>>
pub fn signature( &mut self, c: NameId, ls: LevelsId, ) -> KResult<Option<Signature>>
The Signature of c.{ls}, computed once per settled constant and instantiation and
shared by every later declaration; None for a constant only provisionally in the
environment, or one given the wrong number of universes, whose applications’ types must be
inferred.
Source§impl Sem<'_>
impl Sem<'_>
Sourcepub fn whnf_core(&mut self, v: V, cheap_proj: bool) -> KResult<V>
pub fn whnf_core(&mut self, v: V, cheap_proj: bool) -> KResult<V>
Weak-head normal form without δ. With cheap_proj, a projection’s structure is only
brought to whnf_core (not unfolded), as Lean’s whnfCore does inside conversion.
Source§impl<'a> Sem<'a>
impl<'a> Sem<'a>
pub fn new(k: &'a mut Kernel, st: &'a mut State) -> Sem<'a>
Sourcepub fn under<T>(
&mut self,
ty: V,
f: impl FnOnce(&mut Self, V) -> KResult<T>,
) -> KResult<T>
pub fn under<T>( &mut self, ty: V, f: impl FnOnce(&mut Self, V) -> KResult<T>, ) -> KResult<T>
Runs f under a fresh variable of type ty.
Sourcepub fn check_type(&mut self, ty: ExprId) -> KResult<LevelId>
pub fn check_type(&mut self, ty: ExprId) -> KResult<LevelId>
Checks that the closed term ty is a type; its universe level.