3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-15 17:49:59 +00:00
Commit graph

21967 commits

Author SHA1 Message Date
Nikolaj Bjorner
225b3c1f30
Merge pull request #8972 from Z3Prover/copilot/fix-deep-api-bugs
Fix input validation and null-safety bugs in Z3 C API
2026-03-12 17:03:55 -07:00
copilot-swe-agent[bot]
682fa3f815 Fix indentation: use spaces instead of tabs in api_model.cpp CHECK_NON_NULL
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 23:00:07 +00:00
copilot-swe-agent[bot]
f413a24408 Fix API bugs exercised by test/deep_api_bugs.cpp
- api_fpa.cpp: add RETURN_Z3(nullptr) after SET_ERROR_CODE in Z3_mk_fpa_sort to prevent fall-through to mk_float_sort with invalid params
- api_seq.cpp: add null check for str in Z3_mk_string; add null check for str when sz>0 in Z3_mk_lstring; add lo<=hi validation in Z3_mk_re_loop
- api_array.cpp: add explicit n==0 validation in Z3_mk_array_sort_n
- api_solver.cpp: rename local variable 'c' to avoid shadowing Z3_context param in Z3_solver_propagate_created/decide/on_binding; move init_solver call inside file-exists branches of Z3_solver_from_file
- api_ast.cpp: add null check for target in Z3_translate; add null check for _from/_to arrays when num_exprs>0 in Z3_substitute
- api_model.cpp: add CHECK_NON_NULL(m) in Z3_add_func_interp; add CHECK_NON_NULL(a) in Z3_model_get_const_interp; add null check for target in Z3_model_translate
- api_opt.cpp: add null check for weight string in Z3_optimize_assert_soft
- api_quant.cpp: add num_patterns==0 validation in Z3_mk_pattern

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 22:58:53 +00:00
copilot-swe-agent[bot]
e6c082e6e8 Initial plan 2026-03-12 22:19:41 +00:00
Nikolaj Bjorner
397e3d404a add bugs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-12 15:18:38 -07:00
Nikolaj Bjorner
d3626fee64 fixup release-notes-updater
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-12 14:11:02 -07:00
Nikolaj Bjorner
8ba5fb6698 compile updated workflows
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-12 13:33:37 -07:00
Nikolaj Bjorner
d772503b25
Merge pull request #8968 from Z3Prover/copilot/aw-no-op-runs-tracking
Suppress no-op agentic workflow runs from posting to tracking issue
2026-03-12 13:32:31 -07:00
copilot-swe-agent[bot]
3bc7623f03 Add noop report-as-issue: false to all agentic workflow frontmatter
Prevents no-op workflow runs from posting comments to the [aw] No-Op
Runs tracking issue by setting safe-outputs.noop.report-as-issue: false
in all 13 agentic workflow .md files.

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 20:01:30 +00:00
copilot-swe-agent[bot]
30afc4ab5a Initial plan 2026-03-12 19:58:18 +00:00
Nikolaj Bjorner
1e7f3e2a5f
Merge pull request #8967 from Z3Prover/copilot/fix-mark-prs-ready-review
Fix "Mark PRs Ready for Review" workflow: use PAT instead of GITHUB_TOKEN for GraphQL mutation
2026-03-12 12:55:38 -07:00
copilot-swe-agent[bot]
f8a8d62587 Fix mark-prs-ready-for-review workflow: use GH_AW_GITHUB_TOKEN for GraphQL mutation
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 18:18:45 +00:00
copilot-swe-agent[bot]
036047f725 Initial plan 2026-03-12 18:12:34 +00:00
Nikolaj Bjorner
97e652156a
Merge pull request #8963 from Z3Prover/copilot/add-zipt-solver-to-benchmark
Add ZIPT solver to QF_S benchmark workflow
2026-03-12 10:39:39 -07:00
copilot-swe-agent[bot]
d4d72767d9 add ZIPT solver to QF_S benchmark workflow
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 17:36:48 +00:00
Nikolaj Bjorner
588b07f5ad
Merge pull request #8959 from Z3Prover/copilot/create-workflow-mark-prs-ready
Add workflow to mark all draft PRs ready for review
2026-03-12 10:30:56 -07:00
copilot-swe-agent[bot]
248800c3e4 Initial plan 2026-03-12 17:29:12 +00:00
copilot-swe-agent[bot]
f461876e8a Add pull_request trigger to mark-prs-ready-for-review workflow
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 16:30:09 +00:00
Lev Nachmanson
11309424b3
Merge pull request #8944 from Z3Prover/feas
Fix the regression in maximize of theory_lra.
2026-03-12 06:10:26 -10:00
Lev Nachmanson
3176151cc2 rename bhn_opt to max_reg
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-03-11 19:18:45 -10:00
Nikolaj Bjorner
664c8ca73a compiled workflows
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-11 21:39:28 -07:00
Lev Nachmanson
b8d6952e9e Enable som (sum of monomials) in optimizer simplification
The optimizer's simplification pass did not expand products of sums
into sum-of-monomials form. This caused mathematically equivalent
expressions like (5-x)^2 vs (x-5)^2 to simplify into different
internal forms, where the former produced nested multiplies
(+ 5.0 (* -1.0 x)) that led to harder purification constraints
and solver timeouts.

