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
f9cfccdb
Commit
f9cfccdb
authored
Nov 11, 2020
by
Mickael Laurent
Browse files
algorithmic type system in progress
parent
399fad4d
Changes
2
Show whitespace changes
Inline
Side-by-side
new_system3.tex
View file @
f9cfccdb
...
...
@@ -110,3 +110,126 @@ TODO: Inter rule needed?
\newpage
\subsection
{
Algorithmic type system
}
\begin{mathpar}
\Infer
[Const]
{
}
{
\Gamma\vdash
_
e c:
\{
(
\basic
{
c
}
,
\Gamma
)
\}
}
{
}
\quad
\Infer
[Var]
{
}
{
\Gamma
\vdash
_
e x:
\{
(
\Gamma
(x),
\Gamma
)
\}
}
{
x
\in\dom\Gamma
}
\\
\Infer
[Backtrack]
{
\Gamma
\vdash
_
e e':
\bt\{
t
_
i,
\Gamma
_
i
\}
_{
i
\in
I
}}
{
\Gamma
\vdash
_
e e :
\{
t
_
i,
\Gamma
_
i
\}
_{
i
\in
I
}}
{
}
\qquad
\Infer
[Proj]
{
\Gamma
(x)
\equiv\pair
{
t
_
1
}{
t
_
2
}}
{
\Gamma
\vdash
_
e
\pi
_
i x:
\{
t
_
i,
\Gamma\}
}
{
}
\\
\Infer
[Proj*]
{
\Gamma
(x)
\equiv\textstyle\bigvee
_{
i
\in
I
}
\pair
{
t
_
i
}{
s
_
i
}
\\
\forall
i
\in
I.
\ \Gamma\subst
{
x
}{
\pair
{
t
_
i
}{
s
_
i
}}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
_
i
}
}
{
\Gamma
\vdash
_
e
\pi
_
i x:
\bt\{
(u
_
j,
\Gamma
_
j)
\,\alt\,
i
\in
I,
\
j
\in
J
_
i
\}
}
{
}
\\
\Infer
[ProjDom]
{
\Gamma
(x) = t
\\
\Gamma\subst
{
x
}{
t
\land
(
\pair
{
\Any
}{
\Any
}
)
}
\vdash
_
e e:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\Gamma\subst
{
x
}{
t
\land\neg
(
\pair
{
\Any
}{
\Any
}
)
}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}
}
{
\Gamma
\vdash
_
e
\pi
_
i x:
\bt\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\cup\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}}
{
}
\\
\Infer
[Pair]
{
}
{
\Gamma
\vdash
_
e (x
_
1,x
_
2):
\{
(
\pair
{
\Gamma
(x
_
1)
}
{
\Gamma
(x
_
2)
}
,
\Gamma
)
\}
}
{
}
\\
\Infer
[App]
{
\Gamma
(x
_
1)
\equiv
\textstyle\bigwedge
_{
i
\in
I
}
\arrow
{
s
_
i
}{
t
_
i
}
\\
\Gamma
(x
_
2)=s
\\
\exists
i
\in
I.
\
s
\leq
s
_
i
}
{
\Gamma
\vdash
_
e
{
x
_
1
}{
x
_
2
}
:
\{
((
\textstyle\bigwedge
_{
i
\in
I
}
\arrow
{
s
_
i
}{
t
_
i
}
)
\circ
s,
\Gamma
)
\}
}
{
}
\\
\Infer
[AppR*]
{
\Gamma
(x
_
1)
\equiv
\textstyle\bigwedge
_{
i
\in
I
}
\arrow
{
s
_
i
}{
t
_
i
}
\\
\Gamma
(x
_
2)=s
\\
s
\leq
\textstyle\bigvee
_{
i
\in
I
}
s
_
i
\\
\forall
i
\in
I.
\ \Gamma\subst
{
x
_
2
}{
s
\land
s
_
i
}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
_
i
}
}
{
\Gamma
\vdash
_
e
{
x
_
1
}{
x
_
2
}
:
\bt\{
(u
_
j,
\Gamma
_
j)
\,\alt\,
i
\in
I,
\
j
\in
J
_
i
\}
}
{
}
\\
\Infer
[AppRDom]
{
\Gamma
(x
_
1)
\equiv
\textstyle\bigwedge
_{
i
\in
I
}
\arrow
{
s
_
i
}{
t
_
i
}
\\
\Gamma
(x
_
2)=s
\\
s
_
\circ
=
\textstyle\bigvee
_{
i
\in
I
}
s
_
i
\\
\Gamma\subst
{
x
_
2
}{
s
\land
s
_
\circ
}
\vdash
_
e e:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\Gamma\subst
{
x
_
2
}{
s
\land
\neg
s
_
\circ
}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}
}
{
\Gamma
\vdash
_
e
{
x
_
1
}{
x
_
2
}
:
\bt\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\cup\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}
}
{
}
\\
\Infer
[AppL*]
{
\Gamma
(x
_
1)
\equiv\textstyle\bigvee
_{
i
\in
I
}
\arrow
{
s
_
i
}{
t
_
i
}
\\
\forall
i
\in
I.
\ \Gamma\subst
{
x
_
1
}{
\arrow
{
s
_
i
}{
t
_
i
}}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
_
i
}
}
{
\Gamma
\vdash
_
e
{
x
_
1
}{
x
_
2
}
:
\bt\{
(u
_
j,
\Gamma
_
j)
\,\alt\,
i
\in
I,
\
j
\in
J
_
i
\}
}
{
}
\\
\Infer
[AppLDom]
{
\Gamma
(x
_
1) = t
\\
\Gamma\subst
{
x
_
1
}{
t
\land
(
\arrow
{
\Empty
}{
\Any
}
)
}
\vdash
_
e e:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\Gamma\subst
{
x
_
1
}{
t
\land\neg
(
\arrow
{
\Empty
}{
\Any
}
)
}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}
}
{
\Gamma
\vdash
_
e
{
x
_
1
}{
x
_
2
}
:
\bt\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\cup\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}}
{
}
\\
\Infer
[CaseThen]
{
\Gamma
(x)=t
_
\circ\\
t
_
\circ\leq
t
\\
\Gamma
\vdash
_
e e
_
1:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}}
{
\Gamma\vdash
\tcase
{
x
}
t
{
e
_
1
}{
e
_
2
}
:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}}
{
}
\\
\Infer
[CaseElse]
{
\Gamma
(x)=t
_
\circ\\
t
_
\circ\leq
\neg
t
\\
\Gamma
\vdash
_
e e
_
2:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}}
{
\Gamma\vdash
\tcase
{
x
}
t
{
e
_
1
}{
e
_
2
}
:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}}
{
}
\\
\Infer
[Case*]
{
\Gamma
(x) = t
_
\circ\\
\Gamma\subst
{
x
}{
t
_
\circ\land
t
}
\vdash
_
e e:
\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\Gamma\subst
{
x
}{
t
_
\circ\land\neg
t
}
\vdash
_
e e:
\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}
}
{
\Gamma\vdash
\tcase
{
x
}
t
{
e
_
1
}{
e
_
2
}
:
\bt\{
(u
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\cup\{
(u
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
}}
{
}
% \\
% \Infer[Abs]
% {\Gamma,(x:s)\vdash e:t}
% {\Gamma\vdash\lambda x:s.e: t}
% { }
% \qquad
% \Infer[Let]
% {\Gamma\vdash a:t_\circ\\
% \Gamma,(x:t_\circ)\vdash e:t}
% {
% \Gamma\vdash\letexp x a e : t
% }
% { }
\end{mathpar}
setup.sty
View file @
f9cfccdb
...
...
@@ -293,6 +293,8 @@
\newcommand
{
\ubvdash
}
[3]
{
\vdash
^{{
#1
}
,
\texttt
{
Env
}
\leftarrow
}_{
#2,#3
}}
\newcommand
{
\cvdash
}
[0]
{
\vdash
^{
\texttt
{
Choices
}}}
\newcommand
{
\bt
}
[0]
{
\texttt
{
Backtrack
}}
\makeatletter
% allow us to mention @-commands
\def\arcr
{
\@
arraycr
}
\makeatother
\ No newline at end of file
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