Struct TreeTerm

Source
pub struct TreeTerm<L: Language> {
    pub node: L,
    pub backward_rule: Option<Symbol>,
    pub forward_rule: Option<Symbol>,
    pub child_proofs: Vec<TreeExplanation<L>>,
    /* private fields */
}
Expand description

An explanation for a term and its equivalent children. Each child is a proof transforming the initial child into the final child term. The initial term is given by taking each first sub-term in each child_proofs recursively. The final term is given by all of the final terms in each child_proofs.

If forward_rule is provided, then this TreeTerm’s initial term can be derived from the previous TreeTerm by applying the rule. Similarly, if backward_rule is provided, then the previous TreeTerm’s final term is given by applying the rule to this TreeTerm’s initial term.

TreeTerms are flattened by first flattening child_proofs, then wrapping the flattened proof with this TreeTerm’s node.

Fields§

§node: L

A node representing this TreeTerm’s operator. The children of the node should be ignored.

§backward_rule: Option<Symbol>

A rule rewriting this TreeTerm’s initial term back to the last TreeTerm’s final term.

§forward_rule: Option<Symbol>

A rule rewriting the last TreeTerm’s final term to this TreeTerm’s initial term.

§child_proofs: Vec<TreeExplanation<L>>

A list of child proofs, each transforming the initial term to the final term for that child.

Implementations§

Source§

impl<L: Language> TreeTerm<L>

Source

pub fn new(node: L, child_proofs: Vec<TreeExplanation<L>>) -> TreeTerm<L>

Construct a new TreeTerm given its node and child_proofs.

Source

pub fn get_initial_flat_term(&self) -> FlatTerm<L>

Get a FlatTerm representing the first term in this proof.

Source

pub fn get_last_flat_term(&self) -> FlatTerm<L>

Get a FlatTerm representing the final term in this proof.

Source

pub fn flatten_explanation(&self) -> FlatExplanation<L>

Construct the FlatExplanation for this TreeTerm.

Trait Implementations§

Source§

impl<L: Clone + Language> Clone for TreeTerm<L>

Source§

fn clone(&self) -> TreeTerm<L>

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<L: Debug + Language> Debug for TreeTerm<L>

Source§

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

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

impl<L: Language + Display + FromOp> Display for TreeTerm<L>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L> Freeze for TreeTerm<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for TreeTerm<L>
where L: RefUnwindSafe,

§

impl<L> !Send for TreeTerm<L>

§

impl<L> !Sync for TreeTerm<L>

§

impl<L> Unpin for TreeTerm<L>
where L: Unpin,

§

impl<L> UnwindSafe for TreeTerm<L>

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.