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
aad136ff
Commit
aad136ff
authored
Oct 14, 2020
by
Mickael Laurent
Browse files
add typing rules
parent
f3017d62
Changes
2
Hide whitespace changes
Inline
Side-by-side
new_system.tex
View file @
aad136ff
...
...
@@ -20,6 +20,83 @@ TODO: Which restrictions on types? (cannot test a precise arrow type, etc)
\subsection
{
Typing rules
}
\begin{mathpar}
\Infer
[Const]
{
}
{
\Gamma\vdash
c:
\basic
{
c
}}
{
}
\quad
\Infer
[Var]
{
}
{
\Gamma
\vdash
x:
\Gamma
(x)
}
{
x
\in\dom\Gamma
}
% \qquad
% \Infer[Inter]
% { \Gamma \vdash e:t_1\\\Gamma \vdash e:t_2 }
% { \Gamma \vdash e: t_1 \wedge t_2 }
% { }
\qquad
\Infer
[Subs]
{
\Gamma
\vdash
e:t
\\
t
\leq
t'
}
{
\Gamma
\vdash
e: t'
}
{
}
\\
\Infer
[Efq]
{
\exists
x
\in\dom
{
\Gamma
}
.
\ \Gamma
(x)=
\Empty
}
{
\Gamma
\vdash
e: t
}
{
}
\qquad
\Infer
[Proj]
{
\Gamma
\vdash
a:
\pair
{
t
_
1
}{
t
_
2
}}
{
\Gamma
\vdash
\pi
_
i a:t
_
i
}
{
}
\qquad
\Infer
[Pair]
{
\Gamma
\vdash
a
_
1:t
_
1
\and
\Gamma
\vdash
a
_
2:t
_
2
}
{
\Gamma
\vdash
(a
_
1,a
_
2):
\pair
{
t
_
1
}
{
t
_
2
}}
{
}
\\
\Infer
[App]
{
\Gamma
\vdash
a
_
1:
\arrow
{
t
_
1
}{
t
_
2
}
\quad
\Gamma
\vdash
a
_
2: t
_
1
}
{
\Gamma
\vdash
{
a
_
1
}{
a
_
2
}
: t
_
2
}
{
}
\\
\Infer
[Case]
{
x
\in\dom\Gamma\\
\Gamma\subst
{
x
}{
\Gamma
(x)
\land
t
}
\vdash
e
_
1:t'
\\
\Gamma\subst
{
x
}{
\Gamma
(x)
\land
\neg
t
}
\vdash
e
_
2:t'
}
{
\Gamma\vdash
\tcase
{
x
}
t
{
e
_
1
}{
e
_
2
}
: t'
}
{
}
\\
\Infer
[Abs]
{
\Gamma
,(x:s)
\vdash
e
\triangleright
_
x
\dt\\
\textstyle
{
\dt
'=
\dt\cup\left\{
s
\setminus\bigcup
_{
s'
\in\dt
}
s'
\right\}
}
\\
T=
\{
(s',t')
\,
|
\,
s'
\in\dt
'
\text
{
and
}
\Gamma
,(x:s')
\vdash
e:t'
\}
}
{
\Gamma\vdash\lambda
x:s.e:
\textstyle
\bigwedge
_{
(s',t')
\in
T
}
\arrow
{
s'
}
{
t'
}
}
{
}
\\
\Infer
[Let]
{
\Gamma\vdash
p:t
_
x
\\
\Gamma
,(x:t
_
x)
\vdash
e
\triangleright
_
x
\dt\\
\textstyle
{
\dt
'=
\dt\cup\left\{
t
_
x
\setminus\bigcup
_{
u
\in\dt
}
u
\right\}
}
\\
\forall
u
\in\dt
'.
\ \Gamma\bvdash
{
p
}{
u
}
(
\Gamma
_
u
^
i)
_{
i
\in
I
_
u
}
\\
\forall
u
\in\dt
'.
\ \forall
i
\in
I
_
u.
\ \Gamma
_
u
^
i,(x:u)
\vdash
e:t
}
{
\Gamma\vdash\letexp
x p e : t
}
{
}
\end{mathpar}
TODO: Inter rule needed?
TODO: Algorithmic rules
\subsection
{
Candidates generation rules
}
\subsection
{
Forward refinement rules
}
...
...
setup.sty
View file @
aad136ff
...
...
@@ -284,3 +284,6 @@
\newcommand
{
\RRefine
}
[1]
{
\textsf
{
Refine
}_{
#1
}}
\newcommand
{
\lfp
}
[1]
{
\textsf
{
lfp
}_{
#1
}}
\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
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