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

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

#include <SipsMetric.h>

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

Public Member Functions

 DeltaInputSips (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) deltas, then (3) input, and then (4) left-most.

Definition at line 176 of file SipsMetric.h.

Constructor & Destructor Documentation

◆ DeltaInputSips()

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

Definition at line 178 of file SipsMetric.h.

Member Function Documentation

◆ evaluateCosts()

std::vector< double > souffle::ast::DeltaInputSips::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 321 of file SipsMetric.cpp.

328  {
329  // prioritise all-bound
330  cost.push_back(0);
331  } else if (isDeltaRelation(relName)) {
332  // then deltas
333  cost.push_back(1);
334  } else if (ioTypes.isInput(relDetail.getRelation(relName))) {
335  // then input
336  cost.push_back(2);
337  } else {
338  cost.push_back(3);
339  }
340  }
341  return cost;
342 }
343 
344 } // namespace souffle::ast

Field Documentation

◆ ioTypes

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

Definition at line 188 of file SipsMetric.h.

◆ relDetail

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

Definition at line 187 of file SipsMetric.h.


The documentation for this class was generated from the following files:
souffle::ast::isDeltaRelation
bool isDeltaRelation(const QualifiedName &name)
Returns whether the given atom is a delta relation.
Definition: Utils.cpp:246
souffle::ast::DeltaInputSips::relDetail
const analysis::RelationDetailCacheAnalysis & relDetail
Definition: SipsMetric.h:187
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
souffle::ast::DeltaInputSips::ioTypes
const analysis::IOTypeAnalysis & ioTypes
Definition: SipsMetric.h:188