Prove-It icon indicating copy to clipboard operation
Prove-It copied to clipboard

Avoiding differing expressions that look the same

Open wwitzel opened this issue 2 years ago • 2 comments
trafficstars

It can be very confusing when two expressions look the same but are actually different. Here are two things we can do to avoid this problem.

  1. When checking to see if a parameter should be relabeled in order to avoid a scoping violation, we could check against the string/latex display of the contained sub-expressions rather than just looking for explicit Variable collisions. An example of this came up recently where there was a "collision" between var_ket_psi and ket_psi. They appear the same but are different types of expressions. This solution would avoid that issue.
  2. More generally we could check expressions as they are generating their formatted display to see if there are any sub-expressions that have the same display but are different. If so, we could generate some kind of warning or raise an exception.

wwitzel avatar Oct 05 '23 14:10 wwitzel