-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Predicates for pattern variables are not checked consistently #246
Comments
Related: MT supports rule predicates for dynamic rules for example: ~a * ~b => 0 where (iszero(a) || iszero(b)) where ~a * ~b => (iszero(a) || iszero(b)) ? 0 : nothing It would be great to allow the same pattern for directed rewrite rules as well. ~a * ~b --> 0 where (iszero(a) || iszero(b)) But that would probably require handling the predicate in the compiled matching function. |
Yes indeed |
This suggests that we probably need a nicer way to attaching predicates to variables. Probably a per-scope dictionary in patterns: When parsing pattern
The issue is that the predicate is attached only to the second variable, and not to the first one. When parsing predicate we could use a |
I was surprised by some inconsistent behaviour of pattern variable predicates (when using the same pattern variable).
If a pattern variable occurs twice, it seems that only the predicate for the first occurrance is checked.
Here is a minimal example:
There is also no warning about inconsistent predicates. People might use different predicates for different occurances of pattern variables.
The text was updated successfully, but these errors were encountered: