Skip to content

Commit b3452e4

Browse files
authored
Fix typos, formatting, and broken references in the shelley-ma formal spec PDF
1 parent cab9dc5 commit b3452e4

File tree

4 files changed

+24
-33
lines changed

4 files changed

+24
-33
lines changed

eras/shelley-ma/formal-spec/mary-ledger.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@
382382
\bibliography{references}
383383

384384
\begin{appendix}
385-
\include{valmonoid-examples}
386385
\include{timelock-language}
387386
\include{value-size}
388387
\end{appendix}

eras/shelley-ma/formal-spec/references.bib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ @misc{small_step_semantics
66
url = {https://github.com/input-output-hk/cardano-chain/blob/master/specs/semantics/latex/small-step-semantics.tex},
77
}
88

9-
@misc{delegation_design,
9+
@misc{alonzoCDDL,
1010
label = {alonzoCDDL},
1111
author = {Ledger Team},
1212
title = {{Alonzo CDDL}},

eras/shelley-ma/formal-spec/value-size.tex

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ \section{Output Size}
88
can potentially be arbitrarily large, so the ledger requires each $\UTxO$ entry to
99
contain a minimum amount of Ada, proportional to its size.
1010

11-
There is also another $\Value_C$ size consideration with respect to spendability
11+
There is also another $\Value$ size consideration with respect to spendability
1212
of an output. The restriction on the total serialized size of the transaction (set
1313
by the parameter $\var{maxTxSize}$) serves as an implicit upper bound on the
14-
size of a $\Value_C$ contained in an output of a transaction. Without tighter
15-
limits on the output $\Value_C$ size, one of the following situations could arise,
16-
causing the output to be come unspendable (these are just a two examples) :
14+
size of a $\Value$ contained in an output of a transaction. Without tighter
15+
limits on the output $\Value$ size, one of the following situations could arise,
16+
causing the output to become unspendable (these are just a two examples):
1717

1818
\begin{itemize}
19-
\item The script locking the very large $\Value_C$-containing UTxO is too large
20-
to fit inside the transaction alongside the $\Value_C$ itself while still respecting
19+
\item The script locking the very large $\Value$-containing UTxO is too large
20+
to fit inside the transaction alongside the $\Value$ itself while still respecting
2121
the max transaction size
22-
\item The large $\Value_C$ cannot be split into several outputs, because the
22+
\item The large $\Value$ cannot be split into several outputs, because the
2323
outputs are impossible to fit inside a single transaction
2424
\end{itemize}
2525

2626
The same considerations apply for any underlying $\ValMonoid$ we choose to fix.
27-
In the ShelleyMA eras, the two types that are used to define concrete ledgers are $\Coin$ and $\Value_C$.
27+
In the ShelleyMA eras, the two types that are used to define concrete ledgers are $\Coin$ and $\Value$.
2828
The size calculations for $\Coin$, in practice,
2929
result in either trivial restrictions in the ledger rules,
3030
or ones that align with Shelley (as discussed in Section \ref{sec:utxo}).
@@ -33,7 +33,7 @@ \subsection{Value Size}
3333

3434
Figure \ref{fig:size-helper} contains abstract and helper functions
3535
used in calculating the in-memory and serialized representation
36-
sizes of $\Value_C$ elements.
36+
sizes of $\Value$ elements.
3737

3838
\begin{figure*}[h]
3939
\emph{Abstract Functions}
@@ -52,17 +52,17 @@ \subsection{Value Size}
5252
& \fun{serSize}~v=\lvert \fun{serialize}~{v} \rvert \\
5353
& \text{Gives the size of the serialized representation of a $\ValMonoid$}
5454
& \nextdef
55-
& \fun{numAssets} \in \Value_C \to \N \\
55+
& \fun{numAssets} \in \Value \to \N \\
5656
& \fun{numAssets}~{vl}=\lvert \{~(pid, an)~\vert~ pid \mapsto (an \mapsto \wcard) \in vl~\} \rvert \\
57-
& \text{Returns the number of distinct asset IDs in a $\Value_C$}
57+
& \text{Returns the number of distinct asset IDs in a $\Value$}
5858
& \nextdef
59-
& \fun{sumALs} \in \Value_C \to \N \\
59+
& \fun{sumALs} \in \Value \to \N \\
6060
& \fun{sumALs}~{vl}= \sum_{\{~an~\vert~\wcard~\mapsto~(an~\mapsto~\wcard)~\in~vl~\}} \fun{anameLen}~an \\
61-
& \text{Returns the sum of the lengths (in bytes) of distinct asset names in a $\Value_C$}
61+
& \text{Returns the sum of the lengths (in bytes) of distinct asset names in a $\Value$}
6262
& \nextdef
63-
& \fun{numPids} \in \Value_C \to \N \\
63+
& \fun{numPids} \in \Value \to \N \\
6464
& \fun{numPids}~{vl} = \lvert \fun{pids}~{vl} \rvert \\
65-
& \text{The number of policy IDs in a $\Value_C$}
65+
& \text{The number of policy IDs in a $\Value$}
6666
\end{align*}
6767
\caption{Value Size Helper Functions}
6868
\label{fig:size-helper}
@@ -78,12 +78,12 @@ \subsection{Value Size}
7878
serialized representation of a $\ValMonoid$ element. The specific underlying $\ValMonoid$
7979
is required to be serializable in every era.
8080

81-
The $\fun{serSize}$ function is used constrain
81+
The $\fun{serSize}$ function is used to constrain
8282
the serialized representation of the transaction (in particular, the size
83-
of $\Value_C$ elements in outputs), whereas the min-Ada requirement is a calculation based on
83+
of $\Value$ elements in outputs), whereas the min-Ada requirement is a calculation based on
8484
the in-memory representation size. A transparently-calculated size estimate
8585
is not necessary for limiting the size of values in outputs, since this size-bound
86-
check does not place any additional accounting/monetary constranits on transaction construction,
86+
check does not place any additional accounting/monetary constraints on transaction construction,
8787
unlike the min-Ada requirement.
8888

8989
\subsection{Min UTxO Value}
@@ -105,14 +105,14 @@ \subsection{Min UTxO Value}
105105
%
106106
\emph{Size and Min-Ada Functions}
107107
\begin{align*}
108-
& \fun{size} \in \Value_C \to \MemoryEstimate \\
108+
& \fun{size} \in \Value \to \MemoryEstimate \\
109109
& \fun{size}~\var{vl} =
110110
\begin{cases}
111111
k_0 & \fun{isAdaOnly}~vl\\
112112
k_1 + \lfloor~ \fun{numAssets}~vl * k_2 + \fun{sumALs}~vl & \\
113113
~~~~~~ + \fun{numPids}~vl * k_3 + k_4 - 1 /~ k_4~\rfloor & \text{otherwise} \\
114114
\end{cases} \\
115-
& \text{Calculate the size of a $\Value_C$}
115+
& \text{Calculate the size of a $\Value$}
116116
\nextdef
117117
& \fun{coinsPerUTxOWord}\in \Coin \to \Coin \\
118118
& \fun{coinsPerUTxOWord}~\var{mv} = \lfloor~ \var{mv}~/~ \mathsf{adaOnlyUTxOSize}~ \rfloor \\
@@ -126,12 +126,12 @@ \subsection{Min UTxO Value}
126126
\label{fig:min-val-calc}
127127
\end{figure*}
128128

129-
The $\fun{size}$ function returns the estimated size of a $\Value_C$ element. The size
129+
The $\fun{size}$ function returns the estimated size of a $\Value$ element. The size
130130
function on $\Value$ is defined via the isomorphism in Section \ref{sec:coin-value},
131131

132132
\[ \fun{size}_{\Value}~v=\fun{size}~(\fun{iso}_{v}~v) \]
133133

134-
The size of a $\Value_C$ element is constant in the case when it contains only Ada.
134+
The size of a $\Value$ element is constant in the case when it contains only Ada.
135135
If there are other types of assets contained in it, the size depends on
136136

137137
\begin{itemize}

eras/shelley-ma/formal-spec/value.tex

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ \section{Coin and Multi-Asset Token algebras}
99
A \emph{Token algebra} is a partially ordered commutative monoid
1010
$T$, written additively, (i.e. a commutative monoid together with a
1111
partial order, such that addition is monotonic in both variables)
12-
together with the functions and properties as described in Figure
13-
\ref{fig:TokenAlgebra}.
12+
together with the functions and properties as described in Figure~\ref{fig:TokenAlgebra}.
1413
\end{definition}
1514

1615
%%
@@ -72,13 +71,6 @@ \section{Coin and Multi-Asset Token algebras}
7271

7372
Below we give the definitions of all the functions that must be defined on
7473
$\Coin$ and $\Value$ in order for them to have the structure of a Token algebra.
75-
In Section \ref{sec:other-valmonoids} we give several other types which we can meaningfully
76-
support the definition of the required functions (addition, size, etc.), including
77-
an optimized representation that more accurately represents the implementation
78-
used in the Haskell implementation of the multi-asset type.
79-
These types are convertible to and from the $\Value$ type, and appear in other
80-
parts of the system as a multi-asset representation which is more suitable in particular
81-
use cases.
8274

8375
\subsection{$\Coin$ as a Token algebra}
8476

0 commit comments

Comments
 (0)