<commit_before>#ifndef CRAB_CHECKER_HPP
#define CRAB_CHECKER_HPP

/* 
   A generic forward checker for properties
 */

#include <crab/common/types.hpp>
#include <crab/common/stats.hpp>
#include <crab/checkers/base_property.hpp>
#include <crab/analysis/fwd_analyzer.hpp>
#include <crab/analysis/inter_fwd_analyzer.hpp>
#include <boost/noncopyable.hpp>

namespace crab {

  namespace checker {

  template<typename Analyzer>
  class checker: public boost::noncopyable {
    /*
      The checker propagates the invariants that hold at the entry of
      each block (assume forward analysis) to each program point while
      checking for the properties. The analysis results are shared by
      all the property checkers so the analysis needs to be run only
      once.
     */
   public:

    typedef boost::shared_ptr<property_checker<Analyzer> > prop_checker_ptr;
    typedef std::vector<prop_checker_ptr> prop_checker_vector;

   protected:

    prop_checker_vector m_checkers;
    
   public:

    checker (prop_checker_vector checkers): m_checkers (checkers) { }
    
    virtual void run () = 0;
    
    virtual void show (crab_os& o) {
      for (auto checker: this->m_checkers) {
        checker->write (o);
      }
    }
  };

  template<typename Analyzer>  
  class intra_checker: public checker <Analyzer> {
   public:

    typedef checker<Analyzer> base_checker_t;
    using typename base_checker_t::prop_checker_ptr;
    using typename base_checker_t::prop_checker_vector;

   private:

    typedef typename Analyzer::cfg_t cfg_t;
    typedef typename Analyzer::abs_dom_t abs_dom_t;
    typedef typename Analyzer::abs_tr_ptr abs_tr_ptr;<commit_msg>[NEW] added method that returns a database with all the checks<commit_after>#ifndef CRAB_CHECKER_HPP
#define CRAB_CHECKER_HPP

/* 
   A generic forward checker for properties
 */

#include <crab/common/types.hpp>
#include <crab/common/stats.hpp>
#include <crab/checkers/base_property.hpp>
#include <crab/analysis/fwd_analyzer.hpp>
#include <crab/analysis/inter_fwd_analyzer.hpp>
#include <boost/noncopyable.hpp>

namespace crab {

  namespace checker {

  template<typename Analyzer>
  class checker: public boost::noncopyable {
    /*
      The checker propagates the invariants that hold at the entry of
      each block (assume forward analysis) to each program point while
      checking for the properties. The analysis results are shared by
      all the property checkers so the analysis needs to be run only
      once.
     */
   public:

    typedef boost::shared_ptr<property_checker<Analyzer> > prop_checker_ptr;
    typedef std::vector<prop_checker_ptr> prop_checker_vector;

   protected:

    prop_checker_vector m_checkers;
    
   public:

    checker (prop_checker_vector checkers): m_checkers (checkers) { }
    
    virtual void run () = 0;
    
    virtual void show (crab_os& o) {
      for (auto prop_checker: m_checkers) {
        prop_checker->write (o);
      }
    }

    // merge all the databases in one: useful for crab clients
    virtual checks_db get_all_checks () const {
      checks_db res;
      for (auto prop_checker: m_checkers) {
        res += prop_checker->get_db();
      }
      return res;
    }

  };

  template<typename Analyzer>  
  class intra_checker: public checker <Analyzer> {
   public:

    typedef checker<Analyzer> base_checker_t;
    using typename base_checker_t::prop_checker_ptr;
    using typename base_checker_t::prop_checker_vector;

   private:

    typedef typename Analyzer::cfg_t cfg_t;
    typedef typename Analyzer::abs_dom_t abs_dom_t;
    typedef typename Analyzer::abs_tr_ptr abs_tr_ptr;
{'fraction_non_alphanumeric': 0.07868580894533407, 'fraction_numerical': 0.0005521811154058532, 'mean_word_length': 3.5629722921914357, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4917782', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1137, 'n_words': 307}