I am writing a literate program (with NoWEB), a toolset for Lua that happens to include a Partial evaluator, a Meta-tracer, a pretty-printer etc.
In the appendix, I provide extra information like Lua's BNF grammar (using SimpleBNF) and the Term-rewriting rules for Partial evaluation.
I did not find a LaTex package intended for typesetting TRS, so (with some help from GPT), I created simpletrs.sty (below), which povides the simpletrs package. It's a package for typesetting Term-rewriting rules.
It's a quite simple package. Providse 4 commands:
1- \trule for typesetting normal TRS rules;
2- \truleif for adding conditionals;
3- \ctrule for contextual TRS;
4- \ntrule for named (labeld) TRS;
It's very, very simple to use! Here's an example:
\documentclass{article}
\usepackage{simpletrs}
\begin{document}
% Simple term-rewriting system
\trule{f(x, y)}{g(x, y)}
% Conditional rewriting
\truleif{f(x)}{g(x)}{x > 0}
% Contextual rule
\ctrule{C}{f(x)}{g(x)}
% Named rule
\ntrule{\alpha}{f(x, y)}{g(x, y)}
\end{document}Put this in the same directory as your LaTeX file.
My contacts are in my Github frontpage, where you can find lots of other work. Link. If you need any help, lemme know.