Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Giuseppe Castagna
occurrence-typing
Commits
c4be3dba
Commit
c4be3dba
authored
Dec 02, 2020
by
Giuseppe Castagna
Browse files
bla
parent
2a640499
Changes
1
Hide whitespace changes
Inline
Side-by-side
new_system_beppe.tex
View file @
c4be3dba
...
...
@@ -219,6 +219,8 @@ variant with more compact derivations.
\eras
{
\tcase
{
e
}{
\tau
}{
e
_
1
}{
e
_
2
}}&
=
\tcase
{
\eras
e
}{
\tau
}{
\eras
{
e
_
1
}}{
\eras
{
e
_
2
}}
\\
\eras
{
\letexp
{
x
{
:
}
\anns
}{
e
_
1
}{
e
_
2
}}
&
=
\eras
{
e
_
2
}
\subs
{
x
}{
\eras
{
e
_
1
}}
\end{align*}
(notice the rule for the let).
\subsubsection
{
Soundness of the algorithm
}
If
$
\Gamma\vdashA
e:t
$
then
$
\Gamma\vdash
\eras
e: t
$
\subsubsection
{
Completeness of the algorithm
}
...
...
@@ -231,7 +233,7 @@ $e\reduces e'$ if and only if $\eras e \reduces \eras{e}$
\subsection
{
Normalization
}
To
every source term
$
e
$
there exist
s
many algorithmic terms
$
e'
$
such
For
every source term
$
e
$
there exist many algorithmic terms
$
e'
$
such
that
$
e
=
\eras
{
e'
}$
. The various
$
e'
$
may vary for the annotations used
and the use of let's. We want to eliminate the latter possibility of
variability and consider only terms in which the let expressions are
...
...
@@ -248,7 +250,7 @@ in a particular form defined as follows.
\end{array}
\end{equation}
Now it is possible to associate to every
\emph
{
well-typed
}
explicitly-typed term
$
e
$
a
explicitly-typed term
$
e
$
a
particular
normal form that has the same type and the same reduction
semantics. This is done by induction on the derivation of the type for
$
e
$
. Since every well-typed explicitly-typed term has a unique type
...
...
@@ -256,16 +258,18 @@ $e$. Since every well-typed explicitly-typed term has a unique type
the terms, where
$
\typof
{
e
}$
denotes the unique type derived for
$
e
$
.
\begin{align*}
\norm
{
\lambda
x
{
:
}
\anns
.e
}
&
=
\lambda
x
{
:
}
\anns
.
\norm
e
\\
\norm
{
e
_
1e
_
2
}
&
=
\letexp
{
x
_
1
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
1
}}{
\letexp
{
x
_
2
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
2
}}{
x
_
1x
_
2
}}
\\
\norm
{
(e
_
1,e
_
2)
}
&
=
\letexp
{
x
_
1
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
1
}}{
\letexp
{
x
_
2
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
2
}}{
(x
_
1,x
_
2)
}}
\\
\norm
{
\pi
_
i e
}&
=
\letexp
{
x
{
:
}
\typof
{
e
}}{
\norm
{
e
}}{
\pi
_
ix
}
&
i=1,2
\\
\norm
{
\tcase
{
e
}{
\tau
}{
e
_
1
}{
e
_
2
}}&
=
\letexp
{
x
{
:
}
\typof
{
e
}}{
\norm
{
e
}}{
\tcase
{
x
}{
\tau
}{
\norm
{
e
_
1
}}{
\norm
{
e
_
2
}}}
\\
\norm
{
e
_
1e
_
2
}
&
=
\letexp
{
x
_
1
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
1
}}{
\letexp
{
x
_
2
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
2
}}{
x
_
1x
_
2
}}
&
x
_
1,x
_
2
\text
{
fresh
}
\\
\norm
{
(e
_
1,e
_
2)
}
&
=
\letexp
{
x
_
1
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
1
}}{
\letexp
{
x
_
2
{
:
}
\typof
{
e
_
1
}}{
\norm
{
e
_
2
}}{
(x
_
1,x
_
2)
}}
&
x
_
1,x
_
2
\text
{
fresh
}
\\
\norm
{
\pi
_
i e
}&
=
\letexp
{
x
{
:
}
\typof
{
e
}}{
\norm
{
e
}}{
\pi
_
ix
}
\qquad
x
\text
{
fresh
}&
i=1,2
\\
\norm
{
\tcase
{
e
}{
\tau
}{
e
_
1
}{
e
_
2
}}&
=
\letexp
{
x
{
:
}
\typof
{
e
}}{
\norm
{
e
}}{
\tcase
{
x
}{
\tau
}{
\norm
{
e
_
1
}}{
\norm
{
e
_
2
}}}&
x
\text
{
fresh
}
\\
\norm
{
e
}
&
= e
&
\text
{
otherwise
}
\end{align*}
The case apply only when the various
$
e
$
$
e
_
i
$
are not already
The case
s
apply only when the various
$
e
$
$
e
_
i
$
are not already
variables (all the other cases are long to write).
Notice that
$
\eras
e
=
\eras
{
\norm
e
}$
.
Notice that
$
\eras
e
=
\eras
{
\norm
e
}$
(and that they have the same type)
.
Therefore what we have is that the soundness but, above all, the
completeness of the algorithm can be stated for normal forms:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment