3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-20 23:50:25 +00:00
z3/src/math/lp
Lev Nachmanson 6fb68ac010
Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982)
* outline of signature for assignment based conflict generation

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

* outline of interface contract

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

* remove confusing construction

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

* add material in nra-solver to interface

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

* add marshaling from nlsat lemmas into core solver

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

* tidy

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

* add call to check-assignment

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

* Nl2lin (#7795)

* add linearized projection in nlsat

* implement nlsat check for given assignment

* add some comments

* fixup loop

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

* updates

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

* fixes

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

* debug nl2lin

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* Nl2lin (#7827)

* fix linear projection

* fix linear projection

* use an explicit cell description in check_assignment

* clean up (#7844)

* Simplify no effect checks in nla_core.cpp

Move up linear nlsat call to replace bounded nlsat.

* t

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* t

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* detangle mess

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

* remove the too early return

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* do not set use_nra_model to true

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* remove a comment

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* add a hook to add new multiplication definitions in nla_core

* add internalization routine that uses macro-expanded polynomial representation

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

* add internalization routine that uses macro-expanded polynomial representation

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

* fixup backtranslation to not use roots

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

* call setup_assignment_solver instead of setup_solver

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

* debug the setup, still not working

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* updated clang format

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

* simplify

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

* create polynomials with integer coefficients, use the hook to create new monomials

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* integrating changes from master related to work with polynomials

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* add forgotten files

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* Update nlsat_explain.cpp

Remove a duplicate call

* fix

* move linear cell construction to levelwise

* fix

* fix

* Port throttle and soundness fixes from master

- Fix soundness: pop incomplete lemma from m_lemmas on add_lemma failure
- Gracefully handle root atoms in add_lemma
- Throttle check_assignment with failure counter (decrement on success)
- Add arith.nl.nra_check_assignment parameter

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

* Add arith.nl.nra_check_assignment_max_fail parameter

Replace hardcoded failure threshold with configurable parameter (default 10).

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

* Add cha_abort_on_fail parameter to control failure counter decrement

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

* abort nla check_assignment after a set number of allowed failures

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* Add missing AST query methods to Java API (#8977)

* add Expr.isGround() to Java API

Expose Z3_is_ground as a public method on Expr. Returns true when the
expression contains no free variables.

* add Expr.isLambda() to Java API

Expose Z3_is_lambda as a public method on Expr. Returns true when the
expression is a lambda quantifier.

* add AST.getDepth() to Java API

Expose Z3_get_depth as a public method on AST. Returns the maximum
number of nodes on any path from root to leaf.

* add ArraySort.getArity() to Java API

Expose Z3_get_array_arity as a public method on ArraySort. Returns
the number of dimensions of a multi-dimensional array sort.

* add DatatypeSort.isRecursive() to Java API

Expose Z3_is_recursive_datatype_sort as a public method on
DatatypeSort. Returns true when the datatype refers to itself.

* add FPExpr.isNumeral() to Java API

Expose Z3_fpa_is_numeral as a public method on FPExpr. Returns true
when the expression is a concrete floating-point value.

* add isGroundExample test to JavaExample

Test Expr.isGround() on constants, variables, and compound
expressions.

* add astDepthExample test to JavaExample

Test AST.getDepth() on leaf nodes and nested expressions to verify
the depth computation.

* add arrayArityExample test to JavaExample

Test ArraySort.getArity() on single-domain and multi-domain array
sorts.

* add recursiveDatatypeExample test to JavaExample

Test DatatypeSort.isRecursive() on a recursive list datatype and a
non-recursive pair datatype.

* add fpNumeralExample test to JavaExample

Test FPExpr.isNumeral() on a floating point constant and a symbolic
variable.

* add isLambdaExample test to JavaExample

Test Expr.isLambda() on a lambda expression and a plain variable.

* change the default number of failures in check_assignment to 7

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* Fix high and medium priority API coherence issues (Go, Java, C++, TypeScript) (#8983)

* Initial plan

* Add missing API functions to Go, Java, C++, and TypeScript bindings

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>

* qf-s-benchmark: debug build + seq tracing + seq-fast/nseq-slow trace analysis (#8988)

* Initial plan

* Update qf-s-benchmark: debug build, seq tracing, trace analysis

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>

* disable linear approximation by default to check the merge

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* set check_assignment to true

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* fix restore_x by recalulating new column values

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* fix restore_x by recalulating new column values

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* fix a memory leak

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: ValentinPromies <44966217+ValentinPromies@users.noreply.github.com>
Co-authored-by: Valentin Promies <valentin.promies@rwth-aachen.de>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Angelica Moreira <48168649+angelica-moreira@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-15 06:13:04 -10:00
..
bound_analyzer_on_row.h Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
CMakeLists.txt factor out coi, use polynomial elaboration for nlsat solver (#8039) 2025-11-23 08:59:55 -08:00
column.h add scaffolding for experiments with slack 2025-04-23 17:07:50 -07:00
column_namer.h pretty printing for lp 2025-06-06 11:34:28 +02:00
core_solver_pretty_printer.cpp remove default destructors 2024-10-02 22:20:12 +01:00
core_solver_pretty_printer.h remove default destructors 2024-10-02 22:20:12 +01:00
core_solver_pretty_printer_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
cross_nested.h Fix 13 compiler warnings: sign-comparison and unused parameters (#8215) 2026-01-16 16:00:42 -08:00
dense_matrix.cpp set clang format off for lp files (#6795) 2023-07-03 17:35:16 -07:00
dense_matrix.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
dense_matrix_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
dioph_eq.cpp - When removing a fresh var xt, collect all fresh defs that transitively reference it 2026-01-29 06:17:14 -10:00
dioph_eq.h change the default of running dio to true, and running gcd to false, remove branching in dio 2025-04-18 18:24:50 -07:00
emonics.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
emonics.h Migrate codebase to std::string_view (except z3++.h) (#8266) 2026-01-21 09:30:41 -08:00
explanation.h remove a few copies 2026-02-10 09:52:03 +00:00
factorization.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
factorization.h remove unneeded iterator functions 2024-09-23 12:59:04 +01:00
factorization_factory_imp.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
factorization_factory_imp.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
general_matrix.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
gomory.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
gomory.h remove an unused declaration 2024-01-13 19:11:17 -10:00
hnf.h Fix #7951: add cancellation checks to polynomial gcd_prs and HNF computation 2026-02-27 10:26:28 -10:00
hnf_cutter.cpp Fix #7951: add cancellation checks to polynomial gcd_prs and HNF computation 2026-02-27 10:26:28 -10:00
hnf_cutter.h Api (#7097) 2024-01-24 16:05:18 -08:00
horner.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
horner.h u_set replaced by indexed_uint_set (#6841) 2023-08-03 16:01:27 -07:00
implied_bound.h remove a few default constructors 2024-09-23 08:17:58 +01:00
incremental_vector.h remove lp_assert 2025-04-14 11:10:26 -07:00
indexed_value.h delete more default constructors 2024-09-23 12:59:04 +01:00
indexed_vector.cpp print output file name 2025-02-11 12:23:00 -10:00
indexed_vector.h fix out of bounds bug 2025-02-11 12:23:00 -10:00
indexed_vector_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
int_branch.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
int_branch.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
int_cube.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
int_cube.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
int_gcd_test.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
int_gcd_test.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
int_solver.cpp Revert "optionally throttle patch_basic_columns() especially useful in unsat cases" 2026-02-07 10:45:15 -10:00
int_solver.h slack 2025-05-12 14:02:17 -07:00
lar_constraints.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lar_core_solver.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
lar_core_solver.h Fix NLA optimization regression and relax restore_x 2026-03-10 16:38:08 -10:00
lar_core_solver_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lar_solver.cpp Fix NLA optimization regression and relax restore_x 2026-03-10 16:38:08 -10:00
lar_solver.h Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
lar_term.h Remove redundant non-virtual destructors with = default (#8462) 2026-02-01 15:22:58 -08:00
lia_move.h remove 'unsat' move, we already have 'conflict'. Add display for cancelled 2025-03-24 07:44:13 -10:00
lp_api.h Replace custom util/optional with std::optional (#8162) 2026-01-11 19:47:39 -08:00
lp_bound_propagator.h Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
lp_core_solver_base.cpp use std_vector more and getting NOT_IMPLEMENTING in C:\dev\z3\src\math\lp\dioph_eq.cpp 2025-02-11 12:23:00 -10:00
lp_core_solver_base.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lp_core_solver_base_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lp_params_helper.pyg Revert "optionally throttle patch_basic_columns() especially useful in unsat cases" 2026-02-07 10:45:15 -10:00
lp_primal_core_solver.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
lp_primal_core_solver.h Fix implicit conversion warnings: use UINT_MAX instead of -1 for unsi… (#8342) 2026-01-25 22:35:43 -08:00
lp_primal_core_solver_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lp_primal_core_solver_tableau_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
lp_settings.cpp Revert "optionally throttle patch_basic_columns() especially useful in unsat cases" 2026-02-07 10:45:15 -10:00
lp_settings.h Eliminate unnecessary copy operations in function parameters and range-based loops (#8589) 2026-02-11 21:14:32 +00:00
lp_settings_def.h Eliminate unnecessary copy operations in function parameters and range-based loops (#8589) 2026-02-11 21:14:32 +00:00
lp_types.h Api (#7097) 2024-01-24 16:05:18 -08:00
lp_utils.h [WIP] Find and update std::optional usage in code base (#8272) 2026-01-21 19:55:36 -08:00
matrix.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
matrix.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
matrix_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
mon_eq.cpp rename monomial to monic 2020-01-28 10:04:21 -08:00
monic.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
monomial_bounds.cpp remove a few copies 2026-02-10 09:52:03 +00:00
monomial_bounds.h move fixed variable propagation to nla_core/monomial_bounds 2025-01-13 18:18:53 -08:00
nex.h Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
nex_creator.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nex_creator.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_basics_lemmas.cpp fix latent bug in factorization 2025-09-23 10:47:24 +03:00
nla_basics_lemmas.h rename new_lemma to lemma_builder 2025-06-26 16:33:16 -07:00
nla_coi.cpp Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_coi.h Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_common.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
nla_common.h Arith min max (#6864) 2023-08-19 17:44:09 -07:00
nla_core.cpp Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_core.h Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_defs.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_divisions.cpp rename new_lemma to lemma_builder 2025-06-26 16:33:16 -07:00
nla_divisions.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
nla_grobner.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_grobner.h Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_intervals.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_intervals.h Arith min max (#6864) 2023-08-19 17:44:09 -07:00
nla_monotone_lemmas.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_monotone_lemmas.h consolidate throttling 2025-06-26 16:33:16 -07:00
nla_order_lemmas.cpp Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_order_lemmas.h use the new throttle in order lemmas 2025-06-26 16:33:16 -07:00
nla_powers.cpp evaluate unhandled arithmetic operators based on an initialized model #7876 2025-09-14 06:45:36 -07:00
nla_powers.h remove the line with clang-format off 2023-07-10 12:05:59 -07:00
nla_pp.cpp Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nla_solver.cpp remove set cardinality operators from array theory. Make final-check use priority levels 2025-11-26 15:35:19 -08:00
nla_solver.h remove set cardinality operators from array theory. Make final-check use priority levels 2025-11-26 15:35:19 -08:00
nla_tangent_lemmas.cpp add throttling to generate_plane1/2 2025-06-26 16:33:16 -07:00
nla_tangent_lemmas.h remove a few default constructors 2024-09-23 08:17:58 +01:00
nla_throttle.cpp remove the parameter for throttling nla lemmas 2025-06-26 16:33:16 -07:00
nla_throttle.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
nla_throttle_example.cpp consolidate throttling 2025-06-26 16:33:16 -07:00
nla_types.h following the review comments 2025-06-27 19:48:51 -07:00
nra_solver.cpp Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
nra_solver.h Nl2lin - integrate a linear under approximation of a CAD cell by Valentin Promies. (#8982) 2026-03-15 06:13:04 -10:00
numeric_pair.h improved dio handler 2025-03-24 07:44:13 -10:00
permutation_matrix.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
permutation_matrix.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
permutation_matrix_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
random_updater.cpp remove the line with clang-format off 2023-07-10 12:05:59 -07:00
random_updater.h u_set replaced by indexed_uint_set (#6841) 2023-08-03 16:01:27 -07:00
random_updater_def.h Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
stacked_vector.h remove lp_assert 2025-04-14 11:10:26 -07:00
static_matrix.cpp debug dio 2025-02-11 12:23:00 -10:00
static_matrix.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
static_matrix_def.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
test_bound_analyzer.h Standardize for-loop increments to prefix form (++i) (#8199) 2026-01-14 19:55:31 -08:00
var_eqs.h Remove redundant default constructors when they're the only constructor (#8461) 2026-02-01 16:51:26 -08:00
var_register.h Eliminate unnecessary copy operations in function parameters and range-based loops (#8589) 2026-02-11 21:14:32 +00:00