Nikolaj Bjorner
7d585b5cfd
fix build
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-18 13:30:46 +02:00
Nikolaj Bjorner
af432668be
fix build
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-18 12:58:27 +02:00
Nikolaj Bjorner
43d40ac142
revise axiom instantiation scheme for finite-sets
...
Instead of asserting theory axioms lazily we create them on the fly and allow propagation eagerly.
The approach uses a waterfall model as follows:
- terms are created: they are inserted into an index for (set.in x S) axiom creation.
- two terms are merged by an equality.
Loop over all new opportunities for axiom instantiation
New axioms are added to a queue of recently created axioms.
- an atomic formula was asserted by the SAT solver.
Update the watch list to find new propagations.
During propagation recently created axioms are either inserted into a propagation queue, or inserted into a watch list.
They are inserted into a propagation queue all or all but one literal is assigned to false.
They are inserted into a watch list if at least two literals are unassigned
They are dropped if the axiom contains a literal that is assigned to true
The propagation queue is processed by by asserting the theory axiom to the core.
Also add some elementary statistics.
A breaking change is to change the datatype for undo-trail in smt_context to not use a custom data-structure.
This can likely cause regressions. For example, the region allocator now comes from the stack_trail instead of being
owned within smt_context with a different declaration order. smt_context could crash during destruction or maybe even pop.
We take the risk as the change is overdue.
Add swap method to ref_vector.
2025-10-18 12:08:39 +02:00
Nikolaj Bjorner
aa1f1f56b6
prepare for incremental axiom propagation
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-17 16:54:12 +02:00
Nikolaj Bjorner
5169e552fa
rename finite_set_value_factor to finite_set_factory. Fix type bugs when creating unions of values
2025-10-17 15:09:12 +02:00
Nikolaj Bjorner
af2082a1aa
add a comment, remove }
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-17 14:52:53 +02:00
Nikolaj Bjorner
d6908a3d4b
support AC parsing
...
By tagging union and intersection as AC we allow parsing set union and intersection as n-ary functions.
The internal representation remains binary.
2025-10-17 14:49:43 +02:00
Copilot
8dd91e4698
Implement get_fresh_value algorithm for finite_set_value_factory ( #7987 )
...
* Initial plan
* Implement get_fresh_value algorithm for finite_set_value_factory
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Replace values.back() with values.get(N) as requested
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>
2025-10-17 14:46:04 +02:00
Nikolaj Bjorner
df62e5e9e6
add assume-eqs and extensionality
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-17 09:37:11 +02:00
Nikolaj Bjorner
981c7d27ea
adding factory for model initialization
2025-10-16 22:43:20 +02:00
Nikolaj Bjorner
9e79fe0a51
merge comment
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:39:17 +02:00
Copilot
0371bbd192
Extend finite_set_decl_plugin::is_value to support unions of empty/singleton sets ( #7980 )
...
* Initial plan
* Initial state - all tests passing
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Implement is_value for unions of empty/singleton sets
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>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:36:55 +02:00
Nikolaj Bjorner
1536b4fde3
register the value factory in model
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:35:55 +02:00
Nikolaj Bjorner
a4f5a08edf
add comment
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:32:12 +02:00
Nikolaj Bjorner
ed369dee08
fixup
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:30:02 +02:00
Nikolaj Bjorner
26d37c7b30
fixup
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:29:38 +02:00
Nikolaj Bjorner
cc8bfd7890
add fintie_set_value_factory outline
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:27:26 +02:00
Nikolaj Bjorner
1b918ce4ec
restructure base class struct_factory so that enumeration of values for a sort comes together with hash-table access. This allows to use the enumeration view during value creations for finite sets
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:15:23 +02:00
Nikolaj Bjorner
b53e87dcba
updated with immediate axioms
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 09:20:46 +02:00
Nikolaj Bjorner
d0a7b19806
add comments
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 08:53:38 +02:00
Copilot
2bb22c6489
Fix finite_set::is_fully_interp to check element sort interpretation ( #7982 )
...
* Initial plan
* Implement finite_set is_fully_interp to check element sort
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Refine is_fully_interp implementation with SASSERT
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>
2025-10-15 21:47:32 +02:00
Nikolaj Bjorner
e781648499
fix test
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 20:55:27 +02:00
Nikolaj Bjorner
f22ef75d3e
update header
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 20:51:40 +02:00
Nikolaj Bjorner
ce60a8c5c5
fix merge issues
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 18:50:59 +02:00
Copilot
2e7f80f597
Add comprehensive algebraic rewrite rules to finite_set_rewriter ( #7975 )
...
* Initial plan
* Add comprehensive rewrite rules for finite set operations
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add comprehensive unit tests for finite set rewrite rules
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Fix order of checks in mk_in to handle singleton same element case first
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>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 18:46:10 +02:00
Nikolaj Bjorner
4225f1a0f1
prove your first finite set theorem
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 18:33:35 +02:00
kper
30878541c8
Changed sort of mk_empty to fix test ( #7979 )
2025-10-15 17:03:46 +02:00
Nikolaj Bjorner
54980a38d4
fixup theory_finite_set
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 15:02:58 +02:00
Copilot
b4d41ffe81
Complete theory_finite_set.h header and implement finite set theory solver ( #7976 )
...
* Initial plan
* Implement theory_finite_set header and implementation
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add theory registration to smt_setup
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Update theory_finite_set.cpp
* Refactor membership_atoms and add elements list
Renamed membership_atoms to membership_elements and added elements list.
* Change membership elements to use enode type
* Update theory_finite_set.cpp
* Fix typo in internalize_atom function
* Update theory_finite_set.cpp
* Refactor final_check_eh by removing comments
Removed redundant comments and cleaned up code.
* Add m_lemmas member to theory_finite_set class
* Improve clause management and instantiation logic
Refactor clause handling and instantiate logic in finite set theory.
* Add friend class declaration for testing
* Add placeholder methods for lemma instantiation
Added placeholder methods for lemma instantiation.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 14:55:08 +02:00
kper
7446112fbe
Implement more cases for finite_set_decl_plugin::are_distinct ( #7978 )
...
* Implement more cases for finite_set_decl_plugin::are_distinct
* Adapted distinctive checks for finite sets
2025-10-15 14:35:57 +02:00
kper
b24aec3c4c
Fixed tests by making methods public for finite sets ( #7977 )
2025-10-15 14:03:00 +02:00
Nikolaj Bjorner
f674d22ec8
update description for signature of the theory solver
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 08:54:00 +02:00
Nikolaj Bjorner
f2260d959d
test
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 18:01:41 +02:00
Nikolaj Bjorner
a1b831a3e1
fix build
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:50:08 +02:00
Copilot
930ba5ebd6
Implement inverter functions for finite-set operators ( #7974 )
...
* Initial plan
* Add set operator inverters to array_expr_inverter
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Refactor expr_inverter to remove set operations
Removed handling for set operations like union, intersection, and difference in expr_inverter.cpp. Introduced finite_set_inverter class to manage set union operation.
* Remove OP_SET_COMPLEMENT case from expr_inverter
Removed handling for OP_SET_COMPLEMENT in expr_inverter.
* Change OP_SET_UNION to OP_FINITE_SET_UNION
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:48:40 +02:00
Nikolaj Bjorner
0efe3820fc
build
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:46:49 +02:00
Nikolaj Bjorner
5dacb270f8
add to spec
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:33:19 +02:00
Copilot
75bac9c0ce
Implement finite_set_axioms.cpp and fix empty set constructor bug ( #7973 )
...
* Initial plan
* Add finite_set_axioms.cpp implementation and update CMakeLists.txt
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Fix finite_set_decl_plugin bug and complete implementation
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Use array select instead of function application for map and select axioms
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Simplify range assignment in finite_set_decl_plugin
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:16:29 +02:00
Copilot
c526c20cfc
Implement finite_set_rewriter with basic algebraic simplification rules ( #7972 )
...
* Initial plan
* Add finite_set_rewriter implementation with basic rewrite rules
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Fix finite_set_decl_plugin bug and complete implementation
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Revert finite_set_decl_plugin changes and disable difference rule
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Re-enable difference rule using set_sort directly
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Update finite_set_rewriter.h
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:13:18 +02:00
Nikolaj Bjorner
9442b41716
remove debug output
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-13 22:40:21 +02:00
Nikolaj Bjorner
1b9f27a798
patch definitions, add pretty print support
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-13 22:39:32 +02:00
Nikolaj Bjorner
fc3bd95cc2
AI slop
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-13 21:01:22 +02:00
Lev Nachmanson
fc2c5c7f58
fix the order of parameter evaluation
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:01:22 +02:00
Lev Nachmanson
e1db3c0b17
fixing the order
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:01:22 +02:00
Lev Nachmanson
33ae08ab29
fixing the order
...
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:00:54 +02:00
Nikolaj Bjorner
1344d8f8d7
Remove unused variable 'first' in mpz.cpp
...
Removed unused variable 'first' from the function.
2025-10-13 21:00:54 +02:00
Copilot
0972ab08bb
[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 <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>
2025-10-13 21:00:54 +02:00
dependabot[bot]
d6d1d7f19c
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](https://github.com/actions/checkout/compare/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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-13 21:00:54 +02:00
Philipp Danzinger
a3a8803e64
register finite_set plugin ( #7969 )
2025-10-13 14:06:58 +02:00
Copilot
df4052ec69
Implement finite_set_decl_plugin with complete operator support and polymorphism infrastructure ( #7961 )
...
* Initial plan
* Implement finite_sets_decl_plugin with all specified operations
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add tests for finite_sets_decl_plugin
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add set.singleton operator to finite_sets_decl_plugin
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Refactor finite_sets_decl_plugin to use polymorphic signatures and Array sorts
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Rename finite_sets to finite_set everywhere including file names
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Rename set.filter to set.select
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Refactor finite_set_decl_plugin to use polymorphism_util
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Move psig and match method to polymorphism_util
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add MATCH macros and fix is_fully_interp return value
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add is_finite_set helper and parameter count validation
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>
2025-10-13 10:58:53 +02:00