cprover
ai.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Abstract Interpretation
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
44 
45 #ifndef CPROVER_ANALYSES_AI_H
46 #define CPROVER_ANALYSES_AI_H
47 
48 #include <iosfwd>
49 #include <map>
50 #include <memory>
51 
52 #include <util/json.h>
53 #include <util/xml.h>
54 #include <util/expr.h>
55 #include <util/make_unique.h>
56 
58 
59 #include "ai_domain.h"
60 #include "ai_history.h"
61 #include "ai_storage.h"
62 #include "is_threaded.h"
63 
117 
118 class ai_baset
119 {
120 public:
127 
129  std::unique_ptr<ai_history_factory_baset> &&hf,
130  std::unique_ptr<ai_domain_factory_baset> &&df,
131  std::unique_ptr<ai_storage_baset> &&st)
132  : history_factory(std::move(hf)),
133  domain_factory(std::move(df)),
134  storage(std::move(st))
135  {
136  }
137 
138  virtual ~ai_baset()
139  {
140  }
141 
144  const irep_idt &function_id,
145  const goto_programt &goto_program,
146  const namespacet &ns)
147  {
148  goto_functionst goto_functions;
149  initialize(function_id, goto_program);
150  trace_ptrt p = entry_state(goto_program);
151  fixedpoint(p, function_id, goto_program, goto_functions, ns);
152  finalize();
153  }
154 
157  const goto_functionst &goto_functions,
158  const namespacet &ns)
159  {
160  initialize(goto_functions);
161  trace_ptrt p = entry_state(goto_functions);
162  fixedpoint(p, goto_functions, ns);
163  finalize();
164  }
165 
167  void operator()(const abstract_goto_modelt &goto_model)
168  {
169  const namespacet ns(goto_model.get_symbol_table());
170  initialize(goto_model.get_goto_functions());
171  trace_ptrt p = entry_state(goto_model.get_goto_functions());
172  fixedpoint(p, goto_model.get_goto_functions(), ns);
173  finalize();
174  }
175 
178  const irep_idt &function_id,
179  const goto_functionst::goto_functiont &goto_function,
180  const namespacet &ns)
181  {
182  goto_functionst goto_functions;
183  initialize(function_id, goto_function);
184  trace_ptrt p = entry_state(goto_function.body);
185  fixedpoint(p, function_id, goto_function.body, goto_functions, ns);
186  finalize();
187  }
188 
195  {
196  return storage->abstract_traces_before(l);
197  }
198 
205  {
208  INVARIANT(!l->is_end_function(), "No state after the last instruction");
209  return storage->abstract_traces_before(std::next(l));
210  }
211 
222  {
223  return storage->abstract_state_before(l, *domain_factory);
224  }
225 
235  {
238  INVARIANT(!l->is_end_function(), "No state after the last instruction");
239  return abstract_state_before(std::next(l));
240  }
241 
244  {
245  return storage->abstract_state_before(p, *domain_factory);
246  }
247 
249  {
250  locationt l = p->current_location();
251  INVARIANT(!l->is_end_function(), "No state after the last instruction");
252 
253  locationt n = std::next(l);
254 
255  auto step_return = p->step(
256  n,
257  *(storage->abstract_traces_before(n)),
259  // Caller history not needed as this is a local step
260 
261  return storage->abstract_state_before(step_return.second, *domain_factory);
262  }
263 
265  virtual void clear()
266  {
267  storage->clear();
268  }
269 
276  virtual void output(
277  const namespacet &ns,
278  const irep_idt &function_id,
279  const goto_programt &goto_program,
280  std::ostream &out) const;
281 
283  virtual void output(
284  const namespacet &ns,
285  const goto_functionst &goto_functions,
286  std::ostream &out) const;
287 
289  void output(
290  const goto_modelt &goto_model,
291  std::ostream &out) const
292  {
293  const namespacet ns(goto_model.symbol_table);
294  output(ns, goto_model.goto_functions, out);
295  }
296 
298  void output(
299  const namespacet &ns,
300  const goto_functionst::goto_functiont &goto_function,
301  std::ostream &out) const
302  {
303  output(ns, irep_idt(), goto_function.body, out);
304  }
305 
307  virtual jsont output_json(
308  const namespacet &ns,
309  const goto_functionst &goto_functions) const;
310 
313  const goto_modelt &goto_model) const
314  {
315  const namespacet ns(goto_model.symbol_table);
316  return output_json(ns, goto_model.goto_functions);
317  }
318 
321  const namespacet &ns,
322  const goto_programt &goto_program) const
323  {
324  return output_json(ns, irep_idt(), goto_program);
325  }
326 
329  const namespacet &ns,
330  const goto_functionst::goto_functiont &goto_function) const
331  {
332  return output_json(ns, irep_idt(), goto_function.body);
333  }
334 
336  virtual xmlt output_xml(
337  const namespacet &ns,
338  const goto_functionst &goto_functions) const;
339 
342  const goto_modelt &goto_model) const
343  {
344  const namespacet ns(goto_model.symbol_table);
345  return output_xml(ns, goto_model.goto_functions);
346  }
347 
350  const namespacet &ns,
351  const goto_programt &goto_program) const
352  {
353  return output_xml(ns, irep_idt(), goto_program);
354  }
355 
358  const namespacet &ns,
359  const goto_functionst::goto_functiont &goto_function) const
360  {
361  return output_xml(ns, irep_idt(), goto_function.body);
362  }
363 
364 protected:
367  virtual void
368  initialize(const irep_idt &function_id, const goto_programt &goto_program);
369 
371  virtual void initialize(
372  const irep_idt &function_id,
373  const goto_functionst::goto_functiont &goto_function);
374 
377  virtual void initialize(const goto_functionst &goto_functions);
378 
381  virtual void finalize();
382 
385  trace_ptrt entry_state(const goto_programt &goto_program);
386 
389  trace_ptrt entry_state(const goto_functionst &goto_functions);
390 
397  virtual jsont output_json(
398  const namespacet &ns,
399  const irep_idt &function_id,
400  const goto_programt &goto_program) const;
401 
408  virtual xmlt output_xml(
409  const namespacet &ns,
410  const irep_idt &function_id,
411  const goto_programt &goto_program) const;
412 
415 
417  trace_ptrt get_next(working_sett &working_set);
418 
420  {
421  working_set.insert(t);
422  }
423 
426  virtual bool fixedpoint(
427  trace_ptrt starting_trace,
428  const irep_idt &function_id,
429  const goto_programt &goto_program,
430  const goto_functionst &goto_functions,
431  const namespacet &ns);
432 
433  virtual void fixedpoint(
434  trace_ptrt starting_trace,
435  const goto_functionst &goto_functions,
436  const namespacet &ns);
437 
442  virtual bool visit(
443  const irep_idt &function_id,
444  trace_ptrt p,
445  working_sett &working_set,
446  const goto_programt &goto_program,
447  const goto_functionst &goto_functions,
448  const namespacet &ns);
449 
450  // function calls and return are special cases
451  // different kinds of analysis handle these differently so these are virtual
452  // visit_function_call handles which function(s) to call,
453  // while visit_edge_function_call handles a single call
454  virtual bool visit_function_call(
455  const irep_idt &function_id,
456  trace_ptrt p_call,
457  working_sett &working_set,
458  const goto_programt &goto_program,
459  const goto_functionst &goto_functions,
460  const namespacet &ns);
461 
462  virtual bool visit_end_function(
463  const irep_idt &function_id,
464  trace_ptrt p,
465  working_sett &working_set,
466  const goto_programt &goto_program,
467  const goto_functionst &goto_functions,
468  const namespacet &ns);
469 
470  // The most basic step, computing one edge / transformer application.
471  bool visit_edge(
472  const irep_idt &function_id,
473  trace_ptrt p,
474  const irep_idt &to_function_id,
475  locationt to_l,
476  trace_ptrt caller_history,
477  const namespacet &ns,
478  working_sett &working_set);
479 
480  virtual bool visit_edge_function_call(
481  const irep_idt &calling_function_id,
482  trace_ptrt p_call,
483  locationt l_return,
484  const irep_idt &callee_function_id,
485  working_sett &working_set,
486  const goto_programt &callee,
487  const goto_functionst &goto_functions,
488  const namespacet &ns);
489 
491  std::unique_ptr<ai_history_factory_baset> history_factory;
492 
494  std::unique_ptr<ai_domain_factory_baset> domain_factory;
495 
498  virtual bool merge(const statet &src, trace_ptrt from, trace_ptrt to)
499  {
500  statet &dest = get_state(to);
501  return domain_factory->merge(dest, src, from, to);
502  }
503 
505  virtual std::unique_ptr<statet> make_temporary_state(const statet &s)
506  {
507  return domain_factory->copy(s);
508  }
509 
510  // Domain and history storage
511  std::unique_ptr<ai_storage_baset> storage;
512 
516  {
517  return storage->get_state(p, *domain_factory);
518  }
519 };
520 
521 // Perform interprocedural analysis by simply recursing in the interpreter
522 // This can lead to a call stack overflow if the domain has a large height
524 {
525 public:
527  std::unique_ptr<ai_history_factory_baset> &&hf,
528  std::unique_ptr<ai_domain_factory_baset> &&df,
529  std::unique_ptr<ai_storage_baset> &&st)
530  : ai_baset(std::move(hf), std::move(df), std::move(st))
531  {
532  }
533 
534 protected:
535  // Override the function that handles a single function call edge
537  const irep_idt &calling_function_id,
538  trace_ptrt p_call,
539  locationt l_return,
540  const irep_idt &callee_function_id,
541  working_sett &working_set,
542  const goto_programt &callee,
543  const goto_functionst &goto_functions,
544  const namespacet &ns) override;
545 };
546 
556 template <typename domainT>
558 {
559 public:
560  // constructor
561  ait()
567  {
568  }
569 
570  explicit ait(std::unique_ptr<ai_domain_factory_baset> &&df)
574  std::move(df),
576  {
577  }
578 
580 
582  // The older interface for non-modifying access
583  // Not recommended as it will throw an exception if a location has not
584  // been reached in an analysis and there is no (other) way of telling
585  // if a location has been reached.
586  DEPRECATED(SINCE(2019, 08, 01, "use abstract_state_{before,after} instead"))
587  const domainT &operator[](locationt l) const
588  {
589  auto p = storage->abstract_state_before(l, *domain_factory);
590 
591  if(p.use_count() == 1)
592  {
593  // Would be unsafe to return the dereferenced object
594  throw std::out_of_range("failed to find state");
595  }
596 
597  return static_cast<const domainT &>(*p);
598  }
599 
600 protected:
601  // Support the legacy get_state interface which is needed for a few domains
602  // This is one of the few users of the legacy get_state(locationt) method
603  // in location_sensitive_storaget.
604  DEPRECATED(SINCE(2019, 08, 01, "use get_state(trace_ptrt p) instead"))
606  {
607  auto &s = dynamic_cast<location_sensitive_storaget &>(*storage);
608  return s.get_state(l, *domain_factory);
609  }
610 
612 
613 private:
616  void dummy(const domainT &s) { const statet &x=s; (void)x; }
617 };
618 
640 template<typename domainT>
641 class concurrency_aware_ait:public ait<domainT>
642 {
643 public:
644  using statet = typename ait<domainT>::statet;
645  using locationt = typename statet::locationt;
646 
647  // constructor
649  {
650  }
651  explicit concurrency_aware_ait(std::unique_ptr<ai_domain_factory_baset> &&df)
652  : ait<domainT>(std::move(df))
653  {
654  }
655 
656  virtual bool merge_shared(
657  const statet &src,
658  locationt from,
659  locationt to,
660  const namespacet &ns)
661  {
662  statet &dest=this->get_state(to);
663  return static_cast<domainT &>(dest).merge_shared(
664  static_cast<const domainT &>(src), from, to, ns);
665  }
666 
667 protected:
669 
671  ai_baset::trace_ptrt start_trace,
672  const goto_functionst &goto_functions,
673  const namespacet &ns) override
674  {
675  ai_baset::fixedpoint(start_trace, goto_functions, ns);
676 
677  is_threadedt is_threaded(goto_functions);
678 
679  // construct an initial shared state collecting the results of all
680  // functions
681  goto_programt tmp;
682  tmp.add_instruction();
683  goto_programt::const_targett sh_target = tmp.instructions.begin();
684  ai_baset::trace_ptrt target_hist =
685  ai_baset::history_factory->epoch(sh_target);
686  statet &shared_state = ait<domainT>::get_state(sh_target);
687 
688  struct wl_entryt
689  {
690  wl_entryt(
691  const irep_idt &_function_id,
692  const goto_programt &_goto_program,
693  locationt _location)
694  : function_id(_function_id),
695  goto_program(&_goto_program),
696  location(_location)
697  {
698  }
699 
700  irep_idt function_id;
701  const goto_programt *goto_program;
702  locationt location;
703  };
704 
705  typedef std::list<wl_entryt> thread_wlt;
706  thread_wlt thread_wl;
707 
708  forall_goto_functions(it, goto_functions)
709  forall_goto_program_instructions(t_it, it->second.body)
710  {
711  if(is_threaded(t_it))
712  {
713  thread_wl.push_back(wl_entryt(it->first, it->second.body, t_it));
714 
716  it->second.body.instructions.end();
717  --l_end;
718 
719  merge_shared(shared_state, l_end, sh_target, ns);
720  }
721  }
722 
723  // now feed in the shared state into all concurrently executing
724  // functions, and iterate until the shared state stabilizes
725  bool new_shared = true;
726  while(new_shared)
727  {
728  new_shared = false;
729 
730  for(const auto &wl_entry : thread_wl)
731  {
732  working_sett working_set;
734  ai_baset::history_factory->epoch(wl_entry.location));
735  ai_baset::put_in_working_set(working_set, t);
736 
737  statet &begin_state = ait<domainT>::get_state(wl_entry.location);
738  ait<domainT>::merge(begin_state, target_hist, t);
739 
740  while(!working_set.empty())
741  {
742  ai_baset::trace_ptrt p = ai_baset::get_next(working_set);
743  goto_programt::const_targett l = p->current_location();
744 
746  wl_entry.function_id,
747  p,
748  working_set,
749  *(wl_entry.goto_program),
750  goto_functions,
751  ns);
752 
753  // the underlying domain must make sure that the final state
754  // carries all possible values; otherwise we would need to
755  // merge over each and every state
756  if(l->is_end_function())
757  new_shared |= merge_shared(shared_state, l, sh_target, ns);
758  }
759  }
760  }
761  }
762 };
763 
764 #endif // CPROVER_ANALYSES_AI_H
ai_domain_factory_default_constructort
Definition: ai_domain.h:243
ai_baset::output_xml
xmlt output_xml(const namespacet &ns, const goto_programt &goto_program) const
Output the abstract states for a single function as XML.
Definition: ai.h:349
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:37
ai_baset::abstract_state_after
virtual cstate_ptrt abstract_state_after(const trace_ptrt &p) const
Definition: ai.h:248
ai_baset::output_json
virtual jsont output_json(const namespacet &ns, const goto_functionst &goto_functions) const
Output the abstract states for the whole program as JSON.
Definition: ai.cpp:62
ai_baset::get_next
trace_ptrt get_next(working_sett &working_set)
Get the next location from the work queue.
Definition: ai.cpp:207
abstract_goto_modelt::get_symbol_table
virtual const symbol_tablet & get_symbol_table() const =0
Accessor to get the symbol table.
ai_baset::abstract_traces_after
virtual ctrace_set_ptrt abstract_traces_after(locationt l) const
Returns all of the histories that have reached the end of the instruction.
Definition: ai.h:204
concurrency_aware_ait::fixedpoint
void fixedpoint(ai_baset::trace_ptrt start_trace, const goto_functionst &goto_functions, const namespacet &ns) override
Definition: ai.h:670
ai_baset::visit_end_function
virtual bool visit_end_function(const irep_idt &function_id, trace_ptrt p, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Definition: ai.cpp:457
ai_baset::locationt
goto_programt::const_targett locationt
Definition: ai.h:126
ai_domain.h
Abstract Interpretation Domain.
ai_baset::working_sett
trace_sett working_sett
The work queue, sorted using the history's ordering operator.
Definition: ai.h:414
concurrency_aware_ait::merge_shared
virtual bool merge_shared(const statet &src, locationt from, locationt to, const namespacet &ns)
Definition: ai.h:656
ahistoricalt
The common case of history is to only care about where you are now, not how you got there!...
Definition: ai_history.h:155
ai_recursive_interproceduralt
Definition: ai.h:524
ai_baset::visit_function_call
virtual bool visit_function_call(const irep_idt &function_id, trace_ptrt p_call, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Definition: ai.cpp:383
ait::dummy
void dummy(const domainT &s)
This function exists to enforce that domainT is derived from ai_domain_baset.
Definition: ai.h:616
ai_baset::operator()
void operator()(const abstract_goto_modelt &goto_model)
Run abstract interpretation on a whole program.
Definition: ai.h:167
ai_baset::make_temporary_state
virtual std::unique_ptr< statet > make_temporary_state(const statet &s)
Make a copy of a state.
Definition: ai.h:505
ai_baset::visit
virtual bool visit(const irep_idt &function_id, trace_ptrt p, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Perform one step of abstract interpretation from trace t Depending on the instruction type it may com...
Definition: ai.cpp:263
ai_baset::put_in_working_set
void put_in_working_set(working_sett &working_set, trace_ptrt t)
Definition: ai.h:419
ai_baset::output_xml
virtual xmlt output_xml(const namespacet &ns, const goto_functionst &goto_functions) const
Output the abstract states for the whole program as XML.
Definition: ai.cpp:109
goto_model.h
Symbol Table + CFG.
ait
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition: ai.h:558
goto_modelt
Definition: goto_model.h:26
ai_baset::abstract_state_before
virtual cstate_ptrt abstract_state_before(locationt l) const
Get a copy of the abstract state before the given instruction, without needing to know what kind of d...
Definition: ai.h:221
irep_idt
dstringt irep_idt
Definition: irep.h:32
ai_history_baset::no_caller_history
static const trace_ptrt no_caller_history
Definition: ai_history.h:121
ait::ait
ait()
Definition: ai.h:561
jsont
Definition: json.h:27
xml.h
location_sensitive_storaget::get_state
statet & get_state(trace_ptrt p, const ai_domain_factory_baset &fac) override
Look up the analysis state for a given history, instantiating a new domain if required.
Definition: ai_storage.h:188
ai_baset::~ai_baset
virtual ~ai_baset()
Definition: ai.h:138
expr.h
is_threadedt
Definition: is_threaded.h:22
ai_baset::abstract_state_after
virtual cstate_ptrt abstract_state_after(locationt l) const
Get a copy of the abstract state after the given instruction, without needing to know what kind of do...
Definition: ai.h:234
ai_baset::ai_baset
ai_baset(std::unique_ptr< ai_history_factory_baset > &&hf, std::unique_ptr< ai_domain_factory_baset > &&df, std::unique_ptr< ai_storage_baset > &&st)
Definition: ai.h:128
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:92
ai_baset::statet
ai_domain_baset statet
Definition: ai.h:121
goto_programt::add_instruction
targett add_instruction()
Adds an instruction at the end.
Definition: goto_program.h:694
util_make_unique
std::unique_ptr< T > util_make_unique(Ts &&... ts)
Definition: make_unique.h:19
ai_baset::get_state
virtual statet & get_state(trace_ptrt p)
Get the state for the given history, creating it with the factory if it doesn't exist.
Definition: ai.h:515
ai_history_baset::trace_sett
std::set< trace_ptrt, compare_historyt > trace_sett
Definition: ai_history.h:79
make_unique.h
ait::locationt
goto_programt::const_targett locationt
Definition: ai.h:579
ai_baset::operator()
void operator()(const goto_functionst &goto_functions, const namespacet &ns)
Run abstract interpretation on a whole program.
Definition: ai.h:156
ai_history_factory_default_constructort
An easy factory implementation for histories that don't need parameters.
Definition: ai_history.h:255
ai_baset::output_json
jsont output_json(const namespacet &ns, const goto_functionst::goto_functiont &goto_function) const
Output the abstract states for a single function as JSON.
Definition: ai.h:328
ait::get_state
virtual statet & get_state(trace_ptrt p)
Get the state for the given history, creating it with the factory if it doesn't exist.
Definition: ai.h:515
ai_baset::output
void output(const goto_modelt &goto_model, std::ostream &out) const
Output the abstract states for a whole program.
Definition: ai.h:289
ai_baset::domain_factory
std::unique_ptr< ai_domain_factory_baset > domain_factory
For creating domain objects.
Definition: ai.h:494
ai_storage_baset::ctrace_set_ptrt
std::shared_ptr< const trace_sett > ctrace_set_ptrt
Definition: ai_storage.h:52
is_threaded.h
Over-approximate Concurrency for Threaded Goto Programs.
ai_baset::storage
std::unique_ptr< ai_storage_baset > storage
Definition: ai.h:511
concurrency_aware_ait::concurrency_aware_ait
concurrency_aware_ait(std::unique_ptr< ai_domain_factory_baset > &&df)
Definition: ai.h:651
ai_baset::abstract_traces_before
virtual ctrace_set_ptrt abstract_traces_before(locationt l) const
Returns all of the histories that have reached the start of the instruction.
Definition: ai.h:194
ai_baset::output_json
jsont output_json(const namespacet &ns, const goto_programt &goto_program) const
Output the abstract states for a single function as JSON.
Definition: ai.h:320
ai_baset::cstate_ptrt
ai_storage_baset::cstate_ptrt cstate_ptrt
Definition: ai.h:122
ai_baset::history_factory
std::unique_ptr< ai_history_factory_baset > history_factory
For creating history objects.
Definition: ai.h:491
SINCE
#define SINCE(year, month, day, msg)
Definition: deprecate.h:26
ai_baset::finalize
virtual void finalize()
Override this to add a cleanup or post-processing step after fixedpoint has run.
Definition: ai.cpp:202
xmlt
Definition: xml.h:21
location_sensitive_storaget
The most conventional storage; one domain per location.
Definition: ai_storage.h:150
ai_baset::visit_edge
bool visit_edge(const irep_idt &function_id, trace_ptrt p, const irep_idt &to_function_id, locationt to_l, trace_ptrt caller_history, const namespacet &ns, working_sett &working_set)
Definition: ai.cpp:320
ai_baset::entry_state
trace_ptrt entry_state(const goto_programt &goto_program)
Set the abstract state of the entry location of a single function to the entry state required by the ...
Definition: ai.cpp:175
ai_baset::merge
virtual bool merge(const statet &src, trace_ptrt from, trace_ptrt to)
Merge the state src, flowing from tracet from to tracet to, into the state currently stored for trace...
Definition: ai.h:498
ai_baset::abstract_state_before
virtual cstate_ptrt abstract_state_before(const trace_ptrt &p) const
The same interfaces but with histories.
Definition: ai.h:243
ai_history.h
Abstract Interpretation history.
goto_functionst::goto_functiont
::goto_functiont goto_functiont
Definition: goto_functions.h:25
goto_programt::instructions
instructionst instructions
The list of instructions in the goto program.
Definition: goto_program.h:585
ai_baset::initialize
virtual void initialize(const irep_idt &function_id, const goto_programt &goto_program)
Initialize all the abstract states for a single function.
Definition: ai.cpp:190
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:23
ai_baset::output
void output(const namespacet &ns, const goto_functionst::goto_functiont &goto_function, std::ostream &out) const
Output the abstract states for a function.
Definition: ai.h:298
ai_domain_baset::locationt
goto_programt::const_targett locationt
Definition: ai_domain.h:76
abstract_goto_modelt::get_goto_functions
virtual const goto_functionst & get_goto_functions() const =0
Accessor to get a raw goto_functionst.
ai_storage.h
Abstract Interpretation Storage.
ai_baset::fixedpoint
virtual bool fixedpoint(trace_ptrt starting_trace, const irep_idt &function_id, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Run the fixedpoint algorithm until it reaches a fixed point.
Definition: ai.cpp:225
DEPRECATED
#define DEPRECATED(msg)
Definition: deprecate.h:23
goto_modelt::goto_functions
goto_functionst goto_functions
GOTO functions.
Definition: goto_model.h:33
ai_baset::trace_sett
ai_history_baset::trace_sett trace_sett
Definition: ai.h:124
ai_baset::output
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
Definition: ai.cpp:42
ai_history_baset::trace_ptrt
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.
Definition: ai_history.h:43
ai_storage_baset::cstate_ptrt
std::shared_ptr< const statet > cstate_ptrt
Definition: ai_storage.h:47
concurrency_aware_ait
Base class for concurrency-aware abstract interpretation.
Definition: ai.h:642
ai_baset
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition: ai.h:119
ai_baset::output_json
jsont output_json(const goto_modelt &goto_model) const
Output the abstract states for a whole program as JSON.
Definition: ai.h:312
json.h
ai_baset::operator()
void operator()(const irep_idt &function_id, const goto_programt &goto_program, const namespacet &ns)
Run abstract interpretation on a single function.
Definition: ai.h:143
ait::ait
ait(std::unique_ptr< ai_domain_factory_baset > &&df)
Definition: ai.h:570
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:73
ai_baset::visit_edge_function_call
virtual bool visit_edge_function_call(const irep_idt &calling_function_id, trace_ptrt p_call, locationt l_return, const irep_idt &callee_function_id, working_sett &working_set, const goto_programt &callee, const goto_functionst &goto_functions, const namespacet &ns)
Definition: ai.cpp:360
forall_goto_functions
#define forall_goto_functions(it, functions)
Definition: goto_functions.h:122
ai_baset::trace_ptrt
ai_history_baset::trace_ptrt trace_ptrt
Definition: ai.h:123
ai_baset::clear
virtual void clear()
Reset the abstract state.
Definition: ai.h:265
goto_programt::const_targett
instructionst::const_iterator const_targett
Definition: goto_program.h:580
ai_baset::ctrace_set_ptrt
ai_storage_baset::ctrace_set_ptrt ctrace_set_ptrt
Definition: ai.h:125
abstract_goto_modelt
Abstract interface to eager or lazy GOTO models.
Definition: abstract_goto_model.h:21
ai_recursive_interproceduralt::ai_recursive_interproceduralt
ai_recursive_interproceduralt(std::unique_ptr< ai_history_factory_baset > &&hf, std::unique_ptr< ai_domain_factory_baset > &&df, std::unique_ptr< ai_storage_baset > &&st)
Definition: ai.h:526
ai_domain_baset
The interface offered by a domain, allows code to manipulate domains without knowing their exact type...
Definition: ai_domain.h:58
ai_baset::output_xml
xmlt output_xml(const goto_modelt &goto_model) const
Output the abstract states for the whole program as XML.
Definition: ai.h:341
ai_baset::output_xml
xmlt output_xml(const namespacet &ns, const goto_functionst::goto_functiont &goto_function) const
Output the abstract states for a single function as XML.
Definition: ai.h:357
goto_modelt::symbol_table
symbol_tablet symbol_table
Symbol table.
Definition: goto_model.h:30
ai_baset::operator()
void operator()(const irep_idt &function_id, const goto_functionst::goto_functiont &goto_function, const namespacet &ns)
Run abstract interpretation on a single function.
Definition: ai.h:177
forall_goto_program_instructions
#define forall_goto_program_instructions(it, program)
Definition: goto_program.h:1196
validation_modet::INVARIANT
@ INVARIANT
ai_recursive_interproceduralt::visit_edge_function_call
bool visit_edge_function_call(const irep_idt &calling_function_id, trace_ptrt p_call, locationt l_return, const irep_idt &callee_function_id, working_sett &working_set, const goto_programt &callee, const goto_functionst &goto_functions, const namespacet &ns) override
Definition: ai.cpp:472
concurrency_aware_ait::concurrency_aware_ait
concurrency_aware_ait()
Definition: ai.h:648