summaryrefslogtreecommitdiff
path: root/Source/Core/AbsyExpr.cs
diff options
context:
space:
mode:
authorGravatar Dan Liew <daniel.liew@imperial.ac.uk>2014-05-28 19:01:21 +0100
committerGravatar Dan Liew <daniel.liew@imperial.ac.uk>2014-05-28 19:01:21 +0100
commit44e2777a963f2cd14523093055a86803252049be (patch)
tree4e95833ae0c02830dce7c5b12d408a7ff6157bc4 /Source/Core/AbsyExpr.cs
parent29b1cfaeb1823e314476ecedfdc2683e5a62b2b9 (diff)
Add isBvConst and asBvConst accessors to LiteralExpr to match the
others already present for bool, BigNum and BigDec.
Diffstat (limited to 'Source/Core/AbsyExpr.cs')
-rw-r--r--Source/Core/AbsyExpr.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/AbsyExpr.cs b/Source/Core/AbsyExpr.cs
index d8cb623b..70b445b1 100644
--- a/Source/Core/AbsyExpr.cs
+++ b/Source/Core/AbsyExpr.cs
@@ -604,6 +604,19 @@ namespace Microsoft.Boogie {
}
}
+ public bool isBvConst {
+ get {
+ return Val is BvConst;
+ }
+ }
+
+ public BvConst asBvConst {
+ get {
+ Contract.Assert(isBvConst);
+ return (BvConst)cce.NonNull(Val);
+ }
+ }
+
public override Absy StdDispatch(StandardVisitor visitor) {
//Contract.Requires(visitor != null);
Contract.Ensures(Contract.Result<Absy>() != null);