souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions
souffle::ast::DeltaSips Class Reference

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

#include <SipsMetric.h>

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

Public Member Functions

 DeltaSips ()=default
 
- 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...
 

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

Definition at line 151 of file SipsMetric.h.

Constructor & Destructor Documentation

◆ DeltaSips()

souffle::ast::DeltaSips::DeltaSips ( )
default

Member Function Documentation

◆ evaluateCosts()

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

276  {
277  // prioritise all-bound
278  cost.push_back(0);
279  } else if (isDeltaRelation(atom->getQualifiedName())) {
280  // then deltas
281  cost.push_back(1);
282  } else {
283  cost.push_back(2);
284  }
285  }
286  return cost;
287 }
288 
289 std::vector<double> InputSips::evaluateCosts(
290  const std::vector<Atom*> atoms, const BindingStore& bindingStore) const {
291  // Goal: prioritise (1) all-bound, (2) input, then (3) rest
292  std::vector<double> cost;
293  for (const auto* atom : atoms) {

The documentation for this class was generated from the following files:
souffle::ast::InputSips::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:295
souffle::ast::isDeltaRelation
bool isDeltaRelation(const QualifiedName &name)
Returns whether the given atom is a delta relation.
Definition: Utils.cpp:246