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
8b106db5
Commit
8b106db5
authored
Nov 16, 2020
by
Mickael Laurent
Browse files
simplify let rule
parent
1632c038
Changes
1
Hide whitespace changes
Inline
Side-by-side
new_system3.tex
View file @
8b106db5
...
...
@@ -247,20 +247,35 @@ rules, because one branch is already unreachable and retyping only occurs with s
% {\Gamma\vdash\lambda x:s.e: t}
% { }
% \\
\Infer
[Let
Refine
]
\Infer
[Let
First
]
{
x
\in\dom\Gamma\Rightarrow
t=
\Gamma
(x)
\\
x
\not\in\dom\Gamma\Rightarrow
t=
\Any\\
x
\in\dom\Gamma
'
\Rightarrow
t'=
\Gamma
'(x)
\\
x
\not\in\dom\Gamma
'
\Rightarrow
t'=
\Any\\
\Gamma\avdash\Gammap\ct
a:
\{
(t
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\forall
i
\in
I.
\
t
_
i
\land
t
\leq
t'
\Rightarrow
\Gamma
_
i
\subst
{
x
}{
t
_
i
\land
t
}
\avdash
{
\Gammap\setminus\{
x
\}
}{
\ct
[\letexp x a {[]
}
]
}
e : S
_
i
\\
\forall
i
\in
I.
\
t
_
i
\land
t
\not\leq
t'
\Rightarrow\Gamma
_
i
\land\Gamma
'
\bvdash
{
a
}{
t'
\land
t
\land
t
_
i
}
\{
(t
_
j,
\Gamma
_
j)
\}
_{
j
\in
J
_
i
}
\\
\forall
i
\in
I.
\ \forall
j
\in
J
_
i.
\ \Gamma
_
i
\subst
{
x
}{
t
_
j
}
\avdash
{
\Gammap
_
j
\setminus\{
x
\}
}{
[]
}
\ct
[\letexp x a e]
: S
_
j
}
\forall
i
\in
I.
\ \Gamma
_
i,(x:t
_
i)
\avdash\Gammap\ct\letexp
x a e : S
_
i
}
{
\Gamma\avdash\Gammap\ct\letexp
x a e :
\textstyle\bigcup
S
_
i
\cup
\textstyle\bigcup\bigcup
S
_
j
\Gamma\avdash\Gammap\ct\letexp
x a e :
\textstyle\bigcup
_{
i
\in
I
}
S
_
i
}
{
}
{
x
\not\in\dom\Gamma
}
\\
\Infer
[LetNoRefine]
{
\Gamma\avdash
{
\Gammap\setminus\{
x
\}
}{
\ct
[\letexp x a {[]
}
]
}
e : S
}
{
\Gamma\avdash\Gammap\ct\letexp
x a e : S
}
{
x
\in\dom\Gamma
\text
{
and
}
(x
\not\in\dom\Gammap
\text
{
or
}
\Gamma
(x)
\leq\Gammap
(x))
}
\\
\Infer
[LetRefine]
{
\Gamma\land\Gammap\bvdash
{
a
}{
\Gamma
(x)
\land\Gammap
(x)
}
\{
(t
_
i,
\Gamma
_
i)
\}
_{
i
\in
I
}
\\
\forall
i
\in
I.
\ \Gamma\subst
{
x
}{
t
_
i
}
\avdash
{
\Gamma
_
i
\setminus\{
x
\}
}{
[]
}
\ct
[\letexp x a e]
: S
_
i
}
{
\Gamma\avdash\Gammap\ct\letexp
x a e :
\textstyle\bigcup
_{
i
\in
I
}
S
_
i
}
{
x
\in\dom\Gamma
\text
{
and
}
x
\in\dom\Gammap
\text
{
and
}
\Gamma
(x)
\not\leq
\Gammap
(x)
}
\end{mathpar}
TODO: Check let rule and
divide it into simpler rules
TODO: Check let rule and
optimize
$
\Gammap
$
(it should be minimal but it isn't as output of
$
\bvdash
{
t
}{
a
}$
)
TODO: Abs rules
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