klee
ArrayCache.h
Go to the documentation of this file.
1//===-- ArrayCache.h --------------------------------------------*- C++ -*-===//
2//
3// The KLEE Symbolic Virtual Machine
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef KLEE_ARRAYCACHE_H
11#define KLEE_ARRAYCACHE_H
12
13#include "klee/Expr/Expr.h"
14#include "klee/Expr/ArrayExprHash.h" // For klee::ArrayHashFn
15
16#include <string>
17#include <unordered_set>
18#include <vector>
19
20namespace klee {
21
23 bool operator()(const Array *array1, const Array *array2) const {
24 if (array1 == NULL || array2 == NULL)
25 return false;
26 return (array1->size == array2->size) && (array1->name == array2->name);
27 }
28};
29
32public:
36 //
47 // memory that constains a ``ref<ConstantExpr>`` (i.e. concrete values
48 // for the //array). This should be NULL for symbolic arrays.
56 const Array *CreateArray(const std::string &_name, uint64_t _size,
57 const ref<ConstantExpr> *constantValuesBegin = 0,
58 const ref<ConstantExpr> *constantValuesEnd = 0,
59 Expr::Width _domain = Expr::Int32,
60 Expr::Width _range = Expr::Int8);
61
62private:
63 typedef std::unordered_set<const Array *, klee::ArrayHashFn,
67 typedef std::vector<const Array *> ArrayPtrVec;
69};
70}
71
72#endif /* KLEE_ARRAYCACHE_H */
Provides an interface for creating and destroying Array objects.
Definition: ArrayCache.h:31
std::vector< const Array * > ArrayPtrVec
Definition: ArrayCache.h:67
std::unordered_set< const Array *, klee::ArrayHashFn, klee::EquivArrayCmpFn > ArrayHashMap
Definition: ArrayCache.h:65
ArrayHashMap cachedSymbolicArrays
Definition: ArrayCache.h:66
ArrayPtrVec concreteArrays
Definition: ArrayCache.h:68
const Array * CreateArray(const std::string &_name, uint64_t _size, const ref< ConstantExpr > *constantValuesBegin=0, const ref< ConstantExpr > *constantValuesEnd=0, Expr::Width _domain=Expr::Int32, Expr::Width _range=Expr::Int8)
Create an Array object.
Definition: ArrayCache.cpp:20
const unsigned size
Definition: Expr.h:489
const std::string name
Definition: Expr.h:486
static const Width Int32
Definition: Expr.h:103
unsigned Width
The type of an expression is simply its width, in bits.
Definition: Expr.h:97
static const Width Int8
Definition: Expr.h:101
Definition: Ref.h:82
Definition: main.cpp:291
bool operator()(const Array *array1, const Array *array2) const
Definition: ArrayCache.h:23