pub struct GenericRule<Head, Leaf>{
pub span: Span,
pub head: GenericActions<Head, Leaf>,
pub body: Vec<GenericFact<Head, Leaf>>,
pub name: String,
pub ruleset: String,
pub eval_mode: RuleEvalMode,
pub no_decomp: bool,
pub include_subsumed: bool,
}Fields§
§span: Span§head: GenericActions<Head, Leaf>§body: Vec<GenericFact<Head, Leaf>>§name: StringA globally unique name for this rule in the EGraph.
ruleset: StringThe ruleset this rule belongs to. Defaults to "".
eval_mode: RuleEvalModeHow this rule is evaluated; set by :naive / :unsafe-seminaive.
no_decomp: boolIf true, this rule skips tree-decomposition during query
planning and evaluate rules as a single-bag (without decomposing
it into smaller queries). Set via the :no-decomp rule option.
include_subsumed: boolIf true, table atoms in this rule match subsumed rows as well as
live rows. This is intended for internal maintenance rules, not
ordinary user rewrites.
Implementations§
Source§impl<Head, Leaf> GenericRule<Head, Leaf>
impl<Head, Leaf> GenericRule<Head, Leaf>
Sourcepub fn visit_exprs(
self,
f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
) -> Self
pub fn visit_exprs( self, f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>, ) -> Self
Applies f to every expression that appears in the rule body or head.
Sourcepub fn visit_actions(
self,
f: &mut impl FnMut(GenericAction<Head, Leaf>) -> GenericAction<Head, Leaf>,
) -> Self
pub fn visit_actions( self, f: &mut impl FnMut(GenericAction<Head, Leaf>) -> GenericAction<Head, Leaf>, ) -> Self
Applies f to each action in the rule head, leaving the body unchanged.
Sourcepub fn map_symbols<Head2, Leaf2>(
self,
head: &mut impl FnMut(Head) -> Head2,
leaf: &mut impl FnMut(Leaf) -> Leaf2,
) -> GenericRule<Head2, Leaf2>
pub fn map_symbols<Head2, Leaf2>( self, head: &mut impl FnMut(Head) -> Head2, leaf: &mut impl FnMut(Leaf) -> Leaf2, ) -> GenericRule<Head2, Leaf2>
Applies the provided head and leaf mappings to every symbol that appears in the rule.
Sourcepub fn make_unresolved(self) -> GenericRule<String, String>
pub fn make_unresolved(self) -> GenericRule<String, String>
Converts the rule into its unresolved representation by formatting heads and leaves.
Trait Implementations§
Source§impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
Source§fn clone(&self) -> GenericRule<Head, Leaf>
fn clone(&self) -> GenericRule<Head, Leaf>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more