3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-03 18:31:08 +00:00
Commit graph

22349 commits

Author SHA1 Message Date
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
copilot-swe-agent[bot]
a51ba544ea Fix typo: rename m_parith to m_parikh in seq_nielsen.h/.cpp
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 19:08:11 +00:00
copilot-swe-agent[bot]
4b2f5e2bb0 Add seq_parikh unit tests: 32 tests covering stride, constraints, conflict, char_set
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 18:36:28 +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
copilot-swe-agent[bot]
30c2a9ccdc Address code review: add SASSERT for lo>hi, simplify is_to_re handling
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 17:23:00 +00:00
copilot-swe-agent[bot]
194dfe6c61 Port ZIPT Parikh features: minterm_to_char_set, char range constraints, fix stride soundness
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 17:21:27 +00:00
CEisenhofer
99727faf70 Model reconstruction 2026-03-11 18:13:16 +01:00
copilot-swe-agent[bot]
255d381b72 Make simple_solver incremental: use push/pop scopes in Nielsen DFS
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 17:09:34 +00:00
copilot-swe-agent[bot]
d364604875 Initial plan 2026-03-11 16:35:24 +00:00
copilot-swe-agent[bot]
45a574d7fa Remove nseq_parith.h and nseq_parikh.cpp backwards-compat shims
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 15:48:05 +00:00
CEisenhofer
d23f376b39 Fixed a lot regarding powers, but there seems to be a model reconstruction bug left 2026-03-11 16:44:14 +01:00
CEisenhofer
6d0468861d Fixed git merge problems 2026-03-11 13:05:27 +01:00
CEisenhofer
2f46c8893e Another attempt to fix powers 2026-03-11 11:29:25 +01:00
copilot-swe-agent[bot]
213ddd36ba Rename nseq_parikh→seq_parikh; add m/seq/a member attributes to seq_parikh
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 05:41:16 +00:00
copilot-swe-agent[bot]
4ac5315846 Fix review: min>=max guard, ceiling-div overflow, SASSERT, accessor methods, comments
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 05:15:20 +00:00
copilot-swe-agent[bot]
eca5fcc7bb Integrate nseq_parith into nielsen_graph; add k upper bound and check_parikh_conflict
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 05:10:30 +00:00
copilot-swe-agent[bot]
35ee8f917d Remove redundant zero-guards before u_gcd calls in concat/intersection cases
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 04:26:26 +00:00
copilot-swe-agent[bot]
4cdfceabc5 Use u_gcd from util/mpz.h instead of local gcd definition
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 04:24:16 +00:00
copilot-swe-agent[bot]
d267e452a2 Add Clemens Eisenhofer as co-author to nseq_parith.h and nseq_parikh.cpp
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 04:21:30 +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
copilot-swe-agent[bot]
334df71b11 Add nseq_parith.h and nseq_parikh.cpp: Parikh filter for ZIPT string solver
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-11 00:05:26 +00:00
copilot-swe-agent[bot]
3054f0cb41 Initial plan 2026-03-10 23:43:18 +00:00
Nikolaj Bjorner
51e245a245
Merge pull request #8935 from Z3Prover/copilot/implement-int-bounds-var-bound-watcher
Implement IntBounds/VarBoundWatcher + Constraint.Shared for Nielsen graph arithmetic pruning
2026-03-10 16:36:52 -07:00
Nikolaj Bjorner
53d5d98341
Merge branch 'c3' into copilot/implement-int-bounds-var-bound-watcher 2026-03-10 16:33:25 -07:00
copilot-swe-agent[bot]
57ede4cdcd Address code review: clarify add_lower/upper_int_bound return semantics; fix test assertion
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 23:29:15 +00:00
copilot-swe-agent[bot]
47f9be0270 Implement IntBounds/VarBoundWatcher + Constraint.Shared; fix pre-existing build errors
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 23:26:55 +00:00
Nikolaj Bjorner
c3eb0056db
Merge pull request #8933 from Z3Prover/copilot/fix-build-error-nseq-zipt
Fix build: nseq_zipt fixture missing simple_solver arg to nielsen_graph
2026-03-10 15:49:46 -07:00
Nikolaj Bjorner
3a71f28c6c
Rename dummy_simple_solver to zipt_dummy_simple_solver 2026-03-10 15:49:24 -07:00
copilot-swe-agent[bot]
0efb7402e8 Fix build: add dummy_simple_solver to nseq_zipt.cpp fixture, fix assert_expr in seq_nielsen.cpp
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 22:47:49 +00:00
copilot-swe-agent[bot]
09f5d637b0 Initial plan 2026-03-10 22:44:11 +00:00
copilot-swe-agent[bot]
07ee2f31ef Initial plan 2026-03-10 22:41:43 +00:00
Nikolaj Bjorner
d2739d9816 use reference to solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-10 15:22:50 -07:00
Nikolaj Bjorner
c98ea6dc21 make simple solver a reference
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-10 15:10:51 -07:00
Nikolaj Bjorner
3e3c3f106d
Merge pull request #8931 from Z3Prover/copilot/replace-lp-simple-solver
Replace lp_simple_solver in Nielsen graph with smt::kernel-based context_solver
2026-03-10 15:04:40 -07:00
copilot-swe-agent[bot]
5744958e46 Replace lp_simple_solver in nielsen with context_solver using smt::kernel (seq_len)
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-10 21:39:29 +00:00
copilot-swe-agent[bot]
a4f2c4a217 Initial plan 2026-03-10 21:09:43 +00:00