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
26a662c2
Commit
26a662c2
authored
Oct 27, 2020
by
Mickael Laurent
Browse files
trying some new rules... (wip)
parent
c638c249
Changes
1
Hide whitespace changes
Inline
Side-by-side
new_system2.tex
View file @
26a662c2
...
...
@@ -25,6 +25,8 @@ TODO: Which restrictions on types? (cannot test a precise arrow type, etc)
TODO: Should we allow expr as let definition?
TODO: Simplify pairs (only with variables) + simplify grammar accordingly (no need to distinguish a and u)
\subsection
{
Typing rules
}
\begin{mathpar}
...
...
@@ -82,7 +84,7 @@ TODO: Should we allow expr as let definition?
{
\Gamma
,(x:t')
\vdash
e:t
}
{
\Gamma\vdash
_{
t'
}
\lambda
x:s.e:
\arrow
{
t'
}
{
t
}
\Gamma\vdash
_{
t'
}
\lambda
x:s.e:
\arrow
{
(
t'
\land
s)
}
{
t
}
}
{
}
\\
...
...
@@ -399,25 +401,32 @@ TODO: Algorithmic rules
{
}
\\
\Infer
[Pair]
{
\forall
i
\in
I.
\ \Gamma\bvdash
{
e
_
1
}{
t
_
i
}
\{
(t
_
i
^
j,
\Gamma
_{
1,i
}^
j)
\}
_{
j
\in
J
_
i
}
\\
\forall
i
\in
I.
\ \Gamma\bvdash
{
e
_
2
}{
s
_
i
}
\{
(s
_
i
^
k,
\Gamma
_{
2,i
}^
k)
\}
_{
k
\in
K
_
i
}}
{
\Gamma\bvdash
{
(e
_
1,e
_
2)
}
{
\bigcup
_{
i
\in
I
}
(t
_
i,s
_
i)
}
\bigcup
_{
i
\in
I
}
\{
(
\pair
{
t
_
i
^
j
}{
s
_
i
^
k
}
,
\Gamma
_{
1,i
}^
j
\land\Gamma
_{
2,i
}^
k)
\
|
\
j
\in
J
_
i, k
\in
K
_
i
\}
}
{
\forall
i
\in
I.
\ \Gamma\bvdash
{
a
_
1
}{
t
_
i
}
\{
(t
_
i
^
j,
\Gamma
_{
1,i
}^
j)
\}
_{
j
\in
J
_
i
}
\\
\forall
i
\in
I.
\ \Gamma\bvdash
{
a
_
2
}{
s
_
i
}
\{
(s
_
i
^
k,
\Gamma
_{
2,i
}^
k)
\}
_{
k
\in
K
_
i
}}
{
\Gamma\bvdash
{
(a
_
1,a
_
2)
}
{
\bigcup
_{
i
\in
I
}
(t
_
i,s
_
i)
}
\bigcup
_{
i
\in
I
}
\{
(
\pair
{
t
_
i
^
j
}{
s
_
i
^
k
}
,
\Gamma
_{
1,i
}^
j
\land\Gamma
_{
2,i
}^
k)
\
|
\
j
\in
J
_
i, k
\in
K
_
i
\}
}
{
}
\\
\Infer
[Proj]
{
j = 1
\Rightarrow
t' =
\pair
{
t
}{
\Any
}
\\
j = 2
\Rightarrow
t' =
\pair
{
\Any
}{
t
}
\\
\Gamma\bvdash
{
e
}{
t'
}
\{
(t
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\forall
i
\in
I.
\
t
_
i
\equiv\pair
{
s
_
1
^
i
}{
s
_
2
^
i
}}
{
\Gamma\bvdash
{
\pi
_
j e
}{
t
}
\{
(s
_
j
^
i,
\Gamma
_
i)
\}
_{
i
\in
I
}}
i = 1
\Rightarrow
t' =
\pair
{
t
}{
\Any
}
\\
i = 2
\Rightarrow
t' =
\pair
{
\Any
}{
t
}
}
{
\Gamma\bvdash
{
\pi
_
i x
}{
t
}
\{
(t,
\Gamma\subst
{
x
}{
\Gamma
(x)
\land
t'
}
)
\}
}
{
}
\\
\Infer
[App]
{
\Gamma\vdash
e
_
1:
\bigvee
_{
i
\in
I
}
u
_
i
\\
{
\Gamma\vdash
x
_
1:
\bigvee
_{
i
\in
I
}
u
_
i
\\
\Gamma\vdash
x
_
2:t'
\\
\forall
i
\in
I.
\
u
_
i
\leq
\arrow
{
\neg
t
_
i
}{
s
_
i
}
\text
{
with
}
s
_
i
\land
t =
\varnothing
\\
\forall
i
\in
I.
\ \Gamma\bvdash
{
e
_
1
}{
u
_
i
}
\{
(u
_
i
^
j,
\Gamma
_{
1,i
}^
j)
\}
_{
j
\in
J
_
i
}
\\
\forall
i
\in
I.
\ \Gamma\bvdash
{
e
_
2
}{
t
_
i
}
\{
(t
_
i
^
k,
\Gamma
_{
2,i
}^
k)
\}
_{
k
\in
K
_
i
}
\\
\forall
i
\in
I.
\ \forall
j
\in
J
_
i.
\ \forall
k
\in
K
_
i.
\
u
_
i
^
j
\leq\arrow
{
t
_
i
^
k
}{
s
_
i
^{
j,k
}}}
{
\Gamma\bvdash
{
(e
_
1
\
e
_
2)
}
{
t
}
\bigcup
_{
i
\in
I
}
\{
(s
_
i
^{
j,k
}
,
\Gamma
_{
1,i
}^
j
\land\Gamma
_{
2,i
}^
k)
\
|
\
j
\in
J
_
i, k
\in
K
_
i
\}
}
%\forall i\in I.\ \Gamma\bvdash{e_1}{u_i}\{(u_i^j, \Gamma_{1,i}^j)\}_{j\in J_i}\\
\forall
i
\in
I.
\ \Gamma
_
1
^
i =
\Gamma
,(x
_
1:u
_
i)
\\
%\forall i\in I.\ \Gamma\bvdash{e_2}{t_i}\{(t_i^k, \Gamma_{2,i}^k)\}_{k\in K_i}\\
\forall
i
\in
I.
\ \Gamma
_
2
^
i =
\Gamma
,(x
_
2:t
_
i
\land
t')
\\
%\forall i\in I.\ \forall j\in J_i.\ \forall k\in K_i.\ u_i^j\leq\arrow{t_i^k}{s_i^{j,k}}
\forall
i
\in
I.
\
u
_
i
\leq\arrow
{
(t
_
i
\land
t')
}{
s
_
i
}}
{
%\Gamma\bvdash {(x_1\ x_2)} {t} \bigcup_{i\in I}\{(s_i^{j,k}, \Gamma_{1,i}^j\land\Gamma_{2,i}^k)\ |\ j\in J_i, k\in K_i\}
\Gamma\fvdash
{
(x
_
1
\
x
_
2)
}
{
t
}
\bigcup
_{
i
\in
I
}
\{
(s
_
i,
\Gamma
_{
1
}^
i
\land\Gamma
_{
2
}^
i)
\}
}
{
}
\\
\Infer
[Case]
...
...
@@ -470,5 +479,3 @@ TODO: Algorithmic rules
TODO: Is the Comp rule needed in this new setting where every application is alone in a let,
and where union-arrow app are backtyped by splitting possibilities?
TODO: rename e to the right element according to the grammar
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