souffle
2.0.2-371-g6315b36
|
A base class for ConstraintAnalysis collecting constraints for an analysis by visiting every node of a given AST. More...
#include <Constraint.h>
Public Types | |
using | constraint_type = std::shared_ptr< Constraint< AnalysisVar > > |
using | solution_type = std::map< const Argument *, value_type > |
using | value_type = typename AnalysisVar::property_space::value_type |
Public Member Functions | |
solution_type | analyse (const Clause &clause, std::ostream *debugOutput=nullptr) |
Runs this constraint analysis on the given clause. More... | |
virtual void | collectConstraints (const Clause &clause) |
Public Member Functions inherited from souffle::ast::Visitor< void > | |
void | operator() (const Node &node, Params... args) |
The main entry for the user allowing visitors to be utilized as functions. More... | |
virtual void | visit (const Node &node, Params... args) |
The main entry for a visit process conducting the dispatching of a visit to the various sub-types of Nodes. More... | |
virtual | ~Visitor ()=default |
A virtual destructor. More... | |
Protected Member Functions | |
void | addConstraint (const constraint_type &constraint) |
Adds another constraint to the internally maintained list of constraints. More... | |
AnalysisVar | getVar (const Argument &arg) |
A utility function mapping an Argument to its associated analysis variable. More... | |
AnalysisVar | getVar (const Argument *arg) |
A utility function mapping an Argument to its associated analysis variable. More... | |
Protected Member Functions inherited from souffle::ast::Visitor< void > | |
LINK (AlgebraicDataType, Type) | |
LINK (Argument, Node) | |
LINK (Attribute, Node) | |
LINK (Clause, Node) | |
LINK (Component, Node) | |
LINK (ComponentInit, Node) | |
LINK (ComponentType, Node) | |
LINK (Literal, Node) | |
LINK (Pragma, Node) | |
LINK (Program, Node) | |
LINK (RecordType, Type) | |
LINK (Relation, Node) | |
LINK (SubsetType, Type) | |
LINK (Type, Node) | |
LINK (UnionType, Type) | |
virtual void | visitNode (const Node &, Params...) |
The base case for all visitors – if no more specific overload was defined. More... | |
Protected Attributes | |
Assignment< AnalysisVar > | assignment |
Problem< AnalysisVar > | constraints |
The list of constraints making underlying this analysis. More... | |
std::map< std::string, AnalysisVar > | variables |
A map mapping variables to unique instances to facilitate the unification of variables. More... | |
A base class for ConstraintAnalysis collecting constraints for an analysis by visiting every node of a given AST.
The collected constraints are then utilized to obtain the desired analysis result.
AnalysisVar | the type of variable (and included property space) to be utilized by this analysis. |
Definition at line 64 of file Constraint.h.
using souffle::ast::analysis::ConstraintAnalysis< AnalysisVar >::constraint_type = std::shared_ptr<Constraint<AnalysisVar> > |
Definition at line 67 of file Constraint.h.
using souffle::ast::analysis::ConstraintAnalysis< AnalysisVar >::solution_type = std::map<const Argument*, value_type> |
Definition at line 68 of file Constraint.h.
using souffle::ast::analysis::ConstraintAnalysis< AnalysisVar >::value_type = typename AnalysisVar::property_space::value_type |
Definition at line 66 of file Constraint.h.
|
inlineprotected |
Adds another constraint to the internally maintained list of constraints.
Definition at line 129 of file Constraint.h.
|
inline |
Runs this constraint analysis on the given clause.
clause | the close to be analysed |
debug | a flag enabling the printing of debug information |
Definition at line 81 of file Constraint.h.
|
inlinevirtual |
Reimplemented in souffle::ast::analysis::TypeConstraintsAnalysis.
Definition at line 70 of file Constraint.h.
Referenced by souffle::ast::analysis::ConstraintAnalysis< TypeVar >::collectConstraints().
|
inlineprotected |
A utility function mapping an Argument to its associated analysis variable.
arg | the AST argument to be mapped |
Definition at line 106 of file Constraint.h.
|
inlineprotected |
A utility function mapping an Argument to its associated analysis variable.
arg | the AST argument to be mapped |
Definition at line 124 of file Constraint.h.
|
protected |
Definition at line 133 of file Constraint.h.
Referenced by souffle::ast::analysis::ConstraintAnalysis< TypeVar >::analyse(), and souffle::ast::analysis::ConstraintAnalysis< TypeVar >::collectConstraints().
|
protected |
The list of constraints making underlying this analysis.
Definition at line 136 of file Constraint.h.
Referenced by souffle::ast::analysis::ConstraintAnalysis< TypeVar >::analyse(), and souffle::ast::analysis::ConstraintAnalysis< TypeVar >::collectConstraints().
|
protected |
A map mapping variables to unique instances to facilitate the unification of variables.
Definition at line 139 of file Constraint.h.