TNO / Rejuvenation-Ada

Analysis and manipulation of Ada software based on concrete syntax
BSD 3-Clause "New" or "Revised" License
22 stars 1 forks source link

Improve support of operators and their properties #10

Open pjljvandelaar opened 2 years ago

pjljvandelaar commented 2 years ago

Currently, we have to make almost identical patterns since we can't generalize over operators. E.g. almost identical pattern distribution over if branches for + and & operators.

Furthermore, many operators have properties like idempotent, commutative, and associative. So why do I have to specify both $S_X+0 and 0+$S_X for the + operator?

Note that since operators can be overloaded the properties that hold can change: multiplication for number is commutative, and thus holds a b = b a Yet, this is not true for matrices: matrix multiplication is not commutative!

pjljvandelaar commented 2 years ago

Generalization over operators is blocked since libadalang doesn't support it (yet).