kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Ex_comparator::equal_subtree does not handle use_props correctly #166

Closed kpeeters closed 4 years ago

kpeeters commented 4 years ago

The Ex_comparator::equal_subtree function has a parameter use_props, which can be set to not_at_top. What that should do is that property info is not used at top level, but can be used lower, provided the node at that lower level has parent_rel equal to p_sub or p_super. Right now, it will start looking up properties in a match of \dot{a} with \dot{b} as soon as we reach a and b, which is not correct.

This leads to weird substitution errors like the one reported in https://cadabra.science/qa/1327/dotted-indices-are-not-substituted-correctly .

kpeeters commented 4 years ago

Fixed with commit ed1acdcdd779db5a87e37dd6024195e7d6ed6cab.