Skip to main content

Proof

Struct Proof 

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

A proof produced by the Vampire theorem prover.

A Proof is a sequence of ProofSteps that together form a complete derivation of a contradiction from the negated conjecture and axioms. Each step records the inference rule used and the indices of the premises (earlier steps) it was derived from.

Proofs are obtained via Problem::solve_and_prove.

§Display

Proof implements std::fmt::Display, which prints each step on its own line in the format <index>: <conclusion> [<rule> <premise-indices>].

§Examples

use vampire_prover::{Function, Predicate, Problem, ProofRes, Options};

let p = Predicate::new("P", 1);
let x = Function::constant("x");

let (_, proof) = Problem::new(Options::new())
    .with_axiom(p.with(x))
    .conjecture(p.with(x))
    .solve_and_prove();

if let Some(proof) = proof {
    for step in proof.steps() {
        println!("{}: {:?}", step.discovery_order(), step.rule());
    }
}

Implementations§

Source§

impl Proof

Source

pub fn steps(&self) -> &[ProofStep]

Returns all proof steps in the order Vampire discovered them.

Steps are sorted by their ProofStep::discovery_order. Because each step’s premises always have a lower discovery order than the step itself, this ordering is also a valid topological ordering of the proof DAG.

Source

pub fn topo_iter(&self) -> impl Iterator<Item = &ProofStep>

Iterates over proof steps in topological order (discovery order).

This is equivalent to iterating over Proof::steps and is provided for clarity when the topological property matters.

Trait Implementations§

Source§

impl Clone for Proof

Source§

fn clone(&self) -> Proof

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 Proof

Source§

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

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

impl Display for Proof

Source§

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

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

impl Index<usize> for Proof

Source§

type Output = ProofStep

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl PartialEq for Proof

Source§

fn eq(&self, other: &Proof) -> 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 Proof

Source§

impl StructuralPartialEq for Proof

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl !Send for Proof

§

impl !Sync for Proof

§

impl Unpin for Proof

§

impl UnsafeUnpin for Proof

§

impl UnwindSafe for Proof

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.