3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-03 14:33:56 +00:00

Parallel solving (#7758)

* very basic setup

* ensure solve_eqs is fully disabled when smt.solve_eqs=false, #7743

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* respect smt configuration parameter in elim_unconstrained simplifier

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* indentation

* add bash files for test runs

* add option to selectively disable variable solving for only ground expressions

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* remove verbose output

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #7745

axioms for len(substr(...)) escaped due to nested rewriting

* ensure atomic constraints are processed by arithmetic solver

* #7739 optimization

add simplification rule for at(x, offset) = ""

Introducing j just postpones some rewrites that prevent useful simplifications. Z3 already uses common sub-expressions.
The example highlights some opportunities for simplification, noteworthy at(..) = "".
The example is solved in both versions after adding this simplification.

* fix unsound len(substr) axiom

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* FreshConst is_sort (#7748)

* #7750

add pre-processing simplification

* Add parameter validation for selected API functions

* updates to ac-plugin

fix incrementality bugs by allowing destructive updates during saturation at the cost of redoing saturation after a pop.

* enable passive, add check for bloom up-to-date

* add top-k fixed-sized min-heap priority queue for top scoring literals

* set up worker thread batch manager for multithreaded batch cubes paradigm, need to debug as I am getting segfault still

* fix bug in parallel solving batch setup

* fix bug

* allow for internalize implies

* disable pre-processing during cubing

* debugging

* remove default constructor

* remove a bunch of string copies

* Update euf_ac_plugin.cpp

include reduction rules in forward simplification

* Update euf_completion.cpp

try out restricting scope of equalities added by instantation

* Update smt_parallel.cpp

Drop non-relevant units from shared structures.

* process cubes as lists of individual lits

* merge

* Add support for Algebraic Datatypes in JavaScript/TypeScript bindings (#7734)

* Initial plan

* Add datatype type definitions to types.ts (work in progress)

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Complete datatype type definitions with working TypeScript compilation

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Implement core datatype functionality with TypeScript compilation success

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Complete datatype implementation with full Context integration and tests

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* chipping away at the new code structure

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: humnrdble <83878671+humnrdble@users.noreply.github.com>
Co-authored-by: Nuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Ilana Shapiro 2025-08-05 09:06:36 -07:00 committed by GitHub
parent 0ac6abf3a8
commit aa5d833b38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 552 additions and 469 deletions

View file

@ -29,52 +29,56 @@ bool smt_logics::supported_logic(symbol const & s) {
}
bool smt_logics::logic_has_reals_only(symbol const& s) {
auto str = s.str();
return
s.str().find("LRA") != std::string::npos ||
s.str().find("LRA") != std::string::npos ||
s.str().find("NRA") != std::string::npos ||
s.str().find("RDL") != std::string::npos;
str.find("LRA") != std::string::npos ||
str.find("LRA") != std::string::npos ||
str.find("NRA") != std::string::npos ||
str.find("RDL") != std::string::npos;
}
bool smt_logics::logic_has_arith(symbol const & s) {
auto str = s.str();
return
s.str().find("LRA") != std::string::npos ||
s.str().find("LIRA") != std::string::npos ||
s.str().find("LIA") != std::string::npos ||
s.str().find("LRA") != std::string::npos ||
s.str().find("NRA") != std::string::npos ||
s.str().find("NIRA") != std::string::npos ||
s.str().find("NIA") != std::string::npos ||
s.str().find("IDL") != std::string::npos ||
s.str().find("RDL") != std::string::npos ||
s == "QF_BVRE" ||
s == "QF_FP" ||
s == "FP" ||
s == "QF_FPBV" ||
s == "QF_BVFP" ||
s == "QF_S" ||
str.find("LRA") != std::string::npos ||
str.find("LIRA") != std::string::npos ||
str.find("LIA") != std::string::npos ||
str.find("LRA") != std::string::npos ||
str.find("NRA") != std::string::npos ||
str.find("NIRA") != std::string::npos ||
str.find("NIA") != std::string::npos ||
str.find("IDL") != std::string::npos ||
str.find("RDL") != std::string::npos ||
str == "QF_BVRE" ||
str == "QF_FP" ||
str == "FP" ||
str == "QF_FPBV" ||
str == "QF_BVFP" ||
str == "QF_S" ||
logic_is_all(s) ||
s == "QF_FD" ||
s == "HORN";
str == "QF_FD" ||
str == "HORN";
}
bool smt_logics::logic_has_bv(symbol const & s) {
auto str = s.str();
return
s.str().find("BV") != std::string::npos ||
s == "FP" ||
str.find("BV") != std::string::npos ||
str == "FP" ||
logic_is_all(s) ||
s == "QF_FD" ||
s == "SMTFD" ||
s == "HORN";
str == "QF_FD" ||
str == "SMTFD" ||
str == "HORN";
}
bool smt_logics::logic_has_array(symbol const & s) {
auto str = s.str();
return
s.str().starts_with("QF_A") ||
s.str().starts_with("A") ||
str.starts_with("QF_A") ||
str.starts_with("A") ||
logic_is_all(s) ||
s == "SMTFD" ||
s == "HORN";
str == "SMTFD" ||
str == "HORN";
}
bool smt_logics::logic_has_seq(symbol const & s) {
@ -82,17 +86,28 @@ bool smt_logics::logic_has_seq(symbol const & s) {
}
bool smt_logics::logic_has_str(symbol const & s) {
return s == "QF_S" || s == "QF_SLIA" || s == "QF_SNIA" || logic_is_all(s);
auto str = s.str();
return str == "QF_S" ||
str == "QF_SLIA" ||
str == "QF_SNIA" ||
logic_is_all(s);
}
bool smt_logics::logic_has_fpa(symbol const & s) {
return s == "FP" || s == "QF_FP" || s == "QF_FPBV" || s == "QF_BVFP" || s == "QF_FPLRA" || logic_is_all(s);
auto str = s.str();
return str == "FP" ||
str == "QF_FP" ||
str == "QF_FPBV" ||
str == "QF_BVFP" ||
str == "QF_FPLRA" ||
logic_is_all(s);
}
bool smt_logics::logic_has_uf(symbol const & s) {
auto str = s.str();
return
s.str().find("UF") != std::string::npos ||
s == "SMTFD";
str.find("UF") != std::string::npos ||
str == "SMTFD";
}
bool smt_logics::logic_has_horn(symbol const& s) {
@ -104,9 +119,10 @@ bool smt_logics::logic_has_pb(symbol const& s) {
}
bool smt_logics::logic_has_datatype(symbol const& s) {
auto str = s.str();
return
s.str().find("DT") != std::string::npos ||
s == "QF_FD" ||
str.find("DT") != std::string::npos ||
str == "QF_FD" ||
logic_is_all(s) ||
logic_has_horn(s);
}