-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathnotation.tex
98 lines (90 loc) · 4.31 KB
/
notation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
\section{Notation}
\label{sec:notation-shelley}
The transition system is explained in \cite{small_step_semantics}.
\begin{description}
\item[Powerset] Given a set $\type{X}$, $\powerset{\type{X}}$ is the set of all
the subsets of $\type{X}$.
\item[Sequences] Given a set $\type{X}$, $\seqof{\type{X}}$ is the set of
sequences having elements taken from $\type{X}$. The empty sequence is
denoted by $\epsilon$. Given a sequence $\Lambda$, $\Lambda; \type{x}$ is
the sequence that results from appending $\type{x} \in \type{X}$ to
$\Lambda$.
\item[Functions] $A \to B$ denotes a \textbf{total function} from $A$ to $B$.
Given a function $f$ we write $f~a$ for the application of $f$ to argument
$a$.
\item[Inverse Image] Given a function $f: A \to B$ and $b\in B$, we write
$f^{-1}~b$ for the \textbf{inverse image} of $f$ at $b$, which is defined by
$\{a \mid\ f a = b\}$.
\item[Maps and partial functions] $A \mapsto B$ denotes a \textbf{partial
function} from $A$ to $B$, which can be seen as a map (dictionary) with
keys in $A$ and values in $B$. Given a map $m \in A \mapsto B$, notation
$a \mapsto b \in m$ is equivalent to $m~ a = b$.
The $\emptyset$ symbol is also used to
represent the empty map as well.
\item[Map Operations] Figure~\ref{fig:notation:nonstandard}
describes some non-standard map operations.
\item[Relations] A relation on $A\times B$ is a subset of $A\times B$.
Both maps and functions can be thought of as relations.
A function $f:A\to B$ is a relation consisting of pairs $(a, f(a))$ such that $a\in A$.
A map $m: A\mapsto B$ is a relation consisting of pairs $(a, b)$ such that
$a\mapsto b \in m$.
Given a relation $R$ on $A\times B$, we define the inverse relation $R^{-1}$ to be
all pairs $(b, a)$ such that $(a, b)\in R$. Similarly, given a function $f:A\to B$ we
define the inverse relation $f^{-1}$ to consist of all pairs $(f(a), a)$.
Finally, given two relations $R\subseteq A\times B$ and $S\subseteq B\times C$,
we define the compostion $R\circ S$ to be all pairs $(a, c)$ such that
$(a, b)\in R$ and $(b, c)\in S$ for some $b\in B$.
\item[Option type] An option type in type $A$ is denoted as $A^? = A + \Nothing$. The
$A$ case corresponds to the case when there is a value of type $A$ and the $\Nothing$
case corresponds to the case when there is no value.
\item[:=] We abuse the \textbf{:=} symbol here to mean propositional equality. In the
style of semantics we use in this formal spec, definitional equality is not needed.
It is meant to make the spec easier to read in the sense that each time we use it,
we use a fresh variable as shorthand notation for an expression, e.g. we write
\[s := slot + \StabilityWindow\]
Then, in subsequent expressions, it is more convenient to write simply $s$.
It is not meant to shadow variables, and if it does, there is likely a problem with the
rules that must be addressed.
\end{description}
In Figure~\ref{fig:notation:nonstandard}, we specify the notation that we use in
the rest of the document.
\begin{figure}[htb]
\begin{align*}
\var{set} \restrictdom \var{map}
& = \{ k \mapsto v \mid k \mapsto v \in \var{map}, ~ k \in \var{set} \}
& \text{domain restriction}
\\
\var{set} \subtractdom \var{map}
& = \{ k \mapsto v \mid k \mapsto v \in \var{map}, ~ k \notin \var{set} \}
& \text{domain exclusion}
\\
\var{map} \restrictrange \var{set}
& = \{ k \mapsto v \mid k \mapsto v \in \var{map}, ~ v \in \var{set} \}
& \text{range restriction}
\\
\var{map} \subtractrange \var{set}
& = \{ k \mapsto v \mid k \mapsto v \in \var{map}, ~ v \notin \var{set} \}
& \text{range exclusion}
\\
A \triangle B
& = (A \setminus B) \cup (B \setminus A)
& \text{symmetric difference}
\\
M \unionoverrideRight N
& = (\dom N \subtractdom M)\cup N
& \text{union override right}
\\
M \unionoverrideLeft N
& = M \cup (\dom M \subtractdom N)
& \text{union override left}
\\
M \unionoverridePlus N
& = (M \triangle N)
\cup \{k\mapsto v_1+v_2\mid {k\mapsto v_1}\in M \land {k\mapsto v_2}\in N \}
& \text{union override plus} \\
& & \text{(for monoidal values)}\\
\end{align*}
\caption{Non-standard map operators}
\label{fig:notation:nonstandard}
\end{figure}
\clearpage