pub fn lookup<B>(&self, mut enode: B) -> Option<Id>
    where
        B: BorrowMut<L>,
    {
        let enode = enode.borrow_mut();
        enode.update_children(|id| self.find(id));
        let id = self.memo.get(enode);
        id.map(|&id| self.find(id))
    }
/// Lookup the eclass of the given enode.
///
/// You can pass in either an owned enode or a `&mut` enode,
/// in which case the enode's children will be canonicalized.
///
/// # Example
/// ```
/// # use egg::*;
/// let mut egraph: EGraph<SymbolLang, ()> = Default::default();
/// let a = egraph.add(SymbolLang::leaf("a"));
/// let b = egraph.add(SymbolLang::leaf("b"));
///
/// // lookup will find this node if its in the egraph
/// let mut node_f_ab = SymbolLang::new("f", vec![a, b]);
/// assert_eq!(egraph.lookup(node_f_ab.clone()), None);
/// let id = egraph.add(node_f_ab.clone());
/// assert_eq!(egraph.lookup(node_f_ab.clone()), Some(id));
///
/// // if the query node isn't canonical, and its passed in by &mut instead of owned,
/// // its children will be canonicalized
/// egraph.union(a, b);
/// egraph.rebuild();
/// assert_eq!(egraph.lookup(&mut node_f_ab), Some(id));
/// assert_eq!(node_f_ab, SymbolLang::new("f", vec![a, a]));
/// ```
Lookup the eclass of the given enode.
You can pass in either an owned enode or a `&mut` enode,
in which case the enode's children will be canonicalized.
Lookup the eclass of the given enode . You can pass in either an owned enode or a ` &mut ` enode in which case the enode ' s children will be canonicalized .
pub fn lookup<B>(&self, mut enode: B) -> Option<Id>
    where
        B: BorrowMut<L>,
    {
        let enode = enode.borrow_mut();
        enode.update_children(|id| self.find(id));
        let id = self.memo.get(enode);
        id.map(|&id| self.find(id))
    }
pub fn lookup < B > ( & self , mut enode : B ) -> Option < Id > where B : BorrowMut < L > , { let enode = enode . borrow_mut ( ) ; enode . update_children ( | id | self . find ( id ) ) ; let id = self . memo . get ( enode ) ; id . map ( | & id | self . find ( id ) ) }
Lookup the eclass of the given enode.
Lookup the eclass of the given enode .
&self
enode
B
&self
enode
B
example
None
use egg::*;
let mut egraph: EGraph = Default::default();
let a = egraph.add(SymbolLang::leaf("a"));
let b = egraph.add(SymbolLang::leaf("b")).

lookup will find this node if its in the egraph
let mut node_f_ab = SymbolLang::new("f", vec![a, b]);
assert_eq!), None);
let id = egraph.add(node_f_ab.clone());
assert_eq!), Some(id)).

if the query node isn't canonical, and its passed in by &mut instead of owned,
its children will be canonicalized
egraph.union(a, b);
egraph.rebuild();
assert_eq!, Some(id));
assert_eq!(node_f_ab, SymbolLang::new("f", vec![a, a]));
```
let mut egraph : EGraph = Default :: default () ; let a = egraph . add ( SymbolLang :: leaf ( " a " )) ; let b = egraph . add ( SymbolLang :: leaf ( " b " )) . lookup will find this node if its in the egraph let mut node_f_ab = SymbolLang :: new ( " f " vec! [ a b ] ) ; assert_eq! ) None ) ; let id = egraph . add ( node_f_ab . clone () ) ; assert_eq! ) Some ( id )) . if the query node isn ' t canonical and its passed in by &mut instead of owned its children will be canonicalized egraph . union ( a b ) ; egraph . rebuild () ; assert_eq! Some ( id )) ; assert_eq! ( node_f_ab SymbolLang :: new ( " f " vec! [ a a ] )) ; ` ` `