10#ifndef KLEE_SEARCHER_H
11#define KLEE_SEARCHER_H
18#include "llvm/Support/CommandLine.h"
19#include "llvm/Support/raw_ostream.h"
34 template<
class T,
class Comparator>
class DiscretePDF;
53 const std::vector<ExecutionState *> &addedStates,
54 const std::vector<ExecutionState *> &removedStates) = 0;
86 const std::vector<ExecutionState *> &addedStates,
87 const std::vector<ExecutionState *> &removedStates)
override;
88 bool empty()
override;
89 void printName(llvm::raw_ostream &os)
override;
102 const std::vector<ExecutionState *> &addedStates,
103 const std::vector<ExecutionState *> &removedStates)
override;
104 bool empty()
override;
105 void printName(llvm::raw_ostream &os)
override;
117 const std::vector<ExecutionState *> &addedStates,
118 const std::vector<ExecutionState *> &removedStates)
override;
119 bool empty()
override;
120 void printName(llvm::raw_ostream &os)
override;
138 std::unique_ptr<DiscretePDF<ExecutionState*, ExecutionStateIDCompare>>
states;
153 const std::vector<ExecutionState *> &addedStates,
154 const std::vector<ExecutionState *> &removedStates)
override;
155 bool empty()
override;
156 void printName(llvm::raw_ostream &os)
override;
189 const std::vector<ExecutionState *> &addedStates,
190 const std::vector<ExecutionState *> &removedStates)
override;
191 bool empty()
override;
192 void printName(llvm::raw_ostream &os)
override;
234 const std::vector<ExecutionState *> &addedStates,
235 const std::vector<ExecutionState *> &removedStates)
override;
237 bool empty()
override;
238 void printName(llvm::raw_ostream &os)
override;
262 const std::vector<ExecutionState *> &addedStates,
263 const std::vector<ExecutionState *> &removedStates)
override;
264 bool empty()
override;
265 void printName(llvm::raw_ostream &os)
override;
286 const std::vector<ExecutionState *> &addedStates,
287 const std::vector<ExecutionState *> &removedStates)
override;
288 bool empty()
override;
289 void printName(llvm::raw_ostream &os)
override;
306 const std::vector<ExecutionState *> &addedStates,
307 const std::vector<ExecutionState *> &removedStates)
override;
308 bool empty()
override;
309 void printName(llvm::raw_ostream &os)
override;
std::deque< ExecutionState * > states
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
ExecutionState & selectState() override
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
ExecutionState & selectState() override
std::unique_ptr< Searcher > baseSearcher
unsigned lastStartInstructions
BatchingSearcher(Searcher *baseSearcher, time::Span timeBudget, unsigned instructionBudget)
ExecutionState * lastState
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
unsigned instructionBudget
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
time::Point lastStartTime
~BatchingSearcher() override=default
std::vector< ExecutionState * > states
ExecutionState & selectState() override
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
ExecutionState representing a path under exploration.
ExecutionState & selectState() override
std::vector< std::unique_ptr< Searcher > > searchers
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
~InterleavedSearcher() override=default
InterleavedSearcher(const std::vector< Searcher * > &searchers)
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
std::unique_ptr< Searcher > baseSearcher
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
std::set< ExecutionState * > pausedStates
ExecutionState & selectState() override
IterativeDeepeningTimeSearcher(Searcher *baseSearcher)
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
~IterativeDeepeningTimeSearcher() override=default
Represents one klee_open_merge() call. Handles merging of states that branched from it.
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
std::unique_ptr< Searcher > baseSearcher
ExecutionState & selectState() override
std::set< ExecutionState * > inCloseMerge
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
MergingSearcher(Searcher *baseSearcher)
std::vector< MergeHandler * > mergeGroups
void continueState(ExecutionState &state)
Continue a paused state.
std::vector< ExecutionState * > pausedStates
States that have been paused by the 'pauseState' function.
~MergingSearcher() override=default
void pauseState(ExecutionState &state)
ExecutionState & selectState() override
~RandomPathSearcher() override=default
RandomPathSearcher(PTree &processTree, RNG &rng)
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
RandomSearcher picks a state randomly.
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
std::vector< ExecutionState * > states
ExecutionState & selectState() override
virtual void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates)=0
virtual ~Searcher()=default
virtual void printName(llvm::raw_ostream &os)=0
Prints name of searcher as a klee_message().
virtual ExecutionState & selectState()=0
void update(ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
ExecutionState & selectState() override
~WeightedRandomSearcher() override=default
WeightedRandomSearcher(WeightType type, RNG &rng)
void printName(llvm::raw_ostream &os) override
Prints name of searcher as a klee_message().
std::unique_ptr< DiscretePDF< ExecutionState *, ExecutionStateIDCompare > > states
double getWeight(ExecutionState *)
Span seconds(std::uint64_t)
llvm::cl::opt< bool > UseIncompleteMerge