private PathFormula withCorrectionTermsAndPC(
      Block pBlock,
      FormulaManagerView pFmgr,
      BooleanFormulaManagerView pBfmgr,
      BitvectorFormulaManagerView pBvfmgr,
      PathFormulaManager pPfmgr,
      CFA pCFA) {
    BooleanFormula extendedBlockFormula = pBlock.getFormula();
    PathFormula unprimedBlockContext = pBlock.getUnprimedContext();
    PathFormula primedBlockContext = pBlock.getPrimedContext();
    SSAMap unprimedSSAMap = unprimedBlockContext.getSsa();
    SSAMap primedSSAMap = primedBlockContext.getSsa();
    for (String varName : programVariableNames) {
      // Add general correction v_1 = v_max if v is not in block formula (= not in primed context),
      if (!primedSSAMap.containsVariable(varName)) {
        BooleanFormula correctionterm =
            pBvfmgr.equal(
                makeVar(pPfmgr, pFmgr, this.unprimedContext, varName, STANDARD_UNPRIMED_SSA),
                makeVar(pPfmgr, pFmgr, this.primedContext, varName, highestSSA));
        extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
      } else {
        // Add low correction v_1 = v_? if unprimed context for v has higher index (? > 1).
        if (unprimedSSAMap.containsVariable(varName)
            && unprimedSSAMap.getIndex(varName) > STANDARD_UNPRIMED_SSA) {
          BooleanFormula correctionterm =
              pBvfmgr.equal(
                  makeVar(pPfmgr, pFmgr, unprimedBlockContext, varName, STANDARD_UNPRIMED_SSA),
                  makeVar(
                      pPfmgr,
                      pFmgr,
                      unprimedBlockContext,
                      varName,
                      unprimedSSAMap.getIndex(varName)));
          extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
        }
        // Add high correction v_? = v_max if primed context for v has lower index (? < max)
        if (primedSSAMap.getIndex(varName) < highestSSA) {
          BooleanFormula correctionterm =
              pBvfmgr.equal(
                  makeVar(
                      pPfmgr, pFmgr, primedBlockContext, varName, primedSSAMap.getIndex(varName)),
                  makeVar(pPfmgr, pFmgr, primedBlockContext, varName, highestSSA));
          extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
        }
      }
    }
    // Add program counter
    int predID = getID(pBlock.getPredecessorLocation());
    int succID = getID(pBlock.getSuccessorLocation());
    BooleanFormula pcBefore =
        pFmgr.instantiate(
            makeProgramcounterFormula(predID, pBvfmgr, pCFA),
            SSAMap.emptySSAMap().withDefault(STANDARD_UNPRIMED_SSA));
    BooleanFormula pcAfter =
        pFmgr.instantiate(
            makeProgramcounterFormula(succID, pBvfmgr, pCFA),
            SSAMap.emptySSAMap().withDefault(PC_PRIMED_SSA));
    extendedBlockFormula = pBfmgr.and(pcBefore, extendedBlockFormula, pcAfter);
    @SuppressWarnings("deprecation")
    // TODO: seems buggy because it implicitly combines extendedBlockFormula and
    // primedContext.getSsa() with PointerTargetSet of primedBlockContext, is this correct?
    PathFormula pathFormula =
        pPfmgr.makeNewPathFormula(
            primedBlockContext.updateFormula(extendedBlockFormula), this.primedContext.getSsa());
    return pathFormula;
  }
