[isabelle] Pretty-printing for trees in 2D

Dear list,

For an Isabelle demo, I'd like to pretty-print a binary tree in a 2D layout, say given by the datatype

datatype tree = Leaf nat | Node tree tree

The output should be 2-dimensional, e.g., what drawVerticalTree in Haskell does:


I'm happy to write a print translation for the tree constructors to do that, but I have no clue how I could achieve this with Isabelle's syntax AST. Is this possible at all? Has anyone done something similar before?


This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.