pub struct FlatTerm<L: Language> {
    pub node: L,
    pub backward_rule: Option<Symbol>,
    pub forward_rule: Option<Symbol>,
    pub children: FlatExplanation<L>,
}
Expand description

A single term in an flattened explanation. After the first term in a FlatExplanation, each term will be annotated with exactly one backward_rule or one forward_rule. This can appear in children FlatTerms, indicating that the child is being rewritten.

When forward_rule is provided, the previous FlatTerm can be rewritten to this FlatTerm by applying the rule. When backward_rule is provided, the previous FlatTerm is given by applying the rule to this FlatTerm. Rules are either the string of the name of the rule or the reason provided to union_instantiations.

Fields

node: L

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

backward_rule: Option<Symbol>

A rule rewriting this FlatTerm back to the last FlatTerm.

forward_rule: Option<Symbol>

A rule rewriting the last FlatTerm to this FlatTerm.

children: FlatExplanation<L>

The children of this FlatTerm.

Implementations

Remove the rewrite annotation from this flatterm, if any.

Convert this FlatTerm to an S-expression. See get_flat_string for the format of these expressions.

Convert this FlatTerm to a RecExpr.

Construct a new FlatTerm given a node and its children.

Rewrite the FlatTerm by matching the lhs and substituting the rhs. The lhs must be guaranteed to match.

Checks if this term or any child has a forward_rule.

Checks if this term or any child has a backward_rule.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.