src/puzzle.cpp
/* looking for elimination in dynamic mode
   in SE, such eliminations are always worked out of 2 chains
   analyzed from the left to the right.

   That process works in the same way, so elimination is one of the followings

   a-> b  and a -> ~b  (the classical  form a->~a is included here)
   x-> ~a and ~x -> ~a   
   region or cell multi chain  a -> {~x ~y ~z);

   the process has been reshaped to fit with search at higher levels
   */
looking for elimination in dynamic mode
in SE, such eliminations are always worked out of 2 chains
analyzed from the left to the right.

That process works in the same way, so elimination is one of the followings



the process has been reshaped to fit with search at higher levels
looking for elimination in dynamic mode in SE such eliminations are always worked out of 2 chains analyzed from the left to the right . That process works in the same way so elimination is one of the followings the process has been reshaped to fit with search at higher levels
void PUZZLE::ChainPlus() {
	int godirect = ((rbase + 8) <= ermax);
	BFTAG *t = zcf.h.d.t; 
	if(0 && options.ot && rbase==85 && couprem<2) {
		EE.Enl("\n\nchain plus entry" );
		Image(zcf.h.d	);
	}           
	for(int i = 2; i < col; i += 2) {
		int icand = i >> 1;
		if(dynamic_form1.Off(i)){  
		   BFTAG zw1 = t[i];
		   zw1 &= (t[i].Inverse()).TrueState();
		    if(zw1.IsNotEmpty()) { 
		        dynamic_form1.Set(i); 
				if(1 && options.ot) {
				   EE.E("\n\nfound active a->x and a->~x  a=" );
				   zpln.ImageTag(i);
				   EE.Enl();
			    }           
           if(godirect) 
			   tchain.ClearImmediate(icand);
		   else
			   GoNestedCase1(icand); 
			}
		}
		BFTAG zw2 = t[i];
		zw2 &= t[i ^ 1];
		zw2 = zw2.FalseState();
		zw2-=dynamic_form2[icand]; 
		if(zw2.IsNotEmpty()) { this is x-> ~a and ~x -> ~a
			dynamic_form2[icand] |= zw2;  
			if(1 && options.ot) {
				EE.E("\n\nfound active x->~a and ~x->~a");
				Image(zw2, "elims", i);
			}
			if(godirect) {
				for(int j = 3; j < col; j += 2)
					if(zw2.On(j))
						tchain.ClearImmediate(j >> 1);
			}
			else {
				USHORT ttt[] = {i, i ^ 1};
				zcf.h.dp.Shrink(zw2, i);
				Image(zw2,"elims solde", i);
				for(int j = 3; j < col; j += 2)
					if(zw2.On(j))	
						Rating_Nested(ttt, 2, j);
			}
		}end if zw2
	} end for i
	if(rbase < 85) || tchain.elims_done)  cancelled to be closer to serate
		return;
	if(1 && options.ot) {
		  EE.Enl("\n\ncheck also sets" );
	}
	godirect = ((rbase + 10) <= ermax);
	now check multichains in a similar way but not for nishio
	int ie;
	for(ie = 1; ie < zcx.izc; ie++) {
		const SET &chx = zcx.zc[ie];
		if(chx.type - SET_base)
			break; only base sets can be used
		int n = chx.ncd;
		USHORT *tcd = chx.tcd,
			   ttt[20];
		BFTAG tbt, bfset;
		tbt.SetAll_1();
		tbt -= dynamic_sets[ie]; already seen in dynamic mode
		for(int i = 0; i < n; i++){
			ttt[i] = (tcd[i] << 1);
			bfset.Set(ttt[i] ^ 1);
		}
		for(int i = 0; i < n; i++) {
			BFTAG tw = t[tcd[i] << 1];
			tw -= bfset;
			tbt &= tw;
		}
		if(tbt.IsEmpty())
			continue;
		dynamic_sets[ie] |= tbt;  
		if(1 && options.ot) {
		  EE.E("set active" );chx.Image(this,&EE);
		  Image(tbt,"for",0); EE.Enl( );
		}
        for(int j = 3; j < col; j += 2) if(tbt.On(j)){	
			if(godirect)  
				tchain.ClearImmediate(j>>1);
			else
				Rating_Nested(ttt,n,j);
		}
	}end for ie
}
void PUZZLE :: ChainPlus ( ) { int godirect = ( ( rbase + 8 ) <= ermax ) ; BFTAG * t = zcf . h . d . t ; if ( 0 && options . ot && rbase == 85 && couprem < 2 ) { EE . Enl ( " \n \n " ) ; Image ( zcf . h . d ) ; } for ( int i = 2 ; i < col ; i += 2 ) { int icand = i >> 1 ; if ( dynamic_form1 . Off ( i ) ) { BFTAG zw1 = t [ i ] ; zw1 &= ( t [ i ] . Inverse ( ) ) . TrueState ( ) ; if ( zw1 . IsNotEmpty ( ) ) { dynamic_form1 . Set ( i ) ; if ( 1 && options . ot ) { EE . E ( " \n \n " ) ; zpln . ImageTag ( i ) ; EE . Enl ( ) ; } if ( godirect ) tchain . ClearImmediate ( icand ) ; else GoNestedCase1 ( icand ) ; } } BFTAG zw2 = t [ i ] ; zw2 &= t [ i ^ 1 ] ; zw2 = zw2 . FalseState ( ) ; zw2 -= dynamic_form2 [ icand ] ; if ( zw2 . IsNotEmpty ( ) ) { dynamic_form2 [ icand ] |= zw2 ; if ( 1 && options . ot ) { EE . E ( " \n \n " ) ; Image ( zw2 , " " , i ) ; } if ( godirect ) { for ( int j = 3 ; j < col ; j += 2 ) if ( zw2 . On ( j ) ) tchain . ClearImmediate ( j >> 1 ) ; } else { USHORT ttt [ ] = { i , i ^ 1 } ; zcf . h . dp . Shrink ( zw2 , i ) ; Image ( zw2 , " " , i ) ; for ( int j = 3 ; j < col ; j += 2 ) if ( zw2 . On ( j ) ) Rating_Nested ( ttt , 2 , j ) ; } } } if ( rbase < 85 ) return ; if ( 1 && options . ot ) { EE . Enl ( " \n \n " ) ; } godirect = ( ( rbase + 10 ) <= ermax ) ; int ie ; for ( ie = 1 ; ie < zcx . izc ; ie ++ ) { const SET & chx = zcx . zc [ ie ] ; if ( chx . type - SET_base ) break ; int n = chx . ncd ; USHORT * tcd = chx . tcd , ttt [ 20 ] ; BFTAG tbt , bfset ; tbt . SetAll_1 ( ) ; tbt -= dynamic_sets [ ie ] ; for ( int i = 0 ; i < n ; i ++ ) { ttt [ i ] = ( tcd [ i ] << 1 ) ; bfset . Set ( ttt [ i ] ^ 1 ) ; } for ( int i = 0 ; i < n ; i ++ ) { BFTAG tw = t [ tcd [ i ] << 1 ] ; tw -= bfset ; tbt &= tw ; } if ( tbt . IsEmpty ( ) ) continue ; dynamic_sets [ ie ] |= tbt ; if ( 1 && options . ot ) { EE . E ( " " ) ; chx . Image ( this , & EE ) ; Image ( tbt , " " , 0 ) ; EE . Enl ( ) ; } for ( int j = 3 ; j < col ; j += 2 ) if ( tbt . On ( j ) ) { if ( godirect ) tchain . ClearImmediate ( j >> 1 ) ; else Rating_Nested ( ttt , n , j ) ; } } }
looking for elimination in dynamic mode
in SE, such eliminations are always worked out of 2 chains
analyzed from the left to the right.
looking for elimination in dynamic mode in SE such eliminations are always worked out of 2 chains analyzed from the left to the right .
// this is a a-> b  and a -> ~b //Image(zw1," elims",i); // less already processed in dynamic search // if we start from a bi value, SE does not say // ~x but goes immediatly to the bi-value  saving one step. //  // this is x-> ~a and ~x -> ~a // end if zw2 // end for i // || tchain.elims_done)  cancelled to be closer to serate // now check multichains in a similar way but not for nishio // only base sets can be used // already seen in dynamic mode // end for ie