Struct egg::FlatTerm [−][src]
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 FlatTerm
s,
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
Convert this FlatTerm to an S-expression.
See get_flat_sexps
for the format of these expressions.
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
Auto Trait Implementations
impl<L> RefUnwindSafe for FlatTerm<L> where
L: RefUnwindSafe,
impl<L> UnwindSafe for FlatTerm<L> where
L: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.