Buggy code:
public class GROneDebug { public static void main ( String [ ] args ) throws Exception { } public static void analyze ( SMVModule env , SMVModule sys , String filename ) { } public static class NOPPrintStream extends PrintStream { public NOPPrintStream ( ) { } public void println ( String s ) { } } public static String justiceChecks ( SMVModule env , SMVModule sys , int explainSys , int explainEnv ) throws GameException { BDD all_init = sys . initial ( ) . and ( env . initial ( ) ) ; BDD counter_exmple ; GROneGame g ; String debugInfo = "" ; BDD prev ; g = new GROneGame ( env , sys , sys . justiceNum ( ) , env . justiceNum ( ) ) ; counter_exmple = g . envWinningStates ( ) . and ( all_init ) ; if ( counter_exmple . isZero ( ) ) { debugInfo += "REALIZABLE\n" ; } if ( ! ( env . justiceAt ( ( ( env . justiceNum ( ) ) - 1 ) ) . equals ( Env . TRUE ( ) ) ) ) { for ( int i = env . justiceNum ( ) ; i >= 1 ; i -- ) { if ( env . justiceAt ( ( i - 1 ) ) . isZero ( ) ) { debugInfo += ( "EnvGoals<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainEnv = 1 ; } else if ( ( env . trans ( ) . and ( Env . prime ( env . justiceAt ( ( i - 1 ) ) ) ) . isZero ( ) ) | ( env . trans ( ) . and ( env . justiceAt ( ( i - 1 ) ) ) . isZero ( ) ) ) { debugInfo += ( "EnvGoalsTrans<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainEnv = 1 ; } prev = counter_exmple ; g = new GROneGame ( env , sys , sys . justiceNum ( ) , i ) ; counter_exmple = g . envWinningStates ( ) . and ( all_init ) ; if ( explainEnv == 0 ) { if ( g . calculate_strategy ( 3 , all_init , false ) ) { debugInfo += ( "EnvGoalsTrans<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainEnv = 1 ; i = 0 ; } else if ( ( counter_exmple . isZero ( ) ) && ( i > 1 ) ) { debugInfo += ( "EnvGoals<seq2seq4repair_space>UNREAL<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainEnv = 1 ; i = 0 ; } } } } try { while ( ( env . justiceNum ( ) ) > 0 ) { env . popLastJustice ( ) ; } env . addJustice ( Env . TRUE ( ) ) ; } catch ( Exception e ) { System . err . println ( ( "Error:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } if ( ! ( sys . justiceAt ( 0 ) . equals ( Env . TRUE ( ) ) ) ) { for ( int i = 1 ; i <= ( sys . justiceNum ( ) ) ; i ++ ) { if ( sys . justiceAt ( ( i - 1 ) ) . isZero ( ) ) { debugInfo += ( "SysGoals<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainSys = 1 ; } else if ( ( sys . trans ( ) . and ( Env . prime ( sys . justiceAt ( ( i - 1 ) ) ) ) . isZero ( ) ) | ( sys . trans ( ) . and ( sys . justiceAt ( ( i - 1 ) ) ) . isZero ( ) ) ) { debugInfo += ( "SysGoalsTrans<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainSys = 1 ; } g = new GROneGame ( env , sys , i , 1 ) ; counter_exmple = g . envWinningStates ( ) . and ( all_init ) ; if ( ( explainSys == 0 ) && ( ! ( counter_exmple . isZero ( ) ) ) ) { <START_BUG> if ( g . calculate_counterstrategy ( all_init , true , false ) ) { <END_BUG> debugInfo += ( "SysGoalsTrans<seq2seq4repair_space>UNSAT<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainSys = 1 ; } else { debugInfo += ( "SysGoals<seq2seq4repair_space>UNREAL<seq2seq4repair_space>" + ( i - 1 ) ) + "\n" ; explainSys = 1 ; } i = ( sys . justiceNum ( ) ) + 1 ; } } } return debugInfo ; } No newline ; at end ; of file ; }

Fix:
if ( g . calculate_counterstrategy ( counter_exmple , true , false ) ) {