Skip to content
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

Make it visually easier to recognize similar sub-patterns #10

Open
lukaslueg opened this issue Aug 16, 2018 · 1 comment
Open

Make it visually easier to recognize similar sub-patterns #10

lukaslueg opened this issue Aug 16, 2018 · 1 comment

Comments

@lukaslueg
Copy link
Owner

Moved over from lukaslueg/macro_railroad#12


In many macros, multiple branches share a lot of similar sub-patterns. It would be easier to visually read the diagrams if the similar sub-patterns were aligned. E.g. aligning the 4 occurrences of macro_name ! into one column in this example, and also aligning the 2 occurrences of values = vf ,.

And for macros where a sub-patterns appears verbatim in multiple branches of the macro (or multiple times in one branch), it would make sense to highlight that they are not just similar but the same, by factoring out that sub-pattern into its own sub-rule diagram (and then inserting the name of the sub-rule (or an arrow to the sub-rule diagram) in place of the occurrences of the sub-pattern).

@lukaslueg
Copy link
Owner Author

In both cases the underlying problem is probably (related to) the frequent subgraph mining problem. gSpan is the only thing that comes to mind for me.

I'm unsure about the alignment: We currently completely circumvent the problem of having primitives know about their surrounding and alignment rules. That is, we don't solve the optimization problem of respecting as many alignment rules as possible while simultaneously not blowing up the diagram. A place where this shows up is deep Stacks which return to their exit-point (see example #12) , which could be aligned downwards instead of returning upwards.
To solve this, an implementation similar to CSS-positioning of absolute and relative may suffice.

If we had an FSM-implementation, extracting / rewriting macros into multiple diagrams should be easy.

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

No branches or pull requests

1 participant