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
I
iris-coq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Janno
iris-coq
Commits
3d1e22c5
Commit
3d1e22c5
authored
Jul 05, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ralf/pm' into 'gen_proofmode'
Split prettification from proof mode reduction See merge request FP/iris-coq!170
parents
a0edf35d
cf68129f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
27 deletions
+133
-27
tests/proofmode.ref
tests/proofmode.ref
+61
-3
tests/proofmode.v
tests/proofmode.v
+49
-2
theories/proofmode/class_instances_bi.v
theories/proofmode/class_instances_bi.v
+5
-2
theories/proofmode/classes.v
theories/proofmode/classes.v
+2
-2
theories/proofmode/ltac_tactics.v
theories/proofmode/ltac_tactics.v
+1
-1
theories/proofmode/reduction.v
theories/proofmode/reduction.v
+15
-17
No files found.
tests/proofmode.ref
View file @
3d1e22c5
"demo_0"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -19,6 +21,8 @@
...
@@ -19,6 +21,8 @@
--------------------------------------□
--------------------------------------□
Q ∨ P
Q ∨ P
"test_iDestruct_and_emp"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -59,6 +63,8 @@ In nested Ltac calls to "iSpecialize (open_constr)",
...
@@ -59,6 +63,8 @@ In nested Ltac calls to "iSpecialize (open_constr)",
"iSpecializePat (open_constr) (constr)" and "iSpecializePat_go", last call
"iSpecializePat (open_constr) (constr)" and "iSpecializePat_go", last call
failed.
failed.
Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I with P.
Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I with P.
"test_iNext_plus_3"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -68,6 +74,8 @@ Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I wi
...
@@ -68,6 +74,8 @@ Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I wi
--------------------------------------∗
--------------------------------------∗
▷^(S n + S m) emp
▷^(S n + S m) emp
"test_iFrame_later_1"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -76,6 +84,8 @@ Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I wi
...
@@ -76,6 +84,8 @@ Tactic failure: iSpecialize: cannot instantiate (⌜φ⌝ → P -∗ False)%I wi
--------------------------------------∗
--------------------------------------∗
▷ emp
▷ emp
"test_iFrame_later_2"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -89,6 +99,8 @@ In nested Ltac calls to "iFrame (constr)",
...
@@ -89,6 +99,8 @@ In nested Ltac calls to "iFrame (constr)",
"<iris.proofmode.ltac_tactics.iFrame_go>" and
"<iris.proofmode.ltac_tactics.iFrame_go>" and
"<iris.proofmode.ltac_tactics.iFrameHyp>", last call failed.
"<iris.proofmode.ltac_tactics.iFrameHyp>", last call failed.
Tactic failure: iFrame: cannot frame Q.
Tactic failure: iFrame: cannot frame Q.
"test_and_sep_affine_bi"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -100,6 +112,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -100,6 +112,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
□ P
□ P
"test_big_sepL_simpl"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -126,6 +140,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -126,6 +140,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
P
P
"test_big_sepL2_simpl"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -153,6 +169,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -153,6 +169,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
P ∨ True ∗ ([∗ list] _;_ ∈ l1;l2, True)
P ∨ True ∗ ([∗ list] _;_ ∈ l1;l2, True)
"test_big_sepL2_iDestruct"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -165,6 +183,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -165,6 +183,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
<absorb> Φ x1 x2
<absorb> Φ x1 x2
"test_reducing_after_iDestruct"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -173,6 +193,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -173,6 +193,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
True
True
"test_reducing_after_iApply"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -181,6 +203,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -181,6 +203,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------□
--------------------------------------□
□ emp
□ emp
"test_reducing_after_iApply_late_evar"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -189,6 +213,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -189,6 +213,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------□
--------------------------------------□
□ emp
□ emp
"test_wandM"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -197,7 +223,7 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -197,7 +223,7 @@ Tactic failure: iFrame: cannot frame Q.
============================
============================
"HPQ" : mP -∗? Q
"HPQ" : mP -∗? Q
"HQR" : Q -∗ R
"HQR" : Q -∗ R
"HP" :
pm_
default emp mP
"HP" : default emp mP
--------------------------------------∗
--------------------------------------∗
R
R
...
@@ -207,10 +233,28 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -207,10 +233,28 @@ Tactic failure: iFrame: cannot frame Q.
mP : option PROP
mP : option PROP
Q, R : PROP
Q, R : PROP
============================
============================
"HP" : pm_default emp mP
"HP" : default emp mP
--------------------------------------∗
default emp mP
"elim_mod_accessor"
: string
1 subgoal
PROP : sbi
BiFUpd0 : BiFUpd PROP
X : Type
E1, E2 : coPset.coPset
α : X → PROP
β : X → PROP
γ : X → option PROP
============================
"Hacc" : ∃ x : X, α x ∗ (β x ={E2,E1}=∗ default emp (γ x))
--------------------------------------∗
--------------------------------------∗
pm_default emp mP
|={E2,E1}=> True
"print_long_line_1"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -233,6 +277,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -233,6 +277,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
True
True
"print_long_line_2"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -255,6 +301,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -255,6 +301,8 @@ Tactic failure: iFrame: cannot frame Q.
--------------------------------------∗
--------------------------------------∗
True
True
"long_impl"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -265,6 +313,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -265,6 +313,8 @@ Tactic failure: iFrame: cannot frame Q.
PPPPPPPPPPPPPPPPP
PPPPPPPPPPPPPPPPP
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
"long_impl_nested"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -276,6 +326,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -276,6 +326,8 @@ Tactic failure: iFrame: cannot frame Q.
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
→ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
"long_wand"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -286,6 +338,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -286,6 +338,8 @@ Tactic failure: iFrame: cannot frame Q.
PPPPPPPPPPPPPPPPP
PPPPPPPPPPPPPPPPP
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
"long_wand_nested"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -297,6 +351,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -297,6 +351,8 @@ Tactic failure: iFrame: cannot frame Q.
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
-∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
"long_fupd"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
@@ -308,6 +364,8 @@ Tactic failure: iFrame: cannot frame Q.
...
@@ -308,6 +364,8 @@ Tactic failure: iFrame: cannot frame Q.
PPPPPPPPPPPPPPPPP
PPPPPPPPPPPPPPPPP
={E}=∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
={E}=∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ ∗ QQQQQQQQQQQQQQQQQQ
"long_fupd_nested"
: string
1 subgoal
1 subgoal
PROP : sbi
PROP : sbi
...
...
tests/proofmode.v
View file @
3d1e22c5
...
@@ -6,6 +6,7 @@ Section tests.
...
@@ -6,6 +6,7 @@ Section tests.
Context
{
PROP
:
sbi
}.
Context
{
PROP
:
sbi
}.
Implicit
Types
P
Q
R
:
PROP
.
Implicit
Types
P
Q
R
:
PROP
.
Check
"demo_0"
.
Lemma
demo_0
P
Q
:
□
(
P
∨
Q
)
-
∗
(
∀
x
,
⌜
x
=
0
⌝
∨
⌜
x
=
1
⌝
)
→
(
Q
∨
P
).
Lemma
demo_0
P
Q
:
□
(
P
∨
Q
)
-
∗
(
∀
x
,
⌜
x
=
0
⌝
∨
⌜
x
=
1
⌝
)
→
(
Q
∨
P
).
Proof
.
Proof
.
iIntros
"H #H2"
.
Show
.
iDestruct
"H"
as
"###H"
.
iIntros
"H #H2"
.
Show
.
iDestruct
"H"
as
"###H"
.
...
@@ -52,6 +53,7 @@ Proof.
...
@@ -52,6 +53,7 @@ Proof.
auto
.
auto
.
Qed
.
Qed
.
Check
"test_iDestruct_and_emp"
.
Lemma
test_iDestruct_and_emp
P
Q
`
{!
Persistent
P
,
!
Persistent
Q
}
:
Lemma
test_iDestruct_and_emp
P
Q
`
{!
Persistent
P
,
!
Persistent
Q
}
:
P
∧
emp
-
∗
emp
∧
Q
-
∗
<
affine
>
(
P
∗
Q
).
P
∧
emp
-
∗
emp
∧
Q
-
∗
<
affine
>
(
P
∗
Q
).
Proof
.
iIntros
"[#? _] [_ #?]"
.
Show
.
auto
.
Qed
.
Proof
.
iIntros
"[#? _] [_ #?]"
.
Show
.
auto
.
Qed
.
...
@@ -365,6 +367,7 @@ Lemma test_iNext_plus_1 P n1 n2 : ▷ ▷^n1 ▷^n2 P -∗ ▷^n1 ▷^n2 ▷ P.
...
@@ -365,6 +367,7 @@ Lemma test_iNext_plus_1 P n1 n2 : ▷ ▷^n1 ▷^n2 P -∗ ▷^n1 ▷^n2 ▷ P.
Proof
.
iIntros
"H"
.
iNext
.
iNext
.
by
iNext
.
Qed
.
Proof
.
iIntros
"H"
.
iNext
.
iNext
.
by
iNext
.
Qed
.
Lemma
test_iNext_plus_2
P
n
m
:
▷
^
n
▷
^
m
P
-
∗
▷
^(
n
+
m
)
P
.
Lemma
test_iNext_plus_2
P
n
m
:
▷
^
n
▷
^
m
P
-
∗
▷
^(
n
+
m
)
P
.
Proof
.
iIntros
"H"
.
iNext
.
done
.
Qed
.
Proof
.
iIntros
"H"
.
iNext
.
done
.
Qed
.
Check
"test_iNext_plus_3"
.
Lemma
test_iNext_plus_3
P
Q
n
m
k
:
Lemma
test_iNext_plus_3
P
Q
n
m
k
:
▷
^
m
▷
^(
2
+
S
n
+
k
)
P
-
∗
▷
^
m
▷
▷
^(
2
+
S
n
)
Q
-
∗
▷
^
k
▷
▷
^(
S
(
S
n
+
S
m
))
(
P
∗
Q
).
▷
^
m
▷
^(
2
+
S
n
+
k
)
P
-
∗
▷
^
m
▷
▷
^(
2
+
S
n
)
Q
-
∗
▷
^
k
▷
▷
^(
S
(
S
n
+
S
m
))
(
P
∗
Q
).
Proof
.
iIntros
"H1 H2"
.
iNext
.
iNext
.
iNext
.
iFrame
.
Show
.
iModIntro
.
done
.
Qed
.
Proof
.
iIntros
"H1 H2"
.
iNext
.
iNext
.
iNext
.
iFrame
.
Show
.
iModIntro
.
done
.
Qed
.
...
@@ -408,9 +411,11 @@ Lemma test_iPureIntro_absorbing (φ : Prop) :
...
@@ -408,9 +411,11 @@ Lemma test_iPureIntro_absorbing (φ : Prop) :
φ
→
sbi_emp_valid
(
PROP
:
=
PROP
)
(<
absorb
>
⌜φ⌝
)%
I
.
φ
→
sbi_emp_valid
(
PROP
:
=
PROP
)
(<
absorb
>
⌜φ⌝
)%
I
.
Proof
.
intros
?.
iPureIntro
.
done
.
Qed
.
Proof
.
intros
?.
iPureIntro
.
done
.
Qed
.
Check
"test_iFrame_later_1"
.
Lemma
test_iFrame_later_1
P
Q
:
P
∗
▷
Q
-
∗
▷
(
P
∗
▷
Q
).
Lemma
test_iFrame_later_1
P
Q
:
P
∗
▷
Q
-
∗
▷
(
P
∗
▷
Q
).
Proof
.
iIntros
"H"
.
iFrame
"H"
.
Show
.
auto
.
Qed
.
Proof
.
iIntros
"H"
.
iFrame
"H"
.
Show
.
auto
.
Qed
.
Check
"test_iFrame_later_2"
.
Lemma
test_iFrame_later_2
P
Q
:
▷
P
∗
▷
Q
-
∗
▷
(
▷
P
∗
▷
Q
).
Lemma
test_iFrame_later_2
P
Q
:
▷
P
∗
▷
Q
-
∗
▷
(
▷
P
∗
▷
Q
).
Proof
.
iIntros
"H"
.
iFrame
"H"
.
Show
.
auto
.
Qed
.
Proof
.
iIntros
"H"
.
iFrame
"H"
.
Show
.
auto
.
Qed
.
...
@@ -480,11 +485,13 @@ Proof.
...
@@ -480,11 +485,13 @@ Proof.
-
iDestruct
"H"
as
"[_ [_ #$]]"
.
-
iDestruct
"H"
as
"[_ [_ #$]]"
.
Qed
.
Qed
.
Check
"test_and_sep_affine_bi"
.
Lemma
test_and_sep_affine_bi
`
{
BiAffine
PROP
}
P
Q
:
□
P
∧
Q
⊢
□
P
∗
Q
.
Lemma
test_and_sep_affine_bi
`
{
BiAffine
PROP
}
P
Q
:
□
P
∧
Q
⊢
□
P
∗
Q
.
Proof
.
Proof
.
iIntros
"[??]"
.
iSplit
;
last
done
.
Show
.
done
.
iIntros
"[??]"
.
iSplit
;
last
done
.
Show
.
done
.
Qed
.
Qed
.
Check
"test_big_sepL_simpl"
.
Lemma
test_big_sepL_simpl
x
(
l
:
list
nat
)
P
:
Lemma
test_big_sepL_simpl
x
(
l
:
list
nat
)
P
:
P
-
∗
P
-
∗
([
∗
list
]
k
↦
y
∈
l
,
<
affine
>
⌜
y
=
y
⌝
)
-
∗
([
∗
list
]
k
↦
y
∈
l
,
<
affine
>
⌜
y
=
y
⌝
)
-
∗
...
@@ -492,6 +499,7 @@ Lemma test_big_sepL_simpl x (l : list nat) P :
...
@@ -492,6 +499,7 @@ Lemma test_big_sepL_simpl x (l : list nat) P :
P
.
P
.
Proof
.
iIntros
"HP ??"
.
Show
.
simpl
.
Show
.
done
.
Qed
.
Proof
.
iIntros
"HP ??"
.
Show
.
simpl
.
Show
.
done
.
Qed
.
Check
"test_big_sepL2_simpl"
.
Lemma
test_big_sepL2_simpl
x1
x2
(
l1
l2
:
list
nat
)
P
:
Lemma
test_big_sepL2_simpl
x1
x2
(
l1
l2
:
list
nat
)
P
:
P
-
∗
P
-
∗
([
∗
list
]
k
↦
y1
;
y2
∈
[]
;
l2
,
<
affine
>
⌜
y1
=
y2
⌝
)
-
∗
([
∗
list
]
k
↦
y1
;
y2
∈
[]
;
l2
,
<
affine
>
⌜
y1
=
y2
⌝
)
-
∗
...
@@ -499,6 +507,7 @@ Lemma test_big_sepL2_simpl x1 x2 (l1 l2 : list nat) P :
...
@@ -499,6 +507,7 @@ Lemma test_big_sepL2_simpl x1 x2 (l1 l2 : list nat) P :
P
∨
([
∗
list
]
y1
;
y2
∈
x1
::
l1
;
x2
::
l2
,
True
).
P
∨
([
∗
list
]
y1
;
y2
∈
x1
::
l1
;
x2
::
l2
,
True
).
Proof
.
iIntros
"HP ??"
.
Show
.
simpl
.
Show
.
by
iLeft
.
Qed
.
Proof
.
iIntros
"HP ??"
.
Show
.
simpl
.
Show
.
by
iLeft
.
Qed
.
Check
"test_big_sepL2_iDestruct"
.
Lemma
test_big_sepL2_iDestruct
(
Φ
:
nat
→
nat
→
PROP
)
x1
x2
(
l1
l2
:
list
nat
)
:
Lemma
test_big_sepL2_iDestruct
(
Φ
:
nat
→
nat
→
PROP
)
x1
x2
(
l1
l2
:
list
nat
)
:
([
∗
list
]
y1
;
y2
∈
x1
::
l1
;
x2
::
l2
,
Φ
y1
y2
)
-
∗
([
∗
list
]
y1
;
y2
∈
x1
::
l1
;
x2
::
l2
,
Φ
y1
y2
)
-
∗
<
absorb
>
Φ
x1
x2
.
<
absorb
>
Φ
x1
x2
.
...
@@ -512,6 +521,7 @@ Proof. iIntros "$ ?". iFrame. Qed.
...
@@ -512,6 +521,7 @@ Proof. iIntros "$ ?". iFrame. Qed.
Lemma
test_lemma_1
(
b
:
bool
)
:
Lemma
test_lemma_1
(
b
:
bool
)
:
emp
⊢
@{
PROP
}
□
?b
True
.
emp
⊢
@{
PROP
}
□
?b
True
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Check
"test_reducing_after_iDestruct"
.
Lemma
test_reducing_after_iDestruct
:
emp
⊢
@{
PROP
}
True
.
Lemma
test_reducing_after_iDestruct
:
emp
⊢
@{
PROP
}
True
.
Proof
.
Proof
.
iIntros
"H"
.
iDestruct
(
test_lemma_1
true
with
"H"
)
as
"H"
.
Show
.
done
.
iIntros
"H"
.
iDestruct
(
test_lemma_1
true
with
"H"
)
as
"H"
.
Show
.
done
.
...
@@ -520,6 +530,7 @@ Qed.
...
@@ -520,6 +530,7 @@ Qed.
Lemma
test_lemma_2
(
b
:
bool
)
:
Lemma
test_lemma_2
(
b
:
bool
)
:
□
?b
emp
⊢
@{
PROP
}
emp
.
□
?b
emp
⊢
@{
PROP
}
emp
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Check
"test_reducing_after_iApply"
.
Lemma
test_reducing_after_iApply
:
emp
⊢
@{
PROP
}
emp
.
Lemma
test_reducing_after_iApply
:
emp
⊢
@{
PROP
}
emp
.
Proof
.
Proof
.
iIntros
"#H"
.
iApply
(
test_lemma_2
true
).
Show
.
auto
.
iIntros
"#H"
.
iApply
(
test_lemma_2
true
).
Show
.
auto
.
...
@@ -528,6 +539,7 @@ Qed.
...
@@ -528,6 +539,7 @@ Qed.
Lemma
test_lemma_3
(
b
:
bool
)
:
Lemma
test_lemma_3
(
b
:
bool
)
:
□
?b
emp
⊢
@{
PROP
}
⌜
b
=
b
⌝
.
□
?b
emp
⊢
@{
PROP
}
⌜
b
=
b
⌝
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Proof
.
destruct
b
;
simpl
;
eauto
.
Qed
.
Check
"test_reducing_after_iApply_late_evar"
.
Lemma
test_reducing_after_iApply_late_evar
:
emp
⊢
@{
PROP
}
⌜
true
=
true
⌝
.
Lemma
test_reducing_after_iApply_late_evar
:
emp
⊢
@{
PROP
}
⌜
true
=
true
⌝
.
Proof
.
Proof
.
iIntros
"#H"
.
iApply
(
test_lemma_3
).
Show
.
auto
.
iIntros
"#H"
.
iApply
(
test_lemma_3
).
Show
.
auto
.
...
@@ -535,6 +547,7 @@ Qed.
...
@@ -535,6 +547,7 @@ Qed.
Section
wandM
.
Section
wandM
.
Import
proofmode
.
base
.
Import
proofmode
.
base
.
Check
"test_wandM"
.
Lemma
test_wandM
mP
Q
R
:
Lemma
test_wandM
mP
Q
R
:
(
mP
-
∗
?
Q
)
-
∗
(
Q
-
∗
R
)
-
∗
(
mP
-
∗
?
R
).
(
mP
-
∗
?
Q
)
-
∗
(
Q
-
∗
R
)
-
∗
(
mP
-
∗
?
R
).
Proof
.
Proof
.
...
@@ -544,6 +557,27 @@ Section wandM.
...
@@ -544,6 +557,27 @@ Section wandM.
Qed
.
Qed
.
End
wandM
.
End
wandM
.
Definition
modal_if_def
b
(
P
:
PROP
)
:
=
(
□
?b
P
)%
I
.
Lemma
modal_if_lemma1
b
P
:
False
-
∗
□
?b
P
.
Proof
.
iIntros
"?"
.
by
iExFalso
.
Qed
.
Lemma
test_iApply_prettification1
(
P
:
PROP
)
:
False
-
∗
modal_if_def
true
P
.
Proof
.
(* Make sure the goal is not prettified before [iApply] unifies. *)
iIntros
"?"
.
rewrite
/
modal_if_def
.
iApply
modal_if_lemma1
.
iAssumption
.
Qed
.
Lemma
modal_if_lemma2
P
:
False
-
∗
□
?false
P
.
Proof
.
iIntros
"?"
.
by
iExFalso
.
Qed
.
Lemma
test_iApply_prettification2
(
P
:
PROP
)
:
False
-
∗
∃
b
,
□
?b
P
.
Proof
.
(* Make sure the conclusion of the lemma is not prettified too early. *)
iIntros
"?"
.
iExists
_
.
iApply
modal_if_lemma2
.
done
.
Qed
.
End
tests
.
End
tests
.
(** Test specifically if certain things print correctly. *)
(** Test specifically if certain things print correctly. *)
...
@@ -551,9 +585,15 @@ Section printing_tests.
...
@@ -551,9 +585,15 @@ Section printing_tests.
Context
{
PROP
:
sbi
}
`
{!
BiFUpd
PROP
}.
Context
{
PROP
:
sbi
}
`
{!
BiFUpd
PROP
}.
Implicit
Types
P
Q
R
:
PROP
.
Implicit
Types
P
Q
R
:
PROP
.
Check
"elim_mod_accessor"
.
Lemma
elim_mod_accessor
{
X
:
Type
}
E1
E2
α
(
β
:
X
→
PROP
)
γ
:
accessor
(
fupd
E1
E2
)
(
fupd
E2
E1
)
α
β
γ
-
∗
|={
E1
}=>
True
.
Proof
.
iIntros
">Hacc"
.
Show
.
Abort
.
(* Test line breaking of long assumptions. *)
(* Test line breaking of long assumptions. *)
Section
linebreaks
.
Section
linebreaks
.
Lemma
print_long_line
(
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
:
PROP
)
:
Check
"print_long_line_1"
.
Lemma
print_long_line_1
(
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
:
PROP
)
:
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
∗
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
∗
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
-
∗
True
.
-
∗
True
.
...
@@ -565,38 +605,45 @@ Abort.
...
@@ -565,38 +605,45 @@ Abort.
the proofmode notation breaks the output. *)
the proofmode notation breaks the output. *)
Local
Notation
"'TESTNOTATION' '{{' P '|' Q '}' '}'"
:
=
(
P
∧
Q
)%
I
Local
Notation
"'TESTNOTATION' '{{' P '|' Q '}' '}'"
:
=
(
P
∧
Q
)%
I
(
format
"'TESTNOTATION' '{{' P '|' '/' Q '}' '}'"
)
:
bi_scope
.
(
format
"'TESTNOTATION' '{{' P '|' '/' Q '}' '}'"
)
:
bi_scope
.
Lemma
print_long_line
(
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
:
PROP
)
:
Check
"print_long_line_2"
.
Lemma
print_long_line_2
(
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
:
PROP
)
:
TESTNOTATION
{{
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
|
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
}}
TESTNOTATION
{{
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
|
P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P_P
}}
-
∗
True
.
-
∗
True
.
Proof
.
Proof
.
iIntros
"HP"
.
Show
.
Undo
.
iIntros
"?"
.
Show
.
iIntros
"HP"
.
Show
.
Undo
.
iIntros
"?"
.
Show
.
Abort
.
Abort
.
Check
"long_impl"
.
Lemma
long_impl
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_impl
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
(
PPPPPPPPPPPPPPPPP
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
(
PPPPPPPPPPPPPPPPP
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
Proof
.
Proof
.
iStartProof
.
Show
.
iStartProof
.
Show
.
Abort
.
Abort
.
Check
"long_impl_nested"
.
Lemma
long_impl_nested
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_impl_nested
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
(
PPPPPPPPPPPPPPPPP
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
)
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
(
PPPPPPPPPPPPPPPPP
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
)
→
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
Proof
.
Proof
.
iStartProof
.
Show
.
iStartProof
.
Show
.
Abort
.
Abort
.
Check
"long_wand"
.
Lemma
long_wand
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_wand
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
(
PPPPPPPPPPPPPPPPP
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
(
PPPPPPPPPPPPPPPPP
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
Proof
.
Proof
.
iStartProof
.
Show
.
iStartProof
.
Show
.
Abort
.
Abort
.
Check
"long_wand_nested"
.
Lemma
long_wand_nested
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_wand_nested
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
(
PPPPPPPPPPPPPPPPP
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
)
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
(
PPPPPPPPPPPPPPPPP
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
)
-
∗
(
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
))%
I
.
Proof
.
Proof
.
iStartProof
.
Show
.
iStartProof
.
Show
.
Abort
.
Abort
.
Check
"long_fupd"
.
Lemma
long_fupd
E
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_fupd
E
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
PPPPPPPPPPPPPPPPP
={
E
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
.
PPPPPPPPPPPPPPPPP
={
E
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
.
Proof
.
Proof
.
iStartProof
.
Show
.
iStartProof
.
Show
.
Abort
.
Abort
.
Check
"long_fupd_nested"
.
Lemma
long_fupd_nested
E1
E2
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
Lemma
long_fupd_nested
E1
E2
(
PPPPPPPPPPPPPPPPP
QQQQQQQQQQQQQQQQQQ
:
PROP
)
:
PPPPPPPPPPPPPPPPP
={
E1
,
E2
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
PPPPPPPPPPPPPPPPP
={
E1
,
E2
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
={
E1
,
E2
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
.
={
E1
,
E2
}=
∗
QQQQQQQQQQQQQQQQQQ
∗
QQQQQQQQQQQQQQQQQQ
.
...
...
theories/proofmode/class_instances_bi.v
View file @
3d1e22c5
...
@@ -385,7 +385,7 @@ Proof.
...
@@ -385,7 +385,7 @@ Proof.
Qed
.
Qed
.
Global
Instance
into_wand_wandM
p
q
mP'
P
Q
:
Global
Instance
into_wand_wandM
p
q
mP'
P
Q
:
FromAssumption
q
P
(
pm_
default
emp
%
I
mP'
)
→
IntoWand
p
q
(
mP'
-
∗
?
Q
)
P
Q
.
FromAssumption
q
P
(
default
emp
%
I
mP'
)
→
IntoWand
p
q
(
mP'
-
∗
?
Q
)
P
Q
.
Proof
.
rewrite
/
IntoWand
wandM_sound
.
exact
:
into_wand_wand
.
Qed
.
Proof
.
rewrite
/
IntoWand
wandM_sound
.
exact
:
into_wand_wand
.
Qed
.
Global
Instance
into_wand_and_l
p
q
R1
R2
P'
Q'
:
Global
Instance
into_wand_and_l
p
q
R1
R2
P'
Q'
:
...
@@ -510,7 +510,7 @@ Qed.
...
@@ -510,7 +510,7 @@ Qed.
Global
Instance
from_wand_wand
P1
P2
:
FromWand
(
P1
-
∗
P2
)
P1
P2
.
Global
Instance
from_wand_wand
P1
P2
:
FromWand
(
P1
-
∗
P2
)
P1
P2
.
Proof
.
by
rewrite
/
FromWand
.
Qed
.
Proof
.
by
rewrite
/
FromWand
.
Qed
.
Global
Instance
from_wand_wandM
mP1
P2
:
Global
Instance
from_wand_wandM
mP1
P2
:
FromWand
(
mP1
-
∗
?
P2
)
(
pm_
default
emp
mP1
)%
I
P2
.
FromWand
(
mP1
-
∗
?
P2
)
(
default
emp
mP1
)%
I
P2
.
Proof
.
by
rewrite
/
FromWand
wandM_sound
.
Qed
.
Proof
.
by
rewrite
/
FromWand
wandM_sound
.
Qed
.
Global
Instance
from_wand_embed
`
{
BiEmbed
PROP
PROP'
}
P
Q1
Q2
:
Global
Instance
from_wand_embed
`
{
BiEmbed
PROP
PROP'
}
P
Q1
Q2
:
FromWand
P
Q1
Q2
→
FromWand
⎡
P
⎤
⎡
Q1
⎤
⎡
Q2
⎤
.
FromWand
P
Q1
Q2
→
FromWand
⎡
P
⎤
⎡
Q1
⎤
⎡
Q2
⎤
.
...
@@ -1079,6 +1079,9 @@ Proof.
...
@@ -1079,6 +1079,9 @@ Proof.
-
iApply
(
Hacc
with
"Hinv Hin"
).
done
.
-
iApply
(
Hacc
with
"Hinv Hin"
).
done
.
Qed
.
Qed
.
(* This uses [pm_default] because, after inference, all accessors will have
[None] or [Some _] there, so we want to reduce the combinator before showing the
goal to the user. *)