private PathFormula withCorrectionTermsAndPC(
      Block pBlock,
      FormulaManagerView pFmgr,
      BooleanFormulaManagerView pBfmgr,
      BitvectorFormulaManagerView pBvfmgr,
      PathFormulaManager pPfmgr,
      CFA pCFA) {
    BooleanFormula extendedBlockFormula = pBlock.getFormula();
    PathFormula unprimedBlockContext = pBlock.getUnprimedContext();
    PathFormula primedBlockContext = pBlock.getPrimedContext();
    SSAMap unprimedSSAMap = unprimedBlockContext.getSsa();
    SSAMap primedSSAMap = primedBlockContext.getSsa();
    for (String varName : programVariableNames) {
     
      if (!primedSSAMap.containsVariable(varName)) {
        BooleanFormula correctionterm =
            pBvfmgr.equal(
                makeVar(pPfmgr, pFmgr, this.unprimedContext, varName, STANDARD_UNPRIMED_SSA),
                makeVar(pPfmgr, pFmgr, this.primedContext, varName, highestSSA));
        extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
      } else {
       
        if (unprimedSSAMap.containsVariable(varName)
            && unprimedSSAMap.getIndex(varName) > STANDARD_UNPRIMED_SSA) {
          BooleanFormula correctionterm =
              pBvfmgr.equal(
                  makeVar(pPfmgr, pFmgr, unprimedBlockContext, varName, STANDARD_UNPRIMED_SSA),
                  makeVar(
                      pPfmgr,
                      pFmgr,
                      unprimedBlockContext,
                      varName,
                      unprimedSSAMap.getIndex(varName)));
          extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
        }
       
        if (primedSSAMap.getIndex(varName) < highestSSA) {
          BooleanFormula correctionterm =
              pBvfmgr.equal(
                  makeVar(
                      pPfmgr, pFmgr, primedBlockContext, varName, primedSSAMap.getIndex(varName)),
                  makeVar(pPfmgr, pFmgr, primedBlockContext, varName, highestSSA));
          extendedBlockFormula = pBfmgr.and(extendedBlockFormula, correctionterm);
        }
      }
    }
   
    int predID = getID(pBlock.getPredecessorLocation());
    int succID = getID(pBlock.getSuccessorLocation());
    BooleanFormula pcBefore =
        pFmgr.instantiate(
            makeProgramcounterFormula(predID, pBvfmgr, pCFA),
            SSAMap.emptySSAMap().withDefault(STANDARD_UNPRIMED_SSA));
    BooleanFormula pcAfter =
        pFmgr.instantiate(
            makeProgramcounterFormula(succID, pBvfmgr, pCFA),
            SSAMap.emptySSAMap().withDefault(PC_PRIMED_SSA));
    extendedBlockFormula = pBfmgr.and(pcBefore, extendedBlockFormula, pcAfter);
    @SuppressWarnings("deprecation")
   
   
    PathFormula pathFormula =
        pPfmgr.makeNewPathFormula(
            primedBlockContext.updateFormula(extendedBlockFormula), this.primedContext.getSsa());
    return pathFormula;
  }
private pathformula withcorrectiontermsandpc( block pblock, formulamanagerview pfmgr, booleanformulamanagerview pbfmgr, bitvectorformulamanagerview pbvfmgr, pathformulamanager ppfmgr, cfa pcfa) { booleanformula extendedblockformula = pblock.getformula(); pathformula unprimedblockcontext = pblock.getunprimedcontext(); pathformula primedblockcontext = pblock.getprimedcontext(); ssamap unprimedssamap = unprimedblockcontext.getssa(); ssamap primedssamap = primedblockcontext.getssa(); for (string varname : programvariablenames) { if (!primedssamap.containsvariable(varname)) { booleanformula correctionterm = pbvfmgr.equal( makevar(ppfmgr, pfmgr, this.unprimedcontext, varname, standard_unprimed_ssa), makevar(ppfmgr, pfmgr, this.primedcontext, varname, highestssa)); extendedblockformula = pbfmgr.and(extendedblockformula, correctionterm); } else { if (unprimedssamap.containsvariable(varname) && unprimedssamap.getindex(varname) > standard_unprimed_ssa) { booleanformula correctionterm = pbvfmgr.equal( makevar(ppfmgr, pfmgr, unprimedblockcontext, varname, standard_unprimed_ssa), makevar( ppfmgr, pfmgr, unprimedblockcontext, varname, unprimedssamap.getindex(varname))); extendedblockformula = pbfmgr.and(extendedblockformula, correctionterm); } if (primedssamap.getindex(varname) < highestssa) { booleanformula correctionterm = pbvfmgr.equal( makevar( ppfmgr, pfmgr, primedblockcontext, varname, primedssamap.getindex(varname)), makevar(ppfmgr, pfmgr, primedblockcontext, varname, highestssa)); extendedblockformula = pbfmgr.and(extendedblockformula, correctionterm); } } } int predid = getid(pblock.getpredecessorlocation()); int succid = getid(pblock.getsuccessorlocation()); booleanformula pcbefore = pfmgr.instantiate( makeprogramcounterformula(predid, pbvfmgr, pcfa), ssamap.emptyssamap().withdefault(standard_unprimed_ssa)); booleanformula pcafter = pfmgr.instantiate( makeprogramcounterformula(succid, pbvfmgr, pcfa), ssamap.emptyssamap().withdefault(pc_primed_ssa)); extendedblockformula = pbfmgr.and(pcbefore, extendedblockformula, pcafter); @suppresswarnings("deprecation") pathformula pathformula = ppfmgr.makenewpathformula( primedblockcontext.updateformula(extendedblockformula), this.primedcontext.getssa()); return pathformula; }