Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jonas Kastberg
iris
Commits
e9fec17a
Commit
e9fec17a
authored
Jan 04, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import ssreflect and make a little use of it
parent
77c885d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
channel/heap_lang.v
channel/heap_lang.v
+16
-12
No files found.
channel/heap_lang.v
View file @
e9fec17a
Require
Import
mathcomp
.
ssreflect
.
ssreflect
.
Require
Import
Autosubst
.
Autosubst
.
Require
Import
prelude
.
option
.
Set
Bullet
Behavior
"Strict Subproofs"
.
Inductive
expr
:
=
|
Var
(
x
:
var
)
|
Lit
(
T
:
Type
)
(
t
:
T
)
(* arbitrary Coq values become literals *)
...
...
@@ -53,7 +56,7 @@ Fixpoint e2v (e : expr) : option value :=
Lemma
v2v
v
:
e2v
(
v2e
v
)
=
Some
v
.
Proof
.
induction
v
;
simpl
;
rewrite
?IHv
,
?IHv1
;
simpl
;
rewrite
?IHv2
;
reflexivity
.
induction
v
;
simpl
;
rewrite
?IHv
?IHv1
/=
?IHv2
;
reflexivity
.
Qed
.
Lemma
e2e
e
v
:
...
...
@@ -64,11 +67,11 @@ Proof.
-
intros
Heq
.
injection
Heq
.
clear
Heq
.
intros
Heq
.
subst
.
reflexivity
.
-
destruct
(
e2v
e1
)
;
simpl
;
[|
discriminate
].
destruct
(
e2v
e2
)
;
simpl
;
[|
discriminate
].
intros
Heq
.
injection
Heq
.
clear
Heq
.
intros
Heq
.
subst
.
simpl
.
eauto
using
f_equal2
.
case
=><-
.
simpl
.
eauto
using
f_equal2
.
-
destruct
(
e2v
e
)
;
simpl
;
[|
discriminate
].
intros
Heq
.
injection
Heq
.
clear
Heq
.
intros
Heq
.
subst
.
simpl
.
eauto
using
f_equal
.
case
=><-
.
simpl
.
eauto
using
f_equal
.
-
destruct
(
e2v
e
)
;
simpl
;
[|
discriminate
].
intros
Heq
.
injection
Heq
.
clear
Heq
.
intros
Heq
.
subst
.
simpl
.
eauto
using
f_equal
.
case
=><-
.
simpl
.
eauto
using
f_equal
.
Qed
.
Inductive
ectx
:
=
...
...
@@ -120,20 +123,20 @@ Qed.
Lemma
fill_comp
K1
K2
e
:
fill
K1
(
fill
K2
e
)
=
fill
(
comp_ctx
K1
K2
)
e
.
Proof
.
revert
K2
e
;
induction
K1
;
intros
K2
e
;
simpl
;
rewrite
?IHK1
,
?IHK2
;
reflexivity
.
revert
K2
e
;
induction
K1
=>
K2
e
/=
;
rewrite
?IHK1
?IHK2
;
reflexivity
.
Qed
.
Lemma
fill_inj_r
K
e1
e2
:
fill
K
e1
=
fill
K
e2
->
e1
=
e2
.
Proof
.
revert
e1
e2
;
induction
K
;
intros
el
er
;
simpl
;
intros
Heq
;
try
apply
IHK
;
inversion
Heq
;
reflexivity
.
revert
e1
e2
;
induction
K
=>
el
er
/=
;
(
move
=><-
;
reflexivity
)
||
(
case
=>
/
IHK
<-
;
reflexivity
)
.
Qed
.
Lemma
fill_value
K
e
v'
:
e2v
(
fill
K
e
)
=
Some
v'
->
exists
v
,
e2v
e
=
Some
v
.
Proof
.
revert
v'
;
induction
K
;
intros
v'
;
simpl
;
try
discriminate
;
revert
v'
;
induction
K
=>
v'
/=
;
try
discriminate
;
try
destruct
(
e2v
(
fill
K
e
))
;
rewrite
?v2v
;
eauto
.
Qed
.
...
...
@@ -293,7 +296,7 @@ Proof.
intros
Heq
.
apply
e2e
in
Heq
.
subst
.
eauto
using
stuck_find_redex
,
values_stuck
.
Qed
.
Lemma
reducible_find_redex
e
K'
e'
:
Lemma
reducible_find_redex
{
e
K'
e'
}
:
e
=
fill
K'
e'
->
reducible
e'
->
find_redex
e
=
Some
(
K'
,
e'
).
Proof
.
revert
e
;
induction
K'
;
intros
e
Hfill
Hred
;
subst
e
;
simpl
.
...
...
@@ -301,9 +304,9 @@ Proof.
destruct
Hred
as
(
σ
'
&
e''
&
σ
''
&
ef
&
Hstep
).
destruct
Hstep
;
simpl
.
+
erewrite
find_redex_val
by
eassumption
.
by
rewrite
Hv2
.
+
erewrite
find_redex_val
by
eassumption
.
erewrite
find_redex_val
by
eassumption
.
by
rewrite
Hv1
,
Hv2
.
by
rewrite
Hv1
Hv2
.
+
erewrite
find_redex_val
by
eassumption
.
erewrite
find_redex_val
by
eassumption
.
by
rewrite
Hv1
,
Hv2
.
by
rewrite
Hv1
Hv2
.
+
erewrite
find_redex_val
by
eassumption
.
by
rewrite
Hv0
.
+
erewrite
find_redex_val
by
eassumption
.
by
rewrite
Hv0
.
-
by
erewrite
IHK'
.
...
...
@@ -336,5 +339,6 @@ Lemma step_by_value K K' e e' :
e2v
e
=
None
->
exists
K''
,
K'
=
comp_ctx
K
K''
.
Proof
.
(* TODO *)
intros
Hfill
Hred
Hnval
.
assert
(
Hfind
:
=
reducible_find_redex
Hfill
Hred
).
Abort
.
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