当前位置: 首页>>代码示例>>C++>>正文


C++ Enode::getExpReason方法代码示例

本文整理汇总了C++中Enode::getExpReason方法的典型用法代码示例。如果您正苦于以下问题:C++ Enode::getExpReason方法的具体用法?C++ Enode::getExpReason怎么用?C++ Enode::getExpReason使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Enode的用法示例。


在下文中一共展示了Enode::getExpReason方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: expReRootOn

//
// Subroutine of explainStoreExplanation
// Re-root the tree containing x, in such a way that
// the new root is x itself
//
void Egraph::expReRootOn ( Enode * x )
{
    Enode * p = x;
    Enode * parent = p->getExpParent( );
    Enode * reason = p->getExpReason( );
    x->setExpParent( NULL );
    x->setExpReason( NULL );

    while( parent != NULL )
    {
        // Save grandparent
        Enode * grandparent = parent->getExpParent( );

        // Save reason
        Enode * saved_reason = reason;
        reason = parent->getExpReason( );

        // Reverse edge & reason
        parent->setExpParent( p );
        parent->setExpReason( saved_reason );

#ifdef PEDANTIC_DEBUG
        assert( checkExpTree( parent ) );
#endif

        // Move the two pointers
        p = parent;
        parent = grandparent;
    }
}
开发者ID:patere,项目名称:dReal,代码行数:35,代码来源:EgraphExplain.C

示例2: expExplainAlongPath

//
// Subroutine of explain
// A step of explanation for x and y
//
void Egraph::expExplainAlongPath ( Enode * x, Enode * y )
{
    Enode * v  = expHighestNode( x );
    Enode * to = expHighestNode( y );

    while ( v != to )
    {
        Enode * p = v->getExpParent( );
        assert( p != NULL );
        Enode * r = v->getExpReason( );

        // If it is not a congruence edge
        if ( r != NULL )
        {
            if ( !isDup1( r ) )
            {
                assert( r->isTerm( ) );
                explanation.push_back( r );
                storeDup1( r );
            }
        }
        // Otherwise it is a congruence edge
        // This means that the edge is linking nodes
        // like (v)f(a1,...,an) (p)f(b1,...,bn), and that
        // a1,...,an = b1,...bn. For each pair ai,bi
        // we have therefore to compute the reasons
        else
        {
            assert( v->getCar( ) == p->getCar( ) );
            assert( v->getArity( ) == p->getArity( ) );
            expEnqueueArguments( v, p );
        }

#ifdef PRODUCE_PROOF
        if ( config.produce_inter > 0
                && config.logic != QF_AX )
        {
            cgraph.addCNode( v );
            cgraph.addCNode( p );
            cgraph.addCEdge( v, p, r );
        }
#endif

        expUnion( v, p );
        v = expHighestNode( p );
    }
}
开发者ID:patere,项目名称:dReal,代码行数:51,代码来源:EgraphExplain.C


注:本文中的Enode::getExpReason方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。