You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GuardOrPatterns, introduced in #340, wraps #Or terms on the RHS of rules in #as patterns to remove ambiguity. A regression test, or-llvm was updated to exercise the case that this pass is meant to cover.
Today, if the pass is removed from the compiler pipeline, those tests still pass, and the #Or terms in the RHS of rules in the generated kore are still wrapped up in #as patterns. It happens here, in MinimizeTermConstruction, sometime after the KoreBackend.steps transformation:
So somehow the bookkeeping done by this Transformer as it traverses the terms gets messed up and the value of inBad is wrong when visiting the #Or term.
The text was updated successfully, but these errors were encountered:
gtrepta
changed the title
GuardOrPatterns functionality intersecting MinimizeTermConstruction
MinimizeTermConstruction's behavior intersecting GuardOrPattern's functionality
Mar 19, 2024
After discussing with Dwight, I've learned that MinimizeTermConstruction is meant as an optimization to reduce the number of constructors in a rewrite, and is likely doing what it's supposed to. GuardOrPatterns is to ensure correctness. It's possible that there's a case that GuardOrPatterns handles that MinimizeTermConstruction doesn't handle, but it would probably be pretty difficult to find.
I've created a PR to add a little documentation to MinimizeTermConstruction, and we can close this.
Following up on discussions in #3973
GuardOrPatterns
, introduced in #340, wraps#Or
terms on the RHS of rules in#as
patterns to remove ambiguity. A regression test, or-llvm was updated to exercise the case that this pass is meant to cover.Today, if the pass is removed from the compiler pipeline, those tests still pass, and the
#Or
terms in the RHS of rules in the generated kore are still wrapped up in#as
patterns. It happens here, inMinimizeTermConstruction
, sometime after theKoreBackend.steps
transformation:k/kernel/src/main/java/org/kframework/compile/MinimizeTermConstruction.java
Lines 169 to 176 in ef56dd9
I believe this isn't intended. It looks as if
#Or
patterns are explicitly meant to not be operated on:k/kernel/src/main/java/org/kframework/compile/MinimizeTermConstruction.java
Lines 186 to 188 in ef56dd9
So somehow the bookkeeping done by this Transformer as it traverses the terms gets messed up and the value of
inBad
is wrong when visiting the#Or
term.The text was updated successfully, but these errors were encountered: