summaryrefslogtreecommitdiff
path: root/Source/VCExpr/Boogie2VCExpr.cs
diff options
context:
space:
mode:
authorGravatar rustanleino <unknown>2010-10-12 00:13:50 +0000
committerGravatar rustanleino <unknown>2010-10-12 00:13:50 +0000
commit4fc18b2fe45c9a29cb0b8fe93d3102cec9c83194 (patch)
treea324eff1a6d8266938943a038450ce4eb790810b /Source/VCExpr/Boogie2VCExpr.cs
parentc830dff64feadac2f6aa8e0f2a7e647bf3d690f1 (diff)
Boogie:
* enhanced the printing of captured states * addressed some warnings issued by VS 2010 * some code formatting
Diffstat (limited to 'Source/VCExpr/Boogie2VCExpr.cs')
-rw-r--r--Source/VCExpr/Boogie2VCExpr.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/VCExpr/Boogie2VCExpr.cs b/Source/VCExpr/Boogie2VCExpr.cs
index b90196e2..64239e42 100644
--- a/Source/VCExpr/Boogie2VCExpr.cs
+++ b/Source/VCExpr/Boogie2VCExpr.cs
@@ -277,6 +277,28 @@ namespace Microsoft.Boogie.VCExprAST {
return cce.NonNull(res);
}
+ /// <summary>
+ /// Unlike LookupVariable, this method does not create a new variable mapping if none is
+ /// found. Instead, this method returns null in such cases. Also, this method does not
+ /// look for bound variables.
+ /// </summary>
+ /// <param name="boogieVar"></param>
+ /// <returns></returns>
+ public VCExprVar TryLookupVariable(Variable boogieVar) {
+ Contract.Requires(boogieVar != null);
+
+ VCExprVar res;
+ Formal fml = boogieVar as Formal;
+ if (fml != null && Formals.TryGetValue(fml, out res))
+ return cce.NonNull(res);
+
+ if (UnboundVariables.TryGetValue(boogieVar, out res)) {
+ return cce.NonNull(res);
+ }
+
+ return null; // not present
+ }
+
///////////////////////////////////////////////////////////////////////////////////
internal readonly VCGenerationOptions/*!*/ GenerationOptions;