Commit 2e74175
Debugging param tuning (I think it runs now) (#8012)
* draft attempt at optimizing cube tree with resolvents. have not tested/ran yet
* adding comments
* fix bug about needing to bubble resolvent upwards to highest ancestor
* fix bug where we need to cover the whole resolvent in the path when bubbling up
* clean up comments
* Bump actions/checkout from 4 to 5 (#7954)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* close entire tree when sibling resolvent is empty
* integrate asms directly into cube tree, remove separate tracking
* try to fix bug about redundant resolutions, merging close and try_resolve_upwards into once function
* separate the logic again to avoid mutual recursion
* [WIP] Add a mutex to warning.cpp to ensure that warning messages from different threads don't interfere (#7963)
* Initial plan
* Add mutex to warning.cpp for thread safety
Co-authored-by: NikolajBjorner <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: NikolajBjorner <[email protected]>
* Remove unused variable 'first' in mpz.cpp
Removed unused variable 'first' from the function.
* fixing the order
Signed-off-by: Lev Nachmanson <[email protected]>
* fixing the order
Signed-off-by: Lev Nachmanson <[email protected]>
* fix the order of parameter evaluation
Signed-off-by: Lev Nachmanson <[email protected]>
* remove AI slop
Signed-off-by: Nikolaj Bjorner <[email protected]>
* param order
Signed-off-by: Lev Nachmanson <[email protected]>
* param order
Signed-off-by: Lev Nachmanson <[email protected]>
* param order evaluation
* parameter eval order
* parameter evaluation order
* param eval
* param eval order
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* parameter eval order
Signed-off-by: Lev Nachmanson <[email protected]>
* Bump github/codeql-action from 3 to 4 (#7971)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v3...v4)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: '4'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update Z3_mk_datatype_sort API to accept array of sort parameters and add Z3_mk_polymorphic_datatype (#7966)
* Initial plan
* Update Z3_mk_datatype_sort API to accept array of parameters
Co-authored-by: NikolajBjorner <[email protected]>
* Update language bindings for parametric datatype sort API
- Python: Updated DatatypeSort() to accept optional params list
- OCaml: Added mk_sort_ref_p/mk_sort_ref_ps for parametric datatypes
- .NET: Added MkDatatypeSortRef() methods with optional params
- Java: Added mkDatatypeSortRef() methods with optional params
- All changes maintain backward compatibility
Co-authored-by: NikolajBjorner <[email protected]>
* Fix .NET build error - rename params to parameters
The 'params' keyword is reserved in C#, causing compilation errors.
Renamed parameter from 'params' to 'parameters' in MkDatatypeSortRef methods.
Co-authored-by: NikolajBjorner <[email protected]>
* Add unit test for parametric datatypes
Added test_parametric_datatype.cpp to demonstrate polymorphic datatypes.
The test creates two concrete instantiations of a generic pair concept:
- pair_int_real with fields (first:Int, second:Real)
- pair_real_int with fields (first:Real, second:Int)
Then verifies that accessors work correctly and type checking is enforced.
Co-authored-by: NikolajBjorner <[email protected]>
* Implement polymorphic type variables support for parametric datatypes
- Modified datatype_decl_plugin to allow type variables as parameters
- Updated mk_datatype_decl to extract type variables from field sorts
- Type variables are collected in order of first appearance
- Revised unit test to use Z3_mk_type_variable for polymorphic datatypes
- Test creates pair datatype with type variables alpha and beta
- Successfully instantiates with concrete types (pair Int Real) and (pair Real Int)
- Verifies accessor types match and equality terms are well-typed
- All tests pass
Co-authored-by: NikolajBjorner <[email protected]>
* Add Z3_mk_polymorphic_datatype API and refactor datatype creation
- Added new API Z3_mk_polymorphic_datatype to z3_api.h
- Renamed static mk_datatype_decl to api_datatype_decl in api_datatype.cpp
- Modified api_datatype_decl to accept explicit type parameters
- Updated all callers to use renamed function
- Added test_polymorphic_datatype_api demonstrating new API usage
- Both tests pass successfully
Co-authored-by: NikolajBjorner <[email protected]>
* Remove type variable collection logic from constructors
Removed the logic for collecting type variables from field sorts based on constructors.
* Update comments on parameter handling in api_datatype.cpp
Clarify usage of parameters in API documentation.
* Fix OCaml build error - use list instead of array for mk_datatype_sort
Changed mk_sort_ref to pass empty list [] instead of empty array [||].
Changed mk_sort_ref_p to pass params list directly instead of converting to array.
Z3native.mk_datatype_sort expects a list, not an array.
Co-authored-by: NikolajBjorner <[email protected]>
* Add polymorphic datatype example to C++ examples
Added polymorphic_datatype_example() demonstrating:
- Creating type variables alpha and beta with Z3_mk_type_variable
- Defining parametric Pair datatype with fields of type alpha and beta
- Instantiating with concrete types (Pair Int Real) and (Pair Real Int)
- Getting constructors and accessors from instantiated datatypes
- Creating constants and expressions using the polymorphic types
- Verifying type correctness with equality (= (first p1) (second p2))
Co-authored-by: NikolajBjorner <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: NikolajBjorner <[email protected]>
Co-authored-by: Nikolaj Bjorner <[email protected]>
* trim parametric datatype test
Signed-off-by: Nikolaj Bjorner <[email protected]>
* restore single cell
Signed-off-by: Lev Nachmanson <[email protected]>
* restore the method behavior
Signed-off-by: Lev Nachmanson <[email protected]>
* setting up python tuning experiment, not done
* Add finite_set_value_factory for creating finite set values in model generation (#7981)
* Initial plan
* Add finite_set_value_factory implementation
Co-authored-by: NikolajBjorner <[email protected]>
* Remove unused dl_decl_plugin variable and include
Co-authored-by: NikolajBjorner <[email protected]>
* Update copyright and add TODOs in finite_set_value_factory
Updated copyright information and added TODO comments for handling in finite_set_value_factory methods.
* Update copyright information in finite_set_value_factory.h
Updated copyright year from 2006 to 2025.
* Implement finite_set_value_factory using array_util to create singleton sets
Co-authored-by: NikolajBjorner <[email protected]>
* Simplify empty set creation in finite_set_value_factory
Refactor finite_set_value_factory to simplify empty set handling and remove array-specific logic.
* Change family ID for finite_set_value_factory
* Fix build error by restoring array_decl_plugin include and implementation
Co-authored-by: NikolajBjorner <[email protected]>
* Update finite_set_value_factory.h
* Add SASSERT for finite set check in factory
Added assertion to check if the sort is a finite set.
* Rename member variable from m_util to u
* Refactor finite_set_value_factory for value handling
* Use register_value instead of direct set insertion
Replaced direct insertion into set with register_value calls.
* Update finite_set_value_factory.cpp
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: NikolajBjorner <[email protected]>
Co-authored-by: Nikolaj Bjorner <[email protected]>
* Revert "Add finite_set_value_factory for creating finite set values in model …" (#7985)
This reverts commit 05ffc0a.
* Update arith_rewriter.cpp
fix memory leak introduced by update to ensure determinism
* update pythonnn prototyping experiment, need to add a couple more things
* add explicit constructors for nightly mac build failure
Signed-off-by: Nikolaj Bjorner <[email protected]>
* build fixes
Signed-off-by: Nikolaj Bjorner <[email protected]>
* fixes
* fix some more things but now it hangs
* change multithread to multiprocess seems to have resolved current deadlock
* fix some bugs, it seems to run now
* fix logic about checking clauses individually, and add proof prefix clause selection (naively) via the OnClause hook
* disable manylinux until segfault is resolved
Signed-off-by: Nikolaj Bjorner <[email protected]>
* add the "noexcept" keyword to value_score=(value_score&&) declaration
* expose a status flag for clauses but every single one is being coded as an assumption...
* Add a fast-path to _coerce_exprs. (#7995)
When the inputs are already the same sort, we can skip most of the
coercion logic and just return.
Currently, `_coerce_exprs` is by far the most expensive part of
building up many common Z3 ASTs, so this fast-path is a substantial
speedup for many use-cases.
* Bump actions/setup-node from 5 to 6 (#7994)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v5...v6)
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Enabling Control Flow Guard (CFG) by default for MSVC on Windows, with options to disable CFG. (#7988)
* Enabling Control Flow Guard by default for MSVC on Windows, with options to disable it.
* Fix configuration error for non-MSVC compilers.
* Reviewed and updated configuration for Python build and added comment for CFG.
* try exponential delay in grobner
Signed-off-by: Lev Nachmanson <[email protected]>
* throttle grobner method more actively
Signed-off-by: Lev Nachmanson <[email protected]>
* enable always add all coeffs in nlsat
Signed-off-by: Lev Nachmanson <[email protected]>
* initial parameter probe thread setup in C++
* more param tuning setup
* setting up the param probe solvers and mutation generator
* adding the learned clauses from the internalizer
* fix some things for clause replay
* score the param probes, but i can't figure out how to access the relevant solver statistics fields from the statistics obj
* set up pattern to notify batch manager so worker threads can update their params according
ly
* add a getter for solver stats. it compiles but still everything is untested
* bugfix
* updates to param tuning
* remove the getter for solver statistics since we're getting the vals directly from the context
* merge
* patch fix for default manager construction so it can be used to create the param tuning context without segfault
* still debugging threading issues where we can't create nested param tuners or it spins infinitely. added flag for this. but now there is segfault on the probe_ctx.check() call
* make param tuning singlethreaded to resolve segfault when spawning subprocesses ffor nested ctx checks
---------
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Lev Nachmanson <[email protected]>
Signed-off-by: Nikolaj Bjorner <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: NikolajBjorner <[email protected]>
Co-authored-by: Nikolaj Bjorner <[email protected]>
Co-authored-by: Lev Nachmanson <[email protected]>
Co-authored-by: Nelson Elhage <[email protected]>
Co-authored-by: hwisungi <[email protected]>1 parent 863d0e3 commit 2e74175
File tree
5 files changed
+78
-36
lines changed- src/smt
5 files changed
+78
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3617 | 3617 | | |
3618 | 3618 | | |
3619 | 3619 | | |
3620 | | - | |
| 3620 | + | |
3621 | 3621 | | |
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
3625 | 3625 | | |
3626 | 3626 | | |
3627 | | - | |
3628 | 3627 | | |
| 3628 | + | |
3629 | 3629 | | |
3630 | 3630 | | |
3631 | 3631 | | |
| |||
3685 | 3685 | | |
3686 | 3686 | | |
3687 | 3687 | | |
3688 | | - | |
| 3688 | + | |
3689 | 3689 | | |
3690 | 3690 | | |
3691 | 3691 | | |
3692 | 3692 | | |
3693 | 3693 | | |
3694 | 3694 | | |
3695 | | - | |
| 3695 | + | |
| 3696 | + | |
3696 | 3697 | | |
3697 | 3698 | | |
3698 | 3699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
1689 | 1690 | | |
1690 | 1691 | | |
1691 | 1692 | | |
1692 | | - | |
| 1693 | + | |
1693 | 1694 | | |
1694 | 1695 | | |
1695 | 1696 | | |
| |||
1699 | 1700 | | |
1700 | 1701 | | |
1701 | 1702 | | |
1702 | | - | |
| 1703 | + | |
1703 | 1704 | | |
1704 | 1705 | | |
1705 | 1706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
| 993 | + | |
| 994 | + | |
994 | 995 | | |
995 | 996 | | |
996 | 997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
| |||
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
96 | | - | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
| 104 | + | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| |||
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
| 124 | + | |
115 | 125 | | |
116 | | - | |
117 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
| |||
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
192 | 202 | | |
193 | 203 | | |
194 | 204 | | |
195 | | - | |
| 205 | + | |
| 206 | + | |
196 | 207 | | |
197 | 208 | | |
198 | 209 | | |
| |||
211 | 222 | | |
212 | 223 | | |
213 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| |||
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
237 | 256 | | |
238 | 257 | | |
239 | 258 | | |
| |||
255 | 274 | | |
256 | 275 | | |
257 | 276 | | |
258 | | - | |
| 277 | + | |
259 | 278 | | |
260 | 279 | | |
261 | 280 | | |
| |||
320 | 339 | | |
321 | 340 | | |
322 | 341 | | |
323 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
324 | 347 | | |
325 | 348 | | |
326 | 349 | | |
| |||
450 | 473 | | |
451 | 474 | | |
452 | 475 | | |
453 | | - | |
| 476 | + | |
454 | 477 | | |
455 | 478 | | |
456 | 479 | | |
| |||
516 | 539 | | |
517 | 540 | | |
518 | 541 | | |
519 | | - | |
| 542 | + | |
520 | 543 | | |
521 | 544 | | |
522 | 545 | | |
| |||
561 | 584 | | |
562 | 585 | | |
563 | 586 | | |
564 | | - | |
| 587 | + | |
565 | 588 | | |
566 | 589 | | |
567 | 590 | | |
| |||
575 | 598 | | |
576 | 599 | | |
577 | 600 | | |
578 | | - | |
| 601 | + | |
579 | 602 | | |
580 | 603 | | |
581 | 604 | | |
| |||
585 | 608 | | |
586 | 609 | | |
587 | 610 | | |
588 | | - | |
| 611 | + | |
589 | 612 | | |
590 | 613 | | |
591 | 614 | | |
| |||
595 | 618 | | |
596 | 619 | | |
597 | 620 | | |
598 | | - | |
| 621 | + | |
599 | 622 | | |
600 | 623 | | |
601 | 624 | | |
| |||
675 | 698 | | |
676 | 699 | | |
677 | 700 | | |
| 701 | + | |
678 | 702 | | |
679 | 703 | | |
680 | 704 | | |
| |||
684 | 708 | | |
685 | 709 | | |
686 | 710 | | |
687 | | - | |
| 711 | + | |
688 | 712 | | |
689 | 713 | | |
690 | | - | |
691 | | - | |
| 714 | + | |
| 715 | + | |
692 | 716 | | |
693 | 717 | | |
694 | 718 | | |
695 | | - | |
| 719 | + | |
| 720 | + | |
696 | 721 | | |
697 | 722 | | |
698 | 723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
92 | 105 | | |
93 | 106 | | |
94 | 107 | | |
| |||
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
121 | | - | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
125 | | - | |
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
| |||
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
| 156 | + | |
144 | 157 | | |
145 | 158 | | |
146 | 159 | | |
| |||
206 | 219 | | |
207 | 220 | | |
208 | 221 | | |
209 | | - | |
| 222 | + | |
210 | 223 | | |
211 | 224 | | |
212 | | - | |
| 225 | + | |
213 | 226 | | |
214 | 227 | | |
215 | 228 | | |
216 | 229 | | |
| 230 | + | |
217 | 231 | | |
218 | | - | |
| 232 | + | |
219 | 233 | | |
220 | 234 | | |
221 | 235 | | |
| |||
0 commit comments