-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(BV): Track domains for uninterpreted leaves only (#1004)
This patch changes the internal representation of domains in the bitvector relations. Without the patch, we are keeping track of domains for *all* bit-vector terms, which is correct but wasteful. With the patch, we only track the domains of (currently) uninterpreted class representatives, and rebuild the domain associated with other terms on-the-fly before propagation. This avoids carrying around huge domain maps with a potentially large amount of duplication, and allow to share propagations between terms that include identical sub-terms immediately without a round-trip through Uf (without the patch, if we learn that `0 @ x -> 01??`, it does not immediately propagate that `1 @ x -> 11??`; we first have to assert `x<2,2> = 1` which gets solved into the substitution `x |-> 1 @ x'` and we only learn `11 @ x' -> 11??` when performing the substitution). On the other hand, it means that `Domains.get` and `Domains.update` are a bit more expensive now. Since the `Congruence` is now only used for constraints, and not for domains, we only need to add the arguments of the constraints to the `Congruence` (which should also be a slight performance boost). Other changes to the use of the `Congruence` module are needed to fix the mismatch between what is stored in the `Domains` (whose keys are now uninterpreted terms) and the `Constraints` (the actual arguments of the constraints in the original problem). There is one exception: we now add the arguments of `Distinct` to the congruence, which is required for completeness because the terms that we generate during case splits are not guaranteed to already exist (in fact, in general they don't, since we create 1-bit extractions that have no reason to be in the original problem). Note that there is also a small bugfix in `Congruence`: when performing a substitution we need to remove the old terms, otherwise we will forget dependencies if we ever add it back later.
- Loading branch information
1 parent
214ea7c
commit bd9f133
Showing
2 changed files
with
167 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.