[gen] add @before and @after predicates for relaxations in diy7#1835
Open
ShaleXIONG wants to merge 3 commits into
Open
[gen] add @before and @after predicates for relaxations in diy7#1835ShaleXIONG wants to merge 3 commits into
@before and @after predicates for relaxations in diy7#1835ShaleXIONG wants to merge 3 commits into
Conversation
Extend the relax AST with a predicate node and teach the lexer/parser to recognise predicate applications such as `@before(...)` and `@after(...)`. Add `map_predicate` support to the AST so predicate names can be converted before expansion. Parse `before` and `after` into edge predicates, then attach the parsed predicate to every edge produced by the decorated relax expression.
660be26 to
3f9520e
Compare
Extend `diy7` cycle searching to recognise predicate-decorated boundary edges. `@after(...)` predicates at the end of a candidate edge sequence and `@before(...)` predicates at the start of the existing suffix are matched against the adjacent concrete edge before the search continues. Once predicates have been checked, remove them from candidate cycles before handing them to the normal test generator.
3f9520e to
21ff211
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
diy7-only predicate syntax for relax inputs:@before(...)@after(...)The parser entry points are split so predicate syntax is accepted only by
diy7. The sharedmain/diyone7,diycross7, andcumulparsers reject predicate syntax.During relax expansion, invalid predicate placement is filtered before search:
@before(...)is only valid at the start of a relaxation sequence@after(...)is only valid at the end of a relaxation sequenceDuring
diy7cycle search, boundary predicates are checked against neighbouring concrete edges. Once checked, predicates are stripped before passing candidate cycles to the normal test generator.Added tests for:
diy7parser acceptance of@before(...)and@after(...), while other parsers reject of predicate syntax[]diy7cycle generation, the predicates@beforeand@aftermerge as expectedExample
This constrains the generated boundary edges to match the predicates.
Powill match@before(Po)andafter(Po)during the searching.Another example contains composite relax:
In this case, the only relaxation will be match with themselves, i.e., the leading
PodRW Rfematches the trailing@after([PodRW Rfe]).