souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Private Attributes
souffle::ast::InputSips Class Reference

Goal: prioritise (1) all-bound, then (2) input, and then (3) left-most. More...

#include <SipsMetric.h>

Inheritance diagram for souffle::ast::InputSips:
Inheritance graph
Collaboration diagram for souffle::ast::InputSips:
Collaboration graph

Public Member Functions

 InputSips (const analysis::RelationDetailCacheAnalysis &relDetail, const analysis::IOTypeAnalysis &ioTypes)
 
- Public Member Functions inherited from souffle::ast::SipsMetric
std::vector< unsigned int > getReordering (const Clause *clause) const
 Determines the new ordering of a clause after the SIPS is applied. More...
 
virtual ~SipsMetric ()=default
 

Protected Member Functions

std::vector< double > evaluateCosts (const std::vector< Atom * > atoms, const BindingStore &bindingStore) const override
 Evaluates the cost of choosing each atom next in the current schedule. More...
 

Private Attributes

const analysis::IOTypeAnalysisioTypes
 
const analysis::RelationDetailCacheAnalysisrelDetail
 

Additional Inherited Members

- Static Public Member Functions inherited from souffle::ast::SipsMetric
static std::unique_ptr< SipsMetriccreate (const std::string &heuristic, const TranslationUnit &tu)
 Create a SIPS metric based on a given heuristic. More...
 

Detailed Description

Goal: prioritise (1) all-bound, then (2) input, and then (3) left-most.

Definition at line 161 of file SipsMetric.h.

Constructor & Destructor Documentation

◆ InputSips()

souffle::ast::InputSips::InputSips ( const analysis::RelationDetailCacheAnalysis relDetail,
const analysis::IOTypeAnalysis ioTypes 
)
inline

Definition at line 163 of file SipsMetric.h.

Member Function Documentation

◆ evaluateCosts()

std::vector< double > souffle::ast::InputSips::evaluateCosts ( const std::vector< Atom * >  atoms,
const BindingStore bindingStore 
) const
overrideprotectedvirtual

Evaluates the cost of choosing each atom next in the current schedule.

Parameters
atomsatoms to choose from; may be nullptr
bindingStorethe variables already bound to a value

Implements souffle::ast::SipsMetric.

Definition at line 295 of file SipsMetric.cpp.

302  {
303  // prioritise all-bound
304  cost.push_back(0);
305  } else if (ioTypes.isInput(relDetail.getRelation(relName))) {
306  // then input
307  cost.push_back(1);
308  } else {
309  cost.push_back(2);
310  }
311  }
312  return cost;
313 }
314 
315 std::vector<double> DeltaInputSips::evaluateCosts(
316  const std::vector<Atom*> atoms, const BindingStore& bindingStore) const {
317  // Goal: prioritise (1) all-bound, (2) deltas, (3) input, then (4) rest
318  std::vector<double> cost;
319  for (const auto* atom : atoms) {

Field Documentation

◆ ioTypes

const analysis::IOTypeAnalysis& souffle::ast::InputSips::ioTypes
private

Definition at line 172 of file SipsMetric.h.

◆ relDetail

const analysis::RelationDetailCacheAnalysis& souffle::ast::InputSips::relDetail
private

Definition at line 171 of file SipsMetric.h.


The documentation for this class was generated from the following files:
souffle::ast::DeltaInputSips::evaluateCosts
std::vector< double > evaluateCosts(const std::vector< Atom * > atoms, const BindingStore &bindingStore) const override
Evaluates the cost of choosing each atom next in the current schedule.
Definition: SipsMetric.cpp:321
souffle::ast::InputSips::ioTypes
const analysis::IOTypeAnalysis & ioTypes
Definition: SipsMetric.h:172
souffle::ast::InputSips::relDetail
const analysis::RelationDetailCacheAnalysis & relDetail
Definition: SipsMetric.h:171
souffle::ast::analysis::IOTypeAnalysis::isInput
bool isInput(const Relation *relation) const
Definition: IOType.h:49
souffle::ast::analysis::RelationDetailCacheAnalysis::getRelation
Relation * getRelation(const QualifiedName &name) const
Definition: RelationDetailCache.h:57