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

Reference previous specifications & other material #659

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

Conversation

williamdemeo
Copy link
Collaborator

@williamdemeo williamdemeo commented Jan 30, 2025

Description

This addresses #341.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Any semantic changes to the specifications are documented in CHANGELOG.md
  • Code is formatted according to CONTRIBUTING.md
  • Self-reviewed the diff

@williamdemeo williamdemeo linked an issue Jan 30, 2025 that may be closed by this pull request
@williamdemeo williamdemeo self-assigned this Jan 30, 2025
actionWellFormed _ = ⊤
actionWellFormed (ChangePParams x) = ppdWellFormed x
actionWellFormed (TreasuryWdrl x) = ∀[ a ∈ dom x ] RwdAddr.net a ≡ NetworkId
× ∃[ v ∈ range x ] ¬ (v ≡ 0)
Copy link
Collaborator Author

@williamdemeo williamdemeo Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is not aimed at making the code look nicer, but the small change here is more readable (and I won't remember to make a separate PR for it later).

@@ -35,7 +38,7 @@ explanations may be missing or wrong.

\begin{NoConway}
\begin{center}
Repository: \url{https://github.com/IntersectMBO/formal-ledger-specifications}
Repository: \url{\repourl}
Copy link
Collaborator Author

@williamdemeo williamdemeo Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case the repo url changes in future (again)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/Ledger/Address.lagda Outdated Show resolved Hide resolved
@williamdemeo williamdemeo force-pushed the 341-reference-previous-specifications-other-material branch from 6fa0196 to c93843c Compare February 7, 2025 05:24

module Ledger.Notation where
\end{code}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there's no reason for this to be an Agda module.

%% then we can just use, e.g., \LedgerURL{Chain} instead of requiring a special \LedgerChain macro.
%% Unfortunatley, I get a strange LaTeX error when I try the above.
%% (Maybe make this an issue later; not urgent enough to do now.)
\newcommand{\LedgerLedger}{\href{https://github.com/IntersectMBO/formal-ledger-specifications/blob/master/src/Ledger/Ledger.lagda}{\AgdaModule{Ledger.Ledger}}\xspace}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making module names links to the module in our repo will make it easier for readers to find the source if they wish.

@williamdemeo
Copy link
Collaborator Author

Besides the changes I comment on above, changes to the references.bib file include pulling in refs from the bib files of previous eras, alphabetizing the file, and changing entry names so they share a common pattern.

@williamdemeo williamdemeo marked this pull request as ready for review February 7, 2025 05:34
src/Ledger/Address.lagda Outdated Show resolved Hide resolved
system. Currently, this contains some logic that is handled by
POOLREAP in the Shelley specification, since POOLREAP is not implemented here.
system. Currently, this contains some logic that is handled by
POOLREAP in the Shelley specification~(\cite[Sec.~11.6]{shelley-ledger-spec}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a comment for this review, more like a rambling.

If we are going to continue using latex, it may make sense to switch to biblatex for citations (together with cleveref) so this would be written as:

POOLREAP in \textcite[\sectionname~11.6]{shelley-ledger-spec} ...

where

\NewDocumentCommand{\sectionname}{}{Section}
\crefname{section}{\sectionname}{\sectionname{}s}

so "Section" is render uniformly across the document.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I like it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making a ticket (#681) for this (so I'll save such improvements for a later PR specifically aimed at addressing #681).

@@ -35,7 +38,7 @@ explanations may be missing or wrong.

\begin{NoConway}
\begin{center}
Repository: \url{https://github.com/IntersectMBO/formal-ledger-specifications}
Repository: \url{\repourl}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/Ledger/Introduction.lagda Outdated Show resolved Hide resolved
\href{https://github.com/IntersectMBO/formal-ledger-specifications/issues}%
{open an issue} in
\href{https://github.com/IntersectMBO/formal-ledger-specifications}%
{our GitHub repository} with the `notation' label.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use \repourl here?

there is no \SecurityGroup, but there is the concept of security-relevant
protocol parameters~\cite{cip1694}. The difference between these notions
is only social, so we implement security-relevant protocol parameters as
a group.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is strange to use both \href to refer to a CIP and a citation. We should unify this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure a link is necessary when there's a citation right next to it.

Copy link
Collaborator Author

@williamdemeo williamdemeo Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's strange. I think it's nicer to have occurrences of "CIP-1694" link to the CIP, but also include the more conventional reference. Sometimes you want to navigate directly to the CIP from the page you're reading and sometimes you just want to look the bib metadata. These serve two different purposes.

But I do think it's a good idea to have a latex macro named \cip1694 to make it easier to be consistent whenever we refer to \cip1694.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since TeX doesn't allow numbers in macro names, I've used the "leet speak" equivalents, so, for example, \citeIGgA in a tex or agda source file will be typeset as CIP-1694 with a hyperlink to the CIP.

I'm not particularly fond of leet speak, so if you have a better suggestion for naming the macros, please propose it.

Copy link
Contributor

@carlostome carlostome Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest in any case to use a command that gets as parameter the CIP not a command per CIP. For example,

\ExplSyntaxOn
\NewDocumentCommand\hrefCIP{m}{%
  \clist_if_in:nnTF {0069,1694} {#1}
  {%
    \href{https://github.com/cardano-foundation/CIPs/tree/master/CIP-#1}{CIP-#1}%
  }{%
    \PackageError{agda-latex-macros}{CIP-#1~undefined.}{}
  }%
}
\ExplSyntaxOff

(It checks whether the arguments is in the list and gives an error otherwise)
It can be used as \hrefCIP{0069}, for instance.

@@ -160,6 +160,9 @@ the state of the previous era at the transition into the Conway era.
Alternatively, we can effectively treat the old handling of deposits
as an erratum in the Shelley specification, which we fix by implementing
the new deposits logic in older eras and then replaying the chain.
(The handling of deposits in the Shelley era is discussed
in~\cite[Sec.~8]{shelley-ledger-spec}
and~\cite[Sec.~B.2]{shelley-delegation-design}.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another rambling. Using biblatex this would be:

\texcites[Sec.~8]{shelley-ledger-spec}[App.~B.2]{shelley-delegation-design}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good note for the PR that addresses #681.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@carlostome carlostome Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should maybe agree on a standard for naming references.
I personally like the one used by dblp.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! I like dblp too. For reference, here's the bib entry for our paper about the spec.

Copy link
Collaborator

@WhatisRT WhatisRT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments/typos here and there, but I think I agree with everything @carlostome said

src/Ledger/Introduction.lagda Outdated Show resolved Hide resolved
there is no \SecurityGroup, but there is the concept of security-relevant
protocol parameters~\cite{cip1694}. The difference between these notions
is only social, so we implement security-relevant protocol parameters as
a group.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure a link is necessary when there's a citation right next to it.

src/Ledger/Utxow.lagda Outdated Show resolved Hide resolved
In original spec, however, the right-hand side (\txdatsHashes) could never
contain \nothing, hence the left-hand side (\inputHashes) could never
contain \nothing.

% TODO: Say what "original spec" refers to?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we can just remove the word 'original'. It's just the Alonzo spec.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll remove the word "original" in front of "Alonzo." But in the next sentence, the word "original" is ambiguous. It says, "In the original spec, however,..." so presumably that's a reference to Shelley...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 224, 'original spec' also refers to Alonzo. Shelley didn't have this line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks. In that case, the "however" connective doesn't make sense. I'll rewrite the sentence.

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.

Reference previous specifications & other material
3 participants