Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
Diaframe
Commits
8de9ff72
Commit
8de9ff72
authored
Mar 29, 2022
by
Ike Mulder
Browse files
Now reverting hypotheses if substituted variables occur in it.
parent
7b7705c5
Pipeline
#64016
passed with stage
in 8 minutes and 51 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Sidebyside
theories/examples/comparison/mcs_lock.v
View file @
8de9ff72
...
...
@@ 134,13 +134,7 @@ Section spec.
SPEC
{{
R
∗
acquired_node
γ
m
γ
n
γ
e
n
R
∗
is_lock
γ
m
γ
e
R
v
}}
release
v
#
n
{{
RET
#()
;
free_node
γ
m
n
}}.
Proof
.
iStepsS
;
last
iSmash
.
iRight
.
iStepsS
;
last
iSmash
.
(* need a revert since a detected equality rewrites the context, causing a Mergable instance to be missed *)
iReIntro
"H6"
.
iSmash
.
Qed
.
Proof
.
iSmash
.
Qed
.
Definition
acquired_mutual_exclusion
γ
m
γ
n1
γ
n2
γ
e
n
m
R
:
acquired_node
γ
m
γ
n1
γ
e
n
R
∗
acquired_node
γ
m
γ
n2
γ
e
m
R
⊢
False
:
=
verify
.
(* Cannot do Lemma _ : _ := verify unfortunately. If proper reuse is wanted this should be a Mergable instance *)
...
...
theories/examples/wip/logatom/atomic_clhlock.v
View file @
8de9ff72
...
...
@@ 108,7 +108,7 @@ Section spec.
iStepsS
;
[
iSmash


iSmash
].
iMod
"H5"
as
(
p
)
"[[Hl >Hp] [_ Hcl]]"
.
iReIntro
"Hp"
.
rewrite
left_id
.
iMod
(
"Hcl"
with
"[Hl H5 H
6
H10 H
11
H1 H3 H4]"
)
as
"HAU"
;
first
(
iFrame
;
iStepsS
).
iMod
(
"Hcl"
with
"[Hl H5 H
11
H10 H
7
H1 H3 H4]"
)
as
"HAU"
;
first
(
iFrame
;
iStepsS
).
iSmash
.
Qed
.
...
...
theories/lib/frac_token.v
View file @
8de9ff72
...
...
@@ 60,7 +60,7 @@ Section fractional_tokenizable.
split
.
{
apply
Qp_div_2
.
}
iDestruct
"H2"
as
"[H2 H2']"
.
iStepsS
.

do
4
iStepS
;
last
lia
.

do
4
iStepS
.
apply
Qp_lt_sum
in
H2
as
[
q
>].
iExists
q
.
iStepS
.
...
...
theories/steps/introduce_hyp.v
View file @
8de9ff72
...
...
@@ 347,6 +347,98 @@ Section coq_tactics.
End
coq_tactics
.
Fixpoint
revert_idents
{
PROP
:
bi
}
(
js
:
list
ident
)
Δ
G
:
option
(
envs
PROP
*
PROP
)
:
=
match
js
with

[]
=>
Some
(
Δ
,
G
)

j
::
js
=>
'
(
Δ
'
,
G'
)
←
revert_idents
js
Δ
G
;
'
(
p
,
H
)
←
envs_lookup
j
Δ
'
;
Some
(
envs_delete
true
j
p
Δ
'
,
IntroduceHyp
H
G'
)
end
.
Lemma
revert_idents_sound
{
PROP
:
bi
}
(
js
:
list
ident
)
Δ
(
G
:
PROP
)
:
match
revert_idents
js
Δ
G
with

Some
(
Δ
'
,
G'
)
=>
envs_entails
Δ
'
G'

_
=>
False
end
→
envs_entails
Δ
G
.
Proof
.
rewrite
envs_entails_eq
.
revert
Δ
G
.
induction
js
as
[
j
js
]
=>
//.
move
=>
Δ
G
.
cbn
.
destruct
(
revert_idents
_
_
_
)
as
[[
Δ
'
G'
]]
eqn
:
H
Δ
G
=>
//=.
destruct
(
envs_lookup
_
_
)
as
[[
p
P
]]
eqn
:
Hj
Δ
=>
//=.
move
=>
H
Δ
P
.
apply
IHjs
.
rewrite
H
Δ
G
.
rewrite
envs_lookup_sound
//.
apply
bi
.
wand_elim_r'
.
rewrite
H
Δ
P
.
unseal_diaframe
.
by
rewrite
bi
.
intuitionistically_if_elim
.
Qed
.
(* some ltacs to collect hypotheses which should be reintroduced *)
Ltac
collect_env_occs
x
Γ
i
acci
:
=
let
rec
mthd
Γ
acc
:
=
lazymatch
Γ
with

