SNL DiagramsSome experiments on creating SNL graphs, using a perl script to turn SNL code into a config file for the Graphviz 'dot' program. The SNL code does require some special comments, check the example SNL and the perl script for details:
The following images were all created with the perl script and dot. The first image shows the "plain" state diagram. "Dot" might have made some unfortunate layout choices, but the bottom line is that cyclic transitions, which almost every sequence will have, are difficult to lay out nicely.
- snl_dot.pl perl script,
- www.graphviz.org for the Graphviz 'dot' program,
- test.st the example sequence.
Carl Lionberger (LBL) pointed to the idea of Dromey Behavior Trees, part of Professor Dromey's genetic design, see http://www.sqi.gu.edu.au/gse. It actually tries to cover much more ground, claiming that DBTs ease the understanding of complex requirements, help to find errors in requirements, and in the end result in a software layout.
Something worth looking at when starting a new sequence, also a possible idea for a future graphical SNL creation tool. Meanwhile, I concentrate on diagramming an existing sequence. In my limited understanding of DBTs, the sequence would look a bit like this:
One key idea: Cycles are not represented by "back arrows". Instead, a special symbol indicates that e.g. the bottom "Low" state is not really a new state but just another instance of the original "Low" state.
Currently, my preferred compromise is the following way of drawing a sequence: States and transitions similar to the original state diagram, but with a user choice to point transitions to "dashed" copies of the original states whenever one wants to avoid cyclic references. It's unclear to me if that should be automated, if the script should detect the cycles, or if it should be left to the user who adds the special SNL comments, because in some cases I might prefer to see the cycles in the graph.