klee
ArrayExprRewriter.h
Go to the documentation of this file.
1//===-- ArrayExprRewriter.h -----------------------------------------------===//
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_ARRAYEXPRREWRITER_H
11#define KLEE_ARRAYEXPRREWRITER_H
12
13#include <iterator>
14#include <map>
15#include <vector>
16
17#include "klee/ADT/Ref.h"
18#include "klee/Expr/Expr.h"
19
20namespace klee {
21
22using array2idx_ty = std::map<const Array *, std::vector<ref<Expr>>>;
23using mapIndexOptimizedExpr_ty = std::map<ref<Expr>, std::vector<ref<Expr>>>;
24
26public:
27 static ref<Expr> createOptExpr(const ref<Expr> &e, const array2idx_ty &arrays,
28 const mapIndexOptimizedExpr_ty &idx_valIdx);
29
30private:
31 static ref<Expr> rewrite(const ref<Expr> &e, const array2idx_ty &arrays,
32 const mapIndexOptimizedExpr_ty &idx_valIdx);
33
34 static ref<Expr>
35 concatenateOrExpr(const std::vector<ref<Expr>>::const_iterator begin,
36 const std::vector<ref<Expr>>::const_iterator end);
37
38 static ref<Expr> createEqExpr(const ref<Expr> &index,
39 const ref<Expr> &valIndex);
40
41 static ref<Expr> createRangeExpr(const ref<Expr> &index,
42 const ref<Expr> &valStart,
43 const ref<Expr> &valEnd);
44};
45} // namespace klee
46
47#endif /* KLEE_ARRAYEXPRREWRITER_H */
Implements smart-pointer ref<> used by KLEE.
static ref< Expr > createOptExpr(const ref< Expr > &e, const array2idx_ty &arrays, const mapIndexOptimizedExpr_ty &idx_valIdx)
static ref< Expr > createRangeExpr(const ref< Expr > &index, const ref< Expr > &valStart, const ref< Expr > &valEnd)
static ref< Expr > concatenateOrExpr(const std::vector< ref< Expr > >::const_iterator begin, const std::vector< ref< Expr > >::const_iterator end)
static ref< Expr > rewrite(const ref< Expr > &e, const array2idx_ty &arrays, const mapIndexOptimizedExpr_ty &idx_valIdx)
static ref< Expr > createEqExpr(const ref< Expr > &index, const ref< Expr > &valIndex)
Definition: main.cpp:291
std::map< ref< Expr >, std::vector< ref< Expr > > > mapIndexOptimizedExpr_ty
std::map< const Array *, std::vector< ref< Expr > > > array2idx_ty