本文整理汇总了C++中Enode::getNext方法的典型用法代码示例。如果您正苦于以下问题:C++ Enode::getNext方法的具体用法?C++ Enode::getNext怎么用?C++ Enode::getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enode
的用法示例。
在下文中一共展示了Enode::getNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleArrayMerge
void Egraph::handleArrayMerge( Enode * x, Enode * y )
{
assert( ( x->isDTypeArray( ) && y->isDTypeArray( ) )
|| ( x->isDTypeArrayElement( ) && y->isDTypeArrayElement( ) ) );
vector< Enode * > xSelUsers, xStoUsers;
getUsers( x, xSelUsers, xStoUsers );
vector<Enode * >::iterator xSelUsersIt;
vector<Enode * >::iterator xStoUsersIt;
vector< Enode * > ySelUsers, yStoUsers;
getUsers( y, ySelUsers, yStoUsers );
vector<Enode * >::iterator ySelUsersIt;
vector<Enode * >::iterator yStoUsersIt;
#ifdef ARR_VERB_POSTMERGE
cout << endl << "Getting x and y equivalence class users: " << endl;
cout << "Equivalence class of x is: " << endl;
Enode * aux=x;
do { cout << aux << " "; aux=aux->getNext(); } while(aux!=x);
cout << endl << "Here are x class select users: " << endl;
for ( xSelUsersIt = xSelUsers.begin( ); xSelUsersIt != xSelUsers.end( ); xSelUsersIt++ ) {cout << *xSelUsersIt << " ";}
cout << endl << "Here are x class store users: " << endl;
for ( xStoUsersIt = xStoUsers.begin( ); xStoUsersIt != xStoUsers.end( ); xStoUsersIt++ ) {cout << *xStoUsersIt << " ";}
cout << endl << "Equivalence class of y is: " << endl;
aux=y;
do { cout << aux << " "; aux=aux->getNext(); } while(aux!=y);
cout << endl << "Here are y class select users: " << endl;
for ( ySelUsersIt = ySelUsers.begin( ); ySelUsersIt != ySelUsers.end( ); ySelUsersIt++ ) {cout << *ySelUsersIt << " ";}
cout << endl << "Here are y class store users: " << endl;
for ( yStoUsersIt = yStoUsers.begin( ); yStoUsersIt != yStoUsers.end( ); yStoUsersIt++ ) {cout << *yStoUsersIt << " ";}
cout << endl << endl;
#endif
Enode * z, * zIndex;
// , * zElement, * zArray,
// TODO join all the cases together for more efficiency
// NB x,y are elements of equivalence classes X,Y, we need to scan X or Y looking for store terms
if( y->isDTypeArray() )
{
// Case 1: x is b, y is W(a,i,e), exists z as R(b,j)
// Scan all R(b,j)
for ( xSelUsersIt = xSelUsers.begin( )
; xSelUsersIt != xSelUsers.end( )
; xSelUsersIt++ )
{
z = * xSelUsersIt;
zIndex = z->get2nd( );
// scan Y looking for store terms
Enode * YElem = y;
do
{
if( YElem->isStore( ) )
{
#ifdef ARR_VERB
cout << "Arrow down B: " << x << " W(A,I,E): " << YElem << " R(B,J): " << z << endl;
#endif
// create new term R(W(a,i,e),j)
Enode * s_yelem = dynamicToStatic( YElem );
Enode * s_z2nd = dynamicToStatic( z->get2nd( ) );
Enode * select = mkSelect( s_yelem, s_z2nd );
#ifdef PRODUCE_PROOF
if ( config.gconfig.print_inter > 0 )
{
const uint64_t shared = getIPartitions( s_yelem )
& getIPartitions( s_z2nd );
// Mixed can't be one at this point
assert( shared != 1 );
// Set AB-mixed partition if no intersection
if ( shared == 0 )
setIPartitions( select, 1 );
// Otherwise they share something
else
setIPartitions( select, shared );
}
#endif
handleArrayAssertedAtomTerm( select );
}
YElem = YElem->getNext( );
}
while ( YElem != y );
}
/*// Case 2: x is b, y is W(a,i,e), exists z as W(b,j,f)
// Scan all W(b,j,f)
for (xStoUsersIt=xStoUsers.begin(); xStoUsersIt<xStoUsers.end(); xStoUsersIt++)
{
z=*xStoUsersIt;
zElement=z->get3rd();
zIndex=z->get2nd();
// create new term W(W(a,i,e),j,f)
newSto=mkStore(y,zIndex,zElement,present);
// TODO check if term already seen in a previous assertion on the current path
// deduce clauses for the new store
newArrayDed(newSto);
//.........这里部分代码省略.........