Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpri-2.4-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
POTTIER Francois
mpri-2.4-public
Commits
cfc9f079
Commit
cfc9f079
authored
5 months ago
by
POTTIER Francois
Browse files
Options
Downloads
Patches
Plain Diff
Update the Coq proof of type soundness for simply-typed λ-calculus.
parent
fff06117
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
coq/STLCTypeSoundnessBlank.v
+73
-37
73 additions, 37 deletions
coq/STLCTypeSoundnessBlank.v
coq/STLCTypeSoundnessComplete.v
+0
-42
0 additions, 42 deletions
coq/STLCTypeSoundnessComplete.v
with
73 additions
and
79 deletions
coq/STLCTypeSoundnessBlank.v
+
73
−
37
View file @
cfc9f079
...
@@ -5,48 +5,33 @@ Require Import LambdaCalculusReduction.
...
@@ -5,48 +5,33 @@ Require Import LambdaCalculusReduction.
Require
Import
STLCDefinition
.
Require
Import
STLCDefinition
.
Require
Import
STLCLemmas
.
Require
Import
STLCLemmas
.
(
*|
(
*
--------------------------------------------------------------------------
*
)
This
is
a
failed
attempt
to
prove
the
lemma
`jt_te_substitution_0
`
in
a
direct
way
,
without
introducing
the
auxiliary
judgement
`js
`
.
See
STLCLemmas
for
a
valid
proof
.
|*
)
Goal
(
*
jt_te_substitution_0
*
)
forall
Delta
t1
U
,
jt
Delta
t1
U
->
forall
Gamma
t2
T
,
Delta
=
T
.
:
Gamma
->
jt
Gamma
t2
T
->
jt
Gamma
t1
.[
t2
/
]
U
.
Proof
.
(
*
Let
us
attempt
to
naively
prove
this
statement
by
induction
.
*
)
Abort
.
(
*|
(
*|
The
subject
reduction
theorem
,
also
known
as
type
preservation
:
The
progress
theorem
:
a
closed
,
well
-
typed
term
must
either
be
able
to
the
typing
judgement
is
preserved
by
one
step
of
reduction
.
make
one
step
of
reduction
or
be
a
value
.
This
is
proved
here
for
`cbv
`
,
but
could
be
proved
for
other
notions
of
reduction
,
such
as
`cbn
`
,
or
strong
reduction
.
|*
)
|*
)
Lemma
jt_pr
eservation
:
Lemma
jt_pr
ogress
:
forall
Gamma
t
T
,
forall
Gamma
t
T
,
jt
Gamma
t
T
->
jt
Gamma
t
T
->
forall
t
'
,
closed
t
->
cbv
t
t
'
->
(
exists
t
'
,
cbv
t
t
'
)
\
/
is_value
t
.
jt
Gamma
t
'
T
.
Ltac
use_ih
ih
:=
destruct
ih
;
[
eauto
with
closed
|
unpack
;
eauto
with
red
|
].
Proof
.
Proof
.
Abort
.
Abort
.
(
*
--------------------------------------------------------------------------
*
)
(
*|
(
*|
An
inversion
lemma
:
if
a
closed
value
admits
a
function
type
`TyFun
T1
T2
`
,
The
following
inversion
lemma
is
needed
in
the
proof
of
progress
(
above
).
then
it
must
be
a
lambda
-
abstraction
.
If
a
closed
value
admits
a
function
type
`TyFun
T1
T2
`
,
then
this
value
must
be
a
lambda
-
abstraction
.
|*
)
|*
)
...
@@ -59,20 +44,71 @@ Lemma invert_jt_TyFun:
...
@@ -59,20 +44,71 @@ Lemma invert_jt_TyFun:
Proof
.
Proof
.
Abort
.
Abort
.
(
*
--------------------------------------------------------------------------
*
)
(
*|
(
*|
The
progress
theorem
:
a
closed
,
well
-
typed
term
The
subject
reduction
theorem
,
also
known
as
type
preservation
:
the
typing
must
either
be
able
to
make
one
step
of
reduction
judgement
is
preserved
by
one
step
of
reduction
.
or
be
a
value
.
This
is
proved
here
for
`cbv
`
,
but
could
be
proved
for
other
notions
of
reduction
,
such
as
`cbn
`
,
or
strong
reduction
.
|*
)
|*
)
Lemma
jt_pr
ogress
:
Lemma
jt_pr
eservation
:
forall
Gamma
t
T
,
forall
Gamma
t
T
,
jt
Gamma
t
T
->
jt
Gamma
t
T
->
closed
t
->
forall
t
'
,
(
exists
t
'
,
cbv
t
t
'
)
\
/
is_value
t
.
cbv
t
t
'
->
Ltac
use_ih
ih
:=
jt
Gamma
t
'
T
.
destruct
ih
;
[
eauto
with
closed
|
unpack
;
eauto
with
red
|
].
Proof
.
Proof
.
Abort
.
Abort
.
(
*
--------------------------------------------------------------------------
*
)
(
*|
The
following
substitution
lemma
is
needed
in
the
proof
of
subject
reduction
(
above
).
A
direct
attempt
to
prove
this
lemma
by
induction
fails
(
see
below
).
A
better
approach
is
to
state
a
more
general
substitution
lemma
and
obtain
this
lemma
as
a
special
case
:
see
STLCLemmas
.
v
.
|*
)
Lemma
jt_te_substitution_0
:
forall
Delta
t1
U
,
jt
Delta
t1
U
->
forall
Gamma
t2
T
,
Delta
=
T
.
:
Gamma
->
jt
Gamma
t2
T
->
jt
Gamma
t1
.[
t2
/
]
U
.
Proof
.
(
*
Let
us
attempt
to
naively
prove
this
statement
by
induction
.
*
)
induction
1
;
intros
;
subst
;
asimpl
.
all:
swap
2
3.
(
*
deal
with
JTApp
before
JTLam
*
)
(
*
JTVar
.
*
)
{
(
*
By
cases
on
the
variable
`x
`
.
Either
it
is
zero
,
or
nonzero
.
*
)
destruct
x
as
[
|
x
].
{
asimpl
.
eauto
.
}
{
asimpl
.
eauto
with
jt
.
}
}
(
*
JTApp
.
*
)
(
*
This
case
just
works
,
thanks
to
the
induction
hypotheses
.
*
)
{
eauto
with
jt
.
}
(
*
JTLam
.
*
)
{
(
*
We
must
typecheck
a
lambda
,
so
we
must
apply
JTLam
.
*
)
eapply
JTLam
.
(
*
We
would
now
like
to
apply
the
induction
hypothesis
,
but
this
fails
,
because
the
statement
of
the
lemma
allows
substituting
a
term
for
variable
0
,
but
we
are
now
attempting
to
substitute
a
term
for
variable
1.
*
)
Fail
eapply
IHjt
.
(
*
The
moral
of
the
story
is
that
it
is
preferable
to
state
a
lemma
that
allows
applying
an
arbitrary
substitution
(
of
terms
for
term
variables
)
to
a
term
.
This
will
give
rise
to
statements
that
are
more
general
,
therefore
both
more
powerful
and
easier
to
read
.
See
STLCLemmas
.
*
)
Abort
.
This diff is collapsed.
Click to expand it.
coq/STLCTypeSoundnessComplete.v
+
0
−
42
View file @
cfc9f079
...
@@ -7,48 +7,6 @@ Require Import STLCLemmas.
...
@@ -7,48 +7,6 @@ Require Import STLCLemmas.
(
*|
(
*|
This
is
a
failed
attempt
to
prove
the
lemma
`jt_te_substitution_0
`
in
a
direct
way
,
without
introducing
the
auxiliary
judgement
`js
`
.
See
STLCLemmas
for
a
valid
proof
.
|*
)
Goal
(
*
jt_te_substitution_0
*
)
forall
Delta
t1
U
,
jt
Delta
t1
U
->
forall
Gamma
t2
T
,
Delta
=
T
.
:
Gamma
->
jt
Gamma
t2
T
->
jt
Gamma
t1
.[
t2
/
]
U
.
Proof
.
(
*
Let
us
attempt
to
naively
prove
this
statement
by
induction
.
*
)
induction
1
;
intros
;
subst
;
asimpl
.
all:
swap
2
3.
(
*
deal
with
JTApp
before
JTLam
*
)
(
*
JTVar
.
*
)
{
(
*
By
cases
on
the
variable
`x
`
.
Either
it
is
zero
,
or
nonzero
.
*
)
destruct
x
as
[
|
x
].
{
asimpl
.
eauto
.
}
{
asimpl
.
eauto
with
jt
.
}
}
(
*
JTApp
.
*
)
(
*
This
case
just
works
,
thanks
to
the
induction
hypotheses
.
*
)
{
eauto
with
jt
.
}
(
*
JTLam
.
*
)
{
(
*
We
must
typecheck
a
lambda
,
so
we
must
apply
JTLam
.
*
)
eapply
JTLam
.
(
*
We
would
now
like
to
apply
the
induction
hypothesis
,
but
this
fails
,
because
the
statement
of
the
lemma
allows
substituting
a
term
for
variable
0
,
but
we
are
now
attempting
to
substitute
a
term
for
variable
1.
*
)
Fail
eapply
IHjt
.
(
*
The
moral
of
the
story
is
that
it
is
preferable
to
state
a
lemma
that
allows
applying
an
arbitrary
substitution
(
of
terms
for
term
variables
)
to
a
term
.
This
will
give
rise
to
statements
that
are
more
general
,
therefore
both
more
powerful
and
easier
to
read
.
See
STLCLemmas
.
*
)
Abort
.
(
*|
The
subject
reduction
theorem
,
also
known
as
type
preservation
:
The
subject
reduction
theorem
,
also
known
as
type
preservation
:
the
typing
judgement
is
preserved
by
one
step
of
reduction
.
the
typing
judgement
is
preserved
by
one
step
of
reduction
.
...
...
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