Arie Gurfinkel
1eb83ca9d4
Introduce new monomials in Horner when shared factors have bounded linear combinations
...
When solve-eqs eliminates a variable x (= a - b) that appears as a factor
in a nonlinear product x*y, the product splits into a*y - b*y. The NLA
solver then reasons about a*y and b*y independently, losing the tight
bounds that x had. This can cause severe performance degradation (e.g.,
timeout on a QF_UFNIA verification condition that solves in 3s without
solve-eqs).
The Horner module's cross-nested factoring already recovers the factored
form y*(a-b), and interval_from_term (fixed in the previous commit) finds
the LP column for (a-b) with its tight bounds. However, only Horner's
zero-exclusion check used this — the rest of the NLA solver (order lemmas,
tangent planes, bounds propagation) continued reasoning about the split
monomials independently.
This commit adds a new mechanism: when Horner discovers that a linear
sub-expression maps to a bounded LP column, it introduces a new monomial
pairing that column with the shared factor. For example, if y*(a-b) is
discovered and (a-b) maps to LP column j with bounds [L,U], we create a
new monomial m := y*j via add_mul_def and assert the equality
m = a*y - b*y via literals. This allows all NLA modules to generate
lemmas using j's tight bounds.
The feature is gated by smt.arith.nl.horner_max_new_monomials (default 2,
0 to disable). On the motivating benchmark, this changes
simplify+propagate-values+solve-eqs+smt from timeout (30s) to UNSAT in
~15s with no regressions on other configurations.
Files changed:
- horner.cpp: introduce_monomials_from_term_columns() and find_binary_monic()
- horner.h: m_introduced_monomials dedup set
- nla_intervals.cpp/h: m_term_columns to record interval_from_term discoveries
- smt_params_helper.pyg: arith.nl.horner_max_new_monomials parameter
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 16:25:49 -04:00
Copilot
2436943794
Standardize for-loop increments to prefix form (++i) ( #8199 )
...
* Initial plan
* Convert postfix to prefix increment in for loops
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Fix member variable increment conversion bug
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Update API generator to produce prefix increments
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>
2026-01-14 19:55:31 -08:00
Lev Nachmanson
5bda42e104
rename new_lemma to lemma_builder
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-26 16:33:16 -07:00
LeeYoungJoon
0a93ff515d
Centralize and document TRACE tags using X-macros ( #7657 )
...
* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros
* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md
* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled
* trace: improve trace tag handling system with hierarchical tagging
- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
(class names and descriptions to be refined in a future update)
* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals
* trace : add cstring header
* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py
* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.
* trace : Add TODO comment for future implementation of tag_class activation
* trace : Disable code related to tag_class until implementation is ready (#7663 ).
2025-05-28 14:31:25 +01:00
Nikolaj Bjorner
5e3df9ee77
Arith min max ( #6864 )
...
* prepare for dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* snapshot
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* more refactoring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* more refactoring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* pass in u_dependency_manager
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* address NYIs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* more refactoring names
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* eq_explanation update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* add outline of bounds improvement functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* fix unit tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* remove unused structs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* more bounds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* more bounds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* convert more internals to use u_dependency instead of constraint_index
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* convert more internals to use u_dependency instead of constraint_index
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* remember to push/pop scopes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* use the main function for updating bounds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* remove reset of shared dep manager
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* disable improve-bounds, add statistics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
---------
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-19 17:44:09 -07:00
Lev Nachmanson
af2f74c05f
smarter explanation.h ( #4385 )
...
* smarter explanation.h
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
* clean explanation API
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
* suppress warnings
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
* disable the warnings
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-19 12:38:44 -07:00
Lev Nachmanson
aaf05f18ab
fix a bug in an simplifying interval expressions with terms
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-16 15:19:32 -07:00
Nikolaj Bjorner
33042268b5
bounds propagation functionality
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-13 13:36:22 -07:00
Nikolaj Bjorner
179c9c2da2
consolidate methods that add lemma specific information to under "new_lemma"
2020-05-10 18:31:57 -07:00
Nikolaj Bjorner
4890c3ce31
fix #4230
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-09 18:49:00 -07:00
Nikolaj Bjorner
fdc87f286f
na ( #4254 )
...
* remove level of indirection for context and ast_manager in smt_theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* add request by #4252
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* move to def
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* int
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* fix #4251
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* fix #4255
* fix #4257
* add code to debug #4246
* restore new solver as default
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* fix #4246
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-09 17:40:02 -07:00
Lev Nachmanson
8921ed56b5
fix a bug in Horner heuristic
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-23 15:58:53 -07:00
Nikolaj Bjorner
f76c6424f2
another memory managment leak fix. Relates to different leak exposed by #3997
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-19 12:58:42 -07:00
Nikolaj Bjorner
76735476d4
fix #3999
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-18 19:46:30 -07:00
Lev Nachmanson
21b7dc627e
create a more precize lemma for the empty intersection case
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-09 10:26:37 -07:00
Lev Nachmanson
c5e08f0444
add dependencies lost in case of an empty intersection
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-08 15:47:15 -07:00
Lev Nachmanson
4621767968
handle the empty intersection in nla_intervals
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-08 15:47:15 -07:00
Lev Nachmanson
afce09efe4
assert that the sdi is infinite by default
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-02 15:58:46 -07:00
Lev Nachmanson
b45311cc7c
use only scoped intervals
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-02 15:58:46 -07:00
Lev Nachmanson
cf3f06ee26
use scoped interval
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-02 15:58:46 -07:00
Nikolaj Bjorner
af51d98a32
avoid unintialized value build warnings
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-24 15:02:31 -07:00
Lev Nachmanson
e56a5787dc
remove a too strict debug check and fix a bug in intervals on terms
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-02 19:47:17 -08:00
Lev Nachmanson
1b07ad0952
fix errors with dependency manager reset
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
d310ae9060
rebase with Z3Prover
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
c6ea5c2263
prepare to hook up pdd_grobner
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
22bec010ba
use dep_intervals inside of nla_intervals
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
ee255ef8b3
merge changes from Z3Prover repository
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
0039b68ca3
merged dependency.h from main repo
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
3b61f0b874
enable interval multiplication without dependencies
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Nikolaj Bjorner
0535e24dd1
consolidate parameters, add comment ( #102 )
...
* updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* code review of nla_intervals: combine functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* formatting
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* add comments
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* merge issue
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* tired of looking at compiler warning
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
519bbc5af1
reshaffle the template definitions from nla_interval.h to nla_interval.cpp
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Nikolaj Bjorner
b6c28764f8
nla_interval initial review ( #101 )
...
* updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* code review of nla_intervals: combine functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* formatting
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-28 10:04:21 -08:00
Nikolaj Bjorner
14094bb052
code review ( #98 )
...
* streamline type conversions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* nits
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* use fixed array allocation for sum
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* use fixed array allocation for sum
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* revert creation time allocation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* fix assertion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* separate grobner_core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* grobner_core simplifications
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
882b8ee63b
NB's review
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
eee8188abf
add trace statement
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
a86d4b0675
add dependencies for row in grobner
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
f939a26c86
integrating changes of Nikolaj with m_empty_clause etc.
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
71c3a09f4a
port Grobner
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
9b3ebfdd2a
move interval functionality from horner to intervals
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
033d8a332f
port Grobner: do not derive intervals from common
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
d77e9c444e
more efficient create_sum_from_row and other fixes
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
7fbf3e0707
port Grobner, add fixed var dependencies to create_sum_from_row()
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
b3fc12ffdc
port Grobner, add fixed var dependency to Horner's scheme
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
a085edceff
port grobner basis functionality, prepare create nex objects to the grobner basis calculation
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
b075d3923e
separate calculations on intervals on one with dependencies and one without
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
108bfa55ad
use var equivalence when evaluating the interval over an expression
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
c95f66e02a
toward fetching existing terms intervals from lar_solver
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
aef26598e5
fix choosing rows for horner's schem
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
ccc9a77a1f
Nikolaj's changes related to dependencies on infinite interval bounds
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
1915812f84
add a test for intervals
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00