souffle  2.0.2-371-g6315b36
Public Member Functions | Static Public Attributes | Private Attributes
souffle::ast::analysis::ClauseNormalisationAnalysis Class Reference

#include <ClauseNormalisation.h>

Inheritance diagram for souffle::ast::analysis::ClauseNormalisationAnalysis:
Inheritance graph
Collaboration diagram for souffle::ast::analysis::ClauseNormalisationAnalysis:
Collaboration graph

Public Member Functions

 ClauseNormalisationAnalysis ()
 
const NormalisedClausegetNormalisation (const Clause *clause) const
 
void print (std::ostream &os) const override
 print the analysis result in HTML format More...
 
void run (const TranslationUnit &translationUnit) override
 run analysis for a Ast translation unit More...
 
- Public Member Functions inherited from souffle::ast::analysis::Analysis
 Analysis (std::string identifier)
 
virtual const std::string & getName () const
 get name of the analysis More...
 
virtual ~Analysis ()=default
 

Static Public Attributes

static constexpr const char * name = "clause-normalisation"
 

Private Attributes

std::map< const Clause *, NormalisedClausenormalisations
 

Additional Inherited Members

- Protected Attributes inherited from souffle::ast::analysis::Analysis
const std::string identifier
 

Detailed Description

Definition at line 96 of file ClauseNormalisation.h.

Constructor & Destructor Documentation

◆ ClauseNormalisationAnalysis()

souffle::ast::analysis::ClauseNormalisationAnalysis::ClauseNormalisationAnalysis ( )
inline

Definition at line 100 of file ClauseNormalisation.h.

101 :
102  std::map<const Clause*, NormalisedClause> normalisations;

Member Function Documentation

◆ getNormalisation()

const NormalisedClause & souffle::ast::analysis::ClauseNormalisationAnalysis::getNormalisation ( const Clause clause) const

Definition at line 188 of file ClauseNormalisation.cpp.

◆ print()

void souffle::ast::analysis::ClauseNormalisationAnalysis::print ( std::ostream &  ) const
overridevirtual

print the analysis result in HTML format

Reimplemented from souffle::ast::analysis::Analysis.

Definition at line 174 of file ClauseNormalisation.cpp.

176  :" << els[i].params;
177  }
178  os << "}" << std::endl;
179  }
180 }
181 
182 const NormalisedClause& ClauseNormalisationAnalysis::getNormalisation(const Clause* clause) const {
183  assert(contains(normalisations, clause) && "clause not normalised");
184  return normalisations.at(clause);
185 }
186 

◆ run()

void souffle::ast::analysis::ClauseNormalisationAnalysis::run ( const TranslationUnit )
overridevirtual

run analysis for a Ast translation unit

Implements souffle::ast::analysis::Analysis.

Definition at line 166 of file ClauseNormalisation.cpp.

168  {
169  for (const auto& [clause, norm] : normalisations) {
170  os << "Normalise(" << *clause << ") = {";
171  const auto& els = norm.getElements();
172  for (size_t i = 0; i < els.size(); i++) {

Field Documentation

◆ name

constexpr const char* souffle::ast::analysis::ClauseNormalisationAnalysis::name = "clause-normalisation"
staticconstexpr

Definition at line 98 of file ClauseNormalisation.h.

◆ normalisations

std::map<const Clause*, NormalisedClause> souffle::ast::analysis::ClauseNormalisationAnalysis::normalisations
private

Definition at line 109 of file ClauseNormalisation.h.


The documentation for this class was generated from the following files:
i
size_t i
Definition: json11.h:663
souffle::ast::analysis::ClauseNormalisationAnalysis::normalisations
std::map< const Clause *, NormalisedClause > normalisations
Definition: ClauseNormalisation.h:109