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
6f988c52
Commit
6f988c52
authored
Oct 14, 2020
by
Mickael Laurent
Browse files
candidate generation rules
parent
aad136ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
new_system.tex
View file @
6f988c52
...
...
@@ -99,6 +99,80 @@ TODO: Algorithmic rules
\subsection
{
Candidates generation rules
}
\begin{mathpar}
\Infer
[Var]
{
}
{
\Gamma
\vdash
y
\triangleright
_
x
\varnothing
}
{}
\hfill
\Infer
[Const]
{
}
{
\Gamma
\vdash
c
\triangleright
_
x
\varnothing
}
{}
\hfill
\Infer
[Abs]
{
\Gamma
,(y:s)
\vdash
e
\triangleright
_
x
\dt
}
{
\Gamma\vdash\lambda
y:s.
\
e
\triangleright
_
x
\dt
}
{
x
\neq
y
}
\vspace
{
-2.3mm
}
\\
\Infer
[Pair]
{
\Gamma
\vdash
a
_
1
\triangleright
_
x
\dt
_
1
\and
\Gamma
\vdash
a
_
2
\triangleright
_
x
\dt
_
2
}
{
\Gamma
\vdash
(a
_
1,a
_
2)
\triangleright
_
x
\dt
_
1
\cup\dt
_
2
}
{}
\hfill
\Infer
[Proj]
{
\Gamma
\vdash
a
\triangleright
_
x
\dt
}
{
\Gamma
\vdash
\pi
_
i a
\triangleright
_
x
\dt
}
{}
\vspace
{
-2.3mm
}
\\
\Infer
[Case]
{
\Gamma\subst
{
y
}{
\Gamma
(y)
\land
t
}
\vdash
e
_
1
\triangleright
_
x
\dt
_
1
\\
\Gamma\subst
{
y
}{
\Gamma
(y)
\land
\neg
t
}
\vdash
e
_
2
\triangleright
_
x
\dt
_
2
}
{
\Gamma\vdash
\tcase
{
y
}{
t
}{
e
_
1
}{
e
_
2
}
\triangleright
_
x
\dt
_
1
\cup\dt
_
2
\cup
\left\{
\begin{array}
{
l
}
\{\Gamma
(x)
\land
t,
\Gamma
(x)
\land\neg
t
\}
\text
{
if
}
y=x
\arcr
\varnothing\text
{
otherwise
}
\end{array}
\right
.
}
{}
\vspace
{
-2.3mm
}
\\
\Infer
[App]
{
\Gamma
\vdash
a
_
1 :
\textstyle
{
\bigvee
\bigwedge
_{
i
\in
I
}
s
_
i
\to
t
_
i
}
\\
\Gamma
\vdash
a
_
1
\triangleright
_
x
\dt
_
1
\\
\forall
i
\in
I.
\ \Gamma\fvdash
{
a
_
2
}{
s
_
i
}
\{\Gamma
_
i
^
j
\}
_{
j
\in
J
_
i
}
}
{
\Gamma
\vdash
a
_
1 a
_
2
\triangleright
_
x
\dt
_
1
\cup\textstyle
{
\bigcup
_{
i
\in
I
}
\bigcup
_{
j
\in
J
_
i
}
\{\Gamma
_
i
^
j(x)
\}
}
}
{}
\vspace
{
-2.3mm
}
\\
\Infer
[Let]
{
\Gamma
\vdash
p: t
\\
\Gamma
, (y:t)
\vdash
e
\triangleright
_
x
\dt
_
x
\\
\Gamma
, (y:t)
\vdash
e
\triangleright
_
y
\dt
_
y
\\
\forall
u
\in
\dt
_
y.
\ \Gamma\fvdash
{
p
}{
u
}
\{\Gamma
_
u
^
i
\}
_{
i
\in
I
_
u
}
}
{
\Gamma
\vdash\letexp
{
y
}{
p
}{
e
}
\triangleright
_
x
\dt
_
x
\cup\textstyle
{
\bigcup
_{
u
\in
\dt
_
y
}
\bigcup
_{
i
\in
I
_
u
}
\{\Gamma
_
u
^
i(x)
\}
}}
{}
\end{mathpar}
TODO: example: application
$
x y
$
with
$
x
$
an union of arrow. Candidates
of a variable with a function type should be all the union of arrows of its type?
\\
More generally, a variable that can be written only has an union should be splitted
along this union. Otherwise,
$
\letexp
{
x
}{
\cdots
}{
x
}$
will never be splitted. Or better:
there should be a special split that means "all splits" (it will also be useful when
we will add polymorphism).
TODO: test type system with
$
\lambda
x:
\pair
{
\Int
}{
\Int
}
\lor\pair
{
\Bool
}{
\Bool
}
.
(
\pi
_
1
x,
\pi
_
2
x
)
$
\subsection
{
Forward refinement rules
}
\subsection
{
Backward refinement rules
}
setup.sty
View file @
6f988c52
...
...
@@ -286,4 +286,8 @@
\newcommand
{
\RRefineStep
}
[1]
{
\textsf
{
RefineStep
}_{
#1
}}
\newcommand
{
\dt
}
[0]
{
\mathbb
{
T
}}
\newcommand
{
\fvdash
}
[2]
{
\vdash
^{
\texttt
{
Env
}
\rightarrow
}_{
#1,#2
}}
\newcommand
{
\bvdash
}
[2]
{
\vdash
^{
\texttt
{
Env
}
\leftarrow
}_{
#1,#2
}}
\ No newline at end of file
\newcommand
{
\bvdash
}
[2]
{
\vdash
^{
\texttt
{
Env
}
\leftarrow
}_{
#1,#2
}}
\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