pub struct ProofTreeArray {
pub trees: Vec<ProofTree>,
pub qed: usize,
/* private fields */
}
Expand description
An array of proof trees, used to collect steps of a proof in proof order
Fields§
§trees: Vec<ProofTree>
The list of proof trees
qed: usize
The QED step
Implementations§
Source§impl ProofTreeArray
impl ProofTreeArray
Sourcepub fn with_logical_steps<T>(
&self,
db: &Database,
f: impl Fn(usize, usize, StatementRef<'_>, Vec<usize>) -> T,
) -> Vec<T>
pub fn with_logical_steps<T>( &self, db: &Database, f: impl Fn(usize, usize, StatementRef<'_>, Vec<usize>) -> T, ) -> Vec<T>
Applies the provided function to each of the logical steps. It takes 4 parameters:
cur
- the index of the step among all proof steps (incuding non-logical ones). This can be used as an index inProofTreeArray
’s expressionsexprs
andindents
.ix
- the index of the step, when only logical steps are counted,stmt
- the statement applied at this step,hyps
- the indices of the hypotheses for this step (only counting logical hypotheses)
Sourcepub fn with_steps<T>(
&self,
db: &Database,
f: impl Fn(usize, StatementRef<'_>, &Vec<usize>) -> T,
) -> Vec<T>
pub fn with_steps<T>( &self, db: &Database, f: impl Fn(usize, StatementRef<'_>, &Vec<usize>) -> T, ) -> Vec<T>
Applies the provided function to each of the steps. It takes 3 parameters:
cur
- the current index of the step,stmt
- the statement applied at this step,hyps
- the indices of the hypotheses for this step,
Source§impl ProofTreeArray
impl ProofTreeArray
Sourcepub fn new(enable_exprs: bool) -> Self
pub fn new(enable_exprs: bool) -> Self
Constructs a new empty ProofTreeArray
. If enable_exprs
is true,
it will construct expressions for each step, used by Database::export_mmp_proof_tree
.
Sourcepub fn index(&self, tree: &ProofTree) -> Option<usize>
pub fn index(&self, tree: &ProofTree) -> Option<usize>
Get the index of a proof tree in the array
Sourcepub fn calc_indent(&mut self)
pub fn calc_indent(&mut self)
Finds the shortest path from each node in the proof tree to the qed
step,
using Dijkstra’s algorithm. Based on the example in
https://doc.rust-lang.org/std/collections/binary_heap/.
Sourcepub fn count_parents(&self) -> Vec<usize>
pub fn count_parents(&self) -> Vec<usize>
Get the number of parents of each step in the proof
Sourcepub fn to_rpn(&self, parents: &[usize], explicit: bool) -> Vec<RPNStep>
pub fn to_rpn(&self, parents: &[usize], explicit: bool) -> Vec<RPNStep>
Write the proof as an RPN sequence with backrefs
Sourcepub fn normal_iter(&self, explicit: bool) -> NormalIter<'_> ⓘ
pub fn normal_iter(&self, explicit: bool) -> NormalIter<'_> ⓘ
Produce an iterator over the steps in the proof in normal/uncompressed mode. (Because this can potentially be very long, we do not store the list and just stream it.)
Trait Implementations§
Source§impl Clone for ProofTreeArray
impl Clone for ProofTreeArray
Source§fn clone(&self) -> ProofTreeArray
fn clone(&self) -> ProofTreeArray
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProofTreeArray
impl Debug for ProofTreeArray
Source§impl Default for ProofTreeArray
impl Default for ProofTreeArray
Source§impl ProofBuilder for ProofTreeArray
impl ProofBuilder for ProofTreeArray
Auto Trait Implementations§
impl Freeze for ProofTreeArray
impl RefUnwindSafe for ProofTreeArray
impl Send for ProofTreeArray
impl Sync for ProofTreeArray
impl Unpin for ProofTreeArray
impl UnwindSafe for ProofTreeArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more