本文整理汇总了C++中Enode::hasSortBool方法的典型用法代码示例。如果您正苦于以下问题:C++ Enode::hasSortBool方法的具体用法?C++ Enode::hasSortBool怎么用?C++ Enode::hasSortBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enode
的用法示例。
在下文中一共展示了Enode::hasSortBool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: a
//.........这里部分代码省略.........
if ( config.verbosity > 2 )
cerr << "# Egraph::Skipping canonization of " << enode << " as it's root is purely UF" << endl;
result = enode;
}
else
{
LAExpression a( enode );
result = a.toEnode( *this );
#ifdef PRODUCE_PROOF
const uint64_t partitions = getIPartitions( enode );
assert( partitions != 0 );
setIPartitions( result, partitions );
#endif
if ( split_eqs && result->isEq( ) )
{
#ifdef PRODUCE_PROOF
if ( config.produce_inter > 0 )
opensmt_error2( "can't compute interpolant for equalities at the moment ", enode );
#endif
LAExpression aa( enode );
Enode * e = aa.toEnode( *this );
#ifdef PRODUCE_PROOF
assert( partitions != 0 );
setIPartitions( e, partitions );
#endif
Enode * lhs = e->get1st( );
Enode * rhs = e->get2nd( );
Enode * leq = mkLeq( cons( lhs, cons( rhs ) ) );
LAExpression b( leq );
leq = b.toEnode( *this );
#ifdef PRODUCE_PROOF
assert( partitions != 0 );
setIPartitions( leq, partitions );
#endif
Enode * geq = mkGeq( cons( lhs, cons( rhs ) ) );
LAExpression c( geq );
geq = c.toEnode( *this );
#ifdef PRODUCE_PROOF
assert( partitions != 0 );
setIPartitions( geq, partitions );
#endif
Enode * not_e = mkNot( cons( enode ) );
Enode * not_l = mkNot( cons( leq ) );
Enode * not_g = mkNot( cons( geq ) );
// Add clause ( !x=y v x<=y )
Enode * c1 = mkOr( cons( not_e
, cons( leq ) ) );
// Add clause ( !x=y v x>=y )
Enode * c2 = mkOr( cons( not_e
, cons( geq ) ) );
// Add clause ( x=y v !x>=y v !x<=y )
Enode * c3 = mkOr( cons( enode
, cons( not_l
, cons( not_g ) ) ) );
// Add conjunction of clauses
Enode * ax = mkAnd( cons( c1
, cons( c2
, cons( c3 ) ) ) );
dtc_axioms.push_back( ax );
result = enode;
}
}
}
//
// If nothing have been done copy and simplify
//
if ( result == NULL )
result = copyEnodeEtypeTermWithCache( enode );
assert( valDupMap1( enode ) == NULL );
storeDupMap1( enode, result );
#ifdef PRODUCE_PROOF
if ( config.produce_inter > 0 )
{
// Setting partitions for result
setIPartitions( result, getIPartitions( enode ) );
// Setting partitions for negation as well occ if atom
if ( result->hasSortBool( ) )
{
setIPartitions( mkNot( cons( result ) )
, getIPartitions( enode ) );
}
}
#endif
}
Enode * new_formula = valDupMap1( formula );
assert( new_formula );
doneDupMap1( );
if ( !dtc_axioms.empty( ) )
{
dtc_axioms.push_back( new_formula );
new_formula = mkAnd( cons( dtc_axioms ) );
}
return new_formula;
}