Enabling som=true in the first simplification tactic normalizes
polynomial objectives into canonical monomial form, making the
optimizer robust to operand ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 18:28:40 -10:00
Lev Nachmanson
ce7c7f458e Add max_rev test: BNH with reversed argument order in f1/f2
Same as test_bnh_optimize but constructs f1 and f2 with reversed
parameter order in mk_add, mk_mul, mk_sub calls. Exposes optimizer
sensitivity to expression structure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 18:15:57 -10:00
copilot-swe-agent[bot]
0060608d73 Add workflow to mark all draft pull requests ready for review
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-12 02:27:32 +00:00
copilot-swe-agent[bot]
4364b9865e Initial plan 2026-03-12 02:25:22 +00:00
Nikolaj Bjorner
9c2d34ce43
Merge pull request #8948 from angelica-moreira/z3-skill-exploration
Add Copilot skills and agent for Z3
2026-03-11 19:20:31 -07:00
Nikolaj Bjorner
faf888d35c
Merge pull request #8945 from Z3Prover/vect_fix
Fixed the assertion violation in `mpz.cpp:602` when running with `-tr…
2026-03-11 17:52:27 -07:00
Angelica Moreira
f120cc6903 add per-skill @z3 usage examples to agent readme 2026-03-12 00:16:06 +00:00
Angelica Moreira
68ea8d3a43 move agent readme to repo root as Z3-AGENT.md 2026-03-12 00:11:28 +00:00
Lev Nachmanson
610527ec1a
Merge pull request #8946 from Z3Prover/copilot/sub-pr-8945
[WIP] [WIP] Address feedback on assertion violation fix in mpz.cpp
2026-03-11 13:58:40 -10:00
copilot-swe-agent[bot]
01f9709ff6 Add vector::resize tests including vector<rational>
Co-authored-by: levnach <5377127+levnach@users.noreply.github.com>
2026-03-11 23:54:01 +00:00
copilot-swe-agent[bot]
385b11f55b Initial plan 2026-03-11 23:18:26 +00:00
Lev Nachmanson
8e47c0d842 Fixed the assertion violation in mpz.cpp:602 when running with -tr:arith.
**Root cause**: `vector::resize(SZ s, Args args...)` in `src/util/vector.h` took `args` by value and used `std::forward<Args>(args)` in a loop. The first iteration moved from `args`, leaving all subsequent elements with a moved-from state (`rational{0/0}` instead of
`rational{0/1}`). This corrupted the coefficient vector in the pretty printer, causing a division-by-zero assertion when multiplying.

**Fix**: Changed `resize` to take `Args const& args` and copy-construct each element instead of forwarding/moving.
2026-03-11 12:43:59 -10:00
Angelica Moreira
4e0a41252a
Merge branch 'Z3Prover:master' into z3-skill-exploration 2026-03-11 15:08:12 -07:00
Angelica Moreira
14276fb193 ignore .z3-agent runtime directory 2026-03-11 22:04:15 +00:00
Angelica Moreira
ed8f3ac438 add agent readme with usage examples 2026-03-11 21:53:37 +00:00
Angelica Moreira
90a4cdf855 update skills readme to match current state 2026-03-11 21:53:32 +00:00
Angelica Moreira
ed5b1929f1 add dependency checks to memory-safety and static-analysis 2026-03-11 21:53:27 +00:00
Angelica Moreira
d74f610264 merge z3-solver and z3-verifier into single z3 agent 2026-03-11 21:53:21 +00:00
Angelica Moreira
8eb35b3c46 remove deeptest skill (handled by external agent) 2026-03-11 21:53:16 +00:00
Angelica Moreira
621638abb9 run black and ruff on all skill scripts 2026-03-11 21:53:10 +00:00
Angelica Moreira
9d674404c8 Add action/expectation/result structure to all skill definitions
Each step in every SKILL.md now carries labeled Action, Expectation,
and Result blocks so the agent can mechanically execute, verify, and
branch at each stage. Format chosen after comparing three variants
(indented blocks, inline keywords, tables) on a prove-validity
simulation; indented blocks scored highest on routing completeness
and checkability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 19:51:59 +00:00
Angelica Moreira
d349b93d1d Add Copilot skill architecture with 10 skills, 2 agents, and shared infra
Introduce .github/skills/ with solve, prove, optimize, simplify,
encode, explain, benchmark, memory-safety, static-analysis, and
deeptest skills. Each skill follows a SKILL.md + scripts/ pattern
with Python scripts backed by a shared SQLite logging library
(z3db.py). Two orchestrator agents (z3-solver, z3-verifier) route
requests to the appropriate skills.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 17:41:29 +00:00
Lev Nachmanson
274d64299e Address PR review: add ENSURE checks, fix duplicate test, fix comment
- Add ENSURE(result == Z3_L_TRUE) for each BNH optimization call and
  ENSURE(num_sat == 7) at the end so CI catches regressions.
- Remove test_bnh_optimize() from tst_api() to avoid duplicate
  execution under /a; keep standalone tst_bnh_opt() entry point.
- Fix Test 2 comment: it tests same-size backup, not backup-longer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 16:58:24 -10:00
Lev Nachmanson
6d890fb026 Fix NLA optimization regression and relax restore_x
- Relax restore_x() to handle backup/current size mismatches: when
  backup is shorter (new columns added), call
  move_non_basic_columns_to_bounds() to find a feasible solution.
- Fix 100x performance regression in nonlinear optimization: save LP
  optimum before check_nla and return it as bound regardless of NLA
  result, so opt_solver::check_bound() can validate via full re-solve
  with accumulated NLA lemmas.
- Refactor theory_lra::maximize() into three helpers: max_with_lp(),
  max_with_nl(), and max_result().
- Add mk_gt(theory_var, impq const&) overload for building blockers
  from saved LP optimum values.
- Add BNH multi-objective optimization test (7/7 sat in <1s vs 1/7
  in 30s before fix).
- Add restore_x test for backup size mismatch handling.

Fixes #8890

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 16:38:08 -10:00
Nikolaj Bjorner
235448d929
Merge pull request #8928 from Z3Prover/copilot/update-release-notes
Add Version 4.17.0 release notes from discussion #8907
2026-03-10 11:48:19 -07:00
copilot-swe-agent[bot]
175a50330b Update RELEASE_NOTES.md with additional Version 4.17.0 entries from discussion #8907
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 18:39:34 +00:00
copilot-swe-agent[bot]
240453e452 Initial plan 2026-03-10 18:38:06 +00:00
Nikolaj Bjorner
bb11a56a67
Merge pull request #8918 from Z3Prover/copilot/code-simplification-march-2026
Simplify conditional logic in sls_euf_plugin.cpp and extract sign condition helper in realclosure.cpp
2026-03-10 10:03:22 -07:00
copilot-swe-agent[bot]
42eee12c2f Code simplifications in sls_euf_plugin.cpp and realclosure.cpp
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 16:17:24 +00:00