bool RepSetIterator::isFinished() const { return d_index.empty(); }
-Node RepSetIterator::getCurrentTerm(unsigned v, bool valTerm)
+Node RepSetIterator::getCurrentTerm(unsigned v, bool valTerm) const
{
unsigned ii = d_index_order[v];
unsigned curr = d_index[ii];
return t;
}
+void RepSetIterator::getCurrentTerms(std::vector<Node>& terms) const
+{
+ for (unsigned i = 0, size = d_index_order.size(); i < size; i++)
+ {
+ terms.push_back(getCurrentTerm(i));
+ }
+}
+
void RepSetIterator::debugPrint( const char* c ){
for( unsigned v=0; v<d_index.size(); v++ ){
Debug( c ) << v << " : " << getCurrentTerm( v ) << std::endl;
};
public:
- RepSetIterator(const RepSet* rs, RepBoundExt* rext);
+ RepSetIterator(const RepSet* rs, RepBoundExt* rext = nullptr);
~RepSetIterator() {}
/** set that this iterator will be iterating over instantiations for a
* quantifier */
/** get domain size of the i^th field of this iterator */
unsigned domainSize(unsigned i);
/** get the i^th term in the tuple we are considering */
- Node getCurrentTerm(unsigned v, bool valTerm = false);
+ Node getCurrentTerm(unsigned v, bool valTerm = false) const;
/** get the number of terms in the tuple we are considering */
- unsigned getNumTerms() { return d_index_order.size(); }
+ unsigned getNumTerms() const { return d_index_order.size(); }
+ /** get current terms */
+ void getCurrentTerms(std::vector<Node>& terms) const;
/** get index order, returns var # */
unsigned getIndexOrder(unsigned v) { return d_index_order[v]; }
/** get variable order, returns index # */