souffle  2.0.2-371-g6315b36
Public Member Functions | Private Types | Private Attributes | Friends
souffle::ast::analysis::Problem< Var > Class Template Reference

A problem is a list of constraints for which a solution is desired. More...

#include <ConstraintSystem.h>

Collaboration diagram for souffle::ast::analysis::Problem< Var >:
Collaboration graph

Public Member Functions

void add (const constraint_ptr &constraint)
 Adds another constraint to the internally maintained list of constraints. More...
 
void print (std::ostream &out) const
 Enables a problem to be printed (debugging) More...
 
Assignment< Var > solve () const
 Computes a solution (minimum fixpoint) for the contained list of constraints. More...
 
Assignment< Var > & solve (Assignment< Var > &assignment) const
 Computes a solution (minimum fixpoint) for the contained list of constraints based on an initial assignment. More...
 

Private Types

using constraint = Constraint< Var >
 
using constraint_ptr = std::shared_ptr< constraint >
 

Private Attributes

std::vector< constraint_ptrconstraints
 The list of covered constraints. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Problem &p)
 

Detailed Description

template<typename Var>
class souffle::ast::analysis::Problem< Var >

A problem is a list of constraints for which a solution is desired.

Template Parameters
Varthe domain of variables handled by this problem

Definition at line 50 of file ConstraintSystem.h.

Member Typedef Documentation

◆ constraint

template<typename Var >
using souffle::ast::analysis::Problem< Var >::constraint = Constraint<Var>
private

Definition at line 374 of file ConstraintSystem.h.

◆ constraint_ptr

template<typename Var >
using souffle::ast::analysis::Problem< Var >::constraint_ptr = std::shared_ptr<constraint>
private

Definition at line 375 of file ConstraintSystem.h.

Member Function Documentation

◆ add()

template<typename Var >
void souffle::ast::analysis::Problem< Var >::add ( const constraint_ptr constraint)
inline

Adds another constraint to the internally maintained list of constraints.

Definition at line 384 of file ConstraintSystem.h.

388  {

◆ print()

template<typename Var >
void souffle::ast::analysis::Problem< Var >::print ( std::ostream &  out) const
inline

Enables a problem to be printed (debugging)

Definition at line 419 of file ConstraintSystem.h.

421  {
422  p.print(out);
423  return out;
424  }
425 };

◆ solve() [1/2]

template<typename Var >
Assignment<Var> souffle::ast::analysis::Problem< Var >::solve ( ) const
inline

Computes a solution (minimum fixpoint) for the contained list of constraints.

Returns
an assignment representing a solution for this problem

Definition at line 394 of file ConstraintSystem.h.

399  {

Referenced by souffle::ast::analysis::Problem< TypeVar >::add(), and souffle::ast::analysis::ConstraintAnalysis< TypeVar >::collectConstraints().

◆ solve() [2/2]

template<typename Var >
Assignment<Var>& souffle::ast::analysis::Problem< Var >::solve ( Assignment< Var > &  assignment) const
inline

Computes a solution (minimum fixpoint) for the contained list of constraints based on an initial assignment.

Returns
an assignment representing a solution for this problem

Definition at line 405 of file ConstraintSystem.h.

413  {
414  if (constraints.empty()) {
415  out << "{}";
416  } else {

Friends And Related Function Documentation

◆ operator<<

template<typename Var >
std::ostream& operator<< ( std::ostream &  out,
const Problem< Var > &  p 
)
friend

Definition at line 427 of file ConstraintSystem.h.

Field Documentation

◆ constraints

template<typename Var >
std::vector<constraint_ptr> souffle::ast::analysis::Problem< Var >::constraints
private

The list of covered constraints.

Definition at line 378 of file ConstraintSystem.h.

Referenced by souffle::ast::analysis::Assignment< TypeVar >::end(), and souffle::ast::analysis::Problem< TypeVar >::solve().


The documentation for this class was generated from the following file:
souffle::ast::analysis::Problem::constraints
std::vector< constraint_ptr > constraints
The list of covered constraints.
Definition: ConstraintSystem.h:378
p
a horizontalBars(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})):a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX,{highLow:d, referenceValue:0})), l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y, b.normalized.series, o,{ticks:k}):a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) var p
Definition: htmlJsChartistMin.h:15