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

Goal: choose the atom with the least amount of unbound variables. More...

#include <SipsMetric.h>

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

Public Member Functions

 LeastFreeVarsSips ()=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: choose the atom with the least amount of unbound variables.

Definition at line 124 of file SipsMetric.h.

Constructor & Destructor Documentation

◆ LeastFreeVarsSips()

souffle::ast::LeastFreeVarsSips::LeastFreeVarsSips ( )
default

Member Function Documentation

◆ evaluateCosts()

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

226  {
227  if (bindingStore.isBound(var.getName())) {
228  freeVars.insert(var.getName());
229  }
230  });
231  cost.push_back(freeVars.size());
232  }
233  return cost;
234 }
235 
236 std::vector<double> ProfileUseSips::evaluateCosts(
237  const std::vector<Atom*> atoms, const BindingStore& bindingStore) const {
238  // Goal: reorder based on the given profiling information
239  // Metric: cost(atom_R) = log(|atom_R|) * #free/#args
240  // - exception: propositions are prioritised

The documentation for this class was generated from the following files:
souffle::ast::ProfileUseSips::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:242