Module prelude

Source
Expand description

This module makes it easier to use egglog from Rust. It is intended to be imported fully.

use egglog::prelude::*;

See also rule, rust_rule, query, BaseSort, and ContainerSort.

Re-exports§

pub use egglog::ast::Action;
pub use egglog::ast::Fact;
pub use egglog::ast::Facts;
pub use egglog::sort::BigIntSort;
pub use egglog::sort::BigRatSort;
pub use egglog::sort::BoolSort;
pub use egglog::sort::F64Sort;
pub use egglog::sort::I64Sort;
pub use egglog::sort::StringSort;
pub use egglog::sort::UnitSort;
pub use egglog::EGraph;
pub use egglog::sort;
pub use egglog::sort;

Modules§

exprs

Macros§

action
actions
datatype
Adds sorts and constructor tables to the database.
expr
fact
facts
sort
span
vars

Structs§

GenericActions
QueryResult
The result of a query.
RustRuleContext
A wrapper around an ExecutionState for rules that are written in Rust. See the rust_rule documentation for an example of how to use this.
RustSpan

Enums§

Span

Traits§

BaseSort
A “default” implementation of Sort for simple types which just want to put some data in the e-graph. If you implement this trait, do not implement Sort or ContainerSort. Use add_base_sortto register base sorts with theEGraph. See Sortfor documentation of the methods. Do not overrideto_arcsort`.
ContainerSort
A “default” implementation of Sort for types which just want to store a pure data structure in the e-graph. If you implement this trait, do not implement Sort or BaseSort. Use add_container_sort to register container sorts with the EGraph. See Sort for documentation of the methods. Do not override to_arcsort.

Functions§

add_base_sort
Add a BaseSort to the e-graph
add_constructor
Declare a new constructor table.
add_container_sort
add_function
Declare a new function table.
add_relation
Declare a new relation table.
add_ruleset
Create a new ruleset.
add_sort
Declare a new sort.
query
Run a query over the database.
rule
Add a rule to the e-graph whose right-hand side is made up of actions.
run_ruleset
Run one iteration of a ruleset.
rust_rule
Add a rule to the e-graph whose right-hand side is a Rust callback.