Skip to content

Update types.tex #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions WhileyLanguageSpecification/src/types.tex
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ \section{Tuples}
\paragraph{Example.} The following example illustrates several uses of tuples:

\begin{lstlisting}
function swap(int x, int y) => (int,int):
return y,x
(int, int) x = (4, 5)
function swap((int,int) x) => (int,int):
int a, int b = x // tuple destructuring assignment
return b, a
\end{lstlisting}
This function accepts two integer parameters, and returns a tuple type containing two integers. The function simple reverses the order that the values occur in the tuple passed as a parameter.

Expand Down Expand Up @@ -729,4 +731,4 @@ \subsection{Subtyping}
\begin{definition}[Subtype Completeness] A subtype operator, ${\tt\le}$, is {\em complete} if, for any types ${\tt T_1}$ and ${\tt T_2}$, it holds that ${\tt \llbracket T_1\rrbracket\subseteq\llbracket T_2\rrbracket\Longrightarrow T_1\le T_2}$.
\end{definition}

\noindent A subtype operator which exhibits both of these properties is said to be {\em sound} and {\em complete}.
\noindent A subtype operator which exhibits both of these properties is said to be {\em sound} and {\em complete}.