Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the ability to rename inference rules when Tex filtering. #106

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

heades
Copy link

@heades heades commented Mar 9, 2024

Originally, Ott did not allow one to easily rename an inference rule
in Tex. For example, in an Ott specification one might define a rule
like the following:

G, x : A |- t : B
-------------------- :: Fun
G |- \x:A.t : A -> B

Unfortunately, Ott does not provide any means of giving a Tex version of
the name "Fun".

Given the previous rule Ott would generate the following LaTex
(assuming no prefix was given to Ott, and that the judgment prefix is
"T_"):

\newcommand{\OttdruleTXXFun}[1]{\Ottdrule[#1]{%
\Ottpremise{\Gamma \Ottsym{,}  \mathit{x}  \Ottsym{:}  \Ottnt{A}  \vdash  \Ottnt{t}  \Ottsym{:}  \Ottnt{B}}%
}{
\Gamma \vdash   \lambda  \mathit{x}  :  \Ottnt{A} . \Ottnt{t}   \Ottsym{:}  \Ottnt{A}  \to  \Ottnt{B}}{%
{\Ottdrulename{T\_Fun}}{}%
}}

We can see that the name of the rule "T_Fun" is not easily changed within LaTex.

We fix this issue by having Ott factor out the name of each rule into
a constant LaTex command that can be renewed in LaTex. Now given the
rule above Ott will generate the following:

\newcommand{\OttRenameRuleTXXFun}[0]{\Ottdrulename{T\_Fun}}
\newcommand{\OttdruleTXXFun}[1]{\Ottdrule[#1]{%
\Ottpremise{\Gamma \Ottsym{,}  \mathit{x}  \Ottsym{:}  \Ottnt{A}  \vdash  \Ottnt{t}  \Ottsym{:}  \Ottnt{B}}%
}{
\Gamma \vdash   \lambda  \mathit{x}  :  \Ottnt{A} . \Ottnt{t}   \Ottsym{:}  \Ottnt{A}  \to  \Ottnt{B}}{%
{\OttRenameRuleTXXFun}{}%
}}

Then to rename the rule we can simply add the following after the Ott
generated LaTex include file has been importanted:

\renewcommand{\OttRenameRuleTXXFun}[0]{$\rightarrow_I$}

I felt that this modification was the least problematic when it comes
to backward compatibility.

heades and others added 30 commits December 14, 2019 10:54
Identifiers can now contain greek characters
(prevents missing JSON homs breaking the whole pp output)
@starsandspirals
Copy link

I was just wondering whether there has been any update on the possibility of getting this merged in? It looks like the issues discussed in #62 have been resolved, as far as I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.