Enil
=>
acc

Esnoc
?
Γ
'
?i
?H
=>
lazymatch
H
with

context
[
x
]
=>
let
result
:
=
mthd
Γ
'
acc
in
constr
:
(
i
::
result
)

_
=>
mthd
Γ
'
acc
end
end
in
mthd
Γ
i
acci
.
Ltac
collect_envs_occs
x
Δ
:
=
let
init
:
=
constr
:
(@
nil
ident
)
in
let
Γ
s
:
=
eval
cbn
in
(
env_spatial
Δ
)
in
let
result_s
:
=
collect_env_occs
x
Γ
s
init
in
let
Γ
p
:
=
eval
cbn
in
(
env_intuitionistic
Δ
)
in
collect_env_occs
x
Γ
p
result_s
.
Ltac
my_subst
x
:
=
assert_succeeds
(
subst
x
)
;
lazymatch
goal
with


envs_entails
?
Δ
?G
=>
let
result
:
=
collect_envs_occs
x
Δ
in
refine
(
revert_idents_sound
result
Δ
G
_
)
;
simpl
;
subst
x
end
.
(* adapted from stdpp's simplify_eq *)
Tactic
Notation
"simplify_hyp_eq"
:
=
match
goal
with


?Htype
→
?G
=>
let
H
:
=
fresh
"H"
in
intro
H
;
repeat
match
type
of
H
with

_
≠
_
=>
by
case
H
;
try
clear
H

_
=
_
→
False
=>
by
case
H
;
try
clear
H

?x
=
_
=>
my_subst
x

_
=
?x
=>
my_subst
x

_
=
_
=>
discriminate
H

_
≡
_
=>
apply
leibniz_equiv
in
H

?f
_
=
?f
_
=>
apply
(
inj
f
)
in
H

?f
_
_
=
?f
_
_
=>
apply
(
inj2
f
)
in
H
;
destruct
H
(* before [injection] to circumvent bug #2939 in some situations *)

?f
_
=
?f
_
=>
progress
injection
H
as
H
(* first hyp will be named [H], subsequent hyps will be given fresh names *)

?f
_
_
=
?f
_
_
=>
progress
injection
H
as
H

?f
_
_
_
=
?f
_
_
_
=>
progress
injection
H
as
H

?f
_
_
_
_
=
?f
_
_
_
_
=>
progress
injection
H
as
H

?f
_
_
_
_
_
=
?f
_
_
_
_
_
=>
progress
injection
H
as
H

?f
_
_
_
_
_
_
=
?f
_
_
_
_
_
_
=>
progress
injection
H
as
H

?x
=
?x
=>
clear
H

@
existT
?A
_
_
_
=
existT
_
_
=>
apply
(
Eqdep_dec
.
inj_pair2_eq_dec
_
(
decide_rel
(=@{
A
})))
in
H
end
end
.
Ltac
simplifySolveSepPureHyp
:
=
lazymatch
goal
with


?
φ
→
?P
=>
...
...
@@ 356,7 +448,7 @@ Ltac simplifySolveSepPureHyp :=

lazymatch
φ
with

True
=>
intros
_

?a
=
?a
=>
intros
_

_
=>
intros
;
simplify_
eq
;
subst

_
=>
simplify_
hyp_eq
end
]
end
.
...
...
theories/steps/introduce_var.v
View file @
8de9ff72
...
...
@@ 35,6 +35,6 @@ End introduce_var.
Ltac
introduceVarStep
:
=
first
first
(* is this subst necessary? *)
[
apply
tac_introduce_vars_teleS
;
simpl
;
intros
;
subst
;
simpl

apply
tac_introduce_vars_teleO
].
\ No newline at end of file
Write
Preview
Supports
Markdown
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