-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support custom rewrite rule sets as input #26
Conversation
| (y, ys) <- select xs | ||
] | ||
|
||
matchFindBinding :: Rules.Binding -> [Phi.Binding] -> [([Phi.Binding], Subst)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't be non-deterministic here as it can badly affect the performance (IDK if laziness saves us).
So, maybe apply listToMaybe
instead of returning a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sensible suggestion if we expect at most one match. However, this is not currently the case if Rule.Binding
contains a metavariable binding (i.e. we should match any metavariable). To make this efficient we should then somehow stop and let other part of the matching figure out what metavariable we are talking about, which can be done in some places by rearranging order of matching (for example, for ObjectDispatch
). However, this is not possible in general without constraint-based matching.
Co-authored-by: Abdelrahman Aly Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Aly Abounegm <[email protected]>
Co-authored-by: Abdelrahman Aly Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Abounegm <[email protected]>
Co-authored-by: Abdelrahman Aly Abounegm <[email protected]>
Use a single syntax for custom rules
Otherwise it calls defaultMain, which attempts to read `stdin` again
Based on #9. Closes #11.
Language.EO.Phi.Rules.Common
)Language.EO.Phi.Rules.Yaml
)--rules-yaml FILE
--chain
(not implemented yet)yegor.yaml
)Known issues/limitations:
isNF
condition does not adequately represent intended restrictions (need to consider context somehow)PR-Codex overview
Focus of this PR:
This PR focuses on introducing new features and improvements to the EO Phi normalizer.
Detailed summary:
MetaObject
andMetaBindings
in theObject
data type.Syntax.cf
grammar file to include theMetaId
token.Syntax.Par.y
parser file to handle theMetaId
token.Setup.hs
file to use the--haskell
flag when invokingbnfc
.Language.EO.Phi
module to import qualified modules.