Skip to main content

ScopedChecker

Struct ScopedChecker 

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

A kernel context prepared ONCE from a scope, against which many candidate derivations can then be checked — the reusable half of check_derivation.

check_derivation rebuilds the standard library, the premise hypotheses and every referenced symbol on every call. That is right for a one-shot trust door and wrong for a SEARCH: crate::tactic::ProofState::by_rule proposes one node per candidate premise tuple and must ask the kernel about each of them. The scope does not change between those questions, so it is built once and the per-question cost is the certification itself.

This is the same check check_derivation performs — certify, infer, compare to the goal — so a tactic that consults it before reporting success cannot hand qed a tree the kernel will refuse.

Implementations§

Source§

impl ScopedChecker

Source

pub fn new(premises: &[ProofExpr], goal: &ProofExpr) -> Self

Prepare the context for a goal and the facts in scope.

Source

pub fn certifies(&self, derivation: DerivationTree) -> bool

Does this derivation certify as a proof of the scope’s goal?

Auto Trait Implementations§

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 = 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.