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
8d638edc
Commit
8d638edc
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
one-shot higher-order ghost variables
parent
c62bf902
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
_CoqProject
+1
-0
1 addition, 0 deletions
_CoqProject
program_logic/saved_one_shot.v
+63
-0
63 additions, 0 deletions
program_logic/saved_one_shot.v
with
64 additions
and
0 deletions
_CoqProject
+
1
−
0
View file @
8d638edc
...
@@ -72,6 +72,7 @@ program_logic/tests.v
...
@@ -72,6 +72,7 @@ program_logic/tests.v
program_logic/ghost_ownership.v
program_logic/ghost_ownership.v
program_logic/global_functor.v
program_logic/global_functor.v
program_logic/saved_prop.v
program_logic/saved_prop.v
program_logic/saved_one_shot.v
program_logic/auth.v
program_logic/auth.v
program_logic/sts.v
program_logic/sts.v
program_logic/namespaces.v
program_logic/namespaces.v
...
...
This diff is collapsed.
Click to expand it.
program_logic/saved_one_shot.v
0 → 100644
+
63
−
0
View file @
8d638edc
From
iris
.
algebra
Require
Export
agree
one_shot
.
From
iris
.
program_logic
Require
Export
ghost_ownership
.
Import
uPred
.
Class
oneShotG
(
Λ
:
language
)
(
Σ
:
gFunctors
)
(
F
:
cFunctor
)
:=
one_shot_inG
:>
inG
Λ
Σ
(
one_shotR
$
agreeR
$
laterC
$
F
(
iPreProp
Λ
(
globalF
Σ
)))
.
Definition
oneShotGF
(
F
:
cFunctor
)
:
gFunctor
:=
GFunctor
(
one_shotRF
(
agreeRF
(
▶
F
)))
.
Instance
inGF_oneShotG
`{
inGF
Λ
Σ
(
oneShotGF
F
)}
:
oneShotG
Λ
Σ
F
.
Proof
.
apply
:
inGF_inG
.
Qed
.
Definition
one_shot_pending
`{
oneShotG
Λ
Σ
F
}
(
γ
:
gname
)
:
iPropG
Λ
Σ
:=
own
γ
OneShotPending
.
Definition
one_shot_own
`{
oneShotG
Λ
Σ
F
}
(
γ
:
gname
)
(
x
:
F
(
iPropG
Λ
Σ
))
:
iPropG
Λ
Σ
:=
own
γ
(
Shot
$
to_agree
$
Next
(
cFunctor_map
F
(
iProp_fold
,
iProp_unfold
)
x
))
.
Typeclasses
Opaque
one_shot_pending
one_shot_own
.
Instance
:
Params
(
@
one_shot_own
)
4
.
Section
one_shot
.
Context
`{
oneShotG
Λ
Σ
F
}
.
Implicit
Types
x
y
:
F
(
iPropG
Λ
Σ
)
.
Implicit
Types
γ
:
gname
.
Global
Instance
ne_shot_own_persistent
γ
x
:
Persistent
(
one_shot_own
γ
x
)
.
Proof
.
by
rewrite
/
Persistent
always_own
.
Qed
.
Lemma
one_shot_alloc_strong
N
(
G
:
gset
gname
)
:
True
⊢
pvs
N
N
(
∃
γ
,
■
(
γ
∉
G
)
∧
one_shot_pending
γ
)
.
Proof
.
by
apply
own_alloc_strong
.
Qed
.
Lemma
one_shot_alloc
N
:
True
⊢
pvs
N
N
(
∃
γ
,
one_shot_pending
γ
)
.
Proof
.
by
apply
own_alloc
.
Qed
.
Lemma
one_shot_init
N
γ
x
:
one_shot_pending
γ
⊢
pvs
N
N
(
one_shot_own
γ
x
)
.
Proof
.
by
apply
own_update
,
one_shot_update_shoot
.
Qed
.
Lemma
one_shot_alloc_init
N
x
:
True
⊢
pvs
N
N
(
∃
γ
,
one_shot_own
γ
x
)
.
Proof
.
rewrite
(
one_shot_alloc
N
)
.
apply
pvs_strip_pvs
.
apply
exist_elim
=>
γ
.
rewrite
-
(
exist_intro
γ
)
.
apply
one_shot_init
.
Qed
.
Lemma
one_shot_agree
γ
x
y
:
(
one_shot_own
γ
x
★
one_shot_own
γ
y
)
⊢
▷
(
x
≡
y
)
.
Proof
.
rewrite
-
own_op
own_valid
one_shot_validI
/=
agree_validI
.
rewrite
agree_equivI
later_equivI
.
set
(
G1
:=
cFunctor_map
F
(
iProp_fold
,
iProp_unfold
))
.
set
(
G2
:=
cFunctor_map
F
(
@
iProp_unfold
Λ
(
globalF
Σ
),
@
iProp_fold
Λ
(
globalF
Σ
)))
.
assert
(
∀
z
,
G2
(
G1
z
)
≡
z
)
as
help
.
{
intros
z
.
rewrite
/
G1
/
G2
-
cFunctor_compose
-
{
2
}[
z
]
cFunctor_id
.
apply
(
ne_proper
(
cFunctor_map
F
));
split
=>?;
apply
iProp_fold_unfold
.
}
rewrite
-
{
2
}[
x
]
help
-
{
2
}[
y
]
help
.
apply
later_mono
.
apply
(
eq_rewrite
(
G1
x
)
(
G1
y
)
(
λ
z
,
G2
(
G1
x
)
≡
G2
z
))
%
I
;
first
solve_proper
;
auto
with
I
.
Qed
.
End
one_shot
.
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