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

Rewriting every matching pattern in a graph #9

Closed
GeorgeR227 opened this issue Oct 13, 2022 · 2 comments
Closed

Rewriting every matching pattern in a graph #9

GeorgeR227 opened this issue Oct 13, 2022 · 2 comments

Comments

@GeorgeR227
Copy link

So I'm running into a problem where I want to rewrite all of the matching patterns in this graph:
original

This is the pattern that I'm matching for:
match

And this is the rewrite pattern, with equivalence on the respective, outermost nodes on the matching pattern and edges discarded:
sub

After the first rewrite, the graph looks like this:
rewrite1

But when I apply it for a second time, it performs it in the same place:
rewrite2
Instead I would want into to perform it on the other two original patterns before it finishes.

What would be the best way to complete this kind of total rewrite?

@anandijain
Copy link

Yeah, I'm also running into this. My very primitive understanding is that the matching only seems to happen when vertex ids line up. If you want some very bad code that will handle this, see https://github.com/anandijain/HypergraphRewriting.jl/blob/main/test/runtests.jl
I'm almost sure that your case will work with HR.jl

I very much want to rewrite this package to use Algebraic Julia machinery, but this may be sufficient for the time being

@kris-brown
Copy link
Collaborator

This is now addressed by Query blocks in a rewriting recipe. See examples in the docs (Game of Life, Lotka Volterra) or in test/schedules/Eval.jl though I'll be working on actual docs (rather than just examples) in the future!

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

3 participants