I've gotten Soffit to the point where it can now produce interesting graphs, like this one:
The rule set that produces this graph is:
{
"version" : "0.1",
"start" : "ROOT [color=maroon]",
"X [color=maroon]" : "X[color=maroon]; Y[color=brown]; X--Y",
"Y [color=brown]" : [ "Y [color=brown]; Z[color=green]; Y--Z",
"Y [color=brown]; Z[color=brown]; Y--Z",
"Y [color=forestgreen]; Z1[color=green]; Z2[color=green]; Y--Z1; Y--Z2;" ]
}
As you can see, the tags in this grammar are graphviz attributes, which are just copied into the output directly!
The numbers are the order in which new nodes were added to the graph.
I am thinking of adding an option to do a separate rewrite step, where you apply one grammar and then another, so that the first grammar can be written with "natural" tags like "root", "internal", "leaf" and then be rewritten in one pass to be display labels and attributes.
Getting closer to a release. All this is on github and available to play with right now, but to-do's include:
- Write a tutorial
- Look at how parsing errors are displayed
- Figure out which characters to accept (and do so efficiently, startup time is still kind of long)
- Friendlier command line, other output options besides SVG, ensure dependencies are correct
- More options to control graph expansion (when to quit, for example? Time-based instead of number of iterations?)
- Apply multiple rule sets (maybe in v2)
- Weighting for rules (maybe in v3)
- Add to PyPi? (maybe in a stable version)
Development blog entries
My #procjam project: Soffit
Soffit progress report #2
Soffit non-progress report #3
Hooray for unit tests
Soffit progress report #5
graphviz clusters suck
Graph rewrite examples, generated by Soffit
Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!
Reply !stop to disable the comment. Thanks!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
A simple expression rewrite:
Takes this:
To this:
Implementing the distributive law on an expression DAG.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Another graph generated by iterating a simple rule:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @markgritter! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Do not miss the last post from @steemitboard:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit