3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

extract multi-patterns when pattern can be decomposed

deals with fluke regression for F* reported by Guido Martinez

Background:
The automatic pattern inference facility looks for terms that contains all bound variables of a quantifier. It may end up with a term that contains all bound variables but the extracted term can be simplified.

Example. The pattern

(ApplyTT (ApplyTT @x3!1 (ApplyTT @x4!0 (:var 1))) (ApplyTT @x4!0 (:var 0)))
can be decomposed into a multi-pattern
(ApplyTT @x4!0 (:var 1))) (ApplyTT @x4!0 (:var 0))
The multi-pattern may enable a quantifier instantiation while the original pattern does not. The multi-pattern should be preferred.

The regression showed up based on a change that should not be considered harmful but turned out to be noticeable.
The change was a simplification of and-or expressions based on sorting. This played with the case split queue used by F* (smt.case_split = 3) that uses a top-level case split of clauses to avoid redundant branches. The net effect was that without sorting, the benchmarks would always choose the opportune branch that enabled matching against the larger term. With sorting it would mostly choose inopportune branches.
This commit is contained in:
Nikolaj Bjorner 2023-03-31 12:45:51 -07:00
parent a849a29b4f
commit a62e4b2893
3 changed files with 43 additions and 2 deletions

View file

@ -964,7 +964,7 @@ namespace {
}
void display(std::ostream & out) override {
if (m_queue.empty() && m_queue2.empty())
if (m_queue.empty())
return;
out << "case-splits:\n";
display_core(out, m_queue, m_head, 1);