summaryrefslogtreecommitdiff
path: root/Source/Core/AbsyQuant.cs
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2013-12-24 20:52:24 -0800
committerGravatar qadeer <unknown>2013-12-24 20:52:24 -0800
commit0b396a7572daddd3f5dc1873c4507f92c078d6bb (patch)
treee33b94bd4b5046dbe0bce0799c1c41e37e1e74c7 /Source/Core/AbsyQuant.cs
parent7469e1902162ccfa08a5cf07660a7acfff43136a (diff)
more bug fixes
updates to DeviceCache.bpl to make it verify
Diffstat (limited to 'Source/Core/AbsyQuant.cs')
-rw-r--r--Source/Core/AbsyQuant.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/Core/AbsyQuant.cs b/Source/Core/AbsyQuant.cs
index 460e786a..06d72ee9 100644
--- a/Source/Core/AbsyQuant.cs
+++ b/Source/Core/AbsyQuant.cs
@@ -315,6 +315,37 @@ namespace Microsoft.Boogie {
return defl;
}
+ public static HashSet<Expr> FindExprAttributes(QKeyValue kv, string name)
+ {
+ Contract.Requires(name != null);
+ HashSet<Expr> attrs = new HashSet<Expr>();
+ for (; kv != null; kv = kv.Next)
+ {
+ if (kv.Key == name)
+ {
+ if (kv.Params.Count == 1 && kv.Params[0] is Expr)
+ {
+ attrs.Add((Expr)kv.Params[0]);
+ }
+ }
+ }
+ return attrs;
+ }
+
+ public static HashSet<int> FindIntAttributes(QKeyValue kv, string name)
+ {
+ Contract.Requires(name != null);
+ HashSet<int> attrs = new HashSet<int>();
+ HashSet<Expr> es = FindExprAttributes(kv, name);
+ foreach (Expr e in es)
+ {
+ LiteralExpr l = e as LiteralExpr;
+ if (l != null && l.isBigNum)
+ attrs.Add(l.asBigNum.ToIntSafe);
+ }
+ return attrs;
+ }
+
public override Absy Clone() {
List<object> newParams = new List<object>();
foreach (object o in Params)