From 3c6dceae7cc10a1ce6b263721e535e4b4fe3453e Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 18 Nov 2019 12:03:18 -0800 Subject: [PATCH] fix #2717 Signed-off-by: Nikolaj Bjorner --- src/ast/rewriter/seq_rewriter.cpp | 11 ++++------- src/model/model.cpp | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ast/rewriter/seq_rewriter.cpp b/src/ast/rewriter/seq_rewriter.cpp index eb65d74cc..258d920e7 100644 --- a/src/ast/rewriter/seq_rewriter.cpp +++ b/src/ast/rewriter/seq_rewriter.cpp @@ -1704,8 +1704,7 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) { } unsigned lo1, hi1, lo2, hi2; - if (m_util.re.is_loop(a, a1, lo1, hi1) && m_util.re.is_loop(b, b1, lo2, hi2) && a1 == b1) { - SASSERT(lo1 <= hi1 && lo2 <= hi2); + if (m_util.re.is_loop(a, a1, lo1, hi1) && lo1 <= hi1 && m_util.re.is_loop(b, b1, lo2, hi2) && lo2 <= hi2 && a1 == b1) { result = m_util.re.mk_loop(a1, lo1 + lo2, hi1 + hi2); return BR_DONE; } @@ -1715,8 +1714,7 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) { } for (unsigned i = 0; i < 2; ++i) { // (loop a lo1) + (loop a lo2 hi2) = (loop a lo1 + lo2) - if (m_util.re.is_loop(a, a1, lo1) && m_util.re.is_loop(b, b1, lo2, hi2) && a1 == b1) { - SASSERT(lo2 <= hi2); + if (m_util.re.is_loop(a, a1, lo1) && m_util.re.is_loop(b, b1, lo2, hi2) && lo2 <= hi2 && a1 == b1) { result = m_util.re.mk_loop(a1, lo1 + lo2); return BR_DONE; } @@ -1731,8 +1729,7 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) { return BR_DONE; } // (loop a lo1 hi1) + a = (loop a lo1+1 hi1+1) - if (m_util.re.is_loop(a, a1, lo1, hi1) && a1 == b) { - SASSERT(lo1 <= hi1); + if (m_util.re.is_loop(a, a1, lo1, hi1) && lo1 <= hi1 && a1 == b) { result = m_util.re.mk_loop(a1, lo1+1, hi1+1); return BR_DONE; } @@ -1848,7 +1845,7 @@ br_status seq_rewriter::mk_re_loop(func_decl* f, unsigned num_args, expr* const* lo2 = np > 0 ? f->get_parameter(0).get_int() : 0; hi2 = np > 1 ? f->get_parameter(1).get_int() : 0; if (np == 2 && lo2 > hi2) { - result = m_util.re.mk_loop(args[0], hi2, hi2); + result = m_util.re.mk_loop(args[0], lo2, lo2); return BR_REWRITE1; } // (loop (loop a lo) lo2) = (loop lo*lo2) diff --git a/src/model/model.cpp b/src/model/model.cpp index 31d63ab8e..01dbbae57 100644 --- a/src/model/model.cpp +++ b/src/model/model.cpp @@ -215,6 +215,7 @@ struct model::top_sort : public ::top_sort { }; void model::compress() { + SASSERT(false); if (m_cleaned) return; // stratify m_finterp and m_decls in a topological sort