Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joshua Yanovski
iris-coq
Commits
97bd63aa
Commit
97bd63aa
authored
Mar 07, 2017
by
Robbert Krebbers
Browse files
More sane/consistent syntax for modal specialization patterns.
parent
87a8a19c
Changes
6
Hide whitespace changes
Inline
Side-by-side
ProofMode.md
View file @
97bd63aa
...
...
@@ -242,12 +242,10 @@ _specification patterns_ to express splitting of hypotheses:
consumed. Hypotheses may be prefixed with a
`$`
, which results in them being
framed in the generated goal for the premise.
-
`[-H1 ... Hn]`
: negated form of the above pattern.
-
`
>
[H1 ... Hn]`
: same as the above pattern, but can only be used if the goal
-
`[
>
H1 ... Hn]`
: same as the above pattern, but can only be used if the goal
is a modality, in which case the modality will be kept in the generated goal
for the premise will be wrapped into the modality.
-
`>[-H1 ... Hn]`
: negated form of the above pattern.
-
`>`
: shorthand for
`>[-]`
(typically used for the last premise of an applied
lemma).
-
`[> -H1 ... Hn]`
: negated form of the above pattern.
-
`[#]`
: This pattern can be used when eliminating
`P -∗ Q`
with
`P`
being
persistent. Using this pattern, all hypotheses are available in the goal for
`P`
, as well the remaining goal. The pattern can optionally contain
...
...
theories/base_logic/lib/boxes.v
View file @
97bd63aa
...
...
@@ -225,7 +225,7 @@ Lemma box_empty E f P :
Proof
.
iDestruct
1
as
(
Φ
)
"[#HeqP Hf]"
.
iAssert
([
∗
map
]
γ↦
b
∈
f
,
▷
Φ
γ
∗
box_own_auth
γ
(
◯
Excl
'
false
)
∗
box_own_prop
γ
(
Φ
γ
)
∗
inv
N
(
slice_inv
γ
(
Φ
γ
)))
%
I
with
"
>
[Hf]"
as
"[HΦ ?]"
.
box_own_prop
γ
(
Φ
γ
)
∗
inv
N
(
slice_inv
γ
(
Φ
γ
)))
%
I
with
"[
>
Hf]"
as
"[HΦ ?]"
.
{
iApply
(
fupd_big_sepM
_
_
f
);
iApply
(
big_sepM_impl
_
_
f
);
iFrame
"Hf"
.
iAlways
;
iIntros
(
γ
b
?
)
"(Hγ' & #HγΦ & #Hinv)"
.
assert
(
true
=
b
)
as
<-
by
eauto
.
...
...
theories/heap_lang/lib/barrier/proof.v
View file @
97bd63aa
...
...
@@ -93,7 +93,7 @@ Lemma newbarrier_spec (P : iProp Σ) :
Proof
.
iIntros
(
Φ
)
"HΦ"
.
rewrite
-
wp_fupd
/
newbarrier
/=
.
wp_seq
.
wp_alloc
l
as
"Hl"
.
iApply
(
"HΦ"
with
"
>
[-]"
).
iApply
(
"HΦ"
with
"[
>
-]"
).
iMod
(
saved_prop_alloc
(
F
:=
idCF
)
P
)
as
(
γ
)
"#?"
.
iMod
(
sts_alloc
(
barrier_inv
l
P
)
_
N
(
State
Low
{
[
γ
]
}
)
with
"[-]"
)
as
(
γ'
)
"[#? Hγ']"
;
eauto
.
...
...
@@ -102,7 +102,7 @@ Proof.
iAssert
(
barrier_ctx
γ'
l
P
)
%
I
as
"#?"
.
{
done
.
}
iAssert
(
sts_ownS
γ'
(
i_states
γ
)
{
[
Change
γ
]
}
∗
sts_ownS
γ'
low_states
{
[
Send
]
}
)
%
I
with
"
>
[-]"
as
"[Hr Hs]"
.
∗
sts_ownS
γ'
low_states
{
[
Send
]
}
)
%
I
with
"[
>
-]"
as
"[Hr Hs]"
.
{
iApply
sts_ownS_op
;
eauto
using
i_states_closed
,
low_states_closed
.
-
set_solver
.
-
iApply
(
sts_own_weaken
with
"Hγ'"
);
...
...
@@ -140,7 +140,7 @@ Proof.
wp_load
.
destruct
p
.
-
iMod
(
"Hclose"
$
!
(
State
Low
I
)
{
[
Change
i
]
}
with
"[Hl Hr]"
)
as
"Hγ"
.
{
iSplit
;
first
done
.
rewrite
/
barrier_inv
/=
.
by
iFrame
.
}
iAssert
(
sts_ownS
γ
(
i_states
i
)
{
[
Change
i
]
}
)
%
I
with
"
>
[Hγ]"
as
"Hγ"
.
iAssert
(
sts_ownS
γ
(
i_states
i
)
{
[
Change
i
]
}
)
%
I
with
"[
>
Hγ]"
as
"Hγ"
.
{
iApply
(
sts_own_weaken
with
"Hγ"
);
eauto
using
i_states_closed
.
}
iModIntro
.
wp_if
.
iApply
(
"IH"
with
"Hγ [HQR] [HΦ]"
);
auto
.
...
...
@@ -175,7 +175,7 @@ Proof.
rewrite
/
barrier_inv
/=
.
iNext
.
iFrame
"Hl"
.
by
iApply
(
ress_split
with
"HQ Hi1 Hi2 HQR"
).
}
iAssert
(
sts_ownS
γ
(
i_states
i1
)
{
[
Change
i1
]
}
∗
sts_ownS
γ
(
i_states
i2
)
{
[
Change
i2
]
}
)
%
I
with
"
>
[-]"
as
"[Hγ1 Hγ2]"
.
∗
sts_ownS
γ
(
i_states
i2
)
{
[
Change
i2
]
}
)
%
I
with
"[
>
-]"
as
"[Hγ1 Hγ2]"
.
{
iApply
sts_ownS_op
;
eauto
using
i_states_closed
,
low_states_closed
.
-
abstract
set_solver
.
-
iApply
(
sts_own_weaken
with
"Hγ"
);
...
...
theories/program_logic/weakestpre.v
View file @
97bd63aa
...
...
@@ -129,7 +129,7 @@ Lemma wp_strong_mono E1 E2 e Φ Ψ :
Proof
.
iIntros
(
?
)
"[HΦ H]"
.
iL
ö
b
as
"IH"
forall
(
e
).
rewrite
!
wp_unfold
/
wp_pre
.
destruct
(
to_val
e
)
as
[
v
|
]
eqn
:?
.
{
iApply
(
"HΦ"
with
"
>
[-]"
).
by
iApply
(
fupd_mask_mono
E1
_
).
}
{
iApply
(
"HΦ"
with
"[
>
-]"
).
by
iApply
(
fupd_mask_mono
E1
_
).
}
iIntros
(
σ
1
)
"Hσ"
.
iMod
(
fupd_intro_mask
'
E2
E1
)
as
"Hclose"
;
first
done
.
iMod
(
"H"
with
"[$]"
)
as
"[$ H]"
.
iModIntro
.
iNext
.
iIntros
(
e2
σ
2
efs
Hstep
).
...
...
theories/proofmode/spec_patterns.v
View file @
97bd63aa
...
...
@@ -41,14 +41,13 @@ Fixpoint parse_go (ts : list token) (k : list spec_pat) : option (list spec_pat)
parse_go
ts
(
SAutoFrame
GPersistent
::
k
)
|
TBracketL
::
TFrame
::
TBracketR
::
ts
=>
parse_go
ts
(
SAutoFrame
GSpatial
::
k
)
|
T
Modal
::
TBracketL
::
TFrame
::
TBracketR
::
ts
=>
|
T
BracketL
::
TModal
::
TFrame
::
TBracketR
::
ts
=>
parse_go
ts
(
SAutoFrame
GModal
::
k
)
|
TBracketL
::
TPure
::
TBracketR
::
ts
=>
parse_go
ts
(
SPureGoal
false
::
k
)
|
TBracketL
::
TPure
::
TDone
::
TBracketR
::
ts
=>
parse_go
ts
(
SPureGoal
true
::
k
)
|
TBracketL
::
TAlways
::
ts
=>
parse_goal
ts
GPersistent
false
[]
[]
k
|
TBracketL
::
TModal
::
ts
=>
parse_goal
ts
GModal
false
[]
[]
k
|
TBracketL
::
ts
=>
parse_goal
ts
GSpatial
false
[]
[]
k
|
TModal
::
TBracketL
::
ts
=>
parse_goal
ts
GModal
false
[]
[]
k
|
TModal
::
ts
=>
parse_go
ts
(
SGoal
(
SpecGoal
GModal
true
[]
[]
false
)
::
k
)
|
TForall
::
ts
=>
parse_go
ts
(
SForall
::
k
)
|
_
=>
None
end
...
...
theories/tests/proofmode.v
View file @
97bd63aa
...
...
@@ -96,7 +96,7 @@ Section iris.
(
True
-
∗
P
-
∗
inv
N
Q
-
∗
True
-
∗
R
)
-
∗
P
-
∗
▷
Q
={
E
}=
∗
R
.
Proof
.
iIntros
(
?
)
"H HP HQ"
.
iApply
(
"H"
with
"[% //]
HP >[
HQ]
>
[//]"
).
iApply
(
"H"
with
"[% //]
[$] [>
HQ] [
>
//]"
).
by
iApply
inv_alloc
.
Qed
.
End
iris
.
...
...
@@ -124,7 +124,7 @@ Lemma demo_12 (M : ucmraT) (P : Z → uPred M) : (∀ x, P x) -∗ ∃ x, P x.
Proof
.
iIntros
"HP"
.
iExists
(
0
:
nat
).
iApply
(
"HP"
$
!
(
0
:
nat
)).
Qed
.
Lemma
demo_13
(
M
:
ucmraT
)
(
P
:
uPred
M
)
:
(
|==>
False
)
-
∗
|==>
P
.
Proof
.
iIntros
.
iAssert
False
%
I
with
"
>[-
]"
as
"
[]
"
.
done
.
Qed
.
Proof
.
iIntros
.
iAssert
False
%
I
with
"
[> - //
]"
as
%
[].
Qed
.
Lemma
demo_14
(
M
:
ucmraT
)
(
P
:
uPred
M
)
:
False
-
∗
P
.
Proof
.
iIntros
"H"
.
done
.
Qed
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment