3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 15:16:29 +00:00
Commit graph

22743 commits

Author SHA1 Message Date
CEisenhofer
67906da97a Corrected string extraction 2026-06-05 19:57:00 +02:00
CEisenhofer
8ac7a242eb Z3 arguments got ignored in the Nielsen graph 2026-06-05 19:19:08 +02:00
CEisenhofer
c20bc0e631 First attempt for monadic decomposition 2026-06-05 18:40:36 +02:00
CEisenhofer
9de196b3cb Some signatures changed after merging in master 2026-06-03 17:39:09 +02:00
CEisenhofer
043c6c0ad1 Merge branch 'master' into c3 2026-06-03 17:33:26 +02:00
Clément Pit-Claudel
1d706e875c
Handle SIGXCPU like a regular timeout (#9697)
Z3's -T measures wall clock time, whereas `ulimit -t` measures CPU time.
Currently, an expired ulimit timeout crashes Z3 without printing
statistics; this patch makes it react cleanly (just as if it has
encountered a regular timeout) to SIGXCPU, the signal that ulimit sends
before sending SIGKILL.
2026-06-03 07:26:38 -07:00
Hari Govind V K
922f49e187
Fix MBP QEL soundness bug in datatype accessor elimination (#9571) (#9692)
Two fixes for mbp_dt_tg::apply() when encountering an accessor whose
argument has a different constructor in the model:

1. Don't call rm_accessor (which would assert a contradictory
recognizer, making the formula false). This prevents the original bug
where QEL returned 'false' for satisfiable formulas.

2. Branch on the model-assigned constructor for the accessor's argument.

The correct output should include the literal introduced in (2).
However, this fix does not produce it. Spacer is sound with this
over-approximation, as long as the counter example does not depend on
value of mismatched accessors (e.g. (tl nil)).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-03 07:23:21 -07:00
CEisenhofer
e94b6db8e5 Removed assertion to make the build dependencies acyclic 2026-06-03 10:58:25 +02:00
Nikolaj Bjorner
a0a3047e36 remove side definitions 2026-06-02 21:43:55 -07:00
Nikolaj Bjorner
77f8b33794 re-enable unit tests 2026-06-02 10:39:41 -07:00
Nikolaj Bjorner
2dbe233f6a fix condition that skipped mbqi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-06-02 10:38:52 -07:00
Nikolaj Bjorner
eaf7562a1d disable test in tptp, move to native lambdas 2026-06-02 10:38:51 -07:00
Nikolaj Bjorner
3e0a350411
Comment out ho_curried_application and ho_choice_expression tests
Comment out two test functions for debugging purposes.
2026-06-02 08:47:43 -07:00
CEisenhofer
3908016651 Potentially fixed termination problem with projection operators 2026-06-02 17:04:31 +02:00
Nikolaj Bjorner
78a7b4d3a6
Update model_core.h 2026-06-01 19:47:40 -07:00
Nikolaj Bjorner
358378a6f0 remove tptp from all
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-06-01 19:36:18 -07:00
Nikolaj Bjorner
94b981024e set up udoc relation to use datalog engine 2026-06-01 19:06:25 -07:00
Nikolaj Bjorner
c4366e57f8
Update udoc_relation.cpp 2026-06-01 17:22:06 -07:00
Copilot
947af23fc4
[code-simplifier] Align choice axiom naming in theory_array_full (#9660)
This simplifies the recent `choice` axiom path in the SMT array solver
for consistency with the SAT-side implementation. The change is purely
structural: align local naming with the quantifier body it represents,
inline a single-use literal, and remove stray whitespace in the array
decl header.

- **Choice axiom cleanup**
- Rename the local implication term in
`theory_array_full::instantiate_choice_axiom` from `ax` to `body`
- Match the naming already used in
`sat/smt/array_axioms.cpp::assert_choice_axiom`

- **Single-use literal inlining**
- Replace the temporary `literal l = mk_literal(q); assert_axiom(l);`
with a direct call
  - Reduce noise without changing behavior

- **Header whitespace cleanup**
  - Remove trailing whitespace in `src/ast/array_decl_plugin.h`

```c++
expr_ref body(m.mk_implies(px, pc), m);
expr_ref q(m.mk_forall(1, &x_sort, &x_name, body), m);
ctx.get_rewriter()(q);
assert_axiom(mk_literal(q));
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-06-01 16:03:42 -07:00
dependabot[bot]
b0536c3998
Bump github/gh-aw-actions from 0.76.1 to 0.77.0 (#9661)
Bumps [github/gh-aw-actions](https://github.com/github/gh-aw-actions)
from 0.76.1 to 0.77.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/github/gh-aw-actions/releases">github/gh-aw-actions's
releases</a>.</em></p>
<blockquote>
<h2>v0.77.0</h2>
<p>Sync of actions from <a
href="https://github.com/github/gh-aw">gh-aw</a> at
<code>v0.77.0</code>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b11be78086"><code>b11be78</code></a>
chore: sync actions from gh-aw@v0.77.0 (<a
href="https://redirect.github.com/github/gh-aw-actions/issues/122">#122</a>)</li>
<li>See full diff in <a
href="https://github.com/github/gh-aw-actions/compare/v0.76.1...v0.77.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/gh-aw-actions&package-manager=github_actions&previous-version=0.76.1&new-version=0.77.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-06-01 16:01:32 -07:00
Can Cebeci
8ddd435835
Fix misleading generation number in trace (#9687)
Current implementation prints 0 when the cached generation is used
2026-06-01 16:00:59 -07:00
Nikolaj Bjorner
d025b34606 prepare for enodes over lambdas 2026-06-01 13:00:35 -07:00
Nikolaj Bjorner
705569df24 add include directive 2026-06-01 11:39:18 -07:00
CEisenhofer
5b41c6eb9f Better tracking for debugging 2026-06-01 19:50:34 +02:00
CEisenhofer
2da7c7b3db Cache result of Z3 emptiness checks 2026-06-01 17:53:28 +02:00
CEisenhofer
1637b006c5 Output automaton 2026-06-01 17:29:09 +02:00
Nikolaj Bjorner
ebdf031c8f ensure engine is datalog for dl_table and dl_util tests 2026-05-31 15:32:23 -07:00
Nikolaj Bjorner
24e5a6ae3f ensure base class has propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-30 22:21:15 -07:00
Nikolaj Bjorner
a595e98707 fix regression: m_tmp_diseq has 0 arguments, you have to access the expression
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-30 18:57:21 -07:00
Nikolaj Bjorner
dbe986fdf7 move closure conversion to solver internalization
- only the internalizer performs closure conversion
- theory_array treats propagation of lambdas similar to stores
- ho_matcher treats top-level flex patterns as first-order
- pattern-inference fix to handle quantifiers (lambdas) in patterns that are computed
2026-05-30 18:41:37 -07:00
Nikolaj Bjorner
2cc4422018 use expr based access to enodes to allow for storing first-class lambas 2026-05-30 15:13:08 -07:00
Lev Nachmanson
5f3088f3b5
CI: validate libz3.dylib architecture on macOS to prevent #9662 regression (#9669) 2026-05-29 16:00:36 -07:00
Nikolaj Bjorner
30df8e7ece build warnings 2026-05-29 10:17:46 -07:00
CEisenhofer
cebe57dffa Avoid unnecessary regex cycle splits 2026-05-29 19:14:08 +02:00
CEisenhofer
70031b674c Added real projection operator 2026-05-29 15:51:35 +02:00
Nikolaj Bjorner
48bcee8e62 add lambda-t case in addition to p-lambda case 2026-05-29 01:18:34 -07:00
CEisenhofer
ff99cb442a Unique name for decomposed regex 2026-05-28 18:45:48 +02:00
CEisenhofer
e5d5b493d3 Remove trivial membership constraints also after simplifications 2026-05-28 18:26:50 +02:00
Copilot
b74e35f4fb
Fix mpz_manager leak in algebraic root comparison (#9654)
A `root-obj`-driven unsat case was exiting with a leaked `mpz_manager`
allocation even though solver output was correct. The leak came from
temporary rational bounds created during algebraic-number comparison and
not released before shutdown.

- **Root cause**
- `algebraic_numbers::compare_core()` materialized interval bounds as
raw `mpq` temporaries.
- Those temporaries could allocate backing `mpz` storage, but their
lifetime was not tied to the manager, so the allocator retained leaked
cells at process exit.

- **Change**
- Replace the raw `mpq` temporaries with `scoped_mpq` in
`/src/math/polynomial/algebraic_numbers.cpp`.
- This keeps the comparison logic unchanged while making temporary bound
conversion use RAII-managed cleanup.

- **Effect**
- `root-obj` comparisons no longer leave `mpz_manager` allocations
behind.
- Solver behavior is unchanged; the fix is limited to temporary numeral
lifetime management.

```c++
- mpq l_a, u_a, l_b, u_b;
+ scoped_mpq l_a(qm()), u_a(qm()), l_b(qm()), u_b(qm());
```

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-28 09:06:05 -07:00
CEisenhofer
7d7199dec6 use expr id when doing model construction and not internal id 2026-05-28 18:02:41 +02:00
Nikolaj Bjorner
0b56db7f07 fix #9657 2026-05-28 09:01:48 -07:00
Nikolaj Bjorner
b34a7b4319 use trail stack from context for ho-matcher 2026-05-28 07:57:07 -07:00
CEisenhofer
8f74296cf2 Output substitutions in dot 2026-05-28 16:29:33 +02:00
CEisenhofer
2bbd75a186 We should not bypass checking primitive constraints being empty 2026-05-28 15:29:43 +02:00
Nikolaj Bjorner
9d09a050e8 use max-top-generation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-05-27 14:37:37 -07:00
Nikolaj Bjorner
17c6e0729b control recursion depth for check function 2026-05-27 14:29:53 -07:00
Nikolaj Bjorner
5fe4d88d43 recognize ubv_to_int as part of BV logic 2026-05-27 13:08:54 -07:00
Copilot
51da9db615
Add SMT-LIB choice support via array OP_CHOICE and instantiate choice axioms in array solvers (#9649)
This change wires SMT-LIB Hilbert choice parsing to a concrete
array-theory operator and ensures both array backends enforce the
expected semantic axiom. Previously, `(choice ((x T)) phi)` parsed as
NYI and had no solver-side instantiation path.

- **Parser: lower `choice_k` into array `OP_CHOICE`**
- `pop_quant_frame(choice_k)` now builds `(choice p)` instead of
throwing.
- Added parser include/use of array utilities to construct the term
directly from the generated lambda predicate.

- **Array decl plugin: add `OP_CHOICE` typing + surface syntax**
  - Added declaration support for `choice` with signature:
- `(Array T Bool) -> T` (encoded as `('a -> Bool) -> 'a` in HO view).
- Added recognizer/util helpers (`is_choice`, `mk_choice`) and exposed
`"choice"` in op names.

- **SMT array theory (`theory_array_full`): instantiate choice axiom**
  - Added instantiation for each encountered `choice(p)`:
    - `forall x . p(x) => p(choice(p))`
  - Integrated into internalization/relevancy paths and statistics.

- **SAT/SMT array backend (`sat/smt/array_*`): instantiate choice
axiom**
- Added new axiom record kind for choice, internalization hook,
assertion routine, and diagnostics/stat tracking.
  - Uses the same quantified implication schema as above.

- **Regression coverage**
- Extended SMT2 parser regression with an HO `choice` example to ensure
parser/eval pipeline accepts and processes choice terms.

Example of the now-supported input:

```smt2
(set-logic HO_ALL)
(declare-sort U 0)
(declare-fun P () (-> U Bool))
(assert (exists ((x U)) (P x)))
(assert (= witness (choice ((x U)) (P x))))
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-27 10:05:06 -07:00
yhx-12243
690cdd3f25
fix(make-ts-wrapper): correct out buffer size for WASM (#9644) 2026-05-27 10:03:39 -07:00
CEisenhofer
54782e68e0 Disequalities over units can be processed differently 2026-05-27 18:59:00 +02:00