Always purify universe from set minus (#8201)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 2 Mar 2022 21:55:52 +0000 (15:55 -0600)
committerGitHub <noreply@github.com>
Wed, 2 Mar 2022 21:55:52 +0000 (15:55 -0600)
commite5c444d39c034972bce2f11c8c1c73bccd32b2bf
treefad93ad5cbe9fc3c27a1660c2a4d1962e579bb4b
parentbcf90d561a60ebce1417950fd570e95199061111
Always purify universe from set minus (#8201)

This fixes a bug in our handling of set cardinality + set universe (also used for set complement).

The bug was caused by using the rewritten form of terms to compute siblings in the cardinality graph. This is problematic for
(set.minus set.universe t) whose sibling was computed to be rewrite( (set.inter set.universe t) ) = t.

To avoid the issue, we now purify the argument of set.minus to avoid this behavior.

Fixes #5400.
Fixes the first benchmark on #5402.

This also eliminates a spurious lemma schema for set universe that was leftover from handling set subtyping.
src/theory/inference_id.cpp
src/theory/inference_id.h
src/theory/sets/cardinality_extension.cpp
src/theory/sets/cardinality_extension.h
src/theory/sets/term_registry.cpp
src/theory/sets/theory_sets_private.cpp
test/regress/CMakeLists.txt
test/regress/regress0/sets/issue5400-2-card-minus-univ.smt2 [new file with mode: 0644]
test/regress/regress0/sets/issue5400-card-minus-univ.smt2 [new file with mode: 0644]
test/regress/regress0/sets/issue5402-1-card.smt2 [new file with mode: 0644]