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
R
ReLoC-v1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
Dan Frumin
ReLoC-v1
Commits
0fd743a8
Commit
0fd743a8
authored
Oct 15, 2017
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the "single return" example
parent
39800179
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
theories/examples/various.v
theories/examples/various.v
+40
-2
No files found.
theories/examples/various.v
View file @
0fd743a8
...
...
@@ -123,7 +123,7 @@ Section refinement.
b
↦ᵢ
#
true
∗
b
'
↦ₛ
#
true
)
∨
(
b
↦ᵢ
#
false
∗
b
'
↦ₛ
#
false
))
%
I
.
Definition
i3n
:=
nroot
.
@
"i3"
.
Lemma
refinement3
Γ
:
Lemma
refinement3
Γ
:
Γ
⊨
let:
"b"
:=
ref
#
true
in
let:
"x"
:=
ref
#
0
in
...
...
@@ -212,7 +212,7 @@ Section refinement.
Without
locking
in
the
first
expression
,
the
callback
can
reenter
the
body
in
a
forked
thread
to
change
the
value
of
x
*
)
Lemma
refinement4
Γ
`
{!
lockG
Σ
}:
Lemma
refinement4
Γ
`
{!
lockG
Σ
}:
Γ
⊨
(
let
:
"x"
:=
ref
#
1
in
let:
"l"
:=
newlock
#()
in
...
...
@@ -261,4 +261,42 @@ Section refinement.
rel_vals
;
eauto
.
Qed
.
(
*
"Single return"
example
*
)
Lemma
refinement5
Γ
:
Γ
⊨
(
λ
:
"f"
,
let
:
"x"
:=
ref
#
0
in
let:
"y"
:=
ref
#
0
in
"f"
#();;
"x"
<-
!
"y"
;;
"y"
<-
#
1
;;
!
"x"
)
≤
log
≤
(
λ
:
"f"
,
let
:
"x"
:=
ref
#
0
in
let:
"y"
:=
ref
#
0
in
"f"
#();;
"x"
<-
!
"y"
;;
"y"
<-
#
2
;;
!
"x"
)
:
TArrow
(
TArrow
TUnit
TUnit
)
TNat
.
Proof
.
iIntros
(
Δ
).
iApply
bin_log_related_arrow
;
eauto
.
iAlways
.
iIntros
(
f1
f2
)
"Hf"
.
rel_let_l
.
rel_let_r
.
rel_alloc_l
as
x
"Hx"
.
rel_let_l
.
rel_alloc_l
as
y
"Hy"
.
rel_let_l
.
rel_alloc_r
as
x
'
"Hx'"
.
rel_let_r
.
rel_alloc_r
as
y
'
"Hy'"
.
rel_let_r
.
iApply
(
bin_log_related_seq
with
"[Hf]"
);
eauto
.
{
iApply
(
bin_log_related_app
with
"Hf"
).
iApply
bin_log_related_unit
.
}
rel_load_l
.
rel_load_r
.
rel_store_l
.
rel_store_r
.
rel_let_l
.
rel_let_r
.
rel_store_l
.
rel_store_r
.
rel_let_l
.
rel_let_r
.
rel_load_l
.
rel_load_r
.
iApply
bin_log_related_nat
.
Qed
.
End
refinement
.
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