Live data from Hacker News

LaTeX Finite Automata and State Diagrams with Tikz

hayesall.com

31–36 of 36 posts

Re: LaTeX Finite Automata and State Diagrams with Tikz

#31

On this topic, I recently came across a nice string diagram formalization for automata: https://arxiv.org/pdf/2009.14576.pdf

Neat. If I understand correctly, their work makes diagrams and code isomorphic. Meaning roundtripping between diagrams and code can be done with no loss, no impedance mismatch. Meaning my long-time dream of a two-way structure editor is now feasible. Edit the diagram, the code updates. Edit the code, the diagram updates. Back and forth. As you know, the Achilles Heel of CASE tools (and visual programming) has been th…

Over the past ~25 years there has been a concerted effort to use the tools of category theory (a branch of mathematics) to develop unambiguous diagrammatic languages, and this paper is a good example of the results of that effort. I’m personally quite intrigued by where this could go, but there’s still a lot of work to do before it revolutionizes the way code is written.

If you want to go down some rabbit holes, check out the homepage of the Mathematically Structured Programming group at the University of Strathclyde: https://msp.cis.strath.ac.uk/index.html

Re: LaTeX Finite Automata and State Diagrams with Tikz

#32
post #19
post #5

I find manually laying out graphs and digraphs tedious. It seems like a problem that should be amenable to machine learning approaches. Basically, training a machine as to what is an aesthetically pleasing layout and what is not. Are there layout engines that use machine learning for layout, as against being implemented in terms of specific tree or graph layout algorithms?

It would be nice if there were a tool that would take the input to graphviz, run it to graphviz to get the layout and then use that to generate the tikz code using that layout.

TikZ/PGF had a graph layouting implementation for about a decade now, c.f. "Part IV - Graph Drawing" in the manual. And apparently `dot2tex` can also render TikZ instructions, so going via Graphviz is possible too.

Re: LaTeX Finite Automata and State Diagrams with Tikz

#34
I've never really liked the look of the Tikz-generated automata. Something about them always looks a little off to me. I also dislike the use of 0 and 1 as the canonical alphabet. a and b look nicer, they stand out better in written instructions and solutions (when typeset using math mode), and (this sounds silly) sound nicer when talking about them with the class. Using 0 and 1 seems to imply some connection to binary that is not really there and probably confuses or misleads some students.

Of course, everyone will have a different opinion on such aesthetic matters. I taught an undergrad comp theory course for a decade or so and I wrote my own similar package[1] for generating diagrams using Metapost that built on the standard boxes package. Students were able to learn the system pretty quickly and the results were usually good, though it was pretty easy to pick out which students did/did not care about how things look.

[1] - https://github.com/russross/automata/

Re: LaTeX Finite Automata and State Diagrams with Tikz

#35
post #29

How does this compare to Penrose? Also, has anybody tried using Inkscape [1,2] or another vector drawing tool for this? I imagine it would be faster and more intuitive than learning Tikz. [1] - https://stackoverflow.com/questions/17610717/drawing-an-undi... [2] - The following appears to be part of a presentation: https://gould.cx/ted/presentations/txlf16/Technical%20Drawin...

I briefly looked at their website recently, and it looked to me like Penrose just renders the diagram interactively as a webapp. I didn't see a "compiler" that would translate the diagram code into a standalone PDF/PNG file that would be easy to include in a LaTeX document.
Post reply on HN