src/tactic/core/dom_simplify_tactic.cpp
/**
   \brief determine if a is dominated by b. 
   Walk the immediate dominators of a upwards until hitting b or a term that is deeper than b.
   Save intermediary results in a cache to avoid recomputations.
*/
\brief determine if a is dominated by b.
Walk the immediate dominators of a upwards until hitting b or a term that is deeper than b.
Save intermediary results in a cache to avoid recomputations.
\ brief determine if a is dominated by b . Walk the immediate dominators of a upwards until hitting b or a term that is deeper than b . Save intermediary results in a cache to avoid recomputations .
bool dom_simplify_tactic::is_subexpr(expr * a, expr * b) {
    if (a == b)
        return true;
    bool r;
    if (m_subexpr_cache.find(a, b, r))
        return r;
    if (get_depth(a) >= get_depth(b)) {
        return false;
    }
    SASSERT(a != idom(a) && get_depth(idom(a)) > get_depth(a));
    r = is_subexpr(idom(a), b);
    m_subexpr_cache.insert(a, b, r);   
    return r;
}
bool dom_simplify_tactic :: is_subexpr ( expr * a , expr * b ) { if ( a == b ) return true ; bool r ; if ( m_subexpr_cache . find ( a , b , r ) ) return r ; if ( get_depth ( a ) >= get_depth ( b ) ) { return false ; } SASSERT ( a != idom ( a ) && get_depth ( idom ( a ) ) > get_depth ( a ) ) ; r = is_subexpr ( idom ( a ) , b ) ; m_subexpr_cache . insert ( a , b , r ) ; return r ; }
\brief determine if a is dominated by b.
\ brief determine if a is dominated by b .