Skip to content

docs: document vector product pattern-matching limitation - #922

Open
nasa314159 wants to merge 1 commit into
form-dev:masterfrom
nasa314159:docs/issue-300-vector-pattern-matching
Open

nasa314159 wants to merge 1 commit into
form-dev:masterfrom
nasa314159:docs/issue-300-vector-pattern-matching

Conversation

@nasa314159

Copy link
Copy Markdown

Summary

Adds a short note to the pattern-matching chapter documenting a limitation for products of vector wildcards. This is a documentation-only change; it does not modify the matcher.

Motivation / issue #300

Issue #300 reports that a pattern with repeated vector wildcards does not match a term that would match under another assignment of the same vector factors. A maintainer comment (2020-07-28) says this is a known shortcoming, that a full fix would require a large rewrite, and that it would be best to mention it in the manual instead.

Documents #300.

Documentation changes

  • Add a concise statement of the limitation.
  • Add the minimal reproducer from issue Pattern matching for products of vectors #300.
  • Explain the expected versus actual matching.
  • Note that FORM stores factors in a canonical order, so the input order is not necessarily the order used by the matcher.
  • Note that the matcher has backtracking support for function factors that is not available in the same way for vector factors.
  • Warn that replacing vectors with commuting functions or tensors changes algebraic semantics and is not a general workaround.
  • Note that separate id statements can cover fixed small cases, but do not make the matcher try all permutations.

Validation performed

  • Reproducer on FORM 5.0.2 (macOS arm64) still leaves the first term unchanged and removes the second; exit 0.
  • Tested the fixed-case id workaround and input reordering; reordering the input does not help.
  • Tested replacement by commuting functions/tensors; this changes the objects, so it is not presented as semantically equivalent.
  • git diff --check clean.
  • pdflatex (two passes) and htlatex builds completed locally; dvipng is not installed, so HTML math images were not generated. No system dependencies were installed.
  • The patch changes only doc/manual/pattern.tex.

Limitations

  • This documents the current behavior; it does not fix the matcher.
  • The note does not specify a complete matching order or promise permutation-complete matching.
  • Local documentation builds are not a substitute for upstream CI.
  • Wording may need maintainer adjustment (for example, manual versus developer reference).

The pattern matcher does not in general try all assignments of vector factors to vector wildcards. Document this limitation, with the reproducer from issue form-dev#300 and a note on canonical ordering and workarounds. This documents the limitation; it does not fix the matcher.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant