Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
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
Model registry
Operate
Environments
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
Tej Chajed
iris
Commits
2dda1557
Commit
2dda1557
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add fork
parent
8968f2c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
channel/heap_lang.v
+11
-13
11 additions, 13 deletions
channel/heap_lang.v
with
11 additions
and
13 deletions
channel/heap_lang.v
+
11
−
13
View file @
2dda1557
...
@@ -35,8 +35,10 @@ Inductive expr :=
...
@@ -35,8 +35,10 @@ Inductive expr :=
|
Snd
(
e
:
expr
)
|
Snd
(
e
:
expr
)
|
InjL
(
e
:
expr
)
|
InjL
(
e
:
expr
)
|
InjR
(
e
:
expr
)
|
InjR
(
e
:
expr
)
|
Case
(
e0
:
expr
)
(
e1
:
{
bind
expr
})
(
e2
:
{
bind
expr
})
.
|
Case
(
e0
:
expr
)
(
e1
:
{
bind
expr
})
(
e2
:
{
bind
expr
})
|
Fork
(
e
:
expr
)
.
Definition
lit_unit
:=
Lit
tt
.
Definition
state
:=
unit
.
Definition
state
:=
unit
.
Instance
Ids_expr
:
Ids
expr
.
derive
.
Defined
.
Instance
Ids_expr
:
Ids
expr
.
derive
.
Defined
.
...
@@ -46,7 +48,7 @@ Instance SubstLemmas_expr : SubstLemmas expr. derive. Qed.
...
@@ -46,7 +48,7 @@ Instance SubstLemmas_expr : SubstLemmas expr. derive. Qed.
Inductive
value
:=
Inductive
value
:=
|
LamV
(
e
:
{
bind
expr
})
|
LamV
(
e
:
{
bind
expr
})
|
LitV
(
T
:
Type
)
(
t
:
T
)
(* arbitrary Coq values become literals *)
|
LitV
(
T
:
Type
)
(
t
:
T
)
(* arbitrary Coq values become literal
value
s *)
|
PairV
(
v1
v2
:
value
)
|
PairV
(
v1
v2
:
value
)
|
InjLV
(
v
:
value
)
|
InjLV
(
v
:
value
)
|
InjRV
(
v
:
value
)
.
|
InjRV
(
v
:
value
)
.
...
@@ -62,20 +64,14 @@ Fixpoint v2e (v : value) : expr :=
...
@@ -62,20 +64,14 @@ Fixpoint v2e (v : value) : expr :=
Fixpoint
e2v
(
e
:
expr
)
:
option
value
:=
Fixpoint
e2v
(
e
:
expr
)
:
option
value
:=
match
e
with
match
e
with
|
Var
_
=>
None
|
Lam
e
=>
Some
(
LamV
e
)
|
Lam
e
=>
Some
(
LamV
e
)
|
App
_
_
=>
None
|
Lit
T
t
=>
Some
(
LitV
T
t
)
|
Lit
T
t
=>
Some
(
LitV
T
t
)
|
Op1
_
_
_
_
=>
None
|
Op2
_
_
_
_
_
_
=>
None
|
Pair
e1
e2
=>
v1
←
e2v
e1
;
|
Pair
e1
e2
=>
v1
←
e2v
e1
;
v2
←
e2v
e2
;
v2
←
e2v
e2
;
Some
(
PairV
v1
v2
)
Some
(
PairV
v1
v2
)
|
Fst
e
=>
None
|
Snd
e
=>
None
|
InjL
e
=>
InjLV
<$>
e2v
e
|
InjL
e
=>
InjLV
<$>
e2v
e
|
InjR
e
=>
InjRV
<$>
e2v
e
|
InjR
e
=>
InjRV
<$>
e2v
e
|
Case
e0
e1
e2
=>
None
|
_
=>
None
end
.
end
.
Lemma
v2v
v
:
Lemma
v2v
v
:
...
@@ -202,7 +198,7 @@ Qed.
...
@@ -202,7 +198,7 @@ Qed.
(** The stepping relation *)
(** The stepping relation *)
Inductive
prim_step
:
expr
->
state
->
expr
->
state
->
option
expr
->
Prop
:=
Inductive
prim_step
:
expr
->
state
->
expr
->
state
->
option
expr
->
Prop
:=
|
Beta
e1
e2
v2
σ
(
Hv2
:
e2v
e2
=
Some
v2
):
|
Beta
S
e1
e2
v2
σ
(
Hv2
:
e2v
e2
=
Some
v2
):
prim_step
(
App
(
Lam
e1
)
e2
)
σ
(
e1
.[
e2
/
])
σ
None
prim_step
(
App
(
Lam
e1
)
e2
)
σ
(
e1
.[
e2
/
])
σ
None
|
Op1S
T1
To
(
f
:
T1
->
To
)
t
σ
:
|
Op1S
T1
To
(
f
:
T1
->
To
)
t
σ
:
prim_step
(
Op1
f
(
Lit
t
))
σ
(
Lit
(
f
t
))
σ
None
prim_step
(
Op1
f
(
Lit
t
))
σ
(
Lit
(
f
t
))
σ
None
...
@@ -212,10 +208,12 @@ Inductive prim_step : expr -> state -> expr -> state -> option expr -> Prop :=
...
@@ -212,10 +208,12 @@ Inductive prim_step : expr -> state -> expr -> state -> option expr -> Prop :=
prim_step
(
Fst
(
Pair
e1
e2
))
σ
e1
σ
None
prim_step
(
Fst
(
Pair
e1
e2
))
σ
e1
σ
None
|
SndS
e1
v1
e2
v2
σ
(
Hv1
:
e2v
e1
=
Some
v1
)
(
Hv2
:
e2v
e2
=
Some
v2
):
|
SndS
e1
v1
e2
v2
σ
(
Hv1
:
e2v
e1
=
Some
v1
)
(
Hv2
:
e2v
e2
=
Some
v2
):
prim_step
(
Snd
(
Pair
e1
e2
))
σ
e2
σ
None
prim_step
(
Snd
(
Pair
e1
e2
))
σ
e2
σ
None
|
CaseL
e0
v0
e1
e2
σ
(
Hv0
:
e2v
e0
=
Some
v0
):
|
CaseL
S
e0
v0
e1
e2
σ
(
Hv0
:
e2v
e0
=
Some
v0
):
prim_step
(
Case
(
InjL
e0
)
e1
e2
)
σ
(
e1
.[
e0
/
])
σ
None
prim_step
(
Case
(
InjL
e0
)
e1
e2
)
σ
(
e1
.[
e0
/
])
σ
None
|
CaseR
e0
v0
e1
e2
σ
(
Hv0
:
e2v
e0
=
Some
v0
):
|
CaseRS
e0
v0
e1
e2
σ
(
Hv0
:
e2v
e0
=
Some
v0
):
prim_step
(
Case
(
InjR
e0
)
e1
e2
)
σ
(
e2
.[
e0
/
])
σ
None
.
prim_step
(
Case
(
InjR
e0
)
e1
e2
)
σ
(
e2
.[
e0
/
])
σ
None
|
ForkS
e
σ
:
prim_step
(
Fork
e
)
σ
lit_unit
σ
(
Some
e
)
.
Definition
reducible
e
:
Prop
:=
Definition
reducible
e
:
Prop
:=
exists
σ
e'
σ'
ef
,
prim_step
e
σ
e'
σ'
ef
.
exists
σ
e'
σ'
ef
,
prim_step
e
σ
e'
σ'
ef
.
...
...
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