This change does a bunch of renaming to clear up confusions in these files. In particular, this change:
- Renames variables and methods to clarify the "dim"/"lvl" distinction, and changes them to use the Dimension/Level types as appropriate.
- Introduces new typedefs
- ExprId, LatPointId, LatSetId: to clarify the interning design of the Merger.
- LoopId, LoopOrd: to clarify the distinction between arbitrary names for loop-variables, vs numeric identifiers based on the actual order of loop generation.
- TensorId
- (Future CLs will change these from typedefs to structs/classes, so that the typechecker can help avoid mixups.)
- Updates documentation to match the new terminology
- Adds additional assertions
- Adds const to local variables along the way
You are adding *a lot* of comments with TODOs that read more like notes to self on how to improve the code. It makes the actual code actually a bit harder to read, since each block of comments looks like detailed documentation, but really is not