Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
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
Pierre Roux
Iris
Commits
0e078666
Commit
0e078666
authored
6 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
A bit of refactoring of the `iIntro` tactics.
- More consistent indentation. - Mark new subgoals as comments.
parent
332f5c45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/proofmode/ltac_tactics.v
+62
-51
62 additions, 51 deletions
theories/proofmode/ltac_tactics.v
with
62 additions
and
51 deletions
theories/proofmode/ltac_tactics.v
+
62
−
51
View file @
0e078666
...
...
@@ -400,21 +400,28 @@ Local Tactic Notation "iIntro" "(" simple_intropattern(x) ")" :=
want to unfold x and start the proof mode. Instead, we want to
use intros. So [iStartProof] has to be called only if [intros]
fails *)
intros
x
||
(
iStartProof
;
lazymatch
goal
with
|
|
-
envs_entails
_
_
=>
eapply
tac_forall_intro
;
[
iSolveTC
||
let
P
:=
match
goal
with
|
-
FromForall
?P
_
=>
P
end
in
fail
"iIntro: cannot turn"
P
"into a universal quantifier"
|
pm_prettify
;
intros
x
]
end
)
.
(* We use [_ || _] instead of [first [..|..]] so that the error in the second
branch propagates upwards. *)
(
(* introduction at the meta level *)
intros
x
)
||
(
(* introduction in the logic *)
iStartProof
;
lazymatch
goal
with
|
|
-
envs_entails
_
_
=>
eapply
tac_forall_intro
;
[
iSolveTC
||
let
P
:=
match
goal
with
|
-
FromForall
?P
_
=>
P
end
in
fail
"iIntro: cannot turn"
P
"into a universal quantifier"
|
pm_prettify
;
intros
x
(* subgoal *)
]
end
)
.
Local
Tactic
Notation
"iIntro"
constr
(
H
)
:=
iStartProof
;
first
[
(* (?Q → _) *)
[
(* (?Q → _) *)
eapply
tac_impl_intro
with
_
H
_
_
_;
(* (i:=H) *)
[
iSolveTC
|
pm_reduce
;
iSolveTC
||
...
...
@@ -425,58 +432,62 @@ Local Tactic Notation "iIntro" constr(H) :=
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|
iSolveTC
|]
|
(* (_ -∗ _) *)
|
(* subgoal *)
]
|
(* (_ -∗ _) *)
eapply
tac_wand_intro
with
_
H
_
_;
(* (i:=H) *)
[
iSolveTC
|
pm_reflexivity
||
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|]
|
fail
"iIntro: nothing to introduce"
]
.
|
(* subgoal *)
]
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntro"
"#"
constr
(
H
)
:=
iStartProof
;
first
[
(* (?P → _) *)
eapply
tac_impl_intro_persistent
with
_
H
_
_
_;
(* (i:=H) *)
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
IntoPersistent
_
?P
_
=>
P
end
in
fail
1
"iIntro:"
P
"not persistent"
|
pm_reflexivity
||
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|]
|
(* (?P -∗ _) *)
eapply
tac_wand_intro_persistent
with
_
H
_
_
_;
(* (i:=H) *)
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
IntoPersistent
_
?P
_
=>
P
end
in
fail
1
"iIntro:"
P
"not persistent"
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
TCOr
(
Affine
?P
)
_
=>
P
end
in
fail
1
"iIntro:"
P
"not affine and the goal not absorbing"
|
pm_reflexivity
||
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|]
|
fail
"iIntro: nothing to introduce"
]
.
[
(* (?P → _) *)
eapply
tac_impl_intro_persistent
with
_
H
_
_
_;
(* (i:=H) *)
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
IntoPersistent
_
?P
_
=>
P
end
in
fail
1
"iIntro:"
P
"not persistent"
|
pm_reflexivity
||
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|
(* subgoal *)
]
|
(* (?P -∗ _) *)
eapply
tac_wand_intro_persistent
with
_
H
_
_
_;
(* (i:=H) *)
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
IntoPersistent
_
?P
_
=>
P
end
in
fail
1
"iIntro:"
P
"not persistent"
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
TCOr
(
Affine
?P
)
_
=>
P
end
in
fail
1
"iIntro:"
P
"not affine and the goal not absorbing"
|
pm_reflexivity
||
let
H
:=
pretty_ident
H
in
fail
1
"iIntro:"
H
"not fresh"
|
(* subgoal *)
]
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntro"
"_"
:=
iStartProof
;
first
[
(* (?Q → _) *)
iStartProof
;
eapply
tac_impl_intro_drop
;
[
iSolveTC
|
]
|
(* (_ -∗ _) *)
iStartProof
;
eapply
tac_wand_intro_drop
;
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
TCOr
(
Affine
?P
)
_
=>
P
end
in
fail
1
"iIntro:"
P
"not affine and the goal not absorbing"
|]
|
(* (∀ _, _) *)
iIntro
(_)
|
fail
1
"iIntro: nothing to introduce"
]
.
[
(* (?Q → _) *)
eapply
tac_impl_intro_drop
;
[
iSolveTC
|
(* subgoal *)
]
|
(* (_ -∗ _) *)
eapply
tac_wand_intro_drop
;
[
iSolveTC
|
iSolveTC
||
let
P
:=
match
goal
with
|
-
TCOr
(
Affine
?P
)
_
=>
P
end
in
fail
1
"iIntro:"
P
"not affine and the goal not absorbing"
|
(* subgoal *)
]
|
(* (∀ _, _) *)
iIntro
(_)
(* subgoal *)
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntroForall"
:=
lazymatch
goal
with
...
...
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