3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-02 12:13:25 +00:00
Commit graph

22638 commits

Author SHA1 Message Date
Copilot
90c401c5f2
Add daily clang-tidy warning report workflow (#10348)
Adds a scheduled workflow to build Z3 with the clang-tidy warning
configuration being tracked in detlefs' PRs, including the latest
`-Wgnu-anonymous-struct` flag from #10345. The workflow persists all
emitted warnings as an artifact so warning regressions can be reviewed
from each run.

- **Workflow**
  - Adds `.github/workflows/clang-tidy-warning-report.yml`
  - Runs daily and on manual dispatch
  - Uses Ubuntu + CMake/Ninja with `clang` and `clang-tidy`

- **Warning coverage**
  - Reuses the repository's existing Clang warning setup
  - Layers in the current pending detlefs warning flag:
    - `-Wgnu-anonymous-struct`

- **Artifacts**
  - Captures:
    - `configure.log`
    - `build.log`
    - `combined.log`
    - `warnings.txt`
    - `status.txt`
  - Uploads them as a per-run artifact for inspection

- **Failure behavior**
  - Still uploads logs on failure
- Marks the workflow failed if configure or build fails, so broken
clang-tidy runs are visible in Actions

```yaml
CC=clang CXX=clang++ cmake -GNinja -S . -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -DCMAKE_CXX_CLANG_TIDY=clang-tidy \
  -DCMAKE_CXX_FLAGS="-Wgnu-anonymous-struct"
```

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-01 11:12:44 -07:00
z3prover-ci-bot[bot]
2d327a0080
[fstar-build-fix] Fix nl-arith regression on F* obligation failedQueries-Pulse.Lib.PriorityQueue-3 (#10344)
## Summary

An F* proof build failed to discharge a proof obligation because z3
returned `unknown` instead of the expected `unsat`. This PR fixes an
attributed nonlinear-arithmetic performance/completeness **regression**
in z3 that caused the failure.

- Originating F* build run:
https://github.com/Z3Prover/z3/actions/runs/30685489878
- Failing query:
`inputs/fstar-build-failures/run-30685489878/pulse/failedQueries-Pulse.Lib.PriorityQueue-3.smt2`
(`Z3Prover/bench`)
- Query label: `failedQueries-Pulse.Lib.PriorityQueue-3`
- z3 ref under test: `1ba30df028`
- **Expected result:** `unsat` — **Observed on ref under test:**
`unknown` (`:reason-unknown "canceled"`, i.e. the embedded `(set-option
:rlimit 5000000)` budget was exhausted).

The query embeds its own options (`smt.arith.solver=6`,
`smt.mbqi=false`, `auto_config=false`, `rlimit=5000000`, ...); all runs
below honor those embedded options.

## Root cause and attribution

Bisecting `./z3` between a known-good baseline
(`a05be8a291`, which returns `unsat`) and
the ref under test identified the first bad commit as:

> **`90fe0aa0f32d4cf66f3503c249d1878a39c0cf3c` — "Imp fix (#10304)"**

That commit adds `monomial_bounds::propagate_fixed_rows()` and calls it
from `nla::core::propagate()`, gated by the new parameter
`smt.arith.nl.propagate_fixed_rows` (default **true**). The routine
scans **all** LP rows on **every** nonlinear-propagation call, and calls
`lra.find_feasible_solution()` whenever anything is propagated. On this
obligation that extra work consumes the `rlimit` budget before a proof
is found, so a query that was previously `unsat` becomes `unknown`
(`canceled`). This is a pure performance/completeness regression from a
newly-added, parameter-gated heuristic — not a soundness issue in the
query.

## Fix

Default `smt.arith.nl.propagate_fixed_rows` to **false**, restoring the
pre-#10304 behaviour. The heuristic and its code are left intact and
remain available as opt-in via `smt.arith.nl.propagate_fixed_rows=true`,
pending a more efficient implementation (e.g. not re-scanning every row
on every propagation call).

This is a one-line change in `src/params/smt_params_helper.pyg`; no
solver check is weakened and the failing behaviour is not masked — the
regressing heuristic is simply returned to being opt-in.

## Reproduction and validation

All builds via `python3 scripts/mk_make.py && make -C build -j8`
(CMake/Ninja unavailable in this environment; the Makefile build
produces an equivalent binary).

| z3 | `smt.arith.nl.propagate_fixed_rows` | Result |
|---|---|---|
| baseline `a05be8a` | (n/a, pre-feature) | `unsat` |
| ref under test `1ba30df` | true (default) | `unknown` (canceled) |
| ref under test `1ba30df` | false (override) | `unsat` |
| **patched `1ba30df` (this PR)** | false (new default) | **`unsat`** |

Before the fix the query reproduced the `unknown`/`canceled` failure;
after the fix the patched binary returns the expected `unsat` with the
query's embedded options unchanged.

## Notes / uncertainty

This change restores correctness-preserving behaviour by disabling an
optional heuristic by default rather than reworking its cost model. A
follow-up could re-enable the heuristic once its per-propagation cost is
bounded (e.g. only scanning rows touched since the last call). Created
as a **draft** for maintainer review.




> [!WARNING]
> <details>
> <summary>Firewall blocked 1 domain</summary>
>
> The following domain was blocked by the firewall during workflow
execution:
>
> - `pypi.org`
>> To allow these domains, add them to the `network.allowed` list in
your workflow frontmatter:
>
> ```yaml
> network:
>   allowed:
>     - defaults
>     - "pypi.org"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>


> Generated by [Fix a Z3 failure on an F* proof
obligation](https://github.com/Z3Prover/bench/actions/runs/30692520945)
· 398.4 AIC · ⌖ 21.5 AIC · ⊞ 9.4K ·
[◷](https://github.com/search?q=repo%3AZ3Prover%2Fz3+%22gh-aw-workflow-id%3A+fstar-build-fixer%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: Fix a Z3 failure on an F* proof obligation,
engine: copilot, version: 1.0.65, model: claude-opus-4.8, id:
30692520945, workflow_id: fstar-build-fixer, run:
https://github.com/Z3Prover/bench/actions/runs/30692520945 -->

<!-- gh-aw-workflow-id: fstar-build-fixer -->
<!-- gh-aw-workflow-call-id: Z3Prover/bench/fstar-build-fixer -->

Co-authored-by: z3prover-ci-bot[bot] <305651407+z3prover-ci-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-01 10:58:15 -07:00
Copilot
d86b591368
Optimize build-warning-fixer prebuild flow and issue-context patch handoff (#10347)
This updates the `build-warning-fixer` agentic workflow to reduce
avoidable setup overhead and improve handoff quality when triggered from
GitHub issues. It also hardens repository targeting so the workflow
operates only against `Z3Prover/z3`, not other repos.

- **Scope and intent**
- Restricts agent behavior to `Z3Prover/z3` via explicit prompt
guardrails.
- Clarifies issue-context output requirements so Copilot gets a complete
patch context for PR generation.

- **Prebuild efficiency**
- Replaces unconditional `apt-get update/install` with tool presence
checks.
- Installs build dependencies only when one or more required tools are
missing (`clang`, `clang-tidy`, `cmake`, `ninja`, `python3`).

- **Issue-context diff payload**
  - Expands required patch reporting for issue-dispatched runs:
    - `git status --short`
    - `git diff --stat`
    - `git diff`
- Requires explicit changed-file summary plus full unified diff block
when edits exist.

- **Lockfile synchronization**
- Regenerates `build-warning-fixer.lock.yml` from the updated workflow
source so runtime behavior matches prompt/step updates.

```bash
missing_tools=0
command -v clang >/dev/null 2>&1 || missing_tools=1
command -v clang-tidy >/dev/null 2>&1 || missing_tools=1
command -v cmake >/dev/null 2>&1 || missing_tools=1
command -v ninja >/dev/null 2>&1 || missing_tools=1
command -v python3 >/dev/null 2>&1 || missing_tools=1
if [ "$missing_tools" -eq 1 ]; then
  sudo apt-get update -y
  sudo apt-get install -y clang clang-tidy cmake ninja-build python3
fi
```

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-01 10:56:54 -07:00
Nikolaj Bjorner
47ec61793c allow single argument versions of concat, union, intersect, xor for get_info 2026-08-01 10:54:40 -07:00
Nikolaj Bjorner
50f2747136 Add sequence length constraints to seq monadic
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1a1a0632-f993-4bee-b4f8-a87f960836a1
2026-08-01 10:27:32 -07:00
Nikolaj Bjorner
4fb6b90630 Use expr refs for seq monadic atoms
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1a1a0632-f993-4bee-b4f8-a87f960836a1
2026-08-01 10:16:55 -07:00
Nikolaj Bjorner
6e1ca006f1 add undo trail 2026-08-01 10:09:56 -07:00
Nikolaj Bjorner
516a413559 guard against arity mismatch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-08-01 09:35:52 -07:00
Nikolaj Bjorner
1ba30df028 seq_monadic: add unsat-core extraction with minimization toggle
check() now records the dependencies of an unsat subset in m_core, exposed via
ptr_vector<u_dependency> const& core(). On l_false it calls minimize_core:
with the new m_min_core flag (set_min_core, default true) it deletion-minimizes
to a minimal unsat subset containing only constraints that participate in the
contradiction; with the flag off it returns all membership dependencies.

Add unit tests asserting the core omits irrelevant constraints (e.g. x in a*,
x in ~a*, y in b* has core {x-constraints} only), exercising both flag states.
The test harness runs with minimization disabled by default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 20:53:30 -07:00
Nikolaj Bjorner
1e09b4e6ae seq_monadic: replace solve_and with incremental add()/check() API
Replace the batch solve_and(mems) with an incremental interface:
  void add(expr* term, expr* regex, u_dependency* d);
  lbool check();
add() stores each (term, regex, dependency) triple in
m_memberships (vector<tuple<expr_ref, expr_ref, u_dependency*>>); the
dependency is retained for future unsat-core tracking and may be nullptr.
check() decides the accumulated conjunction (the former solve_and body) and
consumes the memberships; an empty conjunction is sat. Update the unit tests
and benchmark to the add()/check() API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 20:31:44 -07:00
Copilot
022a6505ae
Precompute clang-tidy diagnostics in build-warning-fixer and add issue-context diff handoff (#10336)
This updates the `build-warning-fixer` agentic workflow to front-load
compilation/diagnostic collection before agent execution, reducing
repeated setup work in agent mode. It also improves issue-triggered runs
by requiring explicit git diff output so follow-on PR authoring has
directly usable patches.

- **Pre-agent compile + diagnostics collection**
- Added workflow `steps` in `build-warning-fixer.md` to run checkout,
tool install, CMake configure/build, and diagnostic extraction before
the agent prompt executes.
  - Persisted structured artifacts under `/tmp/gh-aw/agent/`:
    - `prebuild-status.txt`
    - `clang-tidy-configure.log`
    - `clang-tidy-build.log`
    - `clang-tidy-diagnostics.txt`

- **Prompt flow changed to consume prebuilt context**
- Reworked task instructions from “build first” to “inspect prebuild
outputs first.”
- Kept rebuild/fix loop for validated, conservative edits after code
changes.

- **Issue-context PR handoff improvement**
- Added explicit instruction for issue-dispatched runs
(`aw_context.item_type == "issue"`) to include:
    - `git diff --stat`
    - full `git diff` in fenced `diff` output
  - This makes proposed changes directly transferable into PR creation.

- **Workflow metadata refresh**
  - Updated checkout action reference to `actions/checkout@v7.0.1`.
- Recompiled `build-warning-fixer.lock.yml` to reflect source workflow
updates.

```yaml
- name: Prebuild and collect clang diagnostics
  run: |
    CC=clang CXX=clang++ cmake -GNinja -S . -B build \
      -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
      -DCMAKE_CXX_CLANG_TIDY=clang-tidy \
      2>&1 | tee /tmp/gh-aw/agent/clang-tidy-configure.log
    cmake --build build --target shell test-z3 -k 0 \
      2>&1 | tee /tmp/gh-aw/agent/clang-tidy-build.log
    grep -nE 'warning:|error:|clang-tidy' /tmp/gh-aw/agent/clang-tidy-build.log \
      > /tmp/gh-aw/agent/clang-tidy-diagnostics.txt || true
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-31 20:25:24 -07:00
Nikolaj Bjorner
773c5496b9 seq_monadic: replace model out-param with gen-model toggle + get_model()
Remove the obj_map<expr,expr*>* model out-parameter from solve/solve_and/
decide_dnf. Add an m_gen_model flag (default true) with set_gen_model(bool),
store the extracted model in m_model (reset at the top of decide_dnf), and
expose get_model(). Switch live_states out to expr_ref_vector and the
product_nonempty state vectors to ptr_vector<expr>. Simplify the concat case
of parse_term with all_of. Disable model generation in the sat-only unit
tests and the benchmark.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 20:14:59 -07:00
Nikolaj Bjorner
5650fb2460 Simplify seq_monadic: bool returns, is_uninterp_const, style cleanups
- decompose and live_states now return bool instead of a bool& ok out-param.
- Use is_uninterp_const(t) in parse_term.
- Use braced pair init and structured bindings over obj_map iteration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 19:51:55 -07:00
davedets
4ee79af337
Disable "-Wnoctad-maybe-unsupported", add and fix "-Wdeprecated-copy-with-user-provided-copy". (#10332)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings. (2 more flags after this!)

The first of these was -Wctad-maybe-unsupported. That has to do with
"class template argument deduction" -- the flag requires template
deduction guides to be explicitly provided if templated types are used
in situations that requires argument deduction. This fired for various
uses of templated types in the utils directory.

I decided that this should be a case of if it ain't broke, don't fix it,
and explicitly disabled the warning in the Z3 build (which will override
the setting if the flag is enabled in a larger build including Z3, like
clang).

-----

The second flag has to do with the C++ "rule of 3". Here is Google's AI
summary (inf_s_integer is a class in Z3 that triggered the warning):

_This warning means your inf_s_integer class defines a custom copy
assignment operator but lacks a user-defined copy constructor, which the
C++ standard deprecates to encourage the "Rule of Three". To fix this,
explicitly declare and = default the copy constructor in your class
definition._

_...example of how to fix..._

_This updates your code to modern C++ standards, cleanly silencing the
warning._

This seemed like a good standard to follow, and didn't require too many
changes, so I propose them.
2026-07-31 19:34:08 -07:00
Copilot
00de81166d
Fix clang-tidy dead store warnings in util.cpp and model_based_opt.cpp (#10334)
Three `clang-analyzer-deadcode.DeadStores` warnings flagged by
clang-tidy: redundant bit-shifts in the log2 functions and an
unreachable assignment in `def::from_row()`.

## Changes

- **`src/util/util.cpp`** — `log2()` and `uint64_log2()`: Remove `v >>=
1` in the final `if (v & 0x2)` block. Only `r |= 1` matters; `v` is
never read after that point.

  ```cpp
  // Before
  if (v & 0x2) {
      v >>= 1;  // dead store
      r |=  1;
  }
  // After
  if (v & 0x2) {
      r |=  1;
  }
  ```

- **`src/math/simplex/model_based_opt.cpp`** — `def::from_row()`: Remove
`sign = true` assignment when `div < 0`. `sign` is only consumed earlier
in the function (`if (!sign)`) and is not read again after this point.

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #10333

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-31 19:33:49 -07:00
Nikolaj Bjorner
6212042e80 Cache derivative_cofactors calls in seq_monadic
Memoize derivative_cofactors per regex in an owning cache so each regex's
cofactors are computed once per top-level solve. The cache is reset at the
start of solve()/solve_and() and freed in the destructor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 19:20:52 -07:00
Nikolaj Bjorner
168b51d332 Remove var_extra from seq_monadic API
Per-variable extra constraints are now expressed as additional (var in R')
memberships passed to solve_and, so the var_extra parameter is dropped from
solve/solve_and and the internal decide_dnf. Tests updated to route extra
constraints through solve_and.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 14:31:35 -07:00
Nikolaj Bjorner
656d1e6bcb Refactor guard_set out of seq_monadic into guard_set.h/.cpp
Extract the guard_set class (element-value set over derivative cofactor
guards) from the anonymous namespace in seq_monadic.cpp into a
self-contained guard_set.h / guard_set.cpp pair.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 14:17:05 -07:00
Margus Veanes
ddce973e16
Add seq monadic benchmark harness (#10330)
## Summary

Register the opt-in seq_monadic benchmark harness in test-z3.

The harness reads either Z3_SEQ_BENCH_FILE or all SMT2 files under
Z3_SEQ_BENCH_DIR, supports Brz and light-Ant modes through
Z3_SEQ_MONADIC_MODE, and reports per-file CSV timing and verdict
information.
2026-07-31 14:03:21 -07:00
Nikolaj Bjorner
568218e1ed add notes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-07-31 13:59:27 -07:00
Copilot
80a7504686
Cap clang-tidy agent runtime in build-warning-fixer workflow (#10327)
The `agent` job in the Clang-Tidy Warning Fixer workflow was spending
most of its runtime waiting on a full clang-tidy build, then failing
before it could complete its safe-output path. This change narrows the
prompt so the agent can make a bounded decision from early diagnostics
instead of treating the full build as a prerequisite.

- **Prompt guardrail**
- Add a runtime-budget section to the compiled workflow prompt in
`build-warning-fixer.lock.yml`.
- Instruct the agent to stop after it has enough diagnostics for one
safe fix, or after 15 minutes.

- **Build scope reduction**
  - Switch initial diagnostic collection to a `shell`-only build.
- Explicitly avoid waiting for a full `shell + test-z3` clang-tidy build
before deciding whether to act.

- **Fallback behavior**
- Direct the agent to emit `noop` when it cannot reach a safe, validated
fix within the time budget.
- Keep `test-z3` optional unless it is already available or cheap to
build within the remaining budget.

Example of the new prompt guidance:

```yaml
- Use `cmake --build build --target shell -- -k 0 2>&1 | tee /tmp/gh-aw/agent/clang-tidy-build.log` for initial diagnostic collection.
- Do not wait for the full `shell` build to finish before deciding what to do.
- Stop once you have enough diagnostics for one small, high-confidence fix, or after 15 minutes.
- If no safe fix is ready in that budget, call `noop`.
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-31 13:32:47 -07:00
Margus Veanes
784ca5eb38
Fix constant element lifetime in seq monadic decomposition (#10329)
## Summary

Pin constant elements extracted while parsing sequence terms so they
remain alive throughout monadic decomposition.

Without these references, character ASTs could be reclaimed while still
stored as raw pointers in decomposition atoms, causing assertion
failures, fast-fail exits, and access violations during derivative
construction.

The fix eliminates 26 previously observed process failures in the regex
benchmark corpus. No stack-depth bailout is needed for these failures.
2026-07-31 13:20:44 -07:00
Copilot
88612e329e
Export killThreads from z3-solver to allow Node.js thread cleanup (#10320)
Emscripten worker threads spawned for long-running Z3 operations (e.g.
`solver.check()`) are never cleaned up, keeping the Node.js process
alive after Z3 is done.

The `killThreads` helper already existed internally in `jest.ts` but was
never part of the public package.

## Changes

- **`src/kill-threads.ts`** (new) — extracts `killThreads(em)` into a
standalone module; calls `em.PThread.terminateAllThreads()` then polls
until all workers are gone (5 s timeout)
- **`src/node.ts`** — re-exports `killThreads` so it is part of the
published `z3-solver` API
- **`src/jest.ts`** — simplified to re-export from `./kill-threads`
instead of duplicating ~45 lines
- **`src/kill-threads.test.ts`** (new) — unit tests for the exported
function
- **`PUBLISHED_README.md`** — documents the new API

## Usage

```typescript
import { init, killThreads } from 'z3-solver';

const api = await init();
// ... use Z3 ...
await killThreads(api.em);
```

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #7070

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-31 12:00:04 -07:00
Nikolaj Bjorner
33663c4d51 Replace TPTP frontend env vars with tptp config module
Replace the TPTP and Z3_TPTP_DUMP_SMT2 environment variables in
tptp_frontend.cpp with a new 'tptp' configuration module (src/params/tptp.pyg)
exposing tptp.root and tptp.dump_smt2 parameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-31 10:49:12 -07:00
Margus Veanes
683cb4ec03
seq_monadic: add light Antimirov cofactor mode (#10323)
Light-weight Antimirov cofactors for seq_monadic
================================================

Overview
--------

The seq_monadic solver explores symbolic regex derivatives when
computing live
states and product transitions. Its original transition representation
used
Brzozowski cofactors.

This change adds a light-weight Antimirov representation. It first
computes the
existing Brzozowski cofactors and then decomposes targets whose outer
shape is

    s1 | ... | sn

or

    (s1 | ... | sn) . tail

into separate transitions. Concatenations are maintained in
right-associative
form, so a distributable union occurs as the head of the concatenation.
Targets are reconstructed with mk_regex_concat to preserve
normalization.

After decomposition, transitions with the same target are merged by
disjoining
their guards. The existing path-aware cofactor traversal and range
predicates
are therefore retained.

Example
-------

For

    r = .* a .{k}

the Brzozowski cofactors have the shape

    [a,  r | .{k}]
    [^a, r]

The light-weight Antimirov transformation produces

    [., r]
    [a, .{k}]

This preserves the language while avoiding the deterministic subset
states
that grow exponentially on this family.

Modes
-----

seq_monadic exposes two transition modes:

    light_antimirov   default
    brzozowski        retained as an explicit option

The implementation is seq_rewriter::light_ant_derivative_cofactors.

Correctness
-----------

The seq_monadic unit tests run in both modes. They cover character and
generic
element sequences, multiple and repeated variables, variable
constraints,
bounded loops, conjunctions of memberships, and witness construction. A
focused test checks the cofactor transformation above. The complete
94-test
unit suite used during evaluation passed. The benchmark harness is not
registered as a normal unit test; after detaching it, all 93 registered
tests
pass.

Benchmark evaluation
--------------------

The final optimized comparison used all 1,545 SMT2 files under
C:\git\bench\inputs\regexes. Each file was run in a separate process
with a
15-second timeout. There were 1,513 cases where both modes completed
without a
process failure or timeout.

                                    Brzozowski       Light-Ant
    paired solver time                 94.98 s          63.26 s
    median solver time                  1.734 ms         0.710 ms
    derivative calls                    5.70 M           3.39 M
    cofactors                           13.33 M           6.99 M
    live states                          2.74 M           0.44 M
    product states                     652.8 K         642.8 K

Light-Ant reduced paired solver time by 33.4%, derivative calls by
40.5%,
cofactors by 47.5%, and live states by 84.0%. It was faster on 1,091
cases;
Brzozowski was faster on 421 cases.

Light-Ant changed 131 Brzozowski undef results to sat. There were no
reverse
verdict changes and no mismatches against known sat/unsat statuses. Both
modes
had two timeouts. Process failures decreased from 30 to 27.

By corpus, paired solver time improved by 39.1% on ClemensRegex and by
11.9% on
MargusRegex.

Alternatives considered
-----------------------

Direct use of full Antimirov derivatives was also evaluated. It
introduced
large performance outliers, particularly around intersections, and
produced
additional undef results and timeouts. Disabling intersection-over-union
distribution improved some of these cases but remained slower and less
robust
than the light-weight transformation. The direct full-Ant mode was
therefore
removed from this change.

Copilot-Session: a2ce3573-4e15-4a4a-afb5-21e3cb04e4a2
2026-07-31 10:34:34 -07:00
davedets
214726519d
Add -Wignored-qualifiers in clang build, and fix one resulting warning. (#10325)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings. (Only 4 more warnings after this one!)

This PR adds -Wignored-qualifiers. It detects only one violation: a
function whose by-value return type (unsigned) has a const qualifier.
Here is the error message:

```
/Users/daviddetlefs/z3/src/math/lp/dioph_eq.cpp:1518:9: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
 1518 |         const unsigned sub_index(unsigned k) const {
      |         ^~~~~
```

Seems worth fixing.
2026-07-31 10:21:17 -07:00
Copilot
1a73005048
Convert build-warning-fixer into a clang-tidy-driven PR workflow (#10326)
This updates the existing agentic workflow from generic build-warning
cleanup to a clang-tidy-based loop: compile Z3 with Clang, inspect
clang-tidy/compiler diagnostics, and open a PR only for small,
semantics-preserving fixes.

- **Workflow scope**
- Renames and repurposes `build-warning-fixer` as a clang-tidy warning
fixer.
- Keeps the existing agentic PR flow, but narrows it to clang/clang-tidy
findings from the current run.

- **Build/analyze path**
- Switches the authored workflow prompt to use the repo’s CMake + Ninja
build with `clang`/`clang++`.
- Enables `CMAKE_CXX_CLANG_TIDY=clang-tidy` and exports compile commands
for tool-driven analysis.
- Captures configure/build logs in the agent artifact directory for
post-run diagnosis.

- **Agent behavior**
- Instructs the agent to classify clang-tidy warnings, compiler
warnings, and build errors from the build log.
- Biases toward localized fixes only: e.g. `override`,
`[[maybe_unused]]`, `nullptr`, dead locals.
- Explicitly prefers `noop` over speculative edits when diagnostics are
broad, risky, or design-affecting.

- **Generated workflow**
- Regenerates the compiled lockfile to reflect the new prompt and
current auth/permission model used by other agentic workflows in this
repo.

```yaml
CC=clang CXX=clang++ cmake -GNinja -S . -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  -DCMAKE_CXX_CLANG_TIDY=clang-tidy \
  2>&1 | tee /tmp/gh-aw/agent/clang-tidy-configure.log
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-31 10:15:18 -07:00
Nikolaj Bjorner
acb10d0288
Update monomial_bounds.cpp 2026-07-31 10:14:18 -07:00
Nikolaj Bjorner
7fde79f889 add facility to propagate all fixed instead of just changed 2026-07-30 20:28:28 -07:00
Nikolaj Bjorner
dbc1939ffa admit more ho pattern rules, prepare for cgr 2026-07-30 20:28:28 -07:00
Nikolaj Bjorner
52fbd1ca81 prepare ho-matcher for congruences
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-07-30 20:28:27 -07:00
Nikolaj Bjorner
639d7d147b
Update seq_monadic.cpp 2026-07-30 20:20:32 -07:00
Nikolaj Bjorner
87551f2bb0
Add global suppress_platform_verbose parameter (#10319)
## Summary

Adds a global configuration parameter **`suppress_platform_verbose`**
(bool, default `false`).

When set to `true`, memory and time information is suppressed from
verbose output — the same behavior as the `-V` flag proposed in #10301,
but driven by a global parameter instead of a dedicated command-line
switch. This yields deterministic, platform-independent verbose output
that is useful for testing and diffing.

Usage:
```
z3 -v:2 suppress_platform_verbose=true problem.smt2
```

## Approach

Instead of introducing a `-V` command-line flag (#10301), this registers
`suppress_platform_verbose` as a global parameter via `env_params`,
wired to a lightweight `get_suppress_platform_verbose()` flag in `util`.

Verbose output sites guard only their **memory** (`mem_stat`) and
**time** (`m_watch` / `:time` / `:before-memory` / `:after-memory`)
fields on this flag. Platform-independent counters (e.g. `:cost`,
`:threshold`, `:elim-vars`) are always emitted.

Affected sites:
- SAT: asymm-branch, probing, scc, simplifier (subsumer /
blocked-clauses / resolution), solver stats (`sat.stats`, `:memory`,
`mk_stat`)
- SMT: context stats (`smt.stats`)
- Tactic report (`:time`, `:before-memory`, `:after-memory`)

## Validation

- Release build succeeds.
- `suppress_platform_verbose` appears in `z3 -pd` with the correct
type/default, and is accepted on the command line.
- All 93 `test-z3 /a` unit tests pass.

Closes the need for the `-V` switch in #10301.

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-30 20:08:25 -07:00
Nikolaj Bjorner
bffbe2475f
Fix reversed precondition assertion in grobner::pop_scope (#10318)
### What it does

Fixes an inverted precondition assertion in `grobner::pop_scope`
(`src/math/grobner/grobner.cpp`).

```cpp
void grobner::pop_scope(unsigned num_scopes) {
    SASSERT(num_scopes >= get_scope_level());          // was reversed
    unsigned new_lvl = get_scope_level() - num_scopes; // requires num_scopes <= level
    ...
    m_scopes.shrink(new_lvl);
}
```

`get_scope_level()` returns `m_scopes.size()` (grobner.h). The body
computes
`new_lvl = get_scope_level() - num_scopes` and calls
`m_scopes.shrink(new_lvl)`,
which is only well-defined when `num_scopes <= get_scope_level()`. The
assertion
stated the opposite (`>=`), so in debug builds it would fire on any
valid partial
pop (e.g. popping one of several scopes) while failing to catch the
unsigned
underflow it was meant to guard against. Changed to `<=`.

### Evidence

- `get_scope_level() const { return m_scopes.size(); }`
(`src/math/grobner/grobner.h`).
- Compiled the translation unit with MSVC and `Z3DEBUG` defined (so the
`SASSERT`
  is active): builds cleanly.

### What we did not verify

This is a debug-only (`SASSERT`) correctness fix and has no effect on
release
builds. No behavioral test was added.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ad2c295d-7523-48cf-b786-b435b833e3af
2026-07-30 20:04:53 -07:00
Nikolaj Bjorner
3c3fdb81b1
Fix verbose output in sat_cleaner 2026-07-30 19:44:06 -07:00
Nikolaj Bjorner
0e4898be1c
Update verbose_stream output in sat_asymm_branch.cpp
Refactor verbose_stream output to include memory statistics.
2026-07-30 19:38:09 -07:00
Nikolaj Bjorner
dece18a60a
Fix verbose output in sat_cleaner.cpp 2026-07-30 19:34:58 -07:00
Nikolaj Bjorner
276edc5ce8
Update sat_asymm_branch.cpp 2026-07-30 19:33:45 -07:00
davedets
c49eb07c3e
Fix remaining clang warnings for fallthrough switch cases (in debug build). (#10314)
https://github.com/Z3Prover/z3/pull/10284 changed the UNREACHABLE macro
in debug.h to use __builtin_unreachable() to indicate to the compiler
that the
code leading it should be considered unreachable.

In https://github.com/Z3Prover/z3/pull/10295 Copilot figured out that
this was wrong: the unreachable macro makes calls, which shouldn't be
elided, and whose arguments should be evaluated. It partially fixed the
problem by declaring invoke_exit_action to be `[[noreturn]]`. This
eliminated warnings in non-debug builds, but when Z3_DEBUG is enabled,
`UNREACHABLE` ends with an invocation of `INVOKE_DEBUGER()`. This can
call `invoke_debugger()`, which *can* actually return (so it can't be
given the `[[noreturn]]` attribute. So we still get warnings in debug
builds.

This PR fixes those, creating a Z3_unreachable_case macro, which is just
a combination of `UNREACHABLE()` and `Z3_fallthrough`. It uses that in
the places that give warnings.

It seemed better to me to still have these cases have a single macro,
rather than `UNREACHABLE` followed by an explicit `Z3_fallthrough`; this
seemed to me like it would confuse people -- "how can you fall through
if this code is unreachable?" But I'm open to alternative suggestions!
2026-07-30 19:24:46 -07:00
Copilot
141e99ffe7
Recompile agentic workflow lockfiles and refresh pinned AW metadata (#10315)
This addresses stale generated Agentic Workflow artifacts by recompiling
the workflow sources and updating the checked-in lock outputs. The
update brings lockfiles and shared action pin metadata back in sync with
the current compiler/runtime generation.

- **Scope of regeneration**
- Recompiled all Agentic Workflow markdown definitions in
`.github/workflows/*.md` into their corresponding `.lock.yml` outputs.
- Updated generated maintenance workflow output in
`.github/workflows/agentics-maintenance.yml`.

- **Pinned dependency/metadata refresh**
- Refreshed `.github/aw/actions-lock.json` and lockfile manifests
(actions, container digests, compiler metadata) to the latest generated
state.
- Resulting lock headers now reflect the current compiler/toolchain
metadata used for generation.

- **Auth/runtime shape in generated lockfiles**
- Regenerated lock outputs include current AW-generated runtime/env
wiring for Copilot execution paths and token handling where applicable.

```yaml
# Example (lockfile header after regeneration)
# gh-aw-metadata:
#   compiler_version: "v0.83.4"
```

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-30 16:43:39 -07:00
dependabot[bot]
a9133ee475
Bump actions/setup-node from 6.4.0 to 7.0.0 (#10313)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from
6.4.0 to 7.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/setup-node/releases">actions/setup-node's
releases</a>.</em></p>
<blockquote>
<h2>v7.0.0</h2>
<h2>What's Changed</h2>
<h3>Enhancements:</h3>
<ul>
<li>Add cache-primary-key and cache-matched-key as outputs by <a
href="https://github.com/gowridurgad"><code>@​gowridurgad</code></a> in
<a
href="https://redirect.github.com/actions/setup-node/pull/1577">actions/setup-node#1577</a></li>
<li>Migrate to ESM and upgrade dependencies by <a
href="https://github.com/gowridurgad"><code>@​gowridurgad</code></a> in
<a
href="https://redirect.github.com/actions/setup-node/pull/1574">actions/setup-node#1574</a></li>
</ul>
<h3>Bug fixes:</h3>
<ul>
<li>Remove dummy NODE_AUTH_TOKEN export by <a
href="https://github.com/gowridurgad"><code>@​gowridurgad</code></a> in
<a
href="https://redirect.github.com/actions/setup-node/pull/1558">actions/setup-node#1558</a></li>
<li>Only use <code>mirrorToken</code> in <code>getManifest</code> if
it's provided by <a
href="https://github.com/deiga"><code>@​deiga</code></a> in <a
href="https://redirect.github.com/actions/setup-node/pull/1548">actions/setup-node#1548</a></li>
</ul>
<h3>Documentation updates:</h3>
<ul>
<li>Add documentation for publishing to npm with Trusted Publisher
(OIDC) by <a
href="https://github.com/chiranjib-swain"><code>@​chiranjib-swain</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1536">actions/setup-node#1536</a></li>
<li>docs: Update restore-only cache documentation by <a
href="https://github.com/priya-kinthali"><code>@​priya-kinthali</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1550">actions/setup-node#1550</a></li>
<li>docs: Update caching recommendations to mitigate cache poisoning
risks by <a
href="https://github.com/chiranjib-swain"><code>@​chiranjib-swain</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1567">actions/setup-node#1567</a></li>
</ul>
<h3>Dependency update:</h3>
<ul>
<li>Upgrade <code>@​actions/cache</code> to 5.1.0, log cache write
denied by <a
href="https://github.com/jasongin"><code>@​jasongin</code></a> in <a
href="https://redirect.github.com/actions/setup-node/pull/1569">actions/setup-node#1569</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/chiranjib-swain"><code>@​chiranjib-swain</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/setup-node/pull/1536">actions/setup-node#1536</a></li>
<li><a href="https://github.com/deiga"><code>@​deiga</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/setup-node/pull/1548">actions/setup-node#1548</a></li>
<li><a href="https://github.com/jasongin"><code>@​jasongin</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/setup-node/pull/1569">actions/setup-node#1569</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/setup-node/compare/v6...v7.0.0">https://github.com/actions/setup-node/compare/v6...v7.0.0</a></p>
<h2>v6.5.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update <code>@​actions/cache</code> to 5.1.0 and add security
overrides for undici and fast-xml-parser by <a
href="https://github.com/HarithaVattikuti"><code>@​HarithaVattikuti</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1579">actions/setup-node#1579</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/setup-node/compare/v6.4.0...v6.5.0">https://github.com/actions/setup-node/compare/v6.4.0...v6.5.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8207627860"><code>8207627</code></a>
Migrate to ESM and upgrade dependencies (<a
href="https://redirect.github.com/actions/setup-node/issues/1574">#1574</a>)</li>
<li><a
href="04be95cf35"><code>04be95c</code></a>
Add cache-primary-key and cache-matched-key as outputs (<a
href="https://redirect.github.com/actions/setup-node/issues/1577">#1577</a>)</li>
<li><a
href="7c2c68d20d"><code>7c2c68d</code></a>
docs: Update caching recommendations to mitigate cache poisoning risks
(<a
href="https://redirect.github.com/actions/setup-node/issues/1567">#1567</a>)</li>
<li><a
href="6a61c0375d"><code>6a61c03</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/setup-node/issues/1569">#1569</a>
from jasongin/update-actions-cache-5.1.0</li>
<li><a
href="30eb73b41d"><code>30eb73b</code></a>
Resolve high-severity audit issues</li>
<li><a
href="4e1a87a501"><code>4e1a87a</code></a>
Update dist</li>
<li><a
href="360237f0c0"><code>360237f</code></a>
Strict equality</li>
<li><a
href="4f8aac5beb"><code>4f8aac5</code></a>
Bump <code>@​actions/cache</code> to 5.1.0, log cache write denied</li>
<li><a
href="f4a67bbeca"><code>f4a67bb</code></a>
Only use <code>mirrorToken</code> in <code>getManifest</code> if it's
provided (<a
href="https://redirect.github.com/actions/setup-node/issues/1548">#1548</a>)</li>
<li><a
href="0355742c94"><code>0355742</code></a>
Remove dummy NODE_AUTH_TOKEN export (<a
href="https://redirect.github.com/actions/setup-node/issues/1558">#1558</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/actions/setup-node/compare/v6.4.0...v7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-node&package-manager=github_actions&previous-version=6.4.0&new-version=7.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-30 15:18:42 -07:00
dependabot[bot]
7cb225ee9a
Bump actions/cache/save from 5.0.5 to 6.1.0 (#10311)
Bumps [actions/cache/save](https://github.com/actions/cache) from 5.0.5
to 6.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/releases">actions/cache/save's
releases</a>.</em></p>
<blockquote>
<h2>v6.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@​actions/cache</code> to v6.1.0 - handle read-only cache
access by <a
href="https://github.com/jasongin"><code>@​jasongin</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1768">actions/cache#1768</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v6...v6.1.0">https://github.com/actions/cache/compare/v6...v6.1.0</a></p>
<h2>v6.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update packages, migrate to ESM by <a
href="https://github.com/Samirat"><code>@​Samirat</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1760">actions/cache#1760</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v6.0.0">https://github.com/actions/cache/compare/v5...v6.0.0</a></p>
<h2>v5.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@​actions/cache</code> to v5.1.0 - handle read-only cache
access by <a
href="https://github.com/jasongin"><code>@​jasongin</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1775">actions/cache#1775</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v5.1.0">https://github.com/actions/cache/compare/v5...v5.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/blob/main/RELEASES.md">actions/cache/save's
changelog</a>.</em></p>
<blockquote>
<h1>Releases</h1>
<h2>How to prepare a release</h2>
<blockquote>
<p>[!NOTE]
Relevant for maintainers with write access only.</p>
</blockquote>
<ol>
<li>Switch to a new branch from <code>main</code>.</li>
<li>Run <code>npm test</code> to ensure all tests are passing.</li>
<li>Update the version in <a
href="https://github.com/actions/cache/blob/main/package.json"><code>https://github.com/actions/cache/blob/main/package.json</code></a>.</li>
<li>Run <code>npm run build</code> to update the compiled files.</li>
<li>Update this <a
href="https://github.com/actions/cache/blob/main/RELEASES.md"><code>https://github.com/actions/cache/blob/main/RELEASES.md</code></a>
with the new version and changes in the <code>## Changelog</code>
section.</li>
<li>Run <code>licensed cache</code> to update the license report.</li>
<li>Run <code>licensed status</code> and resolve any warnings by
updating the <a
href="https://github.com/actions/cache/blob/main/.licensed.yml"><code>https://github.com/actions/cache/blob/main/.licensed.yml</code></a>
file with the exceptions.</li>
<li>Commit your changes and push your branch upstream.</li>
<li>Open a pull request against <code>main</code> and get it reviewed
and merged.</li>
<li>Draft a new release <a
href="https://github.com/actions/cache/releases">https://github.com/actions/cache/releases</a>
use the same version number used in <code>package.json</code>
<ol>
<li>Create a new tag with the version number.</li>
<li>Auto generate release notes and update them to match the changes you
made in <code>RELEASES.md</code>.</li>
<li>Toggle the set as the latest release option.</li>
<li>Publish the release.</li>
</ol>
</li>
<li>Navigate to <a
href="https://github.com/actions/cache/actions/workflows/release-new-action-version.yml">https://github.com/actions/cache/actions/workflows/release-new-action-version.yml</a>
<ol>
<li>There should be a workflow run queued with the same version
number.</li>
<li>Approve the run to publish the new version and update the major tags
for this action.</li>
</ol>
</li>
</ol>
<h2>Changelog</h2>
<h3>6.1.0</h3>
<ul>
<li>Bump <code>@actions/cache</code> to v6.1.0 to pick up <a
href="https://redirect.github.com/actions/toolkit/pull/2435">actions/toolkit#2435
Handle cache write error due to read-only token</a></li>
<li>Switch redundant &quot;Cache save failed&quot; warning to debug log
in save-only</li>
</ul>
<h3>6.0.0</h3>
<ul>
<li>Updated <code>@actions/cache</code> to ^6.0.1,
<code>@actions/core</code> to ^3.0.1, <code>@actions/exec</code> to
^3.0.0, <code>@actions/io</code> to ^3.0.2</li>
<li>Migrated to ESM module system</li>
<li>Upgraded Jest to v30 and test infrastructure to be ESM
compatible</li>
</ul>
<h3>5.0.4</h3>
<ul>
<li>Bump <code>minimatch</code> to v3.1.5 (fixes ReDoS via globstar
patterns)</li>
<li>Bump <code>undici</code> to v6.24.1 (WebSocket decompression bomb
protection, header validation fixes)</li>
<li>Bump <code>fast-xml-parser</code> to v5.5.6</li>
</ul>
<h3>5.0.3</h3>
<ul>
<li>Bump <code>@actions/cache</code> to v5.0.5 (Resolves: <a
href="https://github.com/actions/cache/security/dependabot/33">https://github.com/actions/cache/security/dependabot/33</a>)</li>
<li>Bump <code>@actions/core</code> to v2.0.3</li>
</ul>
<h3>5.0.2</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="55cc834586"><code>55cc834</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1768">#1768</a>
from jasongin/readonly-cache</li>
<li><a
href="d8cd72f230"><code>d8cd72f</code></a>
Bump <code>@​actions/cache</code> to v6.1.0 - handle cache write error
due to RO token</li>
<li><a
href="2c8a9bd745"><code>2c8a9bd</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1760">#1760</a>
from actions/samirat/esm_migration_and_package_update</li>
<li><a
href="e9b91fdc3f"><code>e9b91fd</code></a>
Prettier fixes</li>
<li><a
href="e4884b8ff7"><code>e4884b8</code></a>
Rebuild dist</li>
<li><a
href="10baf0191a"><code>10baf01</code></a>
Fixed licenses</li>
<li><a
href="e39b386c90"><code>e39b386</code></a>
Fix test mock return order</li>
<li><a
href="b692820337"><code>b692820</code></a>
PR feedback</li>
<li><a
href="60749128a4"><code>6074912</code></a>
Rebuild dist bundles as ESM to match type:module</li>
<li><a
href="5a912e8b4a"><code>5a912e8</code></a>
Fix lint and jest issues</li>
<li>Additional commits viewable in <a
href="27d5ce7f10...55cc834586">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache/save&package-manager=github_actions&previous-version=5.0.5&new-version=6.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-30 15:14:19 -07:00
dependabot[bot]
99a2be2a77
Bump pypa/cibuildwheel from 4.1.0 to 4.1.1 (#10312)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from
4.1.0 to 4.1.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/releases">pypa/cibuildwheel's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.1</h2>
<ul>
<li> Adds <code>pyodide-build</code> as a separate <a
href="https://cibuildwheel.pypa.io/en/stable/options/#build-frontend"><code>build-frontend</code></a>,
now the default frontend for Pyodide, with verbosity flags handling. Any
other frontend is ignored with a warning on Pyodide. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2609">#2609</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2945">#2945</a>)</li>
<li>🔐 Uses digests instead of tags for pinned container images,
strengthening supply-chain security. The human-readable tags remain as
comments in <code>pinned_docker_images.cfg</code>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2915">#2915</a>)</li>
<li>🐛 Fixes platform-specific <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-runtime"><code>test-runtime</code></a>
environment variables (e.g. <code>CIBW_TEST_RUNTIME_ANDROID</code>) not
being honored (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2941">#2941</a>)</li>
<li>🐛 Fixes quoting of <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-requires"><code>test-requires</code></a>
and <a
href="https://cibuildwheel.pypa.io/en/stable/options/#audit-requires"><code>audit-requires</code></a>
so PEP 508 specifiers containing spaces work (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2913">#2913</a>)</li>
<li>🐛 Makes <a
href="https://cibuildwheel.pypa.io/en/stable/options/#archs"><code>archs</code></a>
parsing case-insensitive and platform-aware, so e.g. <code>arm64</code>
works on Windows (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2920">#2920</a>)</li>
<li>🐛 Uses an absolute path for the <code>{project}</code> placeholder
in <a
href="https://cibuildwheel.pypa.io/en/stable/options/#config-settings"><code>config-settings</code></a>
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2934">#2934</a>)</li>
<li>🐛 Validates the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version"><code>pyodide-version</code></a>
option against the build identifier with a clear error (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2925">#2925</a>)</li>
<li>🐛 Fixes PyPy installs on macOS after PyPy switched its downloads
from <code>.tar.bz2</code> to <code>.tar.gz</code> (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2939">#2939</a>)</li>
<li>🐛 Makes a matching <code>python3-config</code> available in the
build and test venvs on macOS (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2922">#2922</a>)</li>
<li>🛠 Updates dependencies and container pins (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2917">#2917</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2935">#2935</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2939">#2939</a>)</li>
<li>🛠 Updates Android tests to current Python versions and the new test
repository URL (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2933">#2933</a>)</li>
<li>🛠 Drops the <code>orjson</code> dependency, no longer used by mypy
2+ (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2923">#2923</a>)</li>
<li>📚 Builds the docs with properdocs, a MkDocs fork (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2946">#2946</a>)</li>
<li>📚 Adds the missing <code>cp314-pyodide_wasm32</code> entry to the
build identifier table (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2947">#2947</a>)</li>
<li>📚 Removes outdated notes about the <code>pip wheel</code> build
frontend and ClearLinux (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2926">#2926</a>)</li>
<li>💼 Adds a &quot;CI: PyPy EoL&quot; PR label to run PyPy EoL tests on
PRs (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2930">#2930</a>)</li>
<li>💼 Updates CI action pins and pre-commit hooks (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2914">#2914</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2932">#2932</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2938">#2938</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2940">#2940</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2942">#2942</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2943">#2943</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md">pypa/cibuildwheel's
changelog</a>.</em></p>
<blockquote>
<h3>v4.1.1</h3>
<p><em>24 July 2026</em></p>
<ul>
<li> Adds <code>pyodide-build</code> as a separate <a
href="https://cibuildwheel.pypa.io/en/stable/options/#build-frontend"><code>build-frontend</code></a>,
now the default frontend for Pyodide, with verbosity flags handling. Any
other frontend is ignored with a warning on Pyodide. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2609">#2609</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2945">#2945</a>)</li>
<li>🔐 Uses digests instead of tags for pinned container images,
strengthening supply-chain security. The human-readable tags remain as
comments in <code>pinned_docker_images.cfg</code>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2915">#2915</a>)</li>
<li>🐛 Fixes platform-specific <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-runtime"><code>test-runtime</code></a>
environment variables (e.g. <code>CIBW_TEST_RUNTIME_ANDROID</code>) not
being honored (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2941">#2941</a>)</li>
<li>🐛 Fixes quoting of <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-requires"><code>test-requires</code></a>
and <a
href="https://cibuildwheel.pypa.io/en/stable/options/#audit-requires"><code>audit-requires</code></a>
so PEP 508 specifiers containing spaces work (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2913">#2913</a>)</li>
<li>🐛 Makes <a
href="https://cibuildwheel.pypa.io/en/stable/options/#archs"><code>archs</code></a>
parsing case-insensitive and platform-aware, so e.g. <code>arm64</code>
works on Windows (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2920">#2920</a>)</li>
<li>🐛 Uses an absolute path for the <code>{project}</code> placeholder
in <a
href="https://cibuildwheel.pypa.io/en/stable/options/#config-settings"><code>config-settings</code></a>
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2934">#2934</a>)</li>
<li>🐛 Validates the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version"><code>pyodide-version</code></a>
option against the build identifier with a clear error (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2925">#2925</a>)</li>
<li>🐛 Fixes PyPy installs on macOS after PyPy switched its downloads
from <code>.tar.bz2</code> to <code>.tar.gz</code> (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2939">#2939</a>)</li>
<li>🐛 Makes a matching <code>python3-config</code> available in the
build and test venvs on macOS (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2922">#2922</a>)</li>
<li>🛠 Updates dependencies and container pins (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2917">#2917</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2935">#2935</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2939">#2939</a>)</li>
<li>🛠 Updates Android tests to current Python versions and the new test
repository URL (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2933">#2933</a>)</li>
<li>🛠 Drops the <code>orjson</code> dependency, no longer used by mypy
2+ (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2923">#2923</a>)</li>
<li>📚 Builds the docs with properdocs, a MkDocs fork (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2946">#2946</a>)</li>
<li>📚 Adds the missing <code>cp314-pyodide_wasm32</code> entry to the
build identifier table (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2947">#2947</a>)</li>
<li>📚 Removes outdated notes about the <code>pip wheel</code> build
frontend and ClearLinux (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2926">#2926</a>)</li>
<li>💼 Adds a &quot;CI: PyPy EoL&quot; PR label to run PyPy EoL tests on
PRs (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2930">#2930</a>)</li>
<li>💼 Updates CI action pins and pre-commit hooks (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2914">#2914</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2932">#2932</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2938">#2938</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2940">#2940</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2942">#2942</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2943">#2943</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4726cd35bb"><code>4726cd3</code></a>
Bump version: v4.1.1</li>
<li><a
href="1af5cd76db"><code>1af5cd7</code></a>
docs: switch from mkdocs to properdocs (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2946">#2946</a>)</li>
<li><a
href="b21d76ae03"><code>b21d76a</code></a>
docs: add missing cp314-pyodide_wasm32 to build-id table (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2947">#2947</a>)</li>
<li><a
href="03cbe932e6"><code>03cbe93</code></a>
fix(macos): make matching python3-config available in build/test venvs
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2922">#2922</a>)</li>
<li><a
href="b7cac6dfef"><code>b7cac6d</code></a>
fix: don't error when a global build-frontend is set on pyodide (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2945">#2945</a>)</li>
<li><a
href="1520daf8ae"><code>1520daf</code></a>
fix: support platform-specific test runtime environment variables (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2941">#2941</a>)</li>
<li><a
href="17b74206ab"><code>17b7420</code></a>
[Bot] Update dependencies (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2939">#2939</a>)</li>
<li><a
href="f8d8cca5bb"><code>f8d8cca</code></a>
chore(deps): bump astral-sh/setup-uv from 8.2.0 to 8.3.2 in the actions
group...</li>
<li><a
href="265b435c86"><code>265b435</code></a>
chore(deps): bump the actions group with 2 updates (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2942">#2942</a>)</li>
<li><a
href="3f8bd1c9ba"><code>3f8bd1c</code></a>
chore(deps): bump the actions group with 3 updates (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2938">#2938</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/cibuildwheel/compare/v4.1.0...v4.1.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pypa/cibuildwheel&package-manager=github_actions&previous-version=4.1.0&new-version=4.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-30 15:14:08 -07:00
davedets
7502e3c409
Remove new instances of unused local vars and functions (#10309)
A few seem to have crept in.  Verified with both dbg and release builds.
2026-07-30 13:41:20 -07:00
Lev Nachmanson
90fe0aa0f3
Imp fix (#10304)
For every row with only one non-fixed variable in nla_core.cpp,
core::propagate, fix this variable.

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nikolaj@cs.stanford.edu>
2026-07-30 12:45:06 -07:00
Lev Nachmanson
41da8b1e9a
Fix #10303: unsound sat in nla when the LP model carries infinitesimals (#10307)
Fixes #10303.

## Symptom

On the reported QF_NRA instance z3 answers `sat` for some values of
`smt.random_seed` and `unsat` for others, and every `sat` comes with a
model z3's own validator rejects. The correct answer is `unsat`.
`smt.arith.solver=2` is unaffected; `smt.arith.solver=6` (the default)
is not.

## Root cause

The simplex model is not rational — each column is a `numeric_pair<mpq>`
`(x, y)` denoting `x + δ·y`, where `δ` is a positive infinitesimal used
to represent *strict* bounds exactly (`v > 0` is stored as `(0, 1)`).
`δ` only becomes concrete at model-output time, in
`from_model_in_impq_to_mpq(v) = v.x + m_delta * v.y`.

But nla decides monomial consistency using **only the rational parts**:

```cpp
const rational& val(lpvar j) const { return lra.get_column_value(j).x; }   // nla_core.h:165
r *= lra.get_column_value(j).x;                                            // product_value
return product_value(m) == lra.get_column_value(m.var()).x;                // check_monic
```

That is sound only on a δ-free model, and it cannot be repaired by also
tracking `y`: a **product** `(x₁+δy₁)(x₂+δy₂)` has a `δ²` term, which a
`numeric_pair` cannot represent. The delta encoding is inherently
linear, so nla structurally cannot reason on a δ-carrying model.

The code relies on this: `core::check()` calls
`lra.get_rid_of_inf_eps()` as its very first action to instantiate δ
before any monomial is inspected. The invariant is:

> `m_to_refine` must only ever be computed on a δ-free model.

`core::optimize_nl_bounds()` breaks it. It calls
`lra.find_feasible_solution()` in the middle of the nla check; the
simplex re-runs, parks columns back onto strict bounds and
**re-introduces non-zero `y`**. It then calls `init_to_refine()` on that
model — one full LP re-solve after the scrub in `core::check()`.

A wrong `m_to_refine` turns directly into a wrong answer:

```
find_feasible_solution() re-introduces δ
  → init_to_refine() mis-measures monomials (compares only .x)
  → m_to_refine wrongly empty
  → horner.cpp:117  set_nla_satisfied()
  → core::check()   returns l_true
  → theory_lra      FC_DONE  →  sat
  → model output instantiates δ  (x + m_delta·y)
  → monomial equations violated → "an invalid model was generated"
```

Instrumenting model construction on the reported benchmark confirms it
exactly: `use_nra_model=0`, **87 columns still carrying infinitesimals,
44 monomials violated** once δ is instantiated — every one of them with
`to_refine = 0`.

## Fix

Enforce the invariant where it is actually depended upon, instead of
only at the entry to `core::check()`:

```cpp
void core::init_to_refine() {
    if (lra.is_feasible())
        lra.get_rid_of_inf_eps();
    m_to_refine.reset();
    ...
}
```

Every caller — including the ones inside `optimize_nl_bounds()` that
follow an LP re-solve — now measures monomials on a δ-free model.

A second commit closes a related hole: the
`arith.nl.optimize_bounds_lp_max_vars` throttle exit returns *after*
`find_feasible_solution()` has already moved the model, and was the only
exit that never called `init_to_refine()` at all — leaving `m_to_refine`
stale rather than merely δ-contaminated.

## Validation

Reported benchmark, `tactic.default_tactic=smt` (deterministic — the
default QF_NRA portfolio uses wall-clock `try_for` budgets, so it is
timing-dependent): master fails on **9 of 20** seeds; with the fix
**20/20** answer `unsat`. Under the default configuration, seeds 1–10
all answer `unsat` (was `sat` + invalid model on 1, 3, 4, 10), matching
`smt.arith.solver=2`.

The bug was much broader than the single reported instance. On the
`QF_NRA_small` corpus (1147 instances, `-T:10`):

| | sat | unsat | unknown | invalid model |
|---|---|---|---|---|
| master | 460 | 597 | 77 | **13** |
| this PR | 466 | 602 | 79 | **0** |

**Zero sat/unsat conflicts.** Of the 13 instances where master emitted
an invalid model, **7 are genuinely `unsat`** — the same unsoundness as
the reported one.

## Performance

Net **faster**, on the 1054 instances answered identically before and
after:

| | total |
|---|---|
| master | 229.7 s |
| this PR | 146.4 s (**−36.3 %**) |

133 instances faster by >200 ms vs. 13 slower by >200 ms.

The added `get_rid_of_inf_eps()` is asymptotically free —
`init_to_refine()` already costs Θ(Σ|monic|) arbitrary-precision
*multiplications*, so adding Θ(#columns) `mpq::is_zero()` tests (which
early-exit when no deltas are present) does not change its complexity
class. The expensive path is also moved rather than added: deltas left
by `optimize_nl_bounds()` previously survived until the next
`core::check()`, which paid the full `find_delta_for_strict_bounds` +
rewrite cost anyway.

The speedup itself comes from correctness — a truthful `m_to_refine`
points grobner / basic_lemma / order / monotonicity / tangent / nra at
the monomials that are genuinely violated, instead of letting them chase
a model that was never consistent.

`test-z3 /a`: 93/93 pass.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-30 12:39:48 -07:00
davedets
966a32cfc0
Add -Wextra-semi to CLANG_ONLY_WARNINGS (#10305)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

I realized that in https://github.com/Z3Prover/z3/pull/10192, I had
intended to add "-Wextra-semi" to CLANG_ONLY_WARNINGS. I certainly did
in testing, and the PR fixes all the remaining warnings it provokes, but
for some reason I left it out of the final PR. This adds it back; I
tested by doing both the dbg and release builds.
2026-07-30 11:36:00 -07:00
Nikolaj Bjorner
808a35b5e3 Remove z3_tptp5 example build steps from GitHub Actions
The tptp5 example was removed, so drop its build/run steps from ci.yml,
coverage.yml, and the daily-test-improver coverage action. The z3 -tptp
front-end and the tptp-benchmark workflow are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-29 15:53:08 -07:00
Nikolaj Bjorner
5b12b607e2 Remove seq_split regex factorization module
Remove the seq_split (regex sigma-splitting / factorization) module and all
code that uses it:
- delete src/ast/rewriter/seq_split.{h,cpp} and src/test/seq_split.cpp
- drop the m_split member, include, and split/simplify_split/split_membership
  wrappers from seq_rewriter
- remove the regex factorization propagation block from seq_regex.cpp
- remove the seq.regex_factorization_enabled/threshold parameters and their
  theory_seq_params fields
- drop the files from the rewriter/test CMake lists and the test registry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
2026-07-29 15:38:21 -07:00
Margus Veanes
0972dd2141
seq_monadic: self-contained monadic-decomposition regex membership solver (generic elements, witnesses, Boolean combinations) (#10296)
## Summary

Adds `seq_monadic` (`src/ast/rewriter/seq_monadic.{h,cpp}`), a
self-contained,
rewriter-level decision procedure for regex membership of a term that is
a
concatenation of sequence variables and constant elements — e.g. `x·a·x
∈ R`,
including repeated and multiple variables. It uses a whole-language
*monadic
decomposition* plus automaton product-reachability; it is minterm-free
and does
**not** use Nielsen word-equation splitting or `seq_split`.

The component is **purely additive**: it is not wired into any solver
path, so
default behavior is unchanged. It ships with a unit test and an opt-in
benchmark
harness that is inert unless `Z3_SEQ_BENCH_DIR` is set.

## What it does

- `x·u ∈ R  ⇔  ⋁_q ( x reaches q in A_R  ∧  u ∈ q )` over the derivative
  automaton; `reach(q)` is never materialized as a regex (avoids the
state-elimination blowup). A variable's constraint is decided by a lazy
product-reachability search over tuples of derivative states, with
transitions
= the product of `brz_derivative_cofactors` branches and
pairwise-conjoined
  `seq::range_predicate` guards.
- **Generic in the element sort**: characters use the exact
`range_predicate`
algebra; any other element sort uses a candidate-basis over the element
values
the guards mention (sound and complete for the
`{true,false,=,<=,and,or,not}`
  guard grammar the derivatives emit).
- **Concrete witnesses**: on sat it reconstructs a witness value (a
sequence of
concrete elements, not predicates) per variable from the accepting
product path.
- **Boolean combinations**: `solve_and` decides a conjunction of
memberships
jointly, so a variable shared across memberships is constrained
consistently.
This is the natural extension since `¬(t∈R) ≡ t∈~R`, `∨` = union of
DNFs, and
  `∧` = product of DNFs.

Also de-duplicates the char-guard → `range_predicate` translator into a
single
public `seq::guard_to_range_predicate` in `seq_range_collapse` (it was
previously
duplicated there and in `seq_monadic`).

## Testing

- `tst_seq_monadic`: single / multiple / repeated variables, nested
complement,
bounded loops, per-variable constraints, a generic `(Seq Int)` section,
witness
  verification (substitute the model back and re-decide membership), and
  `solve_and` cases that are individually sat but jointly unsat.
- Full unit suite `test-z3 /a` passes (93/93).

## Evaluation (offline harness, not part of CI)

On a regex-membership benchmark corpus, restricted to files carrying a
genuine
`(set-info :status)`, the solver decides 318 and 316 are correct
(99.4%); the
only 2 disagreements are a length limitation (`|x|=2k`) that is outside
the
membership fragment.

## Known limitations / follow-ups

- Pathological deeply-nested, high-multiplicity regexes can overflow the
recursive derivative stack; a recursion-depth guard to degrade to
`unknown` is
  a natural follow-up.
- Out-of-fragment constraints (word equations, length / Parikh) are not
handled,
  by design — this decides regex membership only.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nikolaj@cs.stanford.edu>
Copilot-Session: 916db256-43c6-4067-b6f4-fa8d2cf2f37f
2026-07-29 15:16:54 -07:00