pub fn rewrite_with_invention(
    e: Expr,
    inv: &Invention,
) -> Expr {
    let mut egraph = crate::EGraph::default();
    let root = egraph.add_expr(&e.into());
    rewrite_with_invention_egraph(root, inv, &mut egraph)
}
/// Rewrite `root` using an invention `inv`. This will use inventions everywhere
/// as long as it decreases the cost. It will account for the fact that using an invention
/// in a child could prevent the use of the invention in the parent - it will always do whatever
/// gives the lowest cost.
/// 
/// For the `EGraph` argument here you can either pass in a fresh egraph constructed by `let mut egraph = EGraph::new(); egraph.add_expr(expr.into())`
/// or if you make repeated calls to this function feel free to pass in the same egraph over and over. It doesn't matter what is in the EGraph already.
Rewrite `root` using an invention `inv`. This will use inventions everywhere
as long as it decreases the cost. It will account for the fact that using an invention
in a child could prevent the use of the invention in the parent - it will always do whatever
gives the lowest cost.

For the `EGraph` argument here you can either pass in a fresh egraph constructed by `let mut egraph = EGraph::new(); egraph.add_expr(expr.into())`
or if you make repeated calls to this function feel free to pass in the same egraph over and over. It doesn't matter what is in the EGraph already.
Rewrite ` root ` using an invention ` inv ` . This will use inventions everywhere as long as it decreases the cost . It will account for the fact that using an invention in a child could prevent the use of the invention in the parent - it will always do whatever gives the lowest cost . For the ` EGraph ` argument here you can either pass in a fresh egraph constructed by ` let mut egraph = EGraph :: new () ; egraph . add_expr ( expr . into () ) ` or if you make repeated calls to this function feel free to pass in the same egraph over and over . It doesn ' t matter what is in the EGraph already .
pub fn rewrite_with_invention(
    e: Expr,
    inv: &Invention,
) -> Expr {
    let mut egraph = crate::EGraph::default();
    let root = egraph.add_expr(&e.into());
    rewrite_with_invention_egraph(root, inv, &mut egraph)
}
pub fn rewrite_with_invention ( e : Expr , inv : & Invention , ) -> Expr { let mut egraph = crate :: EGraph :: default ( ) ; let root = egraph . add_expr ( & e . into ( ) ) ; rewrite_with_invention_egraph ( root , inv , & mut egraph ) }
Rewrite `root` using an invention `inv`.
Rewrite ` root ` using an invention ` inv ` .
e
Expr
inv
&Invention
e
Expr
inv
&Invention