Transformation-pattern parsing #
This module parses and proves canonical round trips for rearrange, repeat,
and reduce patterns.
def
TorchLean.Tensor.Internal.Syntax.parseTransformPattern
(source : String)
(policy : IdentifierPolicy := IdentifierPolicy.pythonUnicode)
:
Parse the shared pattern language of rearrange, repeat, and reduce.
Instances For
theorem
TorchLean.Tensor.Internal.Syntax.parseTransformPattern_render_eq_ok
(source : String)
(pattern : TransformPattern)
(hParse : parseTransformPattern source = Except.ok pattern)
:
Except.map TransformPattern.render (parseTransformPattern pattern.render) = Except.ok pattern.render
Parsing a successful transformation pattern's canonical rendering succeeds with the same canonical syntax.
This applies uniformly to patterns used by rearrange, repeat, and
reduce; operation-specific shape conditions belong to the checker rather
than this syntax theorem.