diff options
author | qadeer <unknown> | 2014-01-13 15:48:32 -0800 |
---|---|---|
committer | qadeer <unknown> | 2014-01-13 15:48:32 -0800 |
commit | 64f99060b72b3c56e33e9a1523e24dacf9830288 (patch) | |
tree | b61556c483c2f562f26f57b82577c10a36bde3a0 /Source/Concurrency/OwickiGries.cs | |
parent | 451b7bfe5296ed2bd3568363294438b14df08fed (diff) |
a bug fix
Diffstat (limited to 'Source/Concurrency/OwickiGries.cs')
-rw-r--r-- | Source/Concurrency/OwickiGries.cs | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/Source/Concurrency/OwickiGries.cs b/Source/Concurrency/OwickiGries.cs index 1fb6cf20..0fdb01e6 100644 --- a/Source/Concurrency/OwickiGries.cs +++ b/Source/Concurrency/OwickiGries.cs @@ -31,18 +31,23 @@ namespace Microsoft.Boogie private void ProcessCallCmd(CallCmd originalCallCmd, CallCmd callCmd, List<Cmd> newCmds)
{
Procedure originalProc = originalCallCmd.Proc;
- if (phaseNum == enclosingProcPhaseNum && moverTypeChecker.procToActionInfo.ContainsKey(originalProc) && moverTypeChecker.procToActionInfo[originalProc].phaseNum < phaseNum)
+ if (phaseNum == enclosingProcPhaseNum && moverTypeChecker.procToActionInfo.ContainsKey(originalProc))
{
- List<AssertCmd> gate = moverTypeChecker.procToActionInfo[originalProc].thisGate;
- Dictionary<Variable, Expr> map = new Dictionary<Variable, Expr>();
- for (int i = 0; i < originalProc.InParams.Count; i++)
- {
- map[originalProc.InParams[i]] = callCmd.Ins[i];
- }
- Substitution subst = Substituter.SubstitutionFromHashtable(map);
- foreach (AssertCmd assertCmd in gate)
+ ActionInfo actionInfo = moverTypeChecker.procToActionInfo[originalProc];
+ List<AssertCmd> gate = actionInfo.thisGate;
+ if (actionInfo.phaseNum < phaseNum && gate.Count > 0)
{
- newCmds.Add(Substituter.Apply(subst, assertCmd));
+ newCmds.Add(new HavocCmd(Token.NoToken, new List<IdentifierExpr>(new IdentifierExpr[] { Expr.Ident(dummyLocalVar) } )));
+ Dictionary<Variable, Expr> map = new Dictionary<Variable, Expr>();
+ for (int i = 0; i < originalProc.InParams.Count; i++)
+ {
+ map[originalProc.InParams[i]] = callCmd.Ins[i];
+ }
+ Substitution subst = Substituter.SubstitutionFromHashtable(map);
+ foreach (AssertCmd assertCmd in gate)
+ {
+ newCmds.Add(Substituter.Apply(subst, assertCmd));
+ }
}
}
newCmds.Add(callCmd);
@@ -156,6 +161,7 @@ namespace Microsoft.Boogie return procMap[node];
}
+ private Variable dummyLocalVar;
public override Implementation VisitImplementation(Implementation node)
{
enclosingProcPhaseNum = moverTypeChecker.FindPhaseNumber(node.Proc);
@@ -163,7 +169,9 @@ namespace Microsoft.Boogie {
enclosingProcPhaseNum = moverTypeChecker.allPhaseNums.Max();
}
+ dummyLocalVar = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, "og_dummy", Type.Bool));
Implementation impl = base.VisitImplementation(node);
+ impl.LocVars.Add(dummyLocalVar);
impl.Name = impl.Proc.Name;
foreach (Block block in impl.Blocks)
{
|