Buggy code:
@ Options ( prefix = "bmc" ) public class BMCAlgorithm extends AbstractBMCAlgorithm implements Algorithm { @ Option ( secure = true , description = "Check<seq2seq4repair_space>reachability<seq2seq4repair_space>of<seq2seq4repair_space>target<seq2seq4repair_space>states<seq2seq4repair_space>after<seq2seq4repair_space>analysis<seq2seq4repair_space>" + ( ( "(classical<seq2seq4repair_space>BMC).<seq2seq4repair_space>The<seq2seq4repair_space>alternative<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>check<seq2seq4repair_space>the<seq2seq4repair_space>reachability<seq2seq4repair_space>" + "as<seq2seq4repair_space>soon<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>target<seq2seq4repair_space>states<seq2seq4repair_space>are<seq2seq4repair_space>discovered,<seq2seq4repair_space>which<seq2seq4repair_space>is<seq2seq4repair_space>done<seq2seq4repair_space>if<seq2seq4repair_space>" ) + "cpa.predicate.targetStateSatCheck=true." ) ) private boolean checkTargetStates = true ; @ Option ( secure = true , description = "dump<seq2seq4repair_space>counterexample<seq2seq4repair_space>formula<seq2seq4repair_space>to<seq2seq4repair_space>file" ) @ FileOption ( Type . OUTPUT_FILE ) private PathTemplate dumpCounterexampleFormula = PathTemplate . ofFormatString ( "ErrorPath.%d.smt2" ) ; private final ConfigurableProgramAnalysis cpa ; private final FormulaManagerView fmgr ; private final PathFormulaManager pmgr ; private final BooleanFormulaManagerView bfmgr ; private final Solver solver ; private final Configuration config ; private final CFA cfa ; private final AssignmentToPathAllocator assignmentToPathAllocator ; public BMCAlgorithm ( Algorithm pAlgorithm , ConfigurableProgramAnalysis pCPA , Configuration pConfig , LogManager pLogger , ReachedSetFactory pReachedSetFactory , ShutdownNotifier pShutdownNotifier , CFA pCFA ) throws InvalidConfigurationException , CPAException { } @ Override public AlgorithmStatus run ( final ReachedSet reachedSet ) throws InterruptedException , CPAException { } @ Override protected CandidateGenerator getCandidateInvariants ( CFA cfa , Collection < CFANode > targetLocations ) { } @ Override protected boolean boundedModelCheck ( final ReachedSet pReachedSet , final ProverEnvironment pProver , CandidateInvariant pInductionProblem ) throws InterruptedException , CPATransferException , SolverException { } @ Override protected void analyzeCounterexample ( final ReachedSet pReachedSet , final ProverEnvironment pProver ) throws InterruptedException , CPATransferException { if ( ! ( ( cpa ) instanceof ARGCPA ) ) { logger . log ( Level . INFO , "Error<seq2seq4repair_space>found,<seq2seq4repair_space>but<seq2seq4repair_space>error<seq2seq4repair_space>path<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>created<seq2seq4repair_space>without<seq2seq4repair_space>ARGCPA" ) ; return ; } errorPathCreation . start ( ) ; try { logger . log ( Level . INFO , "Error<seq2seq4repair_space>found,<seq2seq4repair_space>creating<seq2seq4repair_space>error<seq2seq4repair_space>path" ) ; Set < ARGState > targetStates = FluentIterable . from ( pReachedSet ) . filter ( IS_TARGET_STATE ) . filter ( ARGState . class ) . toSet ( ) ; final boolean shouldCheckBranching ; if ( ( targetStates . size ( ) ) == 1 ) { ARGState state = Iterables . getOnlyElement ( targetStates ) ; while ( ( ( state . getParents ( ) . size ( ) ) == 1 ) && ( ( state . getChildren ( ) . size ( ) ) <= 1 ) ) { state = Iterables . getOnlyElement ( state . getParents ( ) ) ; } shouldCheckBranching = ( ( state . getParents ( ) . size ( ) ) > 1 ) || ( ( state . getChildren ( ) . size ( ) ) > 1 ) ; } else { shouldCheckBranching = true ; } if ( shouldCheckBranching ) { Iterable < ARGState > arg = FluentIterable . from ( pReachedSet ) . filter ( ARGState . class ) ; BooleanFormula branchingFormula = pmgr . buildBranchingFormula ( arg ) ; if ( bfmgr . isTrue ( branchingFormula ) ) { logger . log ( Level . WARNING , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>error<seq2seq4repair_space>path<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>missing<seq2seq4repair_space>branching<seq2seq4repair_space>information!" ) ; return ; } pProver . push ( branchingFormula ) ; } Model model ; try { boolean stillSatisfiable = ! ( pProver . isUnsat ( ) ) ; if ( ! stillSatisfiable ) { logger . log ( Level . WARNING , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>error<seq2seq4repair_space>path<seq2seq4repair_space>information<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>inconsistent<seq2seq4repair_space>branching<seq2seq4repair_space>information!" ) ; return ; } model = pProver . getModel ( ) ; } catch ( SolverException e ) { logger . log ( Level . WARNING , "Solver<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>produce<seq2seq4repair_space>model,<seq2seq4repair_space>cannot<seq2seq4repair_space>create<seq2seq4repair_space>error<seq2seq4repair_space>path." ) ; logger . logDebugException ( e ) ; return ; } finally { if ( shouldCheckBranching ) { pProver . pop ( ) ; } } Map < Integer , Boolean > branchingInformation = pmgr . getBranchingPredicateValuesFromModel ( model ) ; ARGState root = ( ( ARGState ) ( pReachedSet . getFirstState ( ) ) ) ; ARGPath targetPath ; try { targetPath = ARGUtils . getPathFromBranchingInformation ( root , pReachedSet . asCollection ( ) , branchingInformation ) ; } catch ( IllegalArgumentException e ) { logger . logUserException ( Level . WARNING , e , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>error<seq2seq4repair_space>path" ) ; return ; } CounterexampleInfo counterexample ; Solver solver = this . solver ; PathFormulaManager pmgr = this . pmgr ; if ( solver . getFormulaManager ( ) . getVersion ( ) . toLowerCase ( ) . contains ( "smtinterpol" ) ) { try { solver = Solver . create ( config , logger , shutdownNotifier ) ; FormulaManagerView formulaManager = solver . getFormulaManager ( ) ; pmgr = new org . sosy_lab . cpachecker . util . predicates . pathformula . PathFormulaManagerImpl ( formulaManager , config , logger , shutdownNotifier , cfa , AnalysisDirection . FORWARD ) ; } catch ( InvalidConfigurationException e ) { logger . logUserException ( Level . WARNING , e , "Could<seq2seq4repair_space>not<seq2seq4repair_space>replay<seq2seq4repair_space>error<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>a<seq2seq4repair_space>more<seq2seq4repair_space>precise<seq2seq4repair_space>model" ) ; return ; } } try { PathChecker pathChecker = new PathChecker ( logger , pmgr , solver , assignmentToPathAllocator ) ; CounterexampleTraceInfo info = pathChecker . checkPath ( targetPath . getInnerEdges ( ) ) ; if ( info . isSpurious ( ) ) { logger . log ( Level . WARNING , "Inconsistent<seq2seq4repair_space>replayed<seq2seq4repair_space>error<seq2seq4repair_space>path!" ) ; counterexample = CounterexampleInfo . feasible ( targetPath , RichModel . of ( model ) ) ; } else { counterexample = CounterexampleInfo . feasible ( targetPath , info . getModel ( ) ) ; counterexample . addFurtherInformation ( fmgr . dumpFormula ( bfmgr . and ( info . getCounterExampleFormulas ( ) ) ) , dumpCounterexampleFormula ) ; } } catch ( SolverException | CPATransferException e ) { logger . logUserException ( Level . WARNING , e , "Could<seq2seq4repair_space>not<seq2seq4repair_space>replay<seq2seq4repair_space>error<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>a<seq2seq4repair_space>more<seq2seq4repair_space>precise<seq2seq4repair_space>model" ) ; counterexample = CounterexampleInfo . feasible ( targetPath , RichModel . of ( model ) ) ; } <START_BUG> ( ( ARGCPA ) ( cpa ) ) . addCounterexample ( targetPath . getLastState ( ) , counterexample ) ; <END_BUG> } finally { errorPathCreation . stop ( ) ; } } }

Fix:
( ( ARGCPA ) ( cpa ) ) . addFeasibleCounterexample ( targetPath . getLastState ( ) , counterexample ) ;