about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-10-07 22:37:07 +0100
committerPeter Collingbourne <pcc@google.com>2014-04-15 22:57:20 -0700
commitaf76435053247adedb91219c5ae3cdd7ebbd4231 (patch)
tree91bf86f9221d2aa37f1dd637c3faa7c7b7da8df4 /include
parent5e0682ee26e02c710abd284f9f965e7a2c9a9f32 (diff)
downloadklee-af76435053247adedb91219c5ae3cdd7ebbd4231.tar.gz
Associate a domain and range with each array
Diffstat (limited to 'include')
-rw-r--r--include/klee/Expr.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h
index f893c6cc..ee3c3253 100644
--- a/include/klee/Expr.h
+++ b/include/klee/Expr.h
@@ -587,7 +587,9 @@ public:
   /// a symbolic array. If non-empty, this size of this array is equivalent to
   /// the array size.
   const std::vector< ref<ConstantExpr> > constantValues;
-  
+
+  Expr::Width domain, range;
+
 public:
   /// Array - Construct a new array object.
   ///
@@ -598,9 +600,11 @@ public:
   /// distinguished once printed.
   Array(const std::string &_name, uint64_t _size, 
         const ref<ConstantExpr> *constantValuesBegin = 0,
-        const ref<ConstantExpr> *constantValuesEnd = 0)
+        const ref<ConstantExpr> *constantValuesEnd = 0,
+        Expr::Width _domain = Expr::Int32, Expr::Width _range = Expr::Int8)
     : name(_name), size(_size), 
-      constantValues(constantValuesBegin, constantValuesEnd) {      
+      constantValues(constantValuesBegin, constantValuesEnd),
+      domain(_domain), range(_range) {
     assert((isSymbolicArray() || constantValues.size() == size) &&
            "Invalid size for constant array!");
     computeHash();
@@ -616,8 +620,8 @@ public:
   bool isSymbolicArray() const { return constantValues.empty(); }
   bool isConstantArray() const { return !isSymbolicArray(); }
 
-  Expr::Width getDomain() const { return Expr::Int32; }
-  Expr::Width getRange() const { return Expr::Int8; }
+  Expr::Width getDomain() const { return domain; }
+  Expr::Width getRange() const { return range; }
   
   unsigned computeHash();
   unsigned hash() const { return hashValue; }
@@ -671,7 +675,7 @@ public:
   
   static ref<Expr> create(const UpdateList &updates, ref<Expr> i);
   
-  Width getWidth() const { return Expr::Int8; }
+  Width getWidth() const { return updates.root->getRange(); }
   Kind getKind() const { return Read; }
   
   unsigned getNumKids() const { return numKids; }