src/puzzle.cpp
/* looking for fresh forcing chain
   we have to find
   the equivalent length
   all data necessary to track back the path, which means
   all candidates that must be eliminated to generate new strong links in use in the chain
 
  to explain the path
    go bakcward
    take all even steps (start=1) which are strong links
    check if this is a new link if yes take the equivalent BFTAG

*/
looking for fresh forcing chain
we have to find
the equivalent length
all data necessary to track back the path, which means
all candidates that must be eliminated to generate new strong links in use in the chain

to explain the path
go bakcward
take all even steps (start=1) which are strong links
check if this is a new link if yes take the equivalent BFTAG
looking for fresh forcing chain we have to find the equivalent length all data necessary to track back the path which means all candidates that must be eliminated to generate new strong links in use in the chain to explain the path go bakcward take all even steps ( start = 1 ) which are strong links check if this is a new link if yes take the equivalent BFTAG
void PUZZLE::NestedForcing(BFTAG & elims) {
	for(int i = 2; i < col; i += 2) {
		if( dn.Is(i, i ^ 1)) {  
			BFTAG wch = dpn.t[i], bfs; 
			int era=0;
			USHORT tt[200], itt ; 
			int npasch = wch.SearchChain(dpn.t, i, i ^ 1);
			if((!npasch)|| npasch > 50){
				era=3;
			}
			else{
               itt = npasch + 2;
			   if(wch.TrackBack(dpn.t, i, i ^ 1, tt, itt, i ^ 1))
			       era=2;   intercept error for debugging	
			}
			if(era){ more for debugging
				if(era<3){
					EE.E("nested forcing chain era="); EE.E(era);
					EE.E(" npasch="); EE.E(npasch);EE.Esp();
					EE.E( " search "); zpln.ImageTag(i); EE.Esp();
					EE.E( " => "); zpln.ImageTag(i^1); EE.Enl();
					Image((*cum),"cum ",0);
					Image(dpn.t[i],"dpn (i)",0);
					Image(dn.t[i],"dn (i)",0);
					EE.Enl();
					stop_rating=1;
				}
				continue; just skip it
			}
			for(int j = 1; j < itt - 1; j++) { all strong links 
				if((!(tt[j] & 1)) || (tt[j + 1] & 1)) continue;
				const CANDGOSTRONG * w = tcandgo.Get(tt[j], tt[j + 1]);
				if(w) bfs |= w->source;it is a new strong link
			}
			USHORT ii = tstore.AddOne(tt, itt);
			tsets[i ^ 1] =- tcandgo.itt;
            elims.Set(i ^ 1); 
			tcandgo.tt[tcandgo.itt++].Add(ii, bfs, npasch + 1); 
		}this is the final length
	}
}
void PUZZLE :: NestedForcing ( BFTAG & elims ) { for ( int i = 2 ; i < col ; i += 2 ) { if ( dn . Is ( i , i ^ 1 ) ) { BFTAG wch = dpn . t [ i ] , bfs ; int era = 0 ; USHORT tt [ 200 ] , itt ; int npasch = wch . SearchChain ( dpn . t , i , i ^ 1 ) ; if ( ( ! npasch ) || npasch > 50 ) { era = 3 ; } else { itt = npasch + 2 ; if ( wch . TrackBack ( dpn . t , i , i ^ 1 , tt , itt , i ^ 1 ) ) era = 2 ; } if ( era ) { if ( era < 3 ) { EE . E ( " " ) ; EE . E ( era ) ; EE . E ( " " ) ; EE . E ( npasch ) ; EE . Esp ( ) ; EE . E ( " " ) ; zpln . ImageTag ( i ) ; EE . Esp ( ) ; EE . E ( " " ) ; zpln . ImageTag ( i ^ 1 ) ; EE . Enl ( ) ; Image ( ( * cum ) , " " , 0 ) ; Image ( dpn . t [ i ] , " " , 0 ) ; Image ( dn . t [ i ] , " " , 0 ) ; EE . Enl ( ) ; stop_rating = 1 ; } continue ; } for ( int j = 1 ; j < itt - 1 ; j ++ ) { if ( ( ! ( tt [ j ] & 1 ) ) || ( tt [ j + 1 ] & 1 ) ) continue ; const CANDGOSTRONG * w = tcandgo . Get ( tt [ j ] , tt [ j + 1 ] ) ; if ( w ) bfs |= w -> source ; } USHORT ii = tstore . AddOne ( tt , itt ) ; tsets [ i ^ 1 ] = - tcandgo . itt ; elims . Set ( i ^ 1 ) ; tcandgo . tt [ tcandgo . itt ++ ] . Add ( ii , bfs , npasch + 1 ) ; } } }
looking for fresh forcing chain
we have to find
the equivalent length
all data necessary to track back the path, which means
all candidates that must be eliminated to generate new strong links in use in the chain
looking for fresh forcing chain we have to find the equivalent length all data necessary to track back the path which means all candidates that must be eliminated to generate new strong links in use in the chain
// a forcing chain found, find the length //1+npasch; ignore that long chain //  // intercept error for debugging	 //  more for debugging // just skip it //must add the source of the new strong links // all strong links  // it is a new strong link // this is the final length