Skip to main content

AxiomUsage

Struct AxiomUsage 

Source
pub struct AxiomUsage {
    pub axioms: BTreeSet<String>,
    pub unresolved: BTreeSet<String>,
}
Expand description

What a proof rests on: the axioms it cites transitively, and the names that resolve to nothing.

Fields§

§axioms: BTreeSet<String>

Axioms cited, TRANSITIVELY through definitions. Sorted, so a report is stable and diffable.

§unresolved: BTreeSet<String>

Names that resolve to NOTHING in the context checked against. Non-empty means the proof was minted against a larger base than the one re-checking it — trusted-base drift, named.

Implementations§

Source§

impl AxiomUsage

Source

pub fn absorb(&mut self, other: AxiomUsage)

Fold another report into this one — the union, on both halves.

A closure is almost never over one term: a declaration is its TYPE and its BODY, and a certificate is its proof term and the proposition it CLAIMS. Every caller that walks two terms goes through here, so no caller can merge the axioms and forget the unresolved names — the half that reports trusted-base DRIFT, and the half a summary is most tempted to drop.

Source

pub fn beyond(&self, permitted: &[&str]) -> BTreeSet<String>

Does this proof rest on anything outside permitted?

A trust POLICY is written from this, so it counts an unresolved name too — see AxiomUsage::cited. Permitting a name by spelling silences it whichever half it is in, so one list governs both.

Source

pub fn admitted(&self) -> BTreeSet<String>

Every ADMITTED name this proof rests on, transitively — the taint.

Better than Lean here, and deliberately: Lean warns on the declaration that CONTAINS the sorry and says nothing about its dependants, so a theorem three lemmas downstream of an admission looks finished and #print axioms is a command you have to remember to run. This reads the closure, so the taint is a property of the proof rather than of a warning you might have missed, and it cannot be lost by renaming, re-exporting or citing at a distance.

Source

pub fn is_admitted(&self) -> bool

Is this proof tainted by an admission? Sugar for !admitted().is_empty().

Source

pub fn is_tainted_by(&self, admitted: &[&str]) -> bool

A proof that cites any name a caller considers admitted is not a proof, and neither is anything that transitively cites it.

Source

pub fn render(&self, subject: &str) -> String

The #print axioms report, rendered. One line, stable, diffable — and it names the admission FIRST when there is one, because that is the part a reader must not scroll past.

Trait Implementations§

Source§

impl Clone for AxiomUsage

Source§

fn clone(&self) -> AxiomUsage

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 Debug for AxiomUsage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AxiomUsage

Source§

fn default() -> AxiomUsage

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

impl PartialEq for AxiomUsage

Source§

fn eq(&self, other: &AxiomUsage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for AxiomUsage

Source§

impl StructuralPartialEq for AxiomUsage

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