@@ -469,7 +469,7 @@ class ai_baset
469
469
working_sett &working_set,
470
470
const goto_programt &callee,
471
471
const goto_functionst &goto_functions,
472
- const namespacet &ns);
472
+ const namespacet &ns) = 0 ;
473
473
474
474
// / For creating history objects
475
475
std::unique_ptr<ai_history_factory_baset> history_factory;
@@ -505,6 +505,40 @@ class ai_baset
505
505
message_handlert &message_handler;
506
506
};
507
507
508
+ // Perform function local analysis on all functions in a program.
509
+ // No interprocedural analysis other than what a domain does when
510
+ // visit()'ing an edge that skips a function call.
511
+ class ai_localt : public ai_baset
512
+ {
513
+ public:
514
+ ai_localt (
515
+ std::unique_ptr<ai_history_factory_baset> &&hf,
516
+ std::unique_ptr<ai_domain_factory_baset> &&df,
517
+ std::unique_ptr<ai_storage_baset> &&st,
518
+ message_handlert &mh)
519
+ : ai_baset(std::move(hf), std::move(df), std::move(st), mh)
520
+ {
521
+ }
522
+
523
+ // Handle every function independently
524
+ void operator ()(const goto_functionst &goto_functions, const namespacet &ns)
525
+ override ;
526
+ void operator ()(const abstract_goto_modelt &goto_model) override ;
527
+
528
+ protected:
529
+ // Implement the function that handles a single function call edge
530
+ // by a single edge that gets the domain to approximate the whole function call
531
+ bool visit_edge_function_call (
532
+ const irep_idt &calling_function_id,
533
+ trace_ptrt p_call,
534
+ locationt l_return,
535
+ const irep_idt &callee_function_id,
536
+ working_sett &working_set,
537
+ const goto_programt &callee,
538
+ const goto_functionst &goto_functions,
539
+ const namespacet &ns) override ;
540
+ };
541
+
508
542
// Perform interprocedural analysis by simply recursing in the interpreter
509
543
// This can lead to a call stack overflow if the domain has a large height
510
544
class ai_recursive_interproceduralt : public ai_baset
@@ -525,7 +559,8 @@ class ai_recursive_interproceduralt : public ai_baset
525
559
void operator ()(const abstract_goto_modelt &goto_model) override ;
526
560
527
561
protected:
528
- // Override the function that handles a single function call edge
562
+ // Implement the function that handles a single function call edge
563
+ // by a recursive call to fixpoint
529
564
bool visit_edge_function_call (
530
565
const irep_idt &calling_function_id,
531
566
trace_ptrt p_call,
0 commit comments