Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sgdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gradual-typing
sgdt
Commits
46c88052
Commit
46c88052
authored
1 year ago
by
tingtind
Browse files
Options
Downloads
Patches
Plain Diff
merge two cases(casenat/arr) into one casedyn
parent
92b4760c
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
paper-new/defs.tex
+1
-0
1 addition, 0 deletions
paper-new/defs.tex
paper-new/terms.tex
+15
-31
15 additions, 31 deletions
paper-new/terms.tex
with
16 additions
and
31 deletions
paper-new/defs.tex
+
1
−
0
View file @
46c88052
...
...
@@ -43,6 +43,7 @@
\newcommand
{
\injnat
}
[1]
{
\textsf
{
Inj
}_
\text
{
nat
}
(
{
#1
}
)
}
\newcommand
{
\casenat
}
[4]
{
\text
{
Case
}_
\text
{
nat
}
(
{
#1
}
)
\{
\text
{
no
}
\to
{
#2
}
\alt
\text
{
nat
}
(
{
#3
}
)
\to
{
#4
}
\}
}
\newcommand
{
\casearr
}
[4]
{
\text
{
Case
}_
\ra
(
{
#1
}
)
\{
\text
{
no
}
\to
{
#2
}
\alt
\text
{
fun
}
(
{
#3
}
)
\to
{
#4
}
\}
}
\newcommand
{
\casedyn
}
[5]
{
\text
{
Case
}_
\Dyn
(
{
#1
}
)
\{
\text
{
nat
}
(
{
#2
}
)
\to
{
#3
}
\alt
\text
{
fun
}
(
{
#4
}
)
\to
{
#5
}
\}
}
\newcommand
{
\bind
}
[3]
{
\text
{
var
}
{
#1
}
=
{
#2
}
\text
{
in
}
{
#3
}}
\newcommand
{
\matchnat
}
[4]
{
\text
{
match
}
{
#1
}
\text
{
with
}
\{
\textsf
{
zero
}
\Rightarrow
{
#2
}
\alt
\textsf
{
suc
}
{
#3
}
\Rightarrow
{
#4
}
\}
}
...
...
This diff is collapsed.
Click to expand it.
paper-new/terms.tex
+
15
−
31
View file @
46c88052
...
...
@@ -231,19 +231,13 @@ for case-nat (the rules for case-arrow are analogous).
{
\hasty
\Gamma
M (
\dyn
\ra
\dyn
)
}
{
\hasty
\Gamma
{
\injarr
M
}
\dyn
}
% Case
nat
% Case
dyn
\inferrule*
{
\hasty
{
\Delta
|
_
V
}{
V
}{
\dyn
}
\and
\hasty
{
\Delta
, x :
\nat
}{
M
_{
yes
}}{
B
}
\and
\hasty
{
\Delta
}{
M
_{
no
}}{
B
}}
{
\hasty
{
\Delta
}
{
\casenat
{
V
}{
M
_{
no
}}{
n
}{
M
_{
yes
}}}
{
B
}}
% Case arr
\inferrule*
{
\hasty
{
\Delta
|
_
V
}{
V
}{
\dyn
}
\and
\hasty
{
\Delta
, x : (
\dyn
\ra
\dyn
)
}{
M
_{
yes
}}{
B
}
\and
\hasty
{
\Delta
}{
M
_{
no
}}{
B
}}
{
\hasty
{
\Delta
}
{
\casearr
{
V
}{
M
_{
no
}}{
f
}{
M
_{
yes
}}}
{
B
}}
{
\hasty
{
\Delta
|
_
V
}{
V
}{
\dyn
}
\and
\hasty
{
\Delta
, x :
\nat
}{
M
_{
nat
}}{
B
}
\and
\hasty
{
\Delta
, x : (
\dyn
\ra
\dyn
)
}{
M
_{
fun
}}{
B
}
}
{
\hasty
{
\Delta
}
{
\casedyn
{
V
}{
n
}{
M
_{
nat
}}{
f
}{
M
_{
fun
}}}
{
B
}}
\end{mathpar}
\caption
{
New typing rules for
$
\extlcmm
$
.
}
\label
{
fig:extlc-minus-minus-typing
}
...
...
@@ -252,25 +246,19 @@ for case-nat (the rules for case-arrow are analogous).
\begin{figure}
\begin{mathpar}
% Case-
nat
Beta
% Case-
dyn
Beta
\inferrule*
{
\hasty
\Gamma
V
\nat
}
{
\case
nat
{
\injnat
{
V
}}
{
M
_{
n
o
}}
{
n
}
{
M
_{
yes
}}
= M
_{
yes
}
[V/n]
}
{
\case
dyn
{
\injnat
{
V
}}
{
n
}
{
M
_{
n
at
}}
{
f
}
{
M
_{
fun
}}
= M
_{
nat
}
[V/n]
}
\inferrule*
{
\hasty
\Gamma
V
{
\dyn
\ra
\dyn
}
}
{
\case
nat
{
\injarr
{
V
}}
{
M
_{
n
o
}}
{
n
}
{
M
_{
yes
}}
= M
_{
no
}
}
{
\case
dyn
{
\injarr
{
V
}}
{
n
}
{
M
_{
n
at
}}
{
f
}
{
M
_{
fun
}}
= M
_{
fun
}
[V/f]
}
% Case-
nat
Eta
% Case-
dyn
Eta
\inferrule*
{}
{
\Gamma
, x :
\,
\dyn
\vdash
M =
\casenat
{
x
}{
M
}{
n
}{
M[(
\injnat
{
n
}
) / x]
}
}
% Case-arr Beta
% Case-arr Eta
{
\Gamma
, x :
\,
\dyn
\vdash
M =
\casedyn
{
x
}{
n
}{
M[(
\injnat
{
n
}
) / x]
}{
f
}{
M[(
\injarr
{
f
}
) / x]
}
}
\end{mathpar}
...
...
@@ -461,13 +449,9 @@ interpretation of the scrutinee, which has type $\Dyn$.
\sem
{
\err
_
B
}
&
=
\lambda
\delta
.
\mho
\\
\sem
{
\ret\,
V
}
&
=
\lambda
\gamma
.
\eta\,
\sem
{
V
}
\\
\sem
{
\bind
{
x
}{
M
}{
N
}}
&
=
\lambda
\delta
.
\ext
{
(
\lambda
x .
\sem
{
N
}
\,
(
\delta
, x))
}
{
\sem
{
M
}
\,
\delta
}
\\
\sem
{
V
_
f
\,
V
_
x
}
&
=
\lambda
\gamma
.
\ext
{
(
\lambda
f . (
\ext
{
f
}
{
\sem
{
V
_
x
}
\,
\gamma
}
))
}
{
(
\sem
{
V
_
f
}
\,
\gamma
)
}
\\
\sem
{
\casenat
{
V
}{
M
_{
no
}}{
n
}{
M
_{
yes
}}}
&
=
\lambda
\delta
.
\text
{
case
$
(
\sem
{
V
}
\,
\delta
)
$
of
}
\\
&
\quad\quad\quad\quad
\alt
\inl
(n)
\to
\sem
{
M
_{
yes
}}
(n)
\\
&
\quad\quad\quad\quad
\alt
\inr
(
\tilde
{
f
}
)
\to
\sem
{
M
_{
no
}}
\\
\sem
{
\casearr
{
V
}{
M
_{
no
}}{
\tilde
{
f
}}{
M
_{
yes
}}}
&
=
\sem
{
V
_
f
\,
V
_
x
}
&
=
\lambda
\gamma
.
{
(
{
(
\sem
{
V
_
f
}
\,
\gamma
)
}
\,
{
(
\sem
{
V
_
x
}
\,
\gamma
)
}
)
}
\\
\sem
{
\casedyn
{
V
}{
n
}{
M
_{
nat
}}{
\tilde
{
f
}}{
M
_{
fun
}}}
&
=
\lambda
\delta
.
\text
{
case
$
(
\sem
{
V
}
\,
\delta
)
$
of
}
\\
&
\quad\quad\quad\quad
\alt
\inl
(n)
\to
\sem
{
M
_{
n
o
}}
\\
&
\quad\quad\quad\quad
\alt
\inr
(
\tilde
{
f
}
)
\to
\sem
{
M
_{
yes
}}
(
\tilde
{
f
}
)
&
\quad\quad\quad\quad
\alt
\inl
(n)
\to
\sem
{
M
_{
n
at
}}
(n)
\\
&
\quad\quad\quad\quad
\alt
\inr
(
\tilde
{
f
}
)
\to
\sem
{
M
_{
fun
}}
(
\tilde
{
f
}
)
\end{align*}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment