Skip to content

Commit

Permalink
Add note on how sets & maps are translated in txinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatisRT authored and Jared Corduan committed Feb 22, 2023
1 parent 3fad737 commit 39af4f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions eras/alonzo/formal-spec/txinfo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ \subsection{Type Translations}
and \ref{fig:txinfo-types-two}. Details for types that have non-identity translation
functions between ledger and Plutus types are in Figure \ref{fig:txinfo-translations}.

\textbf{Notation. }
\textbf{Notation.}
In this Section we use the notation $\type{P.PlutusType}$ for the Plutus type
$\type{PlutusType}$ (specified in the Plutus library) to distinguish it from ledger types.

Expand All @@ -27,7 +27,13 @@ \subsection{Type Translations}
In many cases this function is simply the identity function, and all
the cases in which it is not the identity will be described below.

\textbf{Untranslatable Types. }
\textbf{Sets and maps.}
Since the $\Data$ type is effectively a serialization, we need to make some arbitrary choices
for how to encode certain types that aren't inherently ordered. We encode sets as
lexicographically ordered lists, and maps in the same way by treating them first as
sets of key-value pairs.

\textbf{Untranslatable Types.}
Certain types, such as the bootstrap address type, cannot be passed to scripts, and
are therefore translated as $\Nothing$. Any type that cannot be fully translated
as a Plutus-library type is also translated to $\Nothing$.
Expand Down

0 comments on commit 39af4f5

Please sign in to comment.