Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rice Wine
Iris
Commits
b90b85b0
Commit
b90b85b0
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make iIntros work when the implication is hidden behind a definition.
parent
2539f335
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
proofmode/tactics.v
+29
-31
29 additions, 31 deletions
proofmode/tactics.v
tests/proofmode.v
+7
-1
7 additions, 1 deletion
tests/proofmode.v
with
36 additions
and
32 deletions
proofmode/tactics.v
+
29
−
31
View file @
b90b85b0
...
...
@@ -645,43 +645,41 @@ Tactic Notation "iNext":=
apply
_
||
fail
"iNext:"
P
"does not contain laters"
|]
.
(** * Introduction tactic *)
Local
Tactic
Notation
"iIntro"
"{"
simple_intropattern
(
x
)
"}"
:=
lazymatch
goal
with
|
|
-
_
⊢
(
∀
_,
_)
=>
apply
tac_forall_intro
;
intros
x
|
|
-
_
⊢
(
?P
→
_)
=>
eapply
tac_impl_intro_pure
;
[
apply
_
||
fail
"iIntro:"
P
"not pure"
|];
intros
x
|
|
-
_
⊢
(
?P
-★
_)
=>
eapply
tac_wand_intro_pure
;
[
apply
_
||
fail
"iIntro:"
P
"not pure"
|];
intros
x
|
|
-
_
=>
intros
x
end
.
Local
Tactic
Notation
"iIntro"
constr
(
H
)
:=
lazymatch
goal
with
|
|
-
_
⊢
(
?Q
→
_)
=>
Local
Tactic
Notation
"iIntro"
"{"
simple_intropattern
(
x
)
"}"
:=
first
[
(* (∀ _, _) *)
apply
tac_forall_intro
;
intros
x
|
(* (?P → _) *)
eapply
tac_impl_intro_pure
;
[
let
P
:=
match
goal
with
|
-
ToPure
?P
_
=>
P
end
in
apply
_
||
fail
"iIntro:"
P
"not pure"
|
intros
x
]
|
(* (?P -★ _) *)
eapply
tac_wand_intro_pure
;
[
let
P
:=
match
goal
with
|
-
ToPure
?P
_
=>
P
end
in
apply
_
||
fail
"iIntro:"
P
"not pure"
|
intros
x
]
|
intros
x
]
.
Local
Tactic
Notation
"iIntro"
constr
(
H
)
:=
first
[
(* (?Q → _) *)
eapply
tac_impl_intro
with
_
H
;
(* (i:=H) *)
[
reflexivity
||
fail
"iIntro: introducing
"
H
":"
Q
"into non-empty spatial context"
[
reflexivity
||
fail
1
"iIntro: introducing"
H
"into non-empty spatial context"
|
env_cbv
;
reflexivity
||
fail
"iIntro:"
H
"not fresh"
|]
|
|
-
_
⊢
(_
-★
_)
=>
|
(*
(_ -★ _)
*)
eapply
tac_wand_intro
with
_
H
;
(* (i:=H) *)
[
env_cbv
;
reflexivity
||
fail
"iIntro:"
H
"not fresh"
|]
|
_
=>
fail
"iIntro: nothing to introduce"
end
.
[
env_cbv
;
reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntro"
"#"
constr
(
H
)
:=
lazymatch
goal
with
|
|
-
_
⊢
(
?P
→
_)
=>
Local
Tactic
Notation
"iIntro"
"#"
constr
(
H
)
:=
first
[
(* (?P → _) *)
eapply
tac_impl_intro_persistent
with
_
H
_;
(* (i:=H) *)
[
apply
_
||
fail
"iIntro: "
P
" not persistent"
|
env_cbv
;
reflexivity
||
fail
"iIntro:"
H
"not fresh"
|]
|
|
-
_
⊢
(
?P
-★
_)
=>
[
let
P
:=
match
goal
with
|
-
ToPersistentP
?P
_
=>
P
end
in
apply
_
||
fail
1
"iIntro: "
P
" not persistent"
|
env_cbv
;
reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
|
(* (?P -★ _) *)
eapply
tac_wand_intro_persistent
with
_
H
_;
(* (i:=H) *)
[
apply
_
||
fail
"iIntro: "
P
" not persistent"
|
env_cbv
;
reflexivity
||
fail
"iIntro:"
H
"not
fresh"
|]
|
_
=>
fail
"iIntro:
nothing to introduce"
end
.
[
let
P
:=
match
goal
with
|
-
ToPersistentP
?P
_
=>
P
end
in
apply
_
||
fail
1
"iIntro:
"
P
"
not
persistent"
|
env_cbv
;
reflexivity
||
fail
1
"iIntro:
"
H
"not fresh"
|]
|
fail
1
"iIntro: nothing to introduce"
]
.
Tactic
Notation
"iIntros"
constr
(
pat
)
:=
let
rec
go
pats
:=
...
...
This diff is collapsed.
Click to expand it.
tests/proofmode.v
+
7
−
1
View file @
b90b85b0
...
...
@@ -44,4 +44,10 @@ Qed.
Lemma
demo_3
(
M
:
cmraT
)
(
P1
P2
P3
:
uPred
M
)
:
(
P1
★
P2
★
P3
)
⊢
(
▷
P1
★
▷
(
P2
★
∃
x
,
(
P3
∧
x
=
0
)
∨
P3
))
.
Proof
.
iIntros
"($ & $ & H)"
.
iFrame
"H"
.
iNext
.
by
iExists
0
.
Qed
.
\ No newline at end of file
Proof
.
iIntros
"($ & $ & H)"
.
iFrame
"H"
.
iNext
.
by
iExists
0
.
Qed
.
Definition
foo
{
M
}
(
P
:
uPred
M
)
:=
(
P
→
P
)
%
I
.
Definition
bar
{
M
}
:
uPred
M
:=
(
∀
P
,
foo
P
)
%
I
.
Lemma
demo_4
(
M
:
cmraT
)
:
True
⊢
@
bar
M
.
Proof
.
iIntros
{
P
}
"HP"
.
done
.
Qed
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment