diff options
author | wuestholz <unknown> | 2014-06-26 22:32:51 +0200 |
---|---|---|
committer | wuestholz <unknown> | 2014-06-26 22:32:51 +0200 |
commit | f2742460f1fe65bde86dd30b0c8523b1eea40a4f (patch) | |
tree | f5578d5a812e434c30ac650338c4e3327ec716b3 | |
parent | a950dbe4cb278c934bdcb5d519e7c41f0fc4d0d0 (diff) |
Fixed issue in verification result caching.
-rw-r--r-- | Source/Core/Absy.cs | 6 | ||||
-rw-r--r-- | Source/VCGeneration/ConditionGeneration.cs | 4 | ||||
-rw-r--r-- | Test/snapshots/Snapshots15.v0.bpl | 13 | ||||
-rw-r--r-- | Test/snapshots/Snapshots15.v1.bpl | 13 | ||||
-rw-r--r-- | Test/snapshots/runtest.snapshot | 2 | ||||
-rw-r--r-- | Test/snapshots/runtest.snapshot.expect | 7 |
6 files changed, 39 insertions, 6 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs index 82c5cc59..649b4930 100644 --- a/Source/Core/Absy.cs +++ b/Source/Core/Absy.cs @@ -2695,11 +2695,11 @@ namespace Microsoft.Boogie { }
}
- public Expr ConjunctionOfInjectedAssumptionVariables()
+ public Expr ConjunctionOfInjectedAssumptionVariables(Dictionary<Variable, Expr> incarnationMap)
{
- Contract.Requires(InjectedAssumptionVariables != null && InjectedAssumptionVariables.Any());
+ Contract.Requires(InjectedAssumptionVariables != null && InjectedAssumptionVariables.Any() && incarnationMap != null);
- return LiteralExpr.BinaryTreeAnd(injectedAssumptionVariables.Select(v => (Expr)(new IdentifierExpr(Token.NoToken, v))).ToList());
+ return LiteralExpr.BinaryTreeAnd(injectedAssumptionVariables.Where(v => incarnationMap.ContainsKey(v)).Select(v => incarnationMap[v]).ToList());
}
public void InjectAssumptionVariable(LocalVariable variable)
diff --git a/Source/VCGeneration/ConditionGeneration.cs b/Source/VCGeneration/ConditionGeneration.cs index afd2d3e6..7d2ee3ac 100644 --- a/Source/VCGeneration/ConditionGeneration.cs +++ b/Source/VCGeneration/ConditionGeneration.cs @@ -1459,7 +1459,7 @@ namespace VC { && 2 <= currentImplementation.InjectedAssumptionVariables.Count)
{
// TODO(wuestholz): Maybe store the assertion expression in a local variable.
- var expr = LiteralExpr.Imp(currentImplementation.ConjunctionOfInjectedAssumptionVariables(), copy);
+ var expr = LiteralExpr.Imp(currentImplementation.ConjunctionOfInjectedAssumptionVariables(incarnationMap), copy);
passiveCmds.Add(new AssumeCmd(Token.NoToken, expr));
}
else if (currentImplementation != null
@@ -1473,7 +1473,7 @@ namespace VC { && currentImplementation.InjectedAssumptionVariables != null
&& currentImplementation.InjectedAssumptionVariables.Any())
{
- copy = LiteralExpr.Imp(currentImplementation.ConjunctionOfInjectedAssumptionVariables(), copy);
+ copy = LiteralExpr.Imp(currentImplementation.ConjunctionOfInjectedAssumptionVariables(incarnationMap), copy);
}
pc.Expr = copy;
passiveCmds.Add(pc);
diff --git a/Test/snapshots/Snapshots15.v0.bpl b/Test/snapshots/Snapshots15.v0.bpl new file mode 100644 index 00000000..3dbf492e --- /dev/null +++ b/Test/snapshots/Snapshots15.v0.bpl @@ -0,0 +1,13 @@ +procedure {:checksum "0"} M();
+
+implementation {:id "M"} {:checksum "1"} M()
+{
+ call N();
+
+ call N();
+
+ assert false;
+}
+
+procedure {:checksum "2"} N();
+ ensures false;
diff --git a/Test/snapshots/Snapshots15.v1.bpl b/Test/snapshots/Snapshots15.v1.bpl new file mode 100644 index 00000000..877b247c --- /dev/null +++ b/Test/snapshots/Snapshots15.v1.bpl @@ -0,0 +1,13 @@ +procedure {:checksum "0"} M();
+
+implementation {:id "M"} {:checksum "1"} M()
+{
+ call N();
+
+ call N();
+
+ assert false;
+}
+
+procedure {:checksum "3"} N();
+ ensures true;
diff --git a/Test/snapshots/runtest.snapshot b/Test/snapshots/runtest.snapshot index d61e9e4a..9d456440 100644 --- a/Test/snapshots/runtest.snapshot +++ b/Test/snapshots/runtest.snapshot @@ -1,2 +1,2 @@ -// RUN: %boogie -verifySnapshots:2 -verifySeparately Snapshots0.bpl Snapshots1.bpl Snapshots2.bpl Snapshots3.bpl Snapshots4.bpl Snapshots5.bpl Snapshots6.bpl Snapshots7.bpl Snapshots8.bpl Snapshots9.bpl Snapshots10.bpl Snapshots11.bpl Snapshots12.bpl Snapshots13.bpl Snapshots14.bpl > "%t" +// RUN: %boogie -verifySnapshots:2 -verifySeparately Snapshots0.bpl Snapshots1.bpl Snapshots2.bpl Snapshots3.bpl Snapshots4.bpl Snapshots5.bpl Snapshots6.bpl Snapshots7.bpl Snapshots8.bpl Snapshots9.bpl Snapshots10.bpl Snapshots11.bpl Snapshots12.bpl Snapshots13.bpl Snapshots14.bpl Snapshots15.bpl > "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Test/snapshots/runtest.snapshot.expect b/Test/snapshots/runtest.snapshot.expect index a370cbae..48251668 100644 --- a/Test/snapshots/runtest.snapshot.expect +++ b/Test/snapshots/runtest.snapshot.expect @@ -135,3 +135,10 @@ Execution trace: Snapshots14.v1.bpl(5,5): anon0
Boogie program verifier finished with 0 verified, 1 error
+
+Boogie program verifier finished with 1 verified, 0 errors
+Snapshots15.v1.bpl(9,5): Error BP5001: This assertion might not hold.
+Execution trace:
+ Snapshots15.v1.bpl(5,5): anon0
+
+Boogie program verifier finished with 0 verified, 1 error
|