-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sparsification of Affine Equality Matrix #1625
Conversation
6b07930
to
f931125
Compare
…goblint_lib.ml; Reintroduced Timing.wrap;
File splitting
By the way, there are some unresolved comments from @DrMichaelPetter and @michael-schwarz among the long hidden part of this PR. I don't know if there's anything that should still be done w.r.t. those or are they irrelevant by now. |
My remarks will be addressed in a future PR to fine-tune performance, @michael-schwarz issues are concerning the array implementation, which I would also address out of the scope of this course submission, in a cleanup-PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, one last suggestion: it was probably our fault for not giving you a more precise feedback here: side-effects have a very very different association in the context of the goblint analyzer, and this association is quite dear to us. Let us instead call the property sparse
instead of side_effects
(which entails inverting the condition), and make the bracketed explanations the actual explanations.
Ideally, also the AffineEqualityDomainSideEffects
would rather be the AffineEqualityDenseDomain
.
However: With Simmo and me having more or less approved this PR, merging is at the tip of our fingers.
The naming regarding the semantics for "side effects" should now be compliant with the goblint standard. I've tried my best to still convey fully the fact that these functions have an effect on the program state. Also the files have been renamed. |
Thanks! @CopperCableIsolator: I think you accidentally committed some files in the next to last commit? |
Also, I think the conf is not modified yet? |
Co-authored-by: Simmo Saan <[email protected]>
This pull request contributes a sparsification of the
AffineEqualityMatrix
(affeq) and is based on the domain of @MartinWehking from this PR.Following restructuring of the modules is introduced:
We added a second
AffineEqualityDomain
which exploits the sparsity of the affine equality matrices based on this observation by @DrMichaelPetter. ASparseMatrixFunctor
andSparseVectorFunctor
(as well asArrayMatrixFunctor
andArrayVectorFunctor
) were added for this purpose and replaced the generalAbstractMatrix
andAbstractVector
. TheAffineEqualityDomain
is now implemented without relying on side effects.The old
AffineEqualityDomain
using arrays was renamed toAffineEqualityDomainSideEffects
which usesArrayMatrixFunctor
andArrayVectorFunctor
.No new analysis was added to switch between versions. To switch to the old domain, use
--disable ana.affeq.sparse
.The implementation of sparse matrix works as follows:
The sparse matrix is implemented in the
ListMatrix
module. Itstype t
is a list ofsparseVectors
representing the matrix' rows.sparseVector
is implemented as an ordered list of tuples (index, value
) for all non-zero entries.Some functions are implemented for zero-preserving functions only. A function is zero-preserving iff it has a fixpoint at zero. These functions are implemented to gain performance when being used on
sparseVectors
.This implementation is part of an assignment for the course Automated Bug Hunting and Beyond at TUM in the winter term 2024/25.