Skip to main content

LemmaIndex

Struct LemmaIndex 

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

An index over a named lemma library.

Implementations§

Source§

impl LemmaIndex

Source

pub fn build(named: &[(String, ProofExpr)]) -> Self

Build the index from named lemmas (axioms and proved theorems alike).

Source

pub fn find_exact(&self, goal: &ProofExpr) -> Vec<Suggestion>

Lemmas whose conclusion IS the goal (an instance of it). Ranked most- specific first (fewest variable bindings). exact?.

Source

pub fn find_apply(&self, goal: &ProofExpr) -> Vec<Suggestion>

Lemmas whose conclusion matches the goal AND have antecedents — applying them reduces the goal to those (instantiated) antecedents. apply?.

Source

pub fn select_premises(&self, goal: &ProofExpr, k: usize) -> Vec<String>

Rank the whole library by relevance to goal and return the top k names — the premise filter for auto on a large base. Relevance is: an exact/apply conclusion match first, then head-symbol overlap; lemmas sharing no symbol with the goal are dropped entirely.

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.