Skip to main content

Interpreter

Struct Interpreter 

Source
pub struct Interpreter<Cfg: EGraphConfig, L: LitVal, M: LitModel<Value = L>, const TRACK: bool, const PROOFS: bool> {
    pub eg: EGraph<Cfg, L, TRACK, PROOFS>,
    pub model: M,
    /* private fields */
}

Fields§

§eg: EGraph<Cfg, L, TRACK, PROOFS>§model: M

Implementations§

Source§

impl<Cfg: EGraphConfig, L: LitVal, M: LitModel<Value = L>, const TRACK: bool, const PROOFS: bool> Interpreter<Cfg, L, M, TRACK, PROOFS>
where Cfg::O: Hash, MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Source

pub fn new(model: M) -> Self

Source

pub fn with_registries( model: M, sorts: SortRegistry<Cfg::S, TRACK>, ops: OpRegistry<Cfg::O, Cfg::S, TRACK>, ) -> Self

Create an interpreter with pre-built registries (from sortcheck).

Source

pub fn set_shrink_policy(&mut self, policy: ShrinkPolicy)

Set the shrink policy used by push/pop.

Source

pub fn set_strategy(&mut self, strategy: SaturationStrategy)

Select the saturation strategy used by (run …).

Source

pub fn last_sat(&self) -> Option<&SatResult>

Outcome of the most recent (run …) command, or None if none has run.

Source

pub fn last_run_time(&self) -> Option<Duration>

Wall time of the most recent (run …), or None if none has run. Measured around the saturation driver only — building the :until goal’s terms is not included.

Source

pub fn set_cc(&mut self, enabled: bool)

Enable/disable the AC congruence-completion pass (default off; see EGraph::set_cc). Equivalent to set_ac_mode(Eager) / set_ac_mode(Off).

Source

pub fn set_ac_mode(&mut self, mode: AcMode)

Select how AC completion participates in the run (see AcMode). Lazy keeps the e-graph’s completion flag off; completion runs only inside the transaction a lazy check opens.

Source

pub fn set_lazy_ac_rounds(&mut self, rounds: usize)

Alternation budget for a lazy check’s second phase (default 32 rounds).

Source

pub fn set_union_by(&mut self, u: UnionBy)

Select the merge survivor policy (see EGraph::set_union_by).

Source

pub fn set_basis_checks(&mut self, enabled: bool)

Enable/disable the runtime reduced-basis invariant checks (default off; see EGraph::set_basis_checks). Diagnostic only: superlinear brute-force checks.

Source

pub fn global(&mut self, name: &str) -> Option<(Cfg::G, Cfg::S)>

Look up a global binding by name.

Source

pub fn run_checked( &mut self, cmds: &[CCommand<Cfg::O, Cfg::S, L>], ) -> Result<(), InterpError>

Run a pre-checked program (output of sortcheck_program).

Auto Trait Implementations§

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> Freeze for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: Freeze, M: Freeze, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: Freeze, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: Freeze, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: Freeze, IndexScratch<Cfg>: Freeze,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> RefUnwindSafe for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: RefUnwindSafe, M: RefUnwindSafe, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: RefUnwindSafe, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: RefUnwindSafe, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: RefUnwindSafe, IndexScratch<Cfg>: RefUnwindSafe,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> Send for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: Send, M: Send, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: Send, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: Send, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: Send, IndexScratch<Cfg>: Send,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> Sync for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: Sync, M: Sync, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: Sync, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: Sync, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: Sync, IndexScratch<Cfg>: Sync,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> Unpin for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: Unpin, M: Unpin, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: Unpin, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: Unpin, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: Unpin, IndexScratch<Cfg>: Unpin,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> UnsafeUnpin for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: UnsafeUnpin, M: UnsafeUnpin, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: UnsafeUnpin, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: UnsafeUnpin, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: UnsafeUnpin, IndexScratch<Cfg>: UnsafeUnpin,

§

impl<Cfg, L, M, const TRACK: bool, const PROOFS: bool> UnwindSafe for Interpreter<Cfg, L, M, TRACK, PROOFS>
where EGraph<Cfg, L, TRACK, PROOFS>: UnwindSafe, M: UnwindSafe, Vec<PreparedRule<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::S, L>>: UnwindSafe, GlobalCtx<<Cfg as EGraphConfig>::S, <Cfg as EGraphConfig>::G>: UnwindSafe, Vec<Mark<Cfg, <Cfg as EGraphConfig>::O>>: UnwindSafe, IndexScratch<Cfg>: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.