statycc / pymwp

A static analyzer of variable value growth for C programs.
https://statycc.github.io/pymwp/
GNU General Public License v3.0
4 stars 1 forks source link

Additional methods for the Matrix #12

Closed aubertc closed 3 years ago

aubertc commented 3 years ago

I believe it could be beneficial to add to the Matrix.py class:

seiller commented 3 years ago

The fixpoint method (and maybe the equal one) should have existed at some point. We can discuss the most efficient way to compute it; as sums are maximum, the sequence M, M^2, ... is increasing and one just needs to find a M^n that stabilises (M^n=M^n+M). But maybe computing M, M^2, M^4 (iterated products instead of summing with M each time) would be more efficient.

aubertc commented 3 years ago

Oh, and a "print" method.

nkrusch commented 3 years ago

The fixpoint method (and maybe the equal one) should have existed at some point.

we have fixpoint method but it requires creating a Relation then matrix in that relation, then calling fixpoint. The use case here is for computing fixpoint for a matrix (list of list) without needing Relation instance around it.

maybe the equal one

We have polynomial equals. So for list of list of polynomials, need to do element-wise equals currently. It can be done but takes some time to write it. The use case is to look at some two matrices in isolation and be able to tell if they are equal with single function call.

and a "print" method

yes, should add this.

aubertc commented 3 years ago

This is closed with https://github.com/seiller/pymwp/pull/15.