Opetopes can be regarded as certain sequences of trees, and it is easy to encode them in XML. The algorithms are implemented in Tcl using the tDOM extension. Furthermore there is support for translation into the dot language, and automated graphical rendering via a dot interpreter.
<!ELEMENT opetope (constellation+)> <!ELEMENT constellation (dot|leaf)> <!ELEMENT dot (dot|leaf)*> <!ELEMENT leaf EMPTY> <!ATTLIST opetope name CDATA #REQUIRED> <!ATTLIST constellation name CDATA #REQUIRED> <!ATTLIST dot name CDATA #REQUIRED ref CDATA #IMPLIED> <!ATTLIST leaf name CDATA #REQUIRED> |
The first block declares the tags for opetope, constellation, dot, and leaf, specifying which sort of children they can have. In the second block it is specified that each tag must have a name attribute, and that the dot tag is also allowed an optional ref attribute, used only for stopdots.
Click here to see an example of a big opetope encoded in XML.
Most unix systems, including Mac OSX, come with Tcl installed, but typically without tDOM. Windows computers, on the other hand, typically haven't got Tcl, but it is very easy to install it, and then you get tDOM into the bargain.
More information about Tcl, see http://tcl.tk/ and http://wiki.tcl.tk/.
More information about tDOM, see http://www.tdom.org/.
To download Tcl (for all main platforms) together with tDOM, go to http://www.activestate.com/Products/ActiveTcl/ and follow the instructions.
To check that the installation is OK, go to the command line and type tclsh, this will give you a tcl prompt %, in which you type package require tdom. If everything is OK, you should get the message 0.8 or some similar number, indicating that this is the version of tDOM loaded.
In case you are not allowed to install Tcl in its standard location /usr/bin/tclsh, you can install it anywhere else, but in that case there is a risk that it will not be found first in you PATH variable. Rather than modifying your PATH settings you can just modify one configuration file that only affects the opetope scripts: the file is opetope-scripts/tcl/configuration, and the required modification is just to uncomment the second-to-last line and write the full path to the newly installed Tcl.
The script opetope2dot produces a DOT file from an opetope XML file (this is independent of the presence of dot). There is also a wrapper script opetope2pdf which outputs pdf directly, but this script requires the dot interpreter. The graphical output can be very helpful to get an overview of a complicated opetope and its faces, but unfortunately the output is not quite as nice as the drawings in [KJBM]; Specifically, there is no support for drawing the spheres.
The best thing is to get Graphviz, a graphical interface to dot (and other graph-drawing languages) which includes a dot interpreter. Graphviz is available for all major platforms from the web page http://www.graphviz.org/
One last bit of tinkering is needed: although Graphviz contains the dot executable, it is typically not placed in your PATH, so the opetope scripts cannot find it. The dot executable is hidden somewhere inside the Graphviz bundle. In the Mac OSX version of Graphviz (from Pixelglow), dot is found at /Applications/graphviz/Graphviz.app/Contents/MacOS/dot, while if you install a unix-style version of Graphviz, dot will end up at some place like /usr/local/graphviz-2.9/bin/dot. In any case, you can copy it to somewhere in your path (or make a link to it), or you can include the relevant path in your PATH variable. However, a more convenient method is provided, which avoids messing with your PATH variable: simply edit the last line of the file opetope-scripts/tcl/configuration, telling where dot lives.
[%] ../tcl/listSources Q.xml 23 24 25 30 31 32 33 34 35 36 37 26 29 27 28 [%] ../tcl/computeOneSource Q.xml 29 Q-29.xml [%] ../tcl/opetope2pdf Q-29.xmlThis sequence of commands will produce a pdf file of source 13 of the opetope Q.
It may be felt clumsy to have to include the ../tcl/ in every command invocation. It is probably practical to append opetope-scripts/tcl to your PATH. You can achieve this temporarily by running the script opetope-scripts/tcl/setOP: it will start a new shell, in which the tcl directory is appended to the PATH. When you have finished, just exit this shell.
The provided commandline scripts are
checkOpetopeFile XMLFILE areIsomorphic XMLFILE0 XMLFILE1 listSources XMLFILE computeOneSource XMLFILE SOURCENAME ?-o OUTPUTPATH? computeTarget XMLFILE ?-o OUTPUTPATH? computeAllFacets XMLFILE glueOnto BOTTOMXMLFILE SOURCENAME TOPXMLFILE ?-o OUTPUTPATH? opetope2dot XMLFILE opetope2pdf XMLFILESee the manual pages for details.
The basic sequence of operations is
set OP [readOpetope XMLFILE]This will create a dom tree in memory corresponding to the XML file, and this dom tree can be accessed and manipulated with standard Tcl and tDOM techniques. For example
set ct [$OP lastChild] set leafList [$ct selectNodes descendant::leaf]will produce a list of leaves of the composition tree of the opetope. Many specific opetope operations are implemented as domNode methods and can be applied to modify the dom trees in place or to produce new dom trees. In particular, the four basic sphere operations (described in [KJBM]) are available. The last step in the sequence of operations may then typically be
writeOpetope $OP SOMEXMLFILEif the opetope resulting from the transformations is desired saved to disc.
For the specifications and syntax of the provided procedures, see the source file itself which it carefully documented throughout.
Read the man pages for the opetope scrips
See examples of opetopes in high dimension
Download package of scripts and example XML files