Legend:
Library
Module
Module type
Parameter
Class
Class type
Transform any AST (at any stage of transformation) to latex.
Note that the headers are not included; if you want to compile the resulting latex text in a real latex document, you would need to add (fr example):
\documentclass[11pt]{report}
\usepackage{mathtools}
\begin{document}
% thing produced by latex_of_ast
\end{document}
Some details on the latex code produced:
tuple-propositions p(a,b,c) turn into p_a,b,c
variables are displayed in bold font and '$' is removed
we use \mathbf{} for setting bold font on variables. We could use \bm{} (which is a more appropriate way of using bold-font in the math env as it keeps the 'italic' way of displaying math) but \usepackage{bm} does not work with most tools: MathJax (javascript), jlatexmath (java).
ast_fun will apply f on all *formula*-related elements of the AST where cond is true. The tranversal order should not be considered. Whenever a non-formula is given, acc will be immediatly returned.