}
}
if ( source instanceof ExistsNode ) {
BetaMemory memory = (BetaMemory) wm.getNodeMemory( (MemoryFactory) source );
RightTuple rightTuple = leftTuple.getLeftParent().getBlocker();
FastIterator localIt = memory.getRightTupleMemory().fullFastIterator( rightTuple );
for ( LeftTuple childleftTuple = leftTuple.getLeftParentNext(); childleftTuple != null; childleftTuple = childleftTuple.getLeftParentNext() ) {
if ( childleftTuple.getLeftTupleSink() == sink ) {
return childleftTuple;
}
}
leftTuple = leftTuple.getLeftParent();
// now move onto next RightTuple
while ( rightTuple != null ) {
if ( rightTuple.getBlocked() != null ) {
if ( leftTuple != null ) {
leftTuple = leftTuple.getBlockedNext();
} else {
leftTuple = rightTuple.getBlocked();
}
for ( ; leftTuple != null; leftTuple = leftTuple.getBlockedNext() ) {
for ( LeftTuple childleftTuple = leftTuple.getFirstChild(); childleftTuple != null; childleftTuple = childleftTuple.getLeftParentNext() ) {
if ( childleftTuple.getLeftTupleSink() == sink ) {
return childleftTuple;