@@ -97,7 +97,7 @@ \section{Mathematical Definitions and Notations\label{sec:Mathematical Definitio
9797\hypertarget {constant-equalsign}{}
9898\RenderType {Sign}
9999
100- The function $ \sign : \overname {\Q }{\vq } \rightarrow \overname {\Sign }{\vs }$ returns the sign of $ \vq $ :
100+ The function $ \sign ( \overname {\Q }{\vq }) \rightarrow \overname {\Sign }{\vs }$ returns the sign of $ \vq $ :
101101\[
102102\sign (\vq ) \triangleq \begin {cases }
103103 \positivesign & \text {if }\vq > 0\\
@@ -145,10 +145,17 @@ \section{Mathematical Definitions and Notations\label{sec:Mathematical Definitio
145145and the reflexive-transitive closure of $ E$ by $ \graphtransitivereflexive {E}$ .
146146\end {definition }
147147
148+ \paragraph {Function and Relation Notations }
149+ We use a non-standard notation for functions and relations, which is more succinct.
150+ Specifically, we write $ f(T_1 ,\ldots ,T_n) \rightarrow R$ to denote a function from
151+ the argument types $ T_1 ,\ldots ,T_n$ to the result type $ R$ .
152+ %
153+ We write $ f(T_1 ,\ldots ,T_n) \aslrel {} R$ to denote a relation between the argument types $ T_1 ,\ldots ,T_n$ and the result type $ R$ .
154+
148155\hypertarget {def-partialfunc}{}
149156\hypertarget {def-dom}{}
150157\begin {definition }[Partial Function\label {def:PartialFunction }]
151- A \emph {partial function }, denoted $ f : A \partialto B$ , is a function from a \underline {subset} of $ A$ to $ B$ .
158+ A \emph {partial function }, denoted $ f(A) \partialto B$ , is a function from a \underline {subset} of $ A$ to $ B$ .
152159 The \emph {domain } of a partial function $ f$ , denoted $ \dom (f)$ , is the subset of $ A$ for which it is defined.
153160 We use expressions like $ x \in \dom (f)$ and $ x \not \in \dom (f)$ to check whether $ x$ is in the domain of $ f$
154161 or not in the domain of $ f$ , respectively.
@@ -191,7 +198,7 @@ \section{Mathematical Definitions and Notations\label{sec:Mathematical Definitio
191198
192199\begin {definition }[Function Restriction]
193200\hypertarget {def-restrictfunc}{}
194- The \emph {restriction } of a function $ f : X \rightarrow Y$ to a subset of its domain
201+ The \emph {restriction } of a function $ f(X) \rightarrow Y$ to a subset of its domain
195202$ A \subseteq \dom (f)$ , denoted as $ \restrictfunc {f}{A}$ , is defined
196203in terms of the set of input-output pairs:
197204\[
@@ -206,7 +213,7 @@ \section{Mathematical Definitions and Notations\label{sec:Mathematical Definitio
206213the expressions corresponding to the arguments.
207214For example,
208215\[
209- \sign : \overname {\Q }{\vq } \rightarrow \overname {\Sign }{\vs }
216+ \sign ( \overname {\Q }{\vq }) \rightarrow \overname {\Sign }{\vs }
210217\]
211218defines a function type and lets us refer to its argument as $ \vq $
212219and to the result as $ \vs $ .
@@ -282,7 +289,7 @@ \subsection{Lists}
282289
283290\hypertarget {relation-concat}{}
284291\begin {definition }[List Concatenation]
285- The parametric function $ \concat : \KleeneStar {T} \cartimes \ KleeneStar {T} \rightarrow \KleeneStar {T}$ concatenates two lists:
292+ The parametric function $ \concat ( \KleeneStar {T}, \ KleeneStar {T}) \rightarrow \KleeneStar {T}$ concatenates two lists:
286293\[
287294 L \concat {} M \triangleq
288295 \begin {cases }
@@ -318,7 +325,7 @@ \subsection{Lists}
318325\begin {definition }[Equating List Lengths]
319326The parametric function
320327\[
321- \equallength : \overname {\KleeneStar {A}}{a} \cartimes \ overname {\KleeneStar {B}}{b} \rightarrow \Bool
328+ \equallength ( \overname {\KleeneStar {A}}{a}, \ overname {\KleeneStar {B}}{b}) \rightarrow \Bool
322329\]
323330compares the length of two lists:
324331\[
@@ -328,7 +335,7 @@ \subsection{Lists}
328335
329336\hypertarget {def-listprefix}{}
330337\begin {definition }[List Prefix]
331- The parametric function $ \listprefixname : \overname {\KleeneStar {T}}{\vlone } \cartimes \ overname {\KleeneStar {T}}{\vltwo } \rightarrow \Bool $ checks whether
338+ The parametric function $ \listprefixname ( \overname {\KleeneStar {T}}{\vlone }, \ overname {\KleeneStar {T}}{\vltwo }) \rightarrow \Bool $ checks whether
332339the list $ \vlone $ is a \emph {prefix } of the list $ \vltwo $ :
333340\[
334341\listprefixname (\vlone , \vltwo ) \triangleq \exists \vlthree .\ \vltwo = \vlone \concat \vlthree \enspace .
@@ -337,7 +344,7 @@ \subsection{Lists}
337344
338345\hypertarget {def-listrange}{}
339346\begin {definition }[Indices of a List]
340- The parametric function $ \listrange : \KleeneStar {T} \rightarrow \KleeneStar {\N }$ returns the ($ 1 $ -based) list of indices for a given list:
347+ The parametric function $ \listrange ( \KleeneStar {T}) \rightarrow \KleeneStar {\N }$ returns the ($ 1 $ -based) list of indices for a given list:
341348\[
342349 \begin {array }{rcl}
343350 \listrange (\emptylist ) &\triangleq & \emptylist \\
@@ -366,7 +373,7 @@ \subsection{Lists}
366373\begin {definition }[Extracting the First Components from a List of Pairs]
367374The\\ parametric function
368375\[
369- \listfstname : \KleeneStar {(T_1 \cartimes T_2)} \rightarrow \KleeneStar {T_1}
376+ \listfstname ( \KleeneStar {(T_1 \cartimes T_2)}) \rightarrow \KleeneStar {T_1}
370377\]
371378transforms a list of pairs into a lists of elements containing the first components of each pair:
372379\[
@@ -381,7 +388,7 @@ \subsection{Lists}
381388\begin {definition }[Unzipping a List of Pairs]
382389The parametric function
383390\[
384- \unziplist : \KleeneStar {(T_1 \cartimes T_2)} \rightarrow (\KleeneStar {T_1} \cartimes \KleeneStar {T_2})
391+ \unziplist ( \KleeneStar {(T_1 \cartimes T_2)}) \rightarrow (\KleeneStar {T_1} \cartimes \KleeneStar {T_2})
385392\]
386393transforms a list of pairs into the corresponding pair of lists:
387394\[
@@ -398,7 +405,7 @@ \subsection{Lists}
398405\begin {definition }[Unzipping a List of Triples]
399406The parametric function
400407\[
401- \unziplistthree : \KleeneStar {(T_1 \cartimes T_2 \cartimes T_3)} \rightarrow (\KleeneStar {T_1} \cartimes \KleeneStar {T_2} \cartimes \KleeneStar {T_3})
408+ \unziplistthree ( \KleeneStar {(T_1 \cartimes T_2 \cartimes T_3)}) \rightarrow (\KleeneStar {T_1} \cartimes \KleeneStar {T_2} \cartimes \KleeneStar {T_3})
402409\]
403410transforms a list of triples into the corresponding triple of lists:
404411\[
@@ -415,7 +422,7 @@ \subsection{Lists}
415422\texthypertarget {relation-listcross}
416423The parametric function
417424\[
418- \listcrossop : \KleeneStar {T_1} \cartimes \ KleeneStar {T_2} \aslto \KleeneStar {(T_1 \cartimes T_2)}
425+ \listcrossop ( \KleeneStar {T_1}, \ KleeneStar {T_2}) \rightarrow \KleeneStar {(T_1 \cartimes T_2)}
419426\]
420427computes the cross-product of two lists:
421428\[
@@ -441,7 +448,7 @@ \subsection{Lists}
441448The parametric function
442449\hypertarget {def-unionlist}{}
443450\[
444- \unionlist : \KleeneStar {\pow {T}} \rightarrow \pow {T}
451+ \unionlist ( \KleeneStar {\pow {T}}) \rightarrow \pow {T}
445452\]
446453takes the union of a list of sets:
447454\[
@@ -453,7 +460,7 @@ \subsection{Lists}
453460The parametric function
454461\hypertarget {def-intersectionlist}{}
455462\[
456- \intersectionlist : \KleeneStar {\pow {T}} \rightarrow \pow {T}
463+ \intersectionlist ( \KleeneStar {\pow {T}}) \rightarrow \pow {T}
457464\]
458465takes the intersection of a list of sets:
459466\[
@@ -466,13 +473,13 @@ \subsection{Lists}
466473
467474\subsection {Strings }
468475\hypertarget {relation-stringconcat}{}
469- The function $ \concatstrings : \Strings \cartimes \ Strings \rightarrow \Strings $
476+ The function $ \concatstrings ( \Strings , \ Strings) \rightarrow \Strings $
470477concatenates two strings. %
471478We slightly abuse notation by using the same symbol $ \concat $ for concatenating
472479a string $ S$ and an integer $ n$ , separated by a hyphen, for example, \verb |return-42 |.
473480
474481\hypertarget {relation-stringofint}{}
475- The function $ \stringofintname : \Z \rightarrow \Strings $ converts an integer number
482+ The function $ \stringofintname ( \Z ) \rightarrow \Strings $ converts an integer number
476483to the corresponding decimal string.
477484
478485\subsection {OCaml-style Notations }
@@ -1106,10 +1113,10 @@ \subsection{Judgments Over Optional Data Types}
11061113Optional data types are prevalent in the AST.
11071114To facilitate transition judgments over optional data types,
11081115we introduce the following parametric relation,
1109- which accepts a one-argument relation (or function) $ f : A \aslrel B$
1116+ which accepts a one-argument relation (or function) $ f(A) \aslrel B$
11101117and applies it to an optional value:
11111118\[
1112- \mapopt {\cdot } : \overname {\Option {A}}{\vvopt } \aslrel \overname {\Option {B}}{\vvoptnew }
1119+ \mapopt {\cdot }( \overname {\Option {A}}{\vvopt }) \aslrel \overname {\Option {B}}{\vvoptnew }
11131120\]
11141121
11151122\ProseParagraph
0 commit comments