klee
klee::RandomSearcher Class Referencefinal

RandomSearcher picks a state randomly. More...

#include <Searcher.h>

Inheritance diagram for klee::RandomSearcher:
Collaboration diagram for klee::RandomSearcher:

Public Member Functions

 RandomSearcher (RNG &rng)
 
ExecutionStateselectState () override
 
void update (ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates) override
 
bool empty () override
 
void printName (llvm::raw_ostream &os) override
 Prints name of searcher as a klee_message(). More...
 
- Public Member Functions inherited from klee::Searcher
virtual ~Searcher ()=default
 
virtual ExecutionStateselectState ()=0
 
virtual void update (ExecutionState *current, const std::vector< ExecutionState * > &addedStates, const std::vector< ExecutionState * > &removedStates)=0
 
virtual bool empty ()=0
 
virtual void printName (llvm::raw_ostream &os)=0
 Prints name of searcher as a klee_message(). More...
 

Private Attributes

std::vector< ExecutionState * > states
 
RNGtheRNG
 

Additional Inherited Members

- Public Types inherited from klee::Searcher
enum  CoreSearchType : std::uint8_t {
  DFS , BFS , RandomState , RandomPath ,
  NURS_CovNew , NURS_MD2U , NURS_Depth , NURS_RP ,
  NURS_ICnt , NURS_CPICnt , NURS_QC
}
 

Detailed Description

RandomSearcher picks a state randomly.

Definition at line 109 of file Searcher.h.

Constructor & Destructor Documentation

◆ RandomSearcher()

RandomSearcher::RandomSearcher ( RNG rng)
explicit

Definition at line 119 of file Searcher.cpp.

Member Function Documentation

◆ empty()

bool RandomSearcher::empty ( )
overridevirtual
Returns
True if no state left for exploration, False otherwise

Implements klee::Searcher.

Definition at line 139 of file Searcher.cpp.

References states.

◆ printName()

void RandomSearcher::printName ( llvm::raw_ostream &  os)
overridevirtual

Prints name of searcher as a klee_message().

Implements klee::Searcher.

Definition at line 143 of file Searcher.cpp.

◆ selectState()

ExecutionState & RandomSearcher::selectState ( )
overridevirtual

Selects a state for further exploration.

Returns
The selected state.

Implements klee::Searcher.

Definition at line 121 of file Searcher.cpp.

References klee::RNG::getInt32(), states, and theRNG.

Here is the call graph for this function:

◆ update()

void RandomSearcher::update ( ExecutionState current,
const std::vector< ExecutionState * > &  addedStates,
const std::vector< ExecutionState * > &  removedStates 
)
overridevirtual

Notifies searcher about new or deleted states.

Parameters
currentThe currently selected state for exploration.
addedStatesThe newly branched states with current as common ancestor.
removedStatesThe states that will be terminated.

Implements klee::Searcher.

Definition at line 125 of file Searcher.cpp.

References states.

Member Data Documentation

◆ states

std::vector<ExecutionState*> klee::RandomSearcher::states
private

Definition at line 110 of file Searcher.h.

Referenced by empty(), selectState(), and update().

◆ theRNG

RNG& klee::RandomSearcher::theRNG
private

Definition at line 111 of file Searcher.h.

Referenced by selectState().


The documentation for this class was generated from the following files: