3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-27 19:08:49 +00:00
Commit graph

22829 commits

Author SHA1 Message Date
CEisenhofer
6fa354102a A new axiomatization for "stoi" 2026-05-06 15:30:09 +02:00
Nikolaj Bjorner
57692811fa reduce set of assumptions passed into m_core_solver 2026-05-06 03:58:29 -07:00
CEisenhofer
11ff3ccae7 Power unwinding was unsound 2026-05-06 10:22:39 +02:00
dependabot[bot]
c189d66145
Bump github/gh-aw-actions from 0.71.1 to 0.71.4 (#9461)
Bumps [github/gh-aw-actions](https://github.com/github/gh-aw-actions) from 0.71.1 to 0.71.4.
- [Release notes](https://github.com/github/gh-aw-actions/releases)
- [Changelog](https://github.com/github/gh-aw-actions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/gh-aw-actions/compare/v0.71.1...f8495a686e66770ae977f82732f34d7340ee42a4)

---
updated-dependencies:
- dependency-name: github/gh-aw-actions
  dependency-version: 0.71.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-05 11:19:06 -07:00
Nikolaj Bjorner
8c02ec087b fix crash with D:\\bench\\inputs\\QF_S\\20240318-omark\\cyclic-xy.smt2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-05 10:53:12 -07:00
CEisenhofer
b65f22ef3b Bug fix 2026-05-05 14:58:42 +02:00
CEisenhofer
e7cc24d7ea Next step towards partial automata 2026-05-05 13:58:15 +02:00
CEisenhofer
bfa9d17408 We need new variables 2026-05-05 10:48:49 +02:00
Nikolaj Bjorner
e242257070 avoid disequalities from str.at axioms
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-04 16:33:12 -07:00
Nikolaj Bjorner
af2769dbc0 more logging for when arith_value fails
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-04 14:07:49 -07:00
Nikolaj Bjorner
a5c01dcddb move to new model construction instead of original
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-04 13:53:33 -07:00
CEisenhofer
e2e876c7a9 Removed legacy code 2026-05-04 20:16:13 +02:00
CEisenhofer
5b3d734ecb Fixed regex factorization again 2026-05-04 19:25:07 +02:00
CEisenhofer
adb9ca4305 Some steps towards partial automatons 2026-05-04 18:31:38 +02:00
Copilot
1c6943c2cb
fix issues 1-10: add missing API bindings across Go, Julia, TypeScript, OCaml, and Java (#9432)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/b89f3b76-dfd7-47ec-97dd-8ae5e8e88a4a

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-05-04 09:29:47 -07:00
Nikolaj Bjorner
b199b0782a ignore ostrich files under tests 2026-05-03 13:59:37 -07:00
Nikolaj Bjorner
266008e81f update seq_model draft
redo seq_model to be compatible with model_generator
2026-05-03 13:57:56 -07:00
Nikolaj Bjorner
e1d3eb1a80 flag replace_all as unhandled
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-02 15:53:36 -07:00
Nikolaj Bjorner
2c45740986 iterate on seq_model redo draft
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-02 15:47:19 -07:00
Nikolaj Bjorner
3eaa5b7ab7 iterate on seq_model redo draft
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-02 15:37:39 -07:00
Nikolaj Bjorner
6abb2da6a1 update draft
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-02 10:40:53 -07:00
Nikolaj Bjorner
eefb644c93 add solve-eqs to the qfnia tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-01 16:29:29 -07:00
Nikolaj Bjorner
e09964096e add continue as an option to breaking loop at level
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-01 16:15:46 -07:00
Nikolaj Bjorner
466bfea604 add draft for model construction
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-01 11:07:27 -07:00
Copilot
b9109f031e
Update RELEASE_NOTES.md with entries from discussion #9430 for Version 4.17.0 (#9433)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/a1dbb69c-b535-444b-92cb-07f0eecd0a65

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-30 11:41:08 -07:00
Nikolaj Bjorner
c7ccca0873 fix bug exposed in ostrich substr_var_sat.smt2 crash. Add notes to seq_model.cpp to prepare for further fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-30 10:25:15 -07:00
Nikolaj Bjorner
dee35fc1a5 really add fold-unfold as option
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-30 09:56:08 -07:00
Copilot
b9be33bb06
Reorder null check before side effect in linearise_multi_pattern (#9427)
* Initial plan

* Move null check before side effect in linearise_multi_pattern

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/cc69d451-b5a7-414d-9154-2cda3286fe40

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-29 17:18:45 -07:00
Copilot
7c4c709708
Fix static analysis issues: null dereferences, unsafe casts, branch clones, uninitialized members (#9424)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/6e64242e-78e5-4807-8369-02baaf405a70

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-29 13:37:11 -07:00
Copilot
09396b72dd
nla_grobner: remove dead code and fix indentation (#9423)
* Initial plan

* [code-simplifier] nla_grobner: remove dead code and fix indentation

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/1dc7dd96-d7d7-4fca-94b4-bde677fee842

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-29 11:12:45 -07:00
Copilot
42582c6835
euf_seq_plugin: fix identity elimination after merge, activate loop merging, integrate sgraph improvements (#9414)
* Initial plan

* Initial plan

* Fix identity elimination after merge and activate loop merging in euf_seq_plugin

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/053b94e4-645a-4cde-ae5d-cf6d61222f92

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Apply three ZIPT code review improvements to euf_seq_plugin

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/da8647c4-ddff-47ce-9364-2eee3810c38d

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Address code review: improve loop-merge defensive code and test variable names

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/053b94e4-645a-4cde-ae5d-cf6d61222f92

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Refactor: extract saturating_add helper, simplify hash-check condition

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/da8647c4-ddff-47ce-9364-2eee3810c38d

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-29 11:12:00 -07:00
Arie
6d38d5ed41
NLA tracing: emit varmap and grobner-linear-eq for trace analysis (#9415)
Two TRACE blocks under the existing nla_solver tag:

1. theory_lra::false_case_of_check_nla emits a "varmap:" line for each
   NLA lemma, listing j-var → SMT-name mappings for variables in the
   lemma's collect_vars set. Lets lemur nla resolve the LP-internal
   j-numbering back to the original SMT term names when displaying
   lemmas. Without this, lemma-level analysis has to either guess at
   variable identities (and j-numbers are reused across nlsat
   invocations under backtracking — see j-vars-unstable note) or use a
   different trace tag entirely (-tr:nra) for stable algebraic-number
   IDs.

2. nla_grobner emits a "grobner-linear-eq:" line at each call to
   add_term + update_column_type_and_bound that produces a Linear
   Propagation row from completion. Lets us count Gröbner's effective
   contribution to the LP tableau independently of the lemma stream.
   Useful when investigating Gröbner-deficit hypotheses in NLA cascade
   diagnosis.

Both are pure trace emission, behind TRACE(nla_solver, ...). Zero
runtime cost when tracing is off; no semantic change.
2026-04-28 17:31:11 -07:00
Arie
dbb91de64b
Add adaptive growth knobs for Gröbner under arith.nl.grobner_adaptive (#9390)
* Add adaptive growth knobs for Gröbner under arith.nl.grobner_adaptive

When enabled, the per-call growth budget (m_eqs_growth, m_expr_size_growth,
m_expr_degree_growth, m_max_simplified) is scaled by m_growth_boost:
- two consecutive productive runs bump the boost by 3/2 (cap 4x)
- a miss resets the streak and decays the boost toward 1.0x by 1/4 of excess

Default is off; the existing miss-frequency throttle (m_quota / m_delay_base)
is unchanged, so this only affects per-call power, not call frequency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Update src/params/smt_params_helper.pyg

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Arie Gurfinkel <arie.gurfinkel@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 08:50:38 -07:00
Lev Nachmanson
c40f8a200e
smt: reset give-up state when escalating final_check level (#9408)
theory_lra reports num_final_check_levels()==2: full nlsat (m_nra.check)
only runs at level >= 2. When a level-1 round-trip ends with FC_GIVEUP
and the loop escalates to level 2, the previously accumulated 'result',
'f', and 'm_incomplete_theories' were retained, so a subsequent
successful (FC_DONE) round at level 2 was still reported as
(incomplete (theory arithmetic)). Reset that state on each level
escalation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-28 03:33:28 +02:00
Nikolaj Bjorner
6cbc504f0b upgrade workflows
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-27 13:59:30 -07:00
Nikolaj Bjorner
63003b5795 convert z3_exception to tactic exception in try_for
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-26 16:37:39 -07:00
Nikolaj Bjorner
7461103802 making try-for tactic exception resilient on cancelation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-26 15:58:24 -07:00
Copilot
245c117aba
simplify: replace ad-hoc reset_unsafe RAII with on_scope_exit in solve_eqs::reduce() (#9383)
* Initial plan

* simplify: replace reset_unsafe RAII struct with on_scope_exit in solve_eqs::reduce()

Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/ff5650aa-02db-4a71-976f-845debd7222f

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-26 22:21:02 +02:00
Nikolaj Bjorner
0e07b218bc exception protection for nlsat_tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-26 13:12:08 -07:00
Arie
d99d5a736f
Improvements to NLA lemmas (#9391)
* Add dual-row shared-factor sandwich for NLA bound propagation

When enabled via arith.nl.monomial_sandwich (default off), monomial_bounds
finds LP term columns whose term has shape  a_m * m + a_v * v  with exactly
two variables — both factors of a binary monomial m = u*v. The term column's
bound bounds (a_m * m + a_v * v); substituting m = u*v gives v * (a_m*u + a_v),
and sign-aware interval division by v plus an affine shift yields a numeric
bound on u. The derived interval is fed to the existing propagate_value path
so the lemma channel and integer rounding logic are shared with the rest of
NLA's forward/backward propagation; no new emit code.

Catches conflicts of the form
  α_v1 * v + α_m * m ≥ k1
  α_v2 * v + α_m * m ≤ k2
that today require nlsat (when no single row alone yields infeasibility but
their conjunction tightly bounds u after factoring v).

Scope: binary monomials only (m.size()==2, no squares); cap of 16 term-columns
scanned per call; one lemma per (u,v) attempt to keep the lemma channel quiet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add arith.nl.order.binomial_sign flag (default true)

Granular gate for order_lemma_on_binomial_sign — the only order family that
embeds a model-snapshot literal (x ≷ val(x)) in the lemma body. Disabling it
keeps the always-good structural mon-ol family running while removing the
SAT-splitter shape that cascades under model perturbations (e.g., from
arith.nl.monomial_sandwich tightening factor bounds).

Default true preserves master behaviour; the flag is intended as an
experimental knob to measure how much of an observed cascade is specifically
attributable to the binomial-sign splitter vs. the structural cancellation
lemmas in the same module.

See ord-binom-opportunities.md for the full gap analysis and the
deterministic-replacement directions (sandwich, McCormick) that would let
this flag eventually default to false without regressing leaves where
ord-binom currently carries the proof.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add sign-pinned binomial bound for NLA (Opportunity 1 from ord-binom doc)

When enabled via arith.nl.monomial_binomial_sign (default off), monomial_bounds
adds a third pass alongside propagate_down (existing) and propagate_shared_factor
(sandwich). For a binary monomial m = u*v in m_to_refine whose model value mv
disagrees with val(u)*val(v), and where v has a determined sign:

  1. synthesize a one-sided interval for m.var() at mv (no deps; the snapshot
     enters as a literal in the lemma body, not as an antecedent)
  2. divide by v's interval (sign-aware via dep.div<with_deps>) to get a
     deterministic interval for u
  3. emit a propagate_value-style lemma whose body is
        m.var() < mv (or > mv) ∨ u-bound
     conditioned on v's bound witness

Targets the case ord-binom currently handles: factors have determined signs,
m.var() may have no LP bound. The clause is sound modulo the monomial
definition (same condition propagate_down, propagate_shared_factor, and
ord-binom already rely on).

A new throttle kind MONOMIAL_BINOMIAL_SIGN keyed on (m.var, u, v, direction)
prevents cascading: without it, each new val(m.var()) snapshot would re-emit
across model changes the same way ord-binom does.

Validated via smt.arith.validate=true: 0 soundness errors across the
32-leaf test corpus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add McCormick box-corner tangent points (Opportunity 2 from ord-binom doc)

When enabled via arith.nl.tangents.box_corners (default off, sub-flag of
arith.nl.tangents), tangent_imp::get_points selects m_a, m_b at the corners
of the bound box [x_lo, x_hi] × [y_lo, y_hi] instead of the model-centered
points val(x) ± delta. The selection follows the classical McCormick
under/over envelope:

  - m_below=true (under-approximation):
      m_a = (x_lo, y_lo),  m_b = (x_hi, y_hi)
  - m_below=false (over-approximation):
      m_a = (x_lo, y_hi),  m_b = (x_hi, y_lo)

The existing generate_plane already produces the McCormick linear form
xy ≷ pl.y·x + pl.x·y − pl.x·pl.y at any chosen point pl. push_point is
skipped in box-corner mode: corners are extremes, so doubling the offset
moves out of the box and would invalidate the McCormick property.

Falls back to the existing model-driven point selection when either factor
has an unbounded side or the box is degenerate (single-point in a
dimension).

Soundness — non-strict inequality at corners. The classical model-driven
flow uses pl strictly in the interior of the box, so generate_plane emits
xy > T (strict). At the box corners the tangent meets the surface along
the box's edges (xy = T when x = pl.x or y = pl.y), so the strict
inequality is violated by any model with x at the box boundary. A new
m_pl_strict_interior member, set false on a successful set_box_corners(),
switches generate_plane's emission to ≥/≤ (non-strict). The model-driven
path keeps strict — its push_point + plane_is_correct_cut chain already
guarantees pl is interior.

Validated via smt.arith.validate=true: 0 validate_conflict() failures
across the 32-leaf test corpus with box_corners=true.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 21:07:28 +02:00
Nikolaj Bjorner
b0956429fe fix regression from nlsat integration
updates to nlsat polynomial simplification introduced checkpoints.
These can throw exceptions (if setting a timeout).
The code that uses this was not properly protected from exceptions to distinguish timeout based tactics from genuine exceptions that should terminate solving altogether.

see updates such as: 117da362f0
2026-04-26 11:52:46 -07:00
Nikolaj Bjorner
6420bff843 skip other tseitin literals 2026-04-26 11:52:46 -07:00
Copilot
c8453d05f9
Add noop report-as-issue: false to code-simplifier workflow (#9397)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/4dbec82b-a305-4164-bd35-294761afc2e7

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-26 18:28:30 +02:00
Nikolaj Bjorner
f461369ab8 fix tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-26 08:23:26 -07:00
Nikolaj Bjorner
014315764d re-fix the same bug pointed out to an earlier version
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-26 08:16:37 -07:00
Nikolaj Bjorner
cd6fad428b code review updates
1. unit extraction could skip some units
2. create a shared method to check satisfiability that handles exception cases. They are the same among different workers, so shared in the batch manager.
2026-04-25 17:34:09 -07:00
Nikolaj Bjorner
b28f83e2e0 add initial scaffolding for using assumption literals
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-25 08:09:25 -07:00
Nikolaj Bjorner
abbe36561d cleanup service
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-24 17:22:04 -07:00
Nikolaj Bjorner
cedd896ea5 redo length re-computation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-24 15:49:19 -07:00
Nikolaj Bjorner
7fc68d20ea brain got parked somewhere?
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-04-23 19:16:18 -07:00