28 ASSERT(splitStrategy != 0);
43 slice->clearIdealAndSubtract();
58 else if (
_split->isLabelSplit()) {
66 unique_ptr<Slice> slice;
90 unique_ptr<Slice> slice2 =
newSlice();
100 if (slice2->getIdeal().getGeneratorCount() <
101 slice->getIdeal().getGeneratorCount()) {
104 unique_ptr<Slice> tmp = std::move(slice2);
105 slice2 = std::move(slice);
106 slice = std::move(tmp);
109 _tasks.addTask(slice2.release());
110 _tasks.addTask(slice.release());
void noThrowPushBack(Container &container, unique_ptr< Element > pointer)
virtual void setUseIndependence(bool use)
This method should only be called before calling run().
bool getUseIndependence() const
Returns true if independence splits should be performed when possible.
virtual void getPivot(Term &pivot, Slice &slice)=0
Used by pivotSplit to obtain a pivot.
bool getUseSimplification() const
Returns true if slices should be simplified.
const SplitStrategy * _split
vector< Slice * > _sliceCache
This is the cache maintained through newSlice and freeSlice.
virtual void freeSlice(unique_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
virtual bool simplify(Slice &slice)
Simplifies slice and returns true if it changed.
virtual unique_ptr< Slice > allocateSlice()=0
Directly allocate a slice of the correct type using new.
virtual void pivotSplit(unique_ptr< Slice > slice)
Takes over ownership of slice.
SliceStrategyCommon(const SplitStrategy *splitStrategy)
virtual ~SliceStrategyCommon()
virtual void setUseSimplification(bool use)
This method should only be called before calling run().
virtual bool debugIsValidSlice(Slice *slice)=0
Check that this slice is valid for use with this strategy.
unique_ptr< Slice > newSlice()
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice.
TaskEngine _tasks
This keeps track of pending tasks to process.
This class represents a slice, which is the central data structure of the Slice Algorithm.
bool adjustMultiply()
Ensure that for each var, var appears to the first power in some generator of getIdeal().
virtual bool simplify()
Simplifies this object such that it may become simpler without changing the content.
A SplitStrategy is an implementation of a split selection strategy for the Slice Algorithm.
This header file includes common definitions and is included as the first line of code in every imple...