Skip to content

Commit

Permalink
fixes concerning return in equality domain, #159
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernutz committed Jun 30, 2017
1 parent 84b4e00 commit a581709
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private AbstractMultiState<STATE, VARDECL> calculateAbstractPost(
} else {
// a context switch happened
if (mUseHierachicalPre && mTransitionProvider.isLeavingScope(currentAction)) {
postState = preStateWithFreshVariables.apply(postOp, hierachicalPreState, currentAction);
postState = hierachicalPreState.apply(postOp, preState, currentAction);
} else {
postState = preStateWithFreshVariables.apply(postOp, preState, currentAction);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import de.uni_freiburg.informatik.ultimate.logic.TermVariable;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.absint.IAbstractPostOperator;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.CfgSmtToolkit;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.structure.IIcfgTransition;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.structure.IcfgLocation;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.variables.IProgramNonOldVar;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.variables.IProgramVar;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.cfg.variables.IProgramVarOrConst;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.smt.managedscript.ManagedScript;
import de.uni_freiburg.informatik.ultimate.modelcheckerutils.smt.predicates.PredicateTransformer;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.TransFormulaConverterCache;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.VPDomainPreanalysis;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.states.EqConstraint;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.states.EqConstraintFactory;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.states.EqDisjunctiveConstraint;
import de.uni_freiburg.informatik.ultimate.plugins.analysis.abstractinterpretationv2.domain.transformula.vp.states.EqOperationProvider;
Expand Down Expand Up @@ -115,7 +119,18 @@ public List<EqState<ACTION>> apply(EqState<ACTION> stateBeforeLeaving,
} else if (transition instanceof Return) {

final EqPredicate<ACTION> returnPred = stateBeforeLeaving.toEqPredicate();
final EqPredicate<ACTION> callPred = hierarchicalPreOrStateAfterLeaving.toEqPredicate();

Set<IProgramVar> oldVars =
hierarchicalPreOrStateAfterLeaving.getConstraint().getVariables(
mCfgSmtToolkit.getSymbolTable()).stream().filter(var -> var.isOldvar()).collect(Collectors.toSet());
Set<TermVariable> ovTvs = oldVars.stream().map(ov -> ov.getTermVariable()).collect(Collectors.toSet());
EqConstraint<ACTION, EqNode, EqFunction> projectedCons =
hierarchicalPreOrStateAfterLeaving.getConstraint().projectExistentially(ovTvs);
EqState<ACTION> hier = mEqConstraintFactory.getEqStateFactory().getEqState(projectedCons, hierarchicalPreOrStateAfterLeaving.getVariables());

final EqPredicate<ACTION> callPred = hier.toEqPredicate();
// final EqPredicate<ACTION> callPred = hierarchicalPreOrStateAfterLeaving.toEqPredicate();


final EqTransitionRelation<ACTION> returnTF = mTransFormulaConverter
.getEqTransitionRelationFromTransformula(((Return) transition).getAssignmentOfReturn());
Expand Down

0 comments on commit a581709

Please sign in to comment.