25 _split(splitStrategy),
26 _useIndependence(true),
27 _useSimplification(true) {
28 ASSERT(splitStrategy != 0);
43 slice->clearIdealAndSubtract();
66 auto_ptr<Slice> slice;
100 if (slice2->getIdeal().getGeneratorCount() <
101 slice->getIdeal().getGeneratorCount()) {
104 auto_ptr<Slice> tmp = slice2;
virtual bool debugIsValidSlice(Slice *slice)=0
Check that this slice is valid for use with this strategy.
bool getUseSimplification() const
Returns true if slices should be simplified.
virtual bool simplify()
Simplifies this object such that it may become simpler without changing the content.
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
void noThrowPushBack(Container &container, auto_ptr< Element > pointer)
bool getUseIndependence() const
Returns true if independence splits should be performed when possible.
auto_ptr< Slice > newSlice()
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice...
size_t getVarCount() const
virtual void setUseIndependence(bool use)
This method should only be called before calling run().
A SplitStrategy is an implementation of a split selection strategy for the Slice Algorithm.
This class represents a slice, which is the central data structure of the Slice Algorithm.
void reset(size_t newVarCount)
virtual bool isLabelSplit() const =0
If returns true, only call getLabelSplitVariable.
vector< Slice * > _sliceCache
This is the cache maintained through newSlice and freeSlice.
const SplitStrategy * _split
TaskEngine _tasks
This keeps track of pending tasks to process.
virtual auto_ptr< Slice > allocateSlice()=0
Directly allocate a slice of the correct type using new.
virtual void setUseSimplification(bool use)
This method should only be called before calling run().
virtual void freeSlice(auto_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
SliceStrategyCommon(const SplitStrategy *splitStrategy)
virtual void pivotSplit(auto_ptr< Slice > slice)
Takes over ownership of slice.
virtual ~SliceStrategyCommon()
virtual void getPivot(Term &pivot, Slice &slice)=0
Used by pivotSplit to obtain a pivot.
void addTask(Task *task)
Add a task at the head of the list of pending tasks.
virtual bool simplify(Slice &slice)
Simplifies slice and returns true if it changed.
bool adjustMultiply()
Ensure that for each var, var appears to the first power in some generator of getIdeal().