Skip to main content

Arena

Struct Arena 

Source
pub struct Arena { /* private fields */ }
Expand description

All values of a checking session, their memos, and the tables that intern them.

Implementations§

Source§

impl Arena

Source

pub fn new() -> Arena

Source

pub fn reset(&mut self)

Drops every value (the end of a session), keeping the storage for the next session.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, v: V) -> Val

Source

pub fn is_open(&self, v: V) -> bool

Source

pub fn head(&self, h: HeadId) -> Head

Source

pub fn whnf_memo(&self, v: V) -> Option<V>

Source

pub fn set_whnf_memo(&mut self, v: V, r: V)

Source

pub fn whnf_core_memo(&self, v: V) -> Option<V>

Source

pub fn set_whnf_core_memo(&mut self, v: V, r: V)

Source

pub fn delta_memo(&self, v: V) -> Option<V>

Source

pub fn set_delta_memo(&mut self, v: V, r: V)

Source

pub fn type_memo(&self, v: V) -> Option<V>

Source

pub fn set_type_memo(&mut self, v: V, r: V)

Source

pub fn proof_memo(&self, v: V) -> Option<bool>

Whether the value is a proof, once decided.

Source

pub fn set_proof_memo(&mut self, v: V, proof: bool)

Source

pub fn dom_memo(&self, v: V) -> Option<V>

A lambda’s evaluated domain.

Source

pub fn set_dom_memo(&mut self, v: V, r: V)

Source

pub fn find_head(&self, h: &Head) -> Option<V>

Source

pub fn head_value(&mut self, kind: Kind, h: Head) -> V

The bare value of a head (no arguments).

Source

pub fn neutral_app(&mut self, f: V, a: V) -> V

The neutral f a for a neutral f.

Source

pub fn sort(&mut self, l: LevelId) -> V

Source

pub fn nat(&mut self, n: NatId) -> V

Source

pub fn str(&mut self, s: StrId) -> V

Source

pub fn lam(&mut self, dom: ExprId, env: EnvId, body: ExprId) -> V

Source

pub fn pi(&mut self, dom: V, env: EnvId, body: ExprId) -> V

Source

pub fn pi_lam(&mut self, dom: V, env: EnvId, ctx: CtxId, body: ExprId) -> V

Source

pub fn spine_node(&self, s: Sp) -> SpNode

Source

pub fn spine_len(&self, s: Sp) -> usize

Source

pub fn args(&self, s: Sp) -> SmallVec<[V; 8]>

The arguments of a spine, first to last.

Source

pub fn arg(&self, s: Sp, i: usize) -> Option<V>

The i-th argument (0-based, first to last) of a spine.

Source

pub fn env(&self, e: EnvId) -> EnvNode

Source

pub fn last_prune(&self, e: EnvId, mask: u64) -> Option<EnvId>

The environment e was last pruned to with mask, if that was the last pruning asked of it.

Source

pub fn note_prune(&mut self, e: EnvId, mask: u64, r: EnvId)

Source

pub fn env_open(&self, e: EnvId) -> bool

Source

pub fn lsub_of(&self, e: EnvId) -> SubstId

The universe substitution e’s terms are read under.

Source

pub fn lsub_base(&mut self, s: SubstId) -> EnvId

The empty environment of the substitution s (for s the identity, EnvId::EMPTY).

Source

pub fn same_shape(&self, a: EnvId, b: EnvId) -> bool

Whether two environments have the same length and substitution: all that tells them apart besides their entries.

Source

pub fn extend(&mut self, parent: EnvId, val: V) -> EnvId

Source

pub fn frame_slot_count(&self) -> usize

Entries stored in frames so far this session: what pruning has copied.

Source

pub fn lookup(&self, e: EnvId, i: u32) -> Option<V>

The value of de Bruijn index i.

Source

pub fn entries(&self, e: EnvId) -> impl Iterator<Item = V> + '_

The entries of an environment, innermost first (DEAD for those pruned away), in one walk.

Source

pub fn select(&self, e: EnvId, mask: u64, out: &mut SmallVec<[V; 16]>)

The values at the positions mask marks (innermost first), in one walk.

Source

pub fn select_indices( &self, e: EnvId, indices: &[u32], out: &mut SmallVec<[V; 16]>, )

The values at indices (ascending, innermost first), in one walk.

Source

pub fn frame(&mut self, len: u32, mask: u64, vals: &[V], lsub: SubstId) -> EnvId

The frame of len entries whose live entries are vals at the positions mask marks (innermost first), read under the substitution lsub, interned by content.

Source

pub fn wide_frame( &mut self, len: u32, indices: &[u32], vals: &[V], lsub: SubstId, ) -> EnvId

The frame of len entries whose live entries are vals at indices (ascending, some of them 64 or more), read under the substitution lsub, interned by content.

Source

pub fn ctx_extend(&mut self, parent: CtxId, ty: V) -> CtxId

Source

pub fn ctx_lookup(&self, c: CtxId, i: u32) -> Option<V>

Source

pub fn memory_report(&self) -> Vec<(&'static str, usize)>

Bytes held by each part of the arena (capacity: what the process pays).

Source

pub fn bytes(&self) -> usize

Trait Implementations§

Source§

impl Clone for Arena

Source§

fn clone(&self) -> Arena

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Arena

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Arena

§

impl RefUnwindSafe for Arena

§

impl Send for Arena

§

impl Sync for Arena

§

impl Unpin for Arena

§

impl UnsafeUnpin for Arena

§

impl UnwindSafe for Arena

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.