12 #ifndef CPROVER_ANALYSES_AI_HISTORY_H
13 #define CPROVER_ANALYSES_AI_HISTORY_H
43 typedef std::shared_ptr<const ai_history_baset>
trace_ptrt;
79 typedef std::set<trace_ptrt, compare_historyt>
trace_sett;
144 virtual void output(std::ostream &out)
const
184 INVARIANT(others.size() == 1,
"Only needs one history per location");
186 const auto it = others.begin();
189 "The next location in history map must contain next history");
229 void output(std::ostream &out)
const override
253 template <
typename traceT>
The common case of history is to only care about where you are now, not how you got there!...
ahistoricalt(locationt l)
bool operator==(const ai_history_baset &op) const override
History objects should be comparable.
bool operator<(const ai_history_baset &op) const override
The order for history_sett.
ahistoricalt(const ahistoricalt &old)
const locationt & current_location(void) const override
The current location in the history, used to compute the transformer POSTCONDITION(return value is de...
step_returnt step(locationt to, const trace_sett &others, trace_ptrt caller_hist) const override
Step creates a new history by advancing the current one to location "to" It is given the set of all o...
bool should_widen(const ai_history_baset &other) const override
Domains with a substantial height may need to widen when merging this method allows the history to pr...
void output(std::ostream &out) const override
A history object is an abstraction / representation of the control-flow part of a set of traces.
std::shared_ptr< const ai_history_baset > trace_ptrt
History objects are intended to be immutable so they can be shared to reduce memory overhead.
ai_history_baset(const ai_history_baset &)
std::pair< step_statust, trace_ptrt > step_returnt
virtual bool operator<(const ai_history_baset &op) const =0
The order for history_sett.
virtual void output(std::ostream &out) const
static const trace_ptrt no_caller_history
virtual step_returnt step(locationt to, const trace_sett &others, trace_ptrt caller_hist) const =0
Step creates a new history by advancing the current one to location "to" It is given the set of all o...
virtual bool should_widen(const ai_history_baset &other) const
Domains with a substantial height may need to widen when merging this method allows the history to pr...
ai_history_baset(locationt)
Create a new history starting from a given location This is used to start the analysis from scratch P...
virtual jsont output_json(void) const
goto_programt::const_targett locationt
virtual bool operator==(const ai_history_baset &op) const =0
History objects should be comparable.
virtual xmlt output_xml(void) const
virtual const locationt & current_location(void) const =0
The current location in the history, used to compute the transformer POSTCONDITION(return value is de...
virtual ~ai_history_baset()
std::set< trace_ptrt, compare_historyt > trace_sett
As more detailed histories can get complex (for example, nested loops or deep, mutually recursive cal...
virtual ai_history_baset::trace_ptrt epoch(ai_history_baset::locationt)=0
Creates a new history from the given starting point.
virtual ~ai_history_factory_baset()
An easy factory implementation for histories that don't need parameters.
ai_history_baset::trace_ptrt epoch(ai_history_baset::locationt l) override
Creates a new history from the given starting point.
instructionst::const_iterator const_targett
#define PRECONDITION(CONDITION)
In a number of places we need to work with sets of histories so that these (a) make use of the immuta...
bool operator()(const trace_ptrt &l, const trace_ptrt &r) const