Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
transfinite
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
Iris
transfinite
Commits
6ee7c69e
Commit
6ee7c69e
authored
5 months ago
by
Simon Spies
Browse files
Options
Downloads
Patches
Plain Diff
add derived rules for termination
parent
49b14e9f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#110409
passed
5 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_CoqProject
+2
-1
2 additions, 1 deletion
_CoqProject
theories/examples/termination/derived.v
+88
-0
88 additions, 0 deletions
theories/examples/termination/derived.v
with
90 additions
and
1 deletion
_CoqProject
+
2
−
1
View file @
6ee7c69e
...
@@ -135,6 +135,7 @@ theories/examples/transfinite.v
...
@@ -135,6 +135,7 @@ theories/examples/transfinite.v
# derived Hoare triples
# derived Hoare triples
theories/examples/refinements/derived.v
theories/examples/refinements/derived.v
theories/examples/termination/derived.v
# key ideas
# key ideas
theories/examples/keyideas/simulations.v
theories/examples/keyideas/simulations.v
...
@@ -150,7 +151,7 @@ theories/examples/safety/ticket_lock.v
...
@@ -150,7 +151,7 @@ theories/examples/safety/ticket_lock.v
theories/examples/safety/nondet_bool.v
theories/examples/safety/nondet_bool.v
theories/examples/safety/counter.v
theories/examples/safety/counter.v
theories/examples/safety/lazy_coin.v
theories/examples/safety/lazy_coin.v
theories/examples/safety/clairvoyant_coin.v
theories/examples/safety/clairvoyant_coin.v
theories/examples/safety/barrier/barrier.v
theories/examples/safety/barrier/barrier.v
theories/examples/safety/barrier/proof.v
theories/examples/safety/barrier/proof.v
...
...
This diff is collapsed.
Click to expand it.
theories/examples/termination/derived.v
0 → 100644
+
88
−
0
View file @
6ee7c69e
From
iris
.
program_logic
.
refinement
Require
Export
ref_weakestpre
ref_adequacy
seq_weakestpre
.
From
iris
.
examples
.
refinements
Require
Export
refinement
.
From
iris
.
algebra
Require
Import
auth
.
From
iris
.
heap_lang
Require
Import
proofmode
notation
.
From
iris
.
proofmode
Require
Import
tactics
.
Set
Default
Proof
Using
"Type"
.
(* We illustrate here how to derive the rules shown in the paper *)
Section
derived
.
Context
{
SI
}
{
Σ
:
gFunctors
SI
}
`{
Hheap
:
!
heapG
Σ
}
`{
Htc
:
!
tcG
Σ
}
`{
Hseq
:
!
seqG
Σ
}
.
Definition
seq_rswp
E
e
φ
:
iProp
Σ
:=
(
na_own
seqG_name
E
-∗
RSWP
e
at
0
⟨⟨
v
,
na_own
seqG_name
E
∗
φ
v
⟩⟩
)
%
I
.
Notation
"⟨⟨ P ⟩ ⟩ e ⟨⟨ v , Q ⟩ ⟩"
:=
(
□
(
P
-∗
(
seq_rswp
⊤
e
(
λ
v
,
Q
))))
%
I
(
at
level
20
,
P
,
e
,
Q
at
level
200
,
format
"⟨⟨ P ⟩ ⟩ e ⟨⟨ v , Q ⟩ ⟩"
)
:
stdpp_scope
.
Notation
"{{ P } } e {{ v , Q } }"
:=
(
□
(
P
-∗
SEQ
e
⟨⟨
v
,
Q
⟩⟩
))
%
I
(
at
level
20
,
P
,
e
,
Q
at
level
200
,
format
"{{ P } } e {{ v , Q } }"
)
:
stdpp_scope
.
(* Extended Refinement Program Logic of Transfinite Iris *)
Lemma
value_term
(
v
:
val
):
(
⊢
{{
True
}}
v
{{
w
,
⌜
v
=
w
⌝
}})
%
I
.
Proof
.
iIntros
"!> _ $"
.
by
iApply
rwp_value
.
Qed
.
Lemma
bind_term
(
e
:
expr
)
K
P
Q
R
:
({{
P
}}
e
{{
v
,
Q
v
}}
∗
(
∀
v
:
val
,
({{
Q
v
}}
fill
K
(
Val
v
)
{{
w
,
R
w
}}))
⊢
{{
P
}}
fill
K
e
{{
v
,
R
v
}})
%
I
.
Proof
.
iIntros
"[#H1 #H2] !> P Hna"
.
iApply
rwp_bind
.
iSpecialize
(
"H1"
with
"P Hna"
)
.
iApply
(
rwp_strong_mono
with
"H1 []"
);
auto
.
iIntros
(
v
)
"[Hna Q] !>"
.
iApply
(
"H2"
with
"Q Hna"
)
.
Qed
.
Lemma
pure_term
(
e
e'
:
expr
)
P
Q
:
pure_step
e
e'
→
({{
P
}}
e'
{{
v
,
Q
v
}}
⊢
⟨⟨
P
⟩⟩
e
⟨⟨
v
,
Q
v
⟩⟩
)
%
I
.
Proof
.
iIntros
(
Hstep
)
"#H !> P Hna"
.
iApply
(
ref_lifting
.
rswp_pure_step_later
_
_
_
_
_
True
);
[|
done
|
by
iApply
(
"H"
with
"P Hna"
)]
.
intros
_
.
apply
nsteps_once
,
Hstep
.
Qed
.
Lemma
store_term
l
(
v1
v2
:
val
):
(
True
⊢
⟨⟨
l
↦
v1
⟩⟩
#
l
<-
v2
⟨⟨
w
,
⌜
w
=
#
()
⌝
∗
l
↦
v2
⟩⟩
)
%
I
.
Proof
.
iIntros
"_ !> Hl $"
.
iApply
(
rswp_store
with
"[$Hl]"
)
.
by
iIntros
"$"
.
Qed
.
Lemma
load_term
l
v
:
(
True
⊢
⟨⟨
l
↦
v
⟩⟩
!
#
l
⟨⟨
w
,
⌜
w
=
v
⌝
∗
l
↦
v
⟩⟩
)
%
I
.
Proof
.
iIntros
"_ !> Hl $"
.
iApply
(
rswp_load
with
"[$Hl]"
)
.
by
iIntros
"$"
.
Qed
.
Lemma
ref_term
(
v
:
val
):
(
True
⊢
⟨⟨
True
⟩⟩
ref
v
⟨⟨
w
,
∃
l
:
loc
,
⌜
w
=
#
l
⌝
∗
l
↦
v
⟩⟩
)
%
I
.
Proof
.
iIntros
"_ !> _ $"
.
iApply
(
rswp_alloc
with
"[//]"
)
.
iIntros
(
l
)
"[Hl _]"
.
iExists
l
.
by
iFrame
.
Qed
.
Lemma
flip_term
(
e
:
expr
)
P
Q
:
to_val
e
=
None
→
(
⟨⟨
P
⟩⟩
e
⟨⟨
v
,
Q
v
⟩⟩
⊢
{{
P
}}
e
{{
v
,
Q
v
}})
%
I
.
Proof
.
iIntros
(
H
)
"#H !> P Hna"
.
iApply
rwp_no_step
;
first
done
.
by
iApply
(
"H"
with
"P Hna"
)
.
Qed
.
Lemma
spend_cred_term
P
et
Q
α
β
:
to_val
et
=
None
→
ord_lt
β
α
→
⟨⟨
$
β
∗
P
⟩⟩
et
⟨⟨
v
,
Q
v
⟩⟩
⊢
{{
$
α
∗
▷
P
}}
et
{{
v
,
Q
v
}}
.
Proof
.
iIntros
(
He
Hlt
)
"#H !> [Hc P] Hna"
.
iApply
(
rwp_take_step
with
"[Hna P] [Hc]"
);
first
done
;
last
first
.
-
iApply
(
@
auth_src_update
_
_
(
ordA
SI
)
with
"Hc"
)
.
apply
Hlt
.
-
iIntros
"Hβ"
.
iApply
rswp_do_step
.
iNext
.
iApply
(
"H"
with
"[$P $Hβ] Hna"
)
.
Qed
.
Lemma
split_cred_term
α
β
:
$
(
α
⊕
β
)
⊣⊢
$
α
∗
$
β
.
Proof
.
rewrite
srcF_split
//.
Qed
.
End
derived
.
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