summaryrefslogtreecommitdiff
path: root/Source/VCGeneration/ConditionGeneration.cs
diff options
context:
space:
mode:
authorGravatar allydonaldson <unknown>2013-07-18 23:10:38 +0100
committerGravatar allydonaldson <unknown>2013-07-18 23:10:38 +0100
commit51f2fa80a101ffae855c848ed83b889f1becbdd3 (patch)
tree1ca51470facc5d1f14ca4ef6bdaa0af07b41a226 /Source/VCGeneration/ConditionGeneration.cs
parent0f5809abee55aa22f2b496c826ea5b8f1a222e7d (diff)
parent3aba5ba4ae71402535162ca2d6dece344ecfcfb4 (diff)
Merge
Diffstat (limited to 'Source/VCGeneration/ConditionGeneration.cs')
-rw-r--r--Source/VCGeneration/ConditionGeneration.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/VCGeneration/ConditionGeneration.cs b/Source/VCGeneration/ConditionGeneration.cs
index 8afbf027..f625de75 100644
--- a/Source/VCGeneration/ConditionGeneration.cs
+++ b/Source/VCGeneration/ConditionGeneration.cs
@@ -203,15 +203,18 @@ namespace Microsoft.Boogie {
var filename = CommandLineOptions.Clo.ModelViewFile;
if (Model == null || filename == null || CommandLineOptions.Clo.StratifiedInlining > 0) return;
- var m = ModelHasStatesAlready ? Model : this.GetModelWithStates();
+ if (!ModelHasStatesAlready) {
+ PopulateModelWithStates();
+ ModelHasStatesAlready = true;
+ }
if (filename == "-") {
- m.Write(tw);
+ Model.Write(tw);
tw.Flush();
} else {
using (var wr = new StreamWriter(filename, !firstModelFile)) {
firstModelFile = false;
- m.Write(wr);
+ Model.Write(wr);
}
}
}
@@ -227,16 +230,16 @@ namespace Microsoft.Boogie {
m.Substitute(mapping);
}
- public Model GetModelWithStates()
+ public void PopulateModelWithStates()
{
- if (Model == null) return null;
+ Contract.Requires(Model != null);
Model m = Model;
ApplyRedirections(m);
var mvstates = m.TryGetFunc("@MV_state");
if (MvInfo == null || mvstates == null)
- return m;
+ return;
Contract.Assert(mvstates.Arity == 2);
@@ -282,8 +285,6 @@ namespace Microsoft.Boogie {
Contract.Assume(false);
}
}
-
- return m;
}
private Model.Element GetModelValue(Model m, Variable v) {