klee
AssignmentGenerator.h
Go to the documentation of this file.
1//===-- AssignmentGenerator.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_ASSIGNMENTGENERATOR_H
11#define KLEE_ASSIGNMENTGENERATOR_H
12
13#include "klee/ADT/Ref.h"
14#include "klee/Expr/Expr.h"
15
16#include <vector>
17
18namespace klee {
19class Assignment;
20} /* namespace klee */
21
22namespace klee {
23
24class Expr;
25template <class T> class ref;
26
28public:
29 static bool generatePartialAssignment(const ref<Expr> &e, ref<Expr> &val,
30 Assignment *&a);
31
32private:
33 static bool helperGenerateAssignment(const ref<Expr> &e, ref<Expr> &val,
34 Assignment *&a, Expr::Width width,
35 bool sign);
36
37 static bool isReadExprAtOffset(ref<Expr> e, const ReadExpr *base,
38 ref<Expr> offset);
40
41 static ref<Expr> createSubExpr(const ref<Expr> &l, ref<Expr> &r);
42 static ref<Expr> createAddExpr(const ref<Expr> &l, ref<Expr> &r);
43 static ref<Expr> createMulExpr(const ref<Expr> &l, ref<Expr> &r);
44 static ref<Expr> createDivExpr(const ref<Expr> &l, ref<Expr> &r, bool sign);
45 static ref<Expr> createDivRem(const ref<Expr> &l, ref<Expr> &r, bool sign);
46 static ref<Expr> createShlExpr(const ref<Expr> &l, ref<Expr> &r);
47 static ref<Expr> createLShrExpr(const ref<Expr> &l, ref<Expr> &r);
48 static ref<Expr> createAndExpr(const ref<Expr> &l, ref<Expr> &r);
50 static ref<Expr> createExtendExpr(const ref<Expr> &l, ref<Expr> &r);
51
52 static std::vector<unsigned char> getByteValue(ref<Expr> &val);
53 static std::vector<unsigned char>
54 getIndexedValue(const std::vector<unsigned char> &c_val, ConstantExpr &index,
55 const unsigned int size);
56};
57} // namespace klee
58
59#endif /* KLEE_ASSIGNMENTGENERATOR_H */
Implements smart-pointer ref<> used by KLEE.
#define Expr
Definition: STPBuilder.h:19
static ref< Expr > createLShrExpr(const ref< Expr > &l, ref< Expr > &r)
static ref< Expr > createDivRem(const ref< Expr > &l, ref< Expr > &r, bool sign)
static bool isReadExprAtOffset(ref< Expr > e, const ReadExpr *base, ref< Expr > offset)
static ref< Expr > createAddExpr(const ref< Expr > &l, ref< Expr > &r)
static ref< Expr > createExtendExpr(const ref< Expr > &l, ref< Expr > &r)
static bool generatePartialAssignment(const ref< Expr > &e, ref< Expr > &val, Assignment *&a)
static ref< Expr > createShlExpr(const ref< Expr > &l, ref< Expr > &r)
static ref< Expr > createExtractExpr(const ref< Expr > &l, ref< Expr > &r)
static ref< Expr > createDivExpr(const ref< Expr > &l, ref< Expr > &r, bool sign)
static bool helperGenerateAssignment(const ref< Expr > &e, ref< Expr > &val, Assignment *&a, Expr::Width width, bool sign)
static ref< Expr > createMulExpr(const ref< Expr > &l, ref< Expr > &r)
static std::vector< unsigned char > getIndexedValue(const std::vector< unsigned char > &c_val, ConstantExpr &index, const unsigned int size)
static ref< Expr > createAndExpr(const ref< Expr > &l, ref< Expr > &r)
static std::vector< unsigned char > getByteValue(ref< Expr > &val)
static ref< Expr > createSubExpr(const ref< Expr > &l, ref< Expr > &r)
static ReadExpr * hasOrderedReads(ref< Expr > e)
unsigned Width
The type of an expression is simply its width, in bits.
Definition: Expr.h:97
Class representing a one byte read from an array.
Definition: Expr.h:565
Definition: main.cpp:291