Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Spies
lambda-rust
Commits
7df9982d
Commit
7df9982d
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
More reformulation of typing lemmas.
parent
4512e9a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/bool.v
+9
-1
9 additions, 1 deletion
theories/typing/bool.v
theories/typing/int.v
+38
-4
38 additions, 4 deletions
theories/typing/int.v
with
47 additions
and
5 deletions
theories/typing/bool.v
+
9
−
1
View file @
7df9982d
...
@@ -17,13 +17,21 @@ End bool.
...
@@ -17,13 +17,21 @@ End bool.
Section
typing
.
Section
typing
.
Context
`{
typeG
Σ
}
.
Context
`{
typeG
Σ
}
.
Lemma
type_bool
(
b
:
Datatypes
.
bool
)
E
L
:
Lemma
type_bool
_instr
(
b
:
Datatypes
.
bool
)
E
L
:
typed_instruction_ty
E
L
[]
#
b
bool
.
typed_instruction_ty
E
L
[]
#
b
bool
.
Proof
.
Proof
.
iIntros
(
tid
qE
)
"_ _ $ $ $ _"
.
wp_value
.
iIntros
(
tid
qE
)
"_ _ $ $ $ _"
.
wp_value
.
rewrite
tctx_interp_singleton
tctx_hasty_val
.
iExists
_
.
done
.
rewrite
tctx_interp_singleton
tctx_hasty_val
.
iExists
_
.
done
.
Qed
.
Qed
.
Lemma
typed_bool
(
b
:
Datatypes
.
bool
)
E
L
C
T
x
e
:
Closed
(
x
:
b
:
[])
e
→
(
∀
(
v
:
val
),
typed_body
E
L
C
((
v
◁
bool
)
::
T
)
(
subst'
x
v
e
))
→
typed_body
E
L
C
T
(
let
:
x
:=
#
b
in
e
)
.
Proof
.
intros
.
eapply
type_let
;
[
done
|
apply
type_bool_instr
|
solve_typing
|
done
]
.
Qed
.
Lemma
type_if
E
L
C
T
e1
e2
p
:
Lemma
type_if
E
L
C
T
e1
e2
p
:
(
p
◁
bool
)
%
TC
∈
T
→
(
p
◁
bool
)
%
TC
∈
T
→
typed_body
E
L
C
T
e1
→
typed_body
E
L
C
T
e2
→
typed_body
E
L
C
T
e1
→
typed_body
E
L
C
T
e2
→
...
...
This diff is collapsed.
Click to expand it.
theories/typing/int.v
+
38
−
4
View file @
7df9982d
...
@@ -16,14 +16,22 @@ End int.
...
@@ -16,14 +16,22 @@ End int.
Section
typing
.
Section
typing
.
Context
`{
typeG
Σ
}
.
Context
`{
typeG
Σ
}
.
Lemma
type_int
(
z
:
Z
)
E
L
:
Lemma
type_int
_instr
(
z
:
Z
)
E
L
:
typed_instruction_ty
E
L
[]
#
z
int
.
typed_instruction_ty
E
L
[]
#
z
int
.
Proof
.
Proof
.
iIntros
(
tid
qE
)
"_ _ $ $ $ _"
.
wp_value
.
iIntros
(
tid
qE
)
"_ _ $ $ $ _"
.
wp_value
.
rewrite
tctx_interp_singleton
tctx_hasty_val
.
iExists
_
.
done
.
rewrite
tctx_interp_singleton
tctx_hasty_val
.
iExists
_
.
done
.
Qed
.
Qed
.
Lemma
type_plus
E
L
p1
p2
:
Lemma
typed_int
(
z
:
Z
)
E
L
C
T
x
e
:
Closed
(
x
:
b
:
[])
e
→
(
∀
(
v
:
val
),
typed_body
E
L
C
((
v
◁
int
)
::
T
)
(
subst'
x
v
e
))
→
typed_body
E
L
C
T
(
let
:
x
:=
#
z
in
e
)
.
Proof
.
intros
.
eapply
type_let
;
[
done
|
apply
type_int_instr
|
solve_typing
|
done
]
.
Qed
.
Lemma
type_plus_instr
E
L
p1
p2
:
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
+
p2
)
int
.
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
+
p2
)
int
.
Proof
.
Proof
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
...
@@ -36,7 +44,16 @@ Section typing.
...
@@ -36,7 +44,16 @@ Section typing.
iExists
_
.
done
.
iExists
_
.
done
.
Qed
.
Qed
.
Lemma
type_minus
E
L
p1
p2
:
Lemma
typed_plus
E
L
C
T
T'
p1
p2
x
e
:
Closed
(
x
:
b
:
[])
e
→
tctx_extract_ctx
E
L
[
p1
◁
int
;
p2
◁
int
]
T
T'
→
(
∀
(
v
:
val
),
typed_body
E
L
C
((
v
◁
int
)
::
T'
)
(
subst'
x
v
e
))
→
typed_body
E
L
C
T
(
let
:
x
:=
p1
+
p2
in
e
)
.
Proof
.
intros
.
eapply
type_let
;
[
done
|
apply
type_plus_instr
|
solve_typing
|
done
]
.
Qed
.
Lemma
type_minus_instr
E
L
p1
p2
:
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
-
p2
)
int
.
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
-
p2
)
int
.
Proof
.
Proof
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
...
@@ -49,7 +66,16 @@ Section typing.
...
@@ -49,7 +66,16 @@ Section typing.
iExists
_
.
done
.
iExists
_
.
done
.
Qed
.
Qed
.
Lemma
type_le
E
L
p1
p2
:
Lemma
typed_minus
E
L
C
T
T'
p1
p2
x
e
:
Closed
(
x
:
b
:
[])
e
→
tctx_extract_ctx
E
L
[
p1
◁
int
;
p2
◁
int
]
T
T'
→
(
∀
(
v
:
val
),
typed_body
E
L
C
((
v
◁
int
)
::
T'
)
(
subst'
x
v
e
))
→
typed_body
E
L
C
T
(
let
:
x
:=
p1
-
p2
in
e
)
.
Proof
.
intros
.
eapply
type_let
;
[
done
|
apply
type_minus_instr
|
solve_typing
|
done
]
.
Qed
.
Lemma
type_le_instr
E
L
p1
p2
:
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
≤
p2
)
bool
.
typed_instruction_ty
E
L
[
p1
◁
int
;
p2
◁
int
]
(
p1
≤
p2
)
bool
.
Proof
.
Proof
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
iIntros
(
tid
qE
)
"_ _ $ $ $"
.
rewrite
tctx_interp_cons
tctx_interp_singleton
.
...
@@ -62,4 +88,12 @@ Section typing.
...
@@ -62,4 +88,12 @@ Section typing.
iExists
_;
done
.
iExists
_;
done
.
Qed
.
Qed
.
Lemma
typed_le
E
L
C
T
T'
p1
p2
x
e
:
Closed
(
x
:
b
:
[])
e
→
tctx_extract_ctx
E
L
[
p1
◁
int
;
p2
◁
int
]
T
T'
→
(
∀
(
v
:
val
),
typed_body
E
L
C
((
v
◁
bool
)
::
T'
)
(
subst'
x
v
e
))
→
typed_body
E
L
C
T
(
let
:
x
:=
p1
≤
p2
in
e
)
.
Proof
.
intros
.
eapply
type_let
;
[
done
|
apply
type_le_instr
|
solve_typing
|
done
]
.
Qed
.
End
typing
.
End
typing
.
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