NorfairKing / haphviz

Graphviz code generation with Haskell
MIT License
18 stars 4 forks source link

Feature request: render tree automata #1

Closed rpglover64 closed 7 years ago

rpglover64 commented 8 years ago

Feel free to close this if it's too far out of the purview of this library.

You have a module for rendering FSAs. I have a use-case for rendering tree automata (with equality constraints). One way to think of them is directed hypergraphs, but for rendering them, I usually think of a directed bipartite graph.

For example (though not necessarily ideal):

digraph {
    node [label="\N"];
    "f(1,1)"     [shape=square];
    0 -> "f(1,1)"    [label="1=2"];
    "f(1,1)" -> 1;
    "f(2,2)"     [shape=square];
    1 -> "f(2,2)";
    "g(1,2)"     [shape=square];
    1 -> "g(1,2)"    [label="1=1"];
    "f(2,2)" -> 2;
    "g(1,2)" -> 1;
    "g(1,2)" -> 2;
    2 -> "a()";
    "a()" [shape=square];
    "g(2,1)"     [shape=square];
    2 -> "g(2,1)"    [label="1=1"];
    "g(2,1)" -> 1;
    "g(2,1)" -> 2;
}
NorfairKing commented 8 years ago

I'd like to have support for this. It doesn't look like it would need an new dependencies.

The problem is that I haven't studied up on tree automata.

Would you like to have a go at implementing this?

rpglover64 commented 8 years ago

I can take a stab at it, but I'm not likely to have too much time. Separately, if you want to take a look at TAs, the best reference I know is TATA.