Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Amin Timany
iris-coq
Commits
730a9f4a
Commit
730a9f4a
authored
10 years ago
by
David Swasey
Browse files
Options
Downloads
Patches
Plain Diff
Ownership is timeless.
parent
9ba9ef1b
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
iris_core.v
+39
-27
39 additions, 27 deletions
iris_core.v
iris_unsafe.v
+0
-5
0 additions, 5 deletions
iris_unsafe.v
with
39 additions
and
32 deletions
iris_core.v
+
39
−
27
View file @
730a9f4a
...
@@ -180,6 +180,32 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
...
@@ -180,6 +180,32 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
End
Invariants
.
End
Invariants
.
Section
Timeless
.
Definition
timelessP
P
w
n
:=
forall
w'
k
r
(
HSw
:
w
⊑
w'
)
(
HLt
:
k
<
n
)
(
Hp
:
P
w'
k
r
),
P
w'
(
S
k
)
r
.
Program
Definition
timeless
P
:
Props
:=
m
[(
fun
w
=>
mkUPred
(
fun
n
r
=>
timelessP
P
w
n
)
_)]
.
Next
Obligation
.
intros
n1
n2
_
_
HLe
_
HT
w'
k
r
HSw
HLt
Hp
;
eapply
HT
,
Hp
;
[
eassumption
|]
.
omega
.
Qed
.
Next
Obligation
.
intros
w1
w2
EQw
k
;
simpl
;
intros
_
HLt
;
destruct
n
as
[|
n
];
[
now
inversion
HLt
|]
.
split
;
intros
HT
w'
m
r
HSw
HLt'
Hp
.
-
symmetry
in
EQw
;
assert
(
HD
:=
extend_dist
_
_
_
_
EQw
HSw
);
assert
(
HS
:=
extend_sub
_
_
_
_
EQw
HSw
)
.
apply
(
met_morph_nonexp
_
_
P
)
in
HD
;
apply
HD
,
HT
,
HD
,
Hp
;
now
(
assumption
||
eauto
with
arith
)
.
-
assert
(
HD
:=
extend_dist
_
_
_
_
EQw
HSw
);
assert
(
HS
:=
extend_sub
_
_
_
_
EQw
HSw
)
.
apply
(
met_morph_nonexp
_
_
P
)
in
HD
;
apply
HD
,
HT
,
HD
,
Hp
;
now
(
assumption
||
eauto
with
arith
)
.
Qed
.
Next
Obligation
.
intros
w1
w2
HSw
n
;
simpl
;
intros
_
HT
w'
m
r
HSw'
HLt
Hp
.
eapply
HT
,
Hp
;
[
etransitivity
|];
eassumption
.
Qed
.
End
Timeless
.
Section
Ownership
.
Section
Ownership
.
(** Ownership **)
(** Ownership **)
...
@@ -196,13 +222,17 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
...
@@ -196,13 +222,17 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
intros
u1
u2
Hequ
.
intros
w
n
r
.
split
;
intros
[
t
Heqt
];
exists
t
;
[
rewrite
<-
Hequ
|
rewrite
Hequ
];
assumption
.
intros
u1
u2
Hequ
.
intros
w
n
r
.
split
;
intros
[
t
Heqt
];
exists
t
;
[
rewrite
<-
Hequ
|
rewrite
Hequ
];
assumption
.
Qed
.
Qed
.
Lemma
ownR_sc
u
t
:
Lemma
ownR_timeless
{
u
}
:
ownR
(
u
·
t
)
==
ownR
u
*
ownR
t
.
valid
(
timeless
(
ownR
u
))
.
Proof
.
intros
w
n
_
w'
k
r
_
_;
now
auto
.
Qed
.
Lemma
ownR_sc
u
v
:
ownR
(
u
·
v
)
==
ownR
u
*
ownR
v
.
Proof
.
Proof
.
intros
w
n
r
;
split
;
[
intros
Hut
|
intros
[
r1
[
r2
[
EQr
[
Hu
Ht
]
]
]
]
]
.
intros
w
n
r
;
split
;
[
intros
Hut
|
intros
[
r1
[
r2
[
EQr
[
Hu
Ht
]
]
]
]
]
.
-
destruct
Hut
as
[
s
Heq
]
.
rewrite
->
assoc
in
Heq
.
-
destruct
Hut
as
[
s
Heq
]
.
rewrite
->
assoc
in
Heq
.
exists
↓
(
s
·
u
)
by
auto_valid
.
exists
↓
(
s
·
u
)
by
auto_valid
.
exists
↓
t
by
auto_valid
.
exists
↓
v
by
auto_valid
.
split
;
[|
split
]
.
split
;
[|
split
]
.
+
rewrite
<-
Heq
.
reflexivity
.
+
rewrite
<-
Heq
.
reflexivity
.
+
exists
s
.
reflexivity
.
+
exists
s
.
reflexivity
.
...
@@ -228,6 +258,9 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
...
@@ -228,6 +258,9 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
rewrite
EQr
.
reflexivity
.
rewrite
EQr
.
reflexivity
.
Qed
.
Qed
.
Lemma
ownS_timeless
{
σ
}
:
valid
(
timeless
(
ownS
σ
))
.
Proof
.
exact
ownR_timeless
.
Qed
.
(** Proper ghost state: ownership of logical **)
(** Proper ghost state: ownership of logical **)
Program
Definition
ownL
:
RL
.
res
-
n
>
Props
:=
Program
Definition
ownL
:
RL
.
res
-
n
>
Props
:=
n
[(
fun
r
:
RL
.
res
=>
ownR
(
1
,
r
))]
.
n
[(
fun
r
:
RL
.
res
=>
ownR
(
1
,
r
))]
.
...
@@ -236,6 +269,9 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
...
@@ -236,6 +269,9 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
simpl
in
EQr
.
intros
w
m
t
.
simpl
.
change
(
(
ex_unit
state
,
r1
)
⊑
(
ra_proj
t
)
<->
(
ex_unit
state
,
r2
)
⊑
(
ra_proj
t
))
.
rewrite
EQr
.
reflexivity
.
simpl
in
EQr
.
intros
w
m
t
.
simpl
.
change
(
(
ex_unit
state
,
r1
)
⊑
(
ra_proj
t
)
<->
(
ex_unit
state
,
r2
)
⊑
(
ra_proj
t
))
.
rewrite
EQr
.
reflexivity
.
Qed
.
Qed
.
Lemma
ownL_timeless
{
r
:
RL
.
res
}
:
valid
(
timeless
(
ownL
r
))
.
Proof
.
exact
ownR_timeless
.
Qed
.
(** Ghost state ownership **)
(** Ghost state ownership **)
Lemma
ownL_sc
(
r
s
:
RL
.
res
)
:
Lemma
ownL_sc
(
r
s
:
RL
.
res
)
:
ownL
(
r
·
s
)
==
ownL
r
*
ownL
s
.
ownL
(
r
·
s
)
==
ownL
r
*
ownL
s
.
...
@@ -249,30 +285,6 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
...
@@ -249,30 +285,6 @@ Module IrisCore (RL : RA_T) (C : CORE_LANG).
End
Ownership
.
End
Ownership
.
(** Timeless *)
Definition
timelessP
P
w
n
:=
forall
w'
k
r
(
HSw
:
w
⊑
w'
)
(
HLt
:
k
<
n
)
(
Hp
:
P
w'
k
r
),
P
w'
(
S
k
)
r
.
Program
Definition
timeless
P
:
Props
:=
m
[(
fun
w
=>
mkUPred
(
fun
n
r
=>
timelessP
P
w
n
)
_)]
.
Next
Obligation
.
intros
n1
n2
_
_
HLe
_
HT
w'
k
r
HSw
HLt
Hp
;
eapply
HT
,
Hp
;
[
eassumption
|]
.
omega
.
Qed
.
Next
Obligation
.
intros
w1
w2
EQw
k
;
simpl
;
intros
_
HLt
;
destruct
n
as
[|
n
];
[
now
inversion
HLt
|]
.
split
;
intros
HT
w'
m
r
HSw
HLt'
Hp
.
-
symmetry
in
EQw
;
assert
(
HD
:=
extend_dist
_
_
_
_
EQw
HSw
);
assert
(
HS
:=
extend_sub
_
_
_
_
EQw
HSw
)
.
apply
(
met_morph_nonexp
_
_
P
)
in
HD
;
apply
HD
,
HT
,
HD
,
Hp
;
now
(
assumption
||
eauto
with
arith
)
.
-
assert
(
HD
:=
extend_dist
_
_
_
_
EQw
HSw
);
assert
(
HS
:=
extend_sub
_
_
_
_
EQw
HSw
)
.
apply
(
met_morph_nonexp
_
_
P
)
in
HD
;
apply
HD
,
HT
,
HD
,
Hp
;
now
(
assumption
||
eauto
with
arith
)
.
Qed
.
Next
Obligation
.
intros
w1
w2
HSw
n
;
simpl
;
intros
_
HT
w'
m
r
HSw'
HLt
Hp
.
eapply
HT
,
Hp
;
[
etransitivity
|];
eassumption
.
Qed
.
Section
WorldSatisfaction
.
Section
WorldSatisfaction
.
(* First, we need to compose the resources of a finite map. This won't be pretty, for
(* First, we need to compose the resources of a finite map. This won't be pretty, for
...
...
This diff is collapsed.
Click to expand it.
iris_unsafe.v
+
0
−
5
View file @
730a9f4a
...
@@ -11,11 +11,6 @@ Module Unsafety (RL : RA_T) (C : CORE_LANG).
...
@@ -11,11 +11,6 @@ Module Unsafety (RL : RA_T) (C : CORE_LANG).
Local
Open
Scope
bi_scope
.
Local
Open
Scope
bi_scope
.
Local
Open
Scope
iris_scope
.
Local
Open
Scope
iris_scope
.
(* PDS: Move to iris_core.v *)
Lemma
ownL_timeless
{
r
:
RL
.
res
}
:
valid
(
timeless
(
ownL
r
))
.
Proof
.
intros
w
n
_
w'
k
r'
HSW
HLE
.
auto
.
Qed
.
(* PDS: Hoist, somewhere. *)
(* PDS: Hoist, somewhere. *)
Program
Definition
restrictV
(
Q
:
expr
-
n
>
Props
)
:
vPred
:=
Program
Definition
restrictV
(
Q
:
expr
-
n
>
Props
)
:
vPred
:=
n
[(
fun
v
=>
Q
(
`
v
))]
.
n
[(
fun
v
=>
Q
(
`
v
))]
.
...
...
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