diff --git a/src/math/polysat/slicing.cpp b/src/math/polysat/slicing.cpp index 674804145..dcfba7d94 100644 --- a/src/math/polysat/slicing.cpp +++ b/src/math/polysat/slicing.cpp @@ -198,6 +198,7 @@ namespace polysat { xs.push_back(x); } } + SASSERT(ys.empty()); } void slicing::find_base(slice src, slice_vector& out_base) const { diff --git a/src/math/polysat/slicing.h b/src/math/polysat/slicing.h index 03320f2ba..bbe18ad5b 100644 --- a/src/math/polysat/slicing.h +++ b/src/math/polysat/slicing.h @@ -32,6 +32,8 @@ namespace polysat { class slicing final { + friend class test_slicing; + // solver& m_solver; #if 0 @@ -111,16 +113,16 @@ namespace polysat { // Retrieve (or create) base slices s_1,...,s_n such that src[hi:lo] == s_1 ++ ... ++ s_n void mk_slice(slice src, unsigned hi, unsigned lo, slice_vector& out_base); - // find representative + // Find representative slice_idx find(slice_idx i) const; - // merge equivalence classes of two base slices + // Merge equivalence classes of two base slices void merge(slice_idx s1, slice_idx s2); - // Equality x_1 ++ ... ++ x_n == y_1 ++ ... ++ y_k + // Merge equality x_1 ++ ... ++ x_n == y_1 ++ ... ++ y_k // // Precondition: - // - sequence of base slices without holes (TODO: condition on holes probably not necessary? total widths have to match of course) + // - sequence of base slices (equal total width) // - ordered from msb to lsb // - slices have the same reference point void merge(slice_vector& xs, slice_vector& ys); diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 27de8b3af..07a559365 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -109,6 +109,7 @@ add_executable(test-z3 simple_parser.cpp simplex.cpp simplifier.cpp + slicing.cpp small_object_allocator.cpp smt2print_parse.cpp smt_context.cpp diff --git a/src/test/main.cpp b/src/test/main.cpp index bf839bd64..f222837a8 100644 --- a/src/test/main.cpp +++ b/src/test/main.cpp @@ -267,6 +267,7 @@ int main(int argc, char ** argv) { TST(fixplex); TST(mod_interval); TST(viable); + TST(slicing); TST(totalizer); TST(distribution); } diff --git a/src/test/slicing.cpp b/src/test/slicing.cpp new file mode 100644 index 000000000..b87b58651 --- /dev/null +++ b/src/test/slicing.cpp @@ -0,0 +1,15 @@ +#include "math/polysat/slicing.h" + +namespace polysat { + + class test_slicing { + + }; + +} + + +void tst_slicing() { + using namespace polysat; + std::cout << "ok\n"; +}