#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![doc = "## Simple Example\n```"]
#![doc = include_str!("../tests/simple.rs")]
#![doc = "\n```"]
mod macros;
#[doc(hidden)]
pub mod test;
pub mod tutorials;
mod dot;
mod eclass;
mod egraph;
mod explain;
mod extract;
mod language;
#[cfg(feature = "lp")]
mod lp_extract;
mod machine;
mod multipattern;
mod pattern;
mod rewrite;
mod run;
mod subst;
mod unionfind;
mod util;
#[derive(Clone, Copy, Default, Ord, PartialOrd, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde-1", serde(transparent))]
pub struct Id(u32);
impl From<usize> for Id {
fn from(n: usize) -> Id {
Id(n as u32)
}
}
impl From<Id> for usize {
fn from(id: Id) -> usize {
id.0 as usize
}
}
impl std::fmt::Debug for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl std::fmt::Display for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
pub(crate) use {explain::Explain, unionfind::UnionFind};
pub use {
dot::Dot,
eclass::EClass,
egraph::EGraph,
explain::{
Explanation, FlatExplanation, FlatTerm, Justification, TreeExplanation, TreeTerm,
UnionEqualities,
},
extract::*,
language::*,
multipattern::*,
pattern::{ENodeOrVar, Pattern, PatternAst, SearchMatches},
rewrite::{Applier, Condition, ConditionEqual, ConditionalApplier, Rewrite, Searcher},
run::*,
subst::{Subst, Var},
util::*,
};
#[cfg(feature = "lp")]
pub use lp_extract::*;
#[cfg(test)]
fn init_logger() {
let _ = env_logger::builder().is_test(true).try_init();
}