3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-15 08:44:10 +00:00
z3/examples
Guangyu (Gary) HU 704dc9375d
mini_ic3: fix generalize() returning empty/init-overlapping core (#9245)
Two fixes in examples/python/mini_ic3.py:

1. generalize(): the polarity of the disjointness check was inverted,
   and there was no guard against an empty unsat core. With an empty
   core, And([])=True so check_disjoint(init, prev(True)) is always
   False (init is sat), and the code returned the empty core. That
   empty core then became cube2clause([])=Or([])=False, which got
   added as a lemma to all frames. The frame became inconsistent and
   is_valid() returned And(Or())=False as the "inductive invariant".

   Fix: require len(core) > 0 AND check_disjoint(init, prev(core))
   (without the spurious 'not'), so the core is only used when it
   is genuinely disjoint from init.

2. is_transition(): when an init rule's body happens to be an And
   without any Invariant predicate (e.g. (and (not A) (not B) ...)),
   is_body() returns (And(...), None). is_transition then passed
   inv0=None to subst_vars() which crashed inside get_vars(). Add an
   explicit None check so the rule falls through to is_init().

Verified on horn1..5 (unchanged behavior), h_CRC and h_FIFO from the
blocksys benchmarks (now correctly return CEX matching z3 spacer),
and cache_coherence_three (no longer collapses to (and or)).
2026-04-09 02:01:07 -07:00
..
c Remove vestiges of old ml api (#7597) 2025-03-27 16:41:31 -07:00
c++ removing file to deal with build issue 2026-01-13 09:15:14 -08:00
dotnet remove RCF example 2026-01-14 17:07:25 -08:00
go Fix variable naming: tmpFile -> tempFile for Go conventions 2026-02-16 21:48:51 +00:00
java fix: correct misleading API comments in fp.go and JavaExample.java (#9003) 2026-03-15 12:08:59 -07:00
maxsat fix grouping for latest doxygen (#5626) 2021-10-27 23:46:31 +02:00
ml Add Z3_get_estimated_alloc_size to OCaml API (#7068) 2023-12-21 12:54:30 -08:00
python mini_ic3: fix generalize() returning empty/init-overlapping core (#9245) 2026-04-09 02:01:07 -07:00
SMT-LIB2/bounded model checking Fix some typos. (#7115) 2024-02-07 23:06:43 -08:00
tptp move to readme-cmake 2025-05-13 14:36:20 -07:00
userPropagator userPropagator: Compile as C++20. 2022-08-05 07:41:14 +03:00
CMakeLists.txt cmake: Remove ExternalProject BUILD_ALWAYS workaround. 2022-08-02 09:27:11 +03:00