Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Dan Frumin
ReLoC-v1
Commits
084fb1ac
Commit
084fb1ac
authored
Aug 22, 2017
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of some unnecessary closedness conditions
parent
f88e1b37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
F_mu_ref_conc/examples/counter.v
F_mu_ref_conc/examples/counter.v
+0
-3
F_mu_ref_conc/proofmode/classes.v
F_mu_ref_conc/proofmode/classes.v
+19
-0
F_mu_ref_conc/proofmode/rel_tactics.v
F_mu_ref_conc/proofmode/rel_tactics.v
+6
-6
No files found.
F_mu_ref_conc/examples/counter.v
View file @
084fb1ac
...
...
@@ -282,7 +282,6 @@ Section CG_Counter.
iApply
(
bin_log_related_pair
_
with
"[]"
).
-
rel_rec_l
.
{
unfold
FG_increment
.
unlock
.
simpl_subst
/=
.
solve_closed
.
}
unfold
CG_increment
.
unlock
.
rel_rec_r
.
rel_rec_r
.
...
...
@@ -291,9 +290,7 @@ Section CG_Counter.
{
unfold
CG_increment
.
unlock
;
simpl_subst
/=
.
reflexivity
.
}
iApply
(
FG_CG_increment_refinement
with
"Hinv"
).
-
rel_rec_l
.
{
unfold
counter_read
.
unlock
.
simpl_subst
/=
.
solve_closed
.
}
rel_rec_r
.
{
unfold
counter_read
.
unlock
.
simpl_subst
/=
.
solve_closed
.
}
iApply
(
counter_read_refinement
with
"Hinv"
).
Qed
.
End
CG_Counter
.
...
...
F_mu_ref_conc/proofmode/classes.v
View file @
084fb1ac
...
...
@@ -5,6 +5,25 @@ Class PureExec (P : Prop) (e1 e2 : expr) := {
pure_exec_puredet
:
P
->
∀
σ
1
e2
'
σ
2
efs
,
head_step
e1
σ
1
e2
'
σ
2
efs
->
σ
1
=
σ
2
/
\
e2
=
e2
'
/
\
[]
=
efs
;
}
.
(
*
DF
:
Some
tactics
will
loop
pretty
badly
and
consume
lots
of
memory
if
you
make
this
an
instance
*
)
Lemma
PureExec_Closed
P
e1
e2
`
{
Hcl
:
Closed
X
e1
}
`
{
HP
:
PureExec
P
e1
e2
}
:
P
->
Closed
X
e2
.
Proof
.
destruct
HP
as
[
Hpure
Hstep
].
intros
p
.
specialize
(
Hpure
p
).
specialize
(
Hstep
p
).
specialize
(
Hpure
inhabitant
).
unfold
head_reducible
in
*
.
destruct
Hpure
as
(
e
'
&
σ'
&
efs
&
Hst
).
destruct
(
Hstep
inhabitant
e
'
σ'
efs
Hst
)
as
(
?
&
?
&
?
);
subst
.
destruct
e1
;
inv_head_step
;
unfold
Closed
in
*
;
simpl
in
Hcl
;
simpl
;
destruct_and
?
;
split_and
?
;
eauto
.
-
apply
Closed_mono
with
∅
;
[
|
set_solver
].
destruct
f
,
x
;
simpl
in
*
;
eauto
;
repeat
apply
is_closed_subst_preserve
;
eauto
;
try
apply
of_val_closed
.
-
apply
of_val_closed
'
.
Qed
.
Instance
pure_binop
op
e1
v1
e2
v2
v
`
(
to_val
e1
=
Some
v1
)
`
(
to_val
e2
=
Some
v2
)
:
PureExec
(
binop_eval
op
v1
v2
=
Some
v
)
(
BinOp
op
e1
e2
)
...
...
F_mu_ref_conc/proofmode/rel_tactics.v
View file @
084fb1ac
...
...
@@ -99,12 +99,13 @@ Lemma tac_rel_pure_l `{logrelG Σ} K e1 Δ' E1 E2 Δ Γ e e2 ϕ t τ (b : bool)
PureExec
ϕ
e1
e2
→
ϕ
→
Closed
∅
e1
→
Closed
∅
e2
→
((
b
=
true
∧
E1
=
E2
)
∨
b
=
false
)
→
(
Δ'
⊢
▷
?
b
bin_log_related
E1
E2
Δ
Γ
(
fill
K
e2
)
t
τ
)
→
(
Δ'
⊢
bin_log_related
E1
E2
Δ
Γ
e
t
τ
).
Proof
.
intros
Hfill
Hpure
H
ϕ
??
Hb
Hp
.
subst
.
intros
Hfill
Hpure
H
ϕ
?
Hb
Hp
.
subst
.
assert
(
Closed
∅
e2
).
{
eapply
PureExec_Closed
;
eauto
.
}
destruct
b
.
-
destruct
Hb
as
[[
_
?
]
|
Hb
'
];
last
by
inversion
Hb
'
.
subst
.
rewrite
-
(
bin_log_pure_l
Δ
Γ
E2
K
e1
e2
t
τ
).
...
...
@@ -126,7 +127,6 @@ Tactic Notation "rel_pure_l" open_constr(ef) :=
|
apply
_
(
*
PureExec
ϕ
e1
e2
*
)
|
try
(
exact
I
||
reflexivity
||
tac_rel_done
)
|
try
(
simpl
;
solve_closed
)
(
*
Closed
∅
e1
*
)
|
try
(
simpl_subst
/=
;
solve_closed
)
(
*
Closed
∅
e2
*
)
(
*
we
might
get
subst
'
here
*
)
|
first
[
left
;
split
;
reflexivity
|
right
;
reflexivity
]
(
*
E1
=
E2
?
*
)
|
try
iNext
;
simpl_subst
/=
(
*
new
goal
*
)])
||
fail
"rel_pure_l: cannot find the reduct"
.
...
...
@@ -152,12 +152,13 @@ Lemma tac_rel_pure_r `{logrelG Σ} K e1 Δ' E1 E2 Δ Γ e e2 ϕ t τ :
PureExec
ϕ
e1
e2
→
ϕ
→
Closed
∅
e1
→
Closed
∅
e2
→
nclose
specN
⊆
E1
→
(
Δ'
⊢
bin_log_related
E1
E2
Δ
Γ
t
(
fill
K
e2
)
τ
)
→
(
Δ'
⊢
bin_log_related
E1
E2
Δ
Γ
t
e
τ
).
Proof
.
intros
Hfill
Hpure
H
ϕ
???
Hp
.
subst
.
intros
Hfill
Hpure
H
ϕ
??
Hp
.
subst
.
assert
(
Closed
∅
e2
).
{
eapply
PureExec_Closed
;
eauto
.
}
rewrite
-
(
bin_log_pure_r
Δ
Γ
E1
E2
K
e1
e2
t
τ
).
{
exact
Hp
.
}
{
assumption
.
}
...
...
@@ -177,7 +178,6 @@ Tactic Notation "rel_pure_r" open_constr(ef) :=
|
apply
_
(
*
PureExec
ϕ
e1
e2
*
)
|
try
(
exact
I
||
reflexivity
||
tac_rel_done
)
|
try
(
simpl
;
solve_closed
)
(
*
Closed
∅
e1
*
)
|
try
(
simpl_subst
/=
;
solve_closed
)
(
*
Closed
∅
e2
*
)
(
*
we
might
get
subst
'
here
*
)
|
solve_ndisj
(
*
↑
specN
⊆
E1
*
)
|
try
iNext
;
simpl_subst
/=
(
*
new
goal
*
)])
||
fail
"rel_pure_r: cannot find the reduct"
.
...
...
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