klee
Constraints.h
Go to the documentation of this file.
1//===-- Constraints.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_CONSTRAINTS_H
11#define KLEE_CONSTRAINTS_H
12
13#include "klee/Expr/Expr.h"
14
15namespace klee {
16
20 friend class ConstraintManager;
21
22public:
23 using constraints_ty = std::vector<ref<Expr>>;
24 using iterator = constraints_ty::iterator;
25 using const_iterator = constraints_ty::const_iterator;
26
28
29 bool empty() const;
32 size_t size() const noexcept;
33
34 explicit ConstraintSet(constraints_ty cs) : constraints(std::move(cs)) {}
35 ConstraintSet() = default;
36
37 void push_back(const ref<Expr> &e);
38
39 bool operator==(const ConstraintSet &b) const {
40 return constraints == b.constraints;
41 }
42
43private:
45};
46
47class ExprVisitor;
48
51public:
55
61 const ref<Expr> &expr);
62
65 void addConstraint(const ref<Expr> &constraint);
66
67private:
71 bool rewriteConstraints(ExprVisitor &visitor);
72
74 void addConstraintInternal(const ref<Expr> &constraint);
75
77};
78
79} // namespace klee
80
81#endif /* KLEE_CONSTRAINTS_H */
Manages constraints, e.g. optimisation.
Definition: Constraints.h:50
void addConstraintInternal(const ref< Expr > &constraint)
Add constraint to the set of constraints.
bool rewriteConstraints(ExprVisitor &visitor)
Definition: Constraints.cpp:73
ConstraintSet & constraints
Definition: Constraints.h:76
void addConstraint(const ref< Expr > &constraint)
static ref< Expr > simplifyExpr(const ConstraintSet &constraints, const ref< Expr > &expr)
Definition: Constraints.cpp:92
ConstraintManager(ConstraintSet &constraints)
std::vector< ref< Expr > > constraints_ty
Definition: Constraints.h:23
const_iterator constraint_iterator
Definition: Constraints.h:27
constraints_ty constraints
Definition: Constraints.h:44
void push_back(const ref< Expr > &e)
ConstraintSet()=default
constraint_iterator end() const
constraint_iterator begin() const
size_t size() const noexcept
bool empty() const
constraints_ty::const_iterator const_iterator
Definition: Constraints.h:25
constraints_ty::iterator iterator
Definition: Constraints.h:24
bool operator==(const ConstraintSet &b) const
Definition: Constraints.h:39
Definition: main.cpp:291