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
impl Proof
Sourcepub fn steps(&self) -> &[ProofStep]
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.
Sourcepub fn topo_iter(&self) -> impl Iterator<Item = &ProofStep>
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.