3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-15 08:44:10 +00:00
Commit graph

10 commits

Author SHA1 Message Date
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
Nikolaj Bjorner
53f72d9cbe updated mini
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-26 15:44:49 -08:00
Huanyi Chen
19471f9fa3 Implement mini_quip 2019-01-04 18:30:02 -05:00
Huanyi Chen
83e3a79bd1 Remove testcase that takes long time to finish 2019-01-04 17:31:47 -05:00
Huanyi Chen
4b29b208ad Add few more testcases 2018-12-28 13:28:15 -05:00
Huanyi Chen
300e99b67a Make sure init is included when generalize 2018-12-28 13:21:40 -05:00
Huanyi Chen
b083c7546e Substitue Vars in queries
Replace Vars that are representing primary inputs as "i#" when query
solvers.
2018-12-28 13:21:35 -05:00
Nikolaj Bjorner
2b35f1a924 quip
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-09-16 13:14:41 -07:00
Nikolaj Bjorner
98dfd82765 adding quipie
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-09-15 21:55:49 -07:00
Nikolaj Bjorner
0232383191 mini IC3 sample
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-09-15 16:59:06 -07:00