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
ddb415d7
Commit
ddb415d7
authored
Feb 25, 2020
by
Mickael Laurent
Browse files
proofs for the system without type schemes
parent
d81024c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
proofs.tex
View file @
ddb415d7
...
...
@@ -1407,7 +1407,7 @@ theorem for the algorithmic type system presented in \ref{sec:algorules}.
A derivation of the declarative type system is said positive iff it does not contain any rule
\Rule
{
Abs-
}
.
\end{definition}
\begin{theorem}
[Completeness for positive derivations]
\begin{theorem}
[Completeness for positive derivations]
\label
{
completenessAtsPositive
}
For every
$
\Gamma
$
,
$
e
$
,
$
t
$
such that we have a positive derivation of
$
\Gamma
\vdash
e:t
$
,
there exists a global parameter
$
n
_
o
$
with which
$
\tsrep
{
\tyof
e
\Gamma
}
\leq
t
$
.
...
...
@@ -1710,7 +1710,7 @@ theorem for the algorithmic type system presented in \ref{sec:algorules}.
\end{theorem}
\begin{proof}
Trivial by using the
previous lemma and the
theorem
\ref
{
soundnessAts
}
.
Trivial by using the theorem
\ref
{
soundnessAts
}
and the previous lemma
.
\end{proof}
\subsubsection
{
Completeness
}
...
...
@@ -1723,6 +1723,32 @@ theorem for the algorithmic type system presented in \ref{sec:algorules}.
\textbf
{
Positive expression
}
&
e
_
+
&
::
=
&
c
\alt
x
\alt
e
_
+
e
_
+
\alt\lambda
^{
t
^
\lambda
_
+
}
x.e
_
+
\alt
\pi
_
j e
_
+
\alt
(
e
_
+
,e
_
+)
\alt\tcase
{
e
_
+
}{
t
_{
s
}}{
e
_
+
}{
e
_
+
}
\end
{
array
}
\]
\begin{lemma}
If we restrict the language to positive expressions
$
e
_
+
$
,
then we have the following property:
$
\forall
\Gamma
, e
_
+
,
\ts
.
\ \Gamma
\vdashAts
e
_
+
:
\ts
\Rightarrow
\Gamma
\vdashA
e
_
+
:
\tsrep
{
\ts
}$
\end{lemma}
\begin{proof}
We can prove it by induction over the structure of
$
e
_
+
$
.
The main idea of this proof is that, as
$
e
_
+
$
is a positive expression, the rule
\Rule
{
Abs-
}
is not needed anymore
because the negative part of functional types (i.e. the
$
N
_
i
$
part of their DNF) become useless:
\begin{itemize}
\item
When typing an application
$
e
_
1
e
_
2
$
, the negative part of the type of
$
e
_
1
$
is ignored by the operator
$
\apply
{}
{}$
.
\item
Moreover, as there is no negated arrows in the domain of lambda-abstractions,
the negative arrows of the type of
$
e
_
2
$
can also be ignored.
\item
Similarly, negative arrows can be ignored when refining an application (
$
\worra
{}
{}$
also ignore the negative part
of the type of
$
e
_
1
$
).
\item
Finally, as the only functional type that we can test is
$
\arrow
\Empty
\Any
$
, a functional type
cannot be refined to
$
\Empty
$
due to its negative part, and thus we can ignore its negative part
(it makes no difference relatively to the rule
\Rule
{
Efq
}
).
\end{itemize}
\end{proof}
\begin{theorem}
[Completeness of the algorithmic type system for positive expressions]
\label
{
completenessA
}
If we restrict the language to positive expressions
$
e
_
+
$
,
...
...
@@ -1732,21 +1758,6 @@ theorem for the algorithmic type system presented in \ref{sec:algorules}.
$
\forall
\Gamma
, e
_
+
, t.
\ \Gamma
\vdash
e
_
+
:t
\Rightarrow
\exists
t'.
\ \Gamma
\vdashA
e
_
+
: t'
$
\end{theorem}
\begin{proof}
TODO: ADAPT IT. INDUCTION HYPOTHESIS MUST BE STRONGER.
With such restrictions, the rule
\Rule
{
Abs-
}
is not needed anymore
because the negative part of functional types (i.e. the
$
N
_
i
$
part of their DNF) is useless.
Indeed, when typing an application
$
e
_
1
e
_
2
$
, the negative part of the type of
$
e
_
1
$
is ignored by the operator
$
\apply
{}
{}$
.
Moreover, as there is no negated arrows in the domain of lambda-abstractions,
the negative arrows of the type of
$
e
_
2
$
can also be ignored.
Similarly, negative arrows can be ignored when refining an application (
$
\worra
{}
{}$
also ignore the negative part
of the type of
$
e
_
1
$
).
Finally, as the only functional type that we can test is
$
\arrow
\Empty
\Any
$
, a functional type
cannot be refined to
$
\Empty
$
due to its negative part, and thus we can ignore its negative part
(it makes no difference relatively to the rule
\Rule
{
Efq
}
).
\begin{proof}
Trivial by using the theorem
\ref
{
completenessAtsPositive
}
and the previous lemma.
\end{proof}
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