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
Abel Nieto
Iris
Commits
09722955
Commit
09722955
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Misc proof mode clean up.
parent
08212075
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/proofmode/tactics.v
+103
-64
103 additions, 64 deletions
theories/proofmode/tactics.v
with
103 additions
and
64 deletions
theories/proofmode/tactics.v
+
103
−
64
View file @
09722955
...
@@ -110,8 +110,9 @@ Tactic Notation "iClear" "(" ident_list(xs) ")" constr(Hs) :=
...
@@ -110,8 +110,9 @@ Tactic Notation "iClear" "(" ident_list(xs) ")" constr(Hs) :=
Tactic
Notation
"iExact"
constr
(
H
)
:=
Tactic
Notation
"iExact"
constr
(
H
)
:=
eapply
tac_assumption
with
H
_
_;
(* (i:=H) *)
eapply
tac_assumption
with
H
_
_;
(* (i:=H) *)
[
env_reflexivity
||
fail
"iExact:"
H
"not found"
[
env_reflexivity
||
fail
"iExact:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
FromAssumption
_
?P
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iExact:"
H
":"
P
"does not match goal"
]
.
let
P
:=
match
goal
with
|
-
FromAssumption
_
?P
_
=>
P
end
in
fail
"iExact:"
H
":"
P
"does not match goal"
]
.
Tactic
Notation
"iAssumptionCore"
:=
Tactic
Notation
"iAssumptionCore"
:=
let
rec
find
Γ
i
P
:=
let
rec
find
Γ
i
P
:=
...
@@ -151,22 +152,26 @@ Tactic Notation "iExFalso" := apply tac_ex_falso.
...
@@ -151,22 +152,26 @@ Tactic Notation "iExFalso" := apply tac_ex_falso.
Local
Tactic
Notation
"iPersistent"
constr
(
H
)
:=
Local
Tactic
Notation
"iPersistent"
constr
(
H
)
:=
eapply
tac_persistent
with
_
H
_
_
_;
(* (i:=H) *)
eapply
tac_persistent
with
_
H
_
_
_;
(* (i:=H) *)
[
env_reflexivity
||
fail
"iPersistent:"
H
"not found"
[
env_reflexivity
||
fail
"iPersistent:"
H
"not found"
|
let
Q
:=
match
goal
with
|
-
IntoPersistentP
?Q
_
=>
Q
end
in
|
apply
_
||
apply
_
||
fail
"iPersistent:"
Q
"not persistent"
let
Q
:=
match
goal
with
|
-
IntoPersistentP
?Q
_
=>
Q
end
in
fail
"iPersistent:"
Q
"not persistent"
|
env_reflexivity
|]
.
|
env_reflexivity
|]
.
Local
Tactic
Notation
"iPure"
constr
(
H
)
"as"
simple_intropattern
(
pat
)
:=
Local
Tactic
Notation
"iPure"
constr
(
H
)
"as"
simple_intropattern
(
pat
)
:=
eapply
tac_pure
with
_
H
_
_
_;
(* (i:=H1) *)
eapply
tac_pure
with
_
H
_
_
_;
(* (i:=H1) *)
[
env_reflexivity
||
fail
"iPure:"
H
"not found"
[
env_reflexivity
||
fail
"iPure:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iPure:"
P
"not pure"
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
fail
"iPure:"
P
"not pure"
|
intros
pat
]
.
|
intros
pat
]
.
Tactic
Notation
"iPureIntro"
:=
Tactic
Notation
"iPureIntro"
:=
iStartProof
;
iStartProof
;
eapply
tac_pure_intro
;
eapply
tac_pure_intro
;
[
let
P
:=
match
goal
with
|
-
FromPure
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iPureIntro:"
P
"not pure"
|]
.
let
P
:=
match
goal
with
|
-
FromPure
?P
_
=>
P
end
in
fail
"iPureIntro:"
P
"not pure"
|]
.
(** Framing *)
(** Framing *)
Local
Ltac
iFrameFinish
:=
Local
Ltac
iFrameFinish
:=
...
@@ -184,8 +189,9 @@ Local Ltac iFramePure t :=
...
@@ -184,8 +189,9 @@ Local Ltac iFramePure t :=
Local
Ltac
iFrameHyp
H
:=
Local
Ltac
iFrameHyp
H
:=
eapply
tac_frame
with
_
H
_
_
_;
eapply
tac_frame
with
_
H
_
_
_;
[
env_reflexivity
||
fail
"iFrame:"
H
"not found"
[
env_reflexivity
||
fail
"iFrame:"
H
"not found"
|
let
R
:=
match
goal
with
|
-
Frame
_
?R
_
_
=>
R
end
in
|
apply
_
||
apply
_
||
fail
"iFrame: cannot frame"
R
let
R
:=
match
goal
with
|
-
Frame
_
?R
_
_
=>
R
end
in
fail
"iFrame: cannot frame"
R
|
iFrameFinish
]
.
|
iFrameFinish
]
.
Local
Ltac
iFrameAnyPure
:=
Local
Ltac
iFrameAnyPure
:=
...
@@ -268,11 +274,15 @@ Local Tactic Notation "iIntro" "(" simple_intropattern(x) ")" :=
...
@@ -268,11 +274,15 @@ Local Tactic Notation "iIntro" "(" simple_intropattern(x) ")" :=
try
first
try
first
[
(* (∀ _, _) *)
apply
tac_forall_intro
[
(* (∀ _, _) *)
apply
tac_forall_intro
|
(* (?P → _) *)
eapply
tac_impl_intro_pure
;
|
(* (?P → _) *)
eapply
tac_impl_intro_pure
;
[
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iIntro:"
P
"not pure"
|]
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
fail
"iIntro:"
P
"not pure"
|]
|
(* (?P -∗ _) *)
eapply
tac_wand_intro_pure
;
|
(* (?P -∗ _) *)
eapply
tac_wand_intro_pure
;
[
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iIntro:"
P
"not pure"
|]
let
P
:=
match
goal
with
|
-
IntoPure
?P
_
=>
P
end
in
fail
"iIntro:"
P
"not pure"
|]
|
(* ⌜∀ _, _⌝ *)
apply
tac_pure_forall_intro
|
(* ⌜∀ _, _⌝ *)
apply
tac_pure_forall_intro
|
(* ⌜_ → _⌝ *)
apply
tac_pure_impl_intro
];
|
(* ⌜_ → _⌝ *)
apply
tac_pure_impl_intro
];
intros
x
.
intros
x
.
...
@@ -284,10 +294,12 @@ Local Tactic Notation "iIntro" constr(H) :=
...
@@ -284,10 +294,12 @@ Local Tactic Notation "iIntro" constr(H) :=
eapply
tac_impl_intro
with
_
H
;
(* (i:=H) *)
eapply
tac_impl_intro
with
_
H
;
(* (i:=H) *)
[
reflexivity
||
fail
1
"iIntro: introducing"
H
[
reflexivity
||
fail
1
"iIntro: introducing"
H
"into non-empty spatial context"
"into non-empty spatial context"
|
env_reflexivity
||
fail
"iIntro:"
H
"not fresh"
|]
|
env_reflexivity
||
fail
"iIntro:"
H
"not fresh"
|]
|
(* (_ -∗ _) *)
|
(* (_ -∗ _) *)
eapply
tac_wand_intro
with
_
H
;
(* (i:=H) *)
eapply
tac_wand_intro
with
_
H
;
(* (i:=H) *)
[
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
[
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
|
fail
1
"iIntro: nothing to introduce"
]
.
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntro"
"#"
constr
(
H
)
:=
Local
Tactic
Notation
"iIntro"
"#"
constr
(
H
)
:=
...
@@ -295,14 +307,18 @@ Local Tactic Notation "iIntro" "#" constr(H) :=
...
@@ -295,14 +307,18 @@ Local Tactic Notation "iIntro" "#" constr(H) :=
first
first
[
(* (?P → _) *)
[
(* (?P → _) *)
eapply
tac_impl_intro_persistent
with
_
H
_;
(* (i:=H) *)
eapply
tac_impl_intro_persistent
with
_
H
_;
(* (i:=H) *)
[
let
P
:=
match
goal
with
|
-
IntoPersistentP
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
1
"iIntro: "
P
" not persistent"
let
P
:=
match
goal
with
|
-
IntoPersistentP
?P
_
=>
P
end
in
|
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
fail
1
"iIntro: "
P
" not persistent"
|
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
|
(* (?P -∗ _) *)
|
(* (?P -∗ _) *)
eapply
tac_wand_intro_persistent
with
_
H
_;
(* (i:=H) *)
eapply
tac_wand_intro_persistent
with
_
H
_;
(* (i:=H) *)
[
let
P
:=
match
goal
with
|
-
IntoPersistentP
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
1
"iIntro: "
P
" not persistent"
let
P
:=
match
goal
with
|
-
IntoPersistentP
?P
_
=>
P
end
in
|
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
fail
1
"iIntro: "
P
" not persistent"
|
env_reflexivity
||
fail
1
"iIntro:"
H
"not fresh"
|]
|
fail
1
"iIntro: nothing to introduce"
]
.
|
fail
1
"iIntro: nothing to introduce"
]
.
Local
Tactic
Notation
"iIntro"
"_"
:=
Local
Tactic
Notation
"iIntro"
"_"
:=
...
@@ -346,16 +362,18 @@ Local Tactic Notation "iSpecializeArgs" constr(H) open_constr(xs) :=
...
@@ -346,16 +362,18 @@ Local Tactic Notation "iSpecializeArgs" constr(H) open_constr(xs) :=
|
hcons
?x
?xs
=>
|
hcons
?x
?xs
=>
eapply
tac_forall_specialize
with
_
H
_
_
_;
(* (i:=H) (a:=x) *)
eapply
tac_forall_specialize
with
_
H
_
_
_;
(* (i:=H) (a:=x) *)
[
env_reflexivity
||
fail
1
"iSpecialize:"
H
"not found"
[
env_reflexivity
||
fail
1
"iSpecialize:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoForall
?P
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
1
"iSpecialize: cannot instantiate"
P
"with"
x
let
P
:=
match
goal
with
|
-
IntoForall
?P
_
=>
P
end
in
fail
1
"iSpecialize: cannot instantiate"
P
"with"
x
|
exists
x
;
split
;
[
env_reflexivity
|
go
xs
]]
|
exists
x
;
split
;
[
env_reflexivity
|
go
xs
]]
end
in
end
in
go
xs
.
go
xs
.
Local
Tactic
Notation
"iSpecializePat"
constr
(
H
)
constr
(
pat
)
:=
Local
Tactic
Notation
"iSpecializePat"
constr
(
H
)
constr
(
pat
)
:=
let
solve_to_wand
H1
:=
let
solve_to_wand
H1
:=
apply
_
||
let
P
:=
match
goal
with
|
-
IntoWand
?P
_
_
=>
P
end
in
let
P
:=
match
goal
with
|
-
IntoWand
?P
_
_
=>
P
end
in
apply
_
||
fail
"iSpecialize:"
P
"not an implication/wand"
in
fail
"iSpecialize:"
P
"not an implication/wand"
in
let
rec
go
H1
pats
:=
let
rec
go
H1
pats
:=
lazymatch
pats
with
lazymatch
pats
with
|
[]
=>
idtac
|
[]
=>
idtac
...
@@ -366,16 +384,18 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
...
@@ -366,16 +384,18 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
eapply
tac_specialize
with
_
_
H2
_
H1
_
_
_
_;
(* (j:=H1) (i:=H2) *)
eapply
tac_specialize
with
_
_
H2
_
H1
_
_
_
_;
(* (j:=H1) (i:=H2) *)
[
env_reflexivity
||
fail
"iSpecialize:"
H2
"not found"
[
env_reflexivity
||
fail
"iSpecialize:"
H2
"not found"
|
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
|
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
|
let
P
:=
match
goal
with
|
-
IntoWand
?P
?Q
_
=>
P
end
in
|
apply
_
||
let
P
:=
match
goal
with
|
-
IntoWand
?P
?Q
_
=>
P
end
in
let
Q
:=
match
goal
with
|
-
IntoWand
?P
?Q
_
=>
Q
end
in
let
Q
:=
match
goal
with
|
-
IntoWand
?P
?Q
_
=>
Q
end
in
apply
_
||
fail
"iSpecialize: cannot instantiate"
P
"with"
Q
fail
"iSpecialize: cannot instantiate"
P
"with"
Q
|
env_reflexivity
|
go
H1
pats
]
|
env_reflexivity
|
go
H1
pats
]
|
SPureGoal
?d
::
?pats
=>
|
SPureGoal
?d
::
?pats
=>
eapply
tac_specialize_assert_pure
with
_
H1
_
_
_
_
_;
eapply
tac_specialize_assert_pure
with
_
H1
_
_
_
_
_;
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
|
solve_to_wand
H1
|
solve_to_wand
H1
|
let
Q
:=
match
goal
with
|
-
FromPure
?Q
_
=>
Q
end
in
|
apply
_
||
apply
_
||
fail
"iSpecialize:"
Q
"not pure"
let
Q
:=
match
goal
with
|
-
FromPure
?Q
_
=>
Q
end
in
fail
"iSpecialize:"
Q
"not pure"
|
env_reflexivity
|
env_reflexivity
|
done_if
d
(*goal*)
|
done_if
d
(*goal*)
|
go
H1
pats
]
|
go
H1
pats
]
...
@@ -383,8 +403,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
...
@@ -383,8 +403,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
eapply
tac_specialize_assert_persistent
with
_
_
H1
_
_
_
_;
eapply
tac_specialize_assert_persistent
with
_
_
H1
_
_
_
_;
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
|
solve_to_wand
H1
|
solve_to_wand
H1
|
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
|
apply
_
||
apply
_
||
fail
"iSpecialize:"
Q
"not persistent"
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
fail
"iSpecialize:"
Q
"not persistent"
|
env_reflexivity
|
env_reflexivity
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
go
H1
pats
]
|
go
H1
pats
]
...
@@ -406,8 +427,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
...
@@ -406,8 +427,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
eapply
tac_specialize_assert_persistent
with
_
_
H1
_
_
_
_;
eapply
tac_specialize_assert_persistent
with
_
_
H1
_
_
_
_;
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
[
env_reflexivity
||
fail
"iSpecialize:"
H1
"not found"
|
solve_to_wand
H1
|
solve_to_wand
H1
|
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
|
apply
_
||
apply
_
||
fail
"iSpecialize:"
Q
"not persistent"
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
fail
"iSpecialize:"
Q
"not persistent"
|
env_reflexivity
|
env_reflexivity
|
solve
[
iFrame
"∗ #"
]
|
solve
[
iFrame
"∗ #"
]
|
go
H1
pats
]
|
go
H1
pats
]
...
@@ -419,8 +441,8 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
...
@@ -419,8 +441,8 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
|
GSpatial
=>
apply
elim_modal_dummy
|
GSpatial
=>
apply
elim_modal_dummy
|
GModal
=>
apply
_
||
fail
"iSpecialize: goal not a modality"
|
GModal
=>
apply
_
||
fail
"iSpecialize: goal not a modality"
end
end
|
iFrame
"∗ #"
;
apply
tac_unlock
|
iFrame
"∗ #"
;
apply
tac_unlock
||
||
fail
"iSpecialize: premise cannot be solved by framing"
fail
"iSpecialize: premise cannot be solved by framing"
|
reflexivity
];
iIntro
H1
;
go
H1
pats
|
reflexivity
];
iIntro
H1
;
go
H1
pats
end
in
let
pats
:=
spec_pat
.
parse
pat
in
go
H
pats
.
end
in
let
pats
:=
spec_pat
.
parse
pat
in
go
H
pats
.
...
@@ -447,8 +469,9 @@ Tactic Notation "iSpecializeCore" open_constr(t) "as" constr(p) :=
...
@@ -447,8 +469,9 @@ Tactic Notation "iSpecializeCore" open_constr(t) "as" constr(p) :=
eapply
tac_specialize_persistent_helper
with
_
H
_
_
_;
eapply
tac_specialize_persistent_helper
with
_
H
_
_
_;
[
env_reflexivity
||
fail
"iSpecialize:"
H
"not found"
[
env_reflexivity
||
fail
"iSpecialize:"
H
"not found"
|
iSpecializeArgs
H
xs
;
iSpecializePat
H
pat
;
last
(
iExact
H
)
|
iSpecializeArgs
H
xs
;
iSpecializePat
H
pat
;
last
(
iExact
H
)
|
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
|
apply
_
||
apply
_
||
fail
"iSpecialize:"
Q
"not persistent"
let
Q
:=
match
goal
with
|
-
PersistentP
?Q
=>
Q
end
in
fail
"iSpecialize:"
Q
"not persistent"
|
env_reflexivity
|
(* goal *)
]
|
env_reflexivity
|
(* goal *)
]
|
false
=>
iSpecializeArgs
H
xs
;
iSpecializePat
H
pat
|
false
=>
iSpecializeArgs
H
xs
;
iSpecializePat
H
pat
end
end
...
@@ -611,21 +634,27 @@ Tactic Notation "iRevert" "(" ident(x1) ident(x2) ident(x3) ident(x4)
...
@@ -611,21 +634,27 @@ Tactic Notation "iRevert" "(" ident(x1) ident(x2) ident(x3) ident(x4)
Tactic
Notation
"iLeft"
:=
Tactic
Notation
"iLeft"
:=
iStartProof
;
iStartProof
;
eapply
tac_or_l
;
eapply
tac_or_l
;
[
let
P
:=
match
goal
with
|
-
FromOr
?P
_
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iLeft:"
P
"not a disjunction"
|]
.
let
P
:=
match
goal
with
|
-
FromOr
?P
_
_
=>
P
end
in
fail
"iLeft:"
P
"not a disjunction"
|]
.
Tactic
Notation
"iRight"
:=
Tactic
Notation
"iRight"
:=
iStartProof
;
iStartProof
;
eapply
tac_or_r
;
eapply
tac_or_r
;
[
let
P
:=
match
goal
with
|
-
FromOr
?P
_
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iRight:"
P
"not a disjunction"
|]
.
let
P
:=
match
goal
with
|
-
FromOr
?P
_
_
=>
P
end
in
fail
"iRight:"
P
"not a disjunction"
|]
.
Local
Tactic
Notation
"iOrDestruct"
constr
(
H
)
"as"
constr
(
H1
)
constr
(
H2
)
:=
Local
Tactic
Notation
"iOrDestruct"
constr
(
H
)
"as"
constr
(
H1
)
constr
(
H2
)
:=
eapply
tac_or_destruct
with
_
_
H
_
H1
H2
_
_
_;
(* (i:=H) (j1:=H1) (j2:=H2) *)
eapply
tac_or_destruct
with
_
_
H
_
H1
H2
_
_
_;
(* (i:=H) (j1:=H1) (j2:=H2) *)
[
env_reflexivity
||
fail
"iOrDestruct:"
H
"not found"
[
env_reflexivity
||
fail
"iOrDestruct:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoOr
?P
_
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iOrDestruct: cannot destruct"
P
let
P
:=
match
goal
with
|
-
IntoOr
?P
_
_
=>
P
end
in
fail
"iOrDestruct: cannot destruct"
P
|
env_reflexivity
||
fail
"iOrDestruct:"
H1
"not fresh"
|
env_reflexivity
||
fail
"iOrDestruct:"
H1
"not fresh"
|
env_reflexivity
||
fail
"iOrDestruct:"
H2
"not fresh"
|
|]
.
|
env_reflexivity
||
fail
"iOrDestruct:"
H2
"not fresh"
|
|]
.
(** * Conjunction and separating conjunction *)
(** * Conjunction and separating conjunction *)
Tactic
Notation
"iSplit"
:=
Tactic
Notation
"iSplit"
:=
...
@@ -633,24 +662,27 @@ Tactic Notation "iSplit" :=
...
@@ -633,24 +662,27 @@ Tactic Notation "iSplit" :=
lazymatch
goal
with
lazymatch
goal
with
|
|
-
_
⊢
_
=>
|
|
-
_
⊢
_
=>
eapply
tac_and_split
;
eapply
tac_and_split
;
[
let
P
:=
match
goal
with
|
-
FromAnd
?P
_
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iSplit:"
P
"not a conjunction"
|
|]
let
P
:=
match
goal
with
|
-
FromAnd
?P
_
_
=>
P
end
in
fail
"iSplit:"
P
"not a conjunction"
|
|]
end
.
end
.
Tactic
Notation
"iSplitL"
constr
(
Hs
)
:=
Tactic
Notation
"iSplitL"
constr
(
Hs
)
:=
iStartProof
;
iStartProof
;
let
Hs
:=
words
Hs
in
let
Hs
:=
words
Hs
in
eapply
tac_sep_split
with
_
_
false
Hs
_
_;
(* (js:=Hs) *)
eapply
tac_sep_split
with
_
_
false
Hs
_
_;
(* (js:=Hs) *)
[
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iSplitL:"
P
"not a separating conjunction"
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
fail
"iSplitL:"
P
"not a separating conjunction"
|
env_reflexivity
||
fail
"iSplitL: hypotheses"
Hs
|
env_reflexivity
||
fail
"iSplitL: hypotheses"
Hs
"not found in the context"
|
|]
.
"not found in the context"
|
|]
.
Tactic
Notation
"iSplitR"
constr
(
Hs
)
:=
Tactic
Notation
"iSplitR"
constr
(
Hs
)
:=
iStartProof
;
iStartProof
;
let
Hs
:=
words
Hs
in
let
Hs
:=
words
Hs
in
eapply
tac_sep_split
with
_
_
true
Hs
_
_;
(* (js:=Hs) *)
eapply
tac_sep_split
with
_
_
true
Hs
_
_;
(* (js:=Hs) *)
[
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iSplitR:"
P
"not a separating conjunction"
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
fail
"iSplitR:"
P
"not a separating conjunction"
|
env_reflexivity
||
fail
"iSplitR: hypotheses"
Hs
|
env_reflexivity
||
fail
"iSplitR: hypotheses"
Hs
"not found in the context"
|
|]
.
"not found in the context"
|
|]
.
...
@@ -660,15 +692,17 @@ Tactic Notation "iSplitR" := iSplitL "".
...
@@ -660,15 +692,17 @@ Tactic Notation "iSplitR" := iSplitL "".
Local
Tactic
Notation
"iAndDestruct"
constr
(
H
)
"as"
constr
(
H1
)
constr
(
H2
)
:=
Local
Tactic
Notation
"iAndDestruct"
constr
(
H
)
"as"
constr
(
H1
)
constr
(
H2
)
:=
eapply
tac_and_destruct
with
_
H
_
H1
H2
_
_
_;
(* (i:=H) (j1:=H1) (j2:=H2) *)
eapply
tac_and_destruct
with
_
H
_
H1
H2
_
_
_;
(* (i:=H) (j1:=H1) (j2:=H2) *)
[
env_reflexivity
||
fail
"iAndDestruct:"
H
"not found"
[
env_reflexivity
||
fail
"iAndDestruct:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoAnd
_
?P
_
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iAndDestruct: cannot destruct"
P
let
P
:=
match
goal
with
|
-
IntoAnd
_
?P
_
_
=>
P
end
in
fail
"iAndDestruct: cannot destruct"
P
|
env_reflexivity
||
fail
"iAndDestruct:"
H1
"or"
H2
" not fresh"
|]
.
|
env_reflexivity
||
fail
"iAndDestruct:"
H1
"or"
H2
" not fresh"
|]
.
Local
Tactic
Notation
"iAndDestructChoice"
constr
(
H
)
"as"
constr
(
lr
)
constr
(
H'
)
:=
Local
Tactic
Notation
"iAndDestructChoice"
constr
(
H
)
"as"
constr
(
lr
)
constr
(
H'
)
:=
eapply
tac_and_destruct_choice
with
_
H
_
lr
H'
_
_
_;
eapply
tac_and_destruct_choice
with
_
H
_
lr
H'
_
_
_;
[
env_reflexivity
||
fail
"iAndDestructChoice:"
H
"not found"
[
env_reflexivity
||
fail
"iAndDestructChoice:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoAnd
_
?P
_
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iAndDestructChoice: cannot destruct"
P
let
P
:=
match
goal
with
|
-
IntoAnd
_
?P
_
_
=>
P
end
in
fail
"iAndDestructChoice: cannot destruct"
P
|
env_reflexivity
||
fail
"iAndDestructChoice:"
H'
" not fresh"
|]
.
|
env_reflexivity
||
fail
"iAndDestructChoice:"
H'
" not fresh"
|]
.
(** * Combinining hypotheses *)
(** * Combinining hypotheses *)
...
@@ -686,8 +720,9 @@ Tactic Notation "iCombine" constr(H1) constr(H2) "as" constr(H) :=
...
@@ -686,8 +720,9 @@ Tactic Notation "iCombine" constr(H1) constr(H2) "as" constr(H) :=
Tactic
Notation
"iExists"
uconstr
(
x1
)
:=
Tactic
Notation
"iExists"
uconstr
(
x1
)
:=
iStartProof
;
iStartProof
;
eapply
tac_exist
;
eapply
tac_exist
;
[
let
P
:=
match
goal
with
|
-
FromExist
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iExists:"
P
"not an existential"
let
P
:=
match
goal
with
|
-
FromExist
?P
_
=>
P
end
in
fail
"iExists:"
P
"not an existential"
|
cbv
beta
;
eexists
x1
]
.
|
cbv
beta
;
eexists
x1
]
.
Tactic
Notation
"iExists"
uconstr
(
x1
)
","
uconstr
(
x2
)
:=
Tactic
Notation
"iExists"
uconstr
(
x1
)
","
uconstr
(
x2
)
:=
...
@@ -715,8 +750,9 @@ Local Tactic Notation "iExistDestruct" constr(H)
...
@@ -715,8 +750,9 @@ Local Tactic Notation "iExistDestruct" constr(H)
"as"
simple_intropattern
(
x
)
constr
(
Hx
)
:=
"as"
simple_intropattern
(
x
)
constr
(
Hx
)
:=
eapply
tac_exist_destruct
with
H
_
Hx
_
_;
(* (i:=H) (j:=Hx) *)
eapply
tac_exist_destruct
with
H
_
Hx
_
_;
(* (i:=H) (j:=Hx) *)
[
env_reflexivity
||
fail
"iExistDestruct:"
H
"not found"
[
env_reflexivity
||
fail
"iExistDestruct:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
IntoExist
?P
_
=>
P
end
in
|
apply
_
||
apply
_
||
fail
"iExistDestruct: cannot destruct"
P
|];
let
P
:=
match
goal
with
|
-
IntoExist
?P
_
=>
P
end
in
fail
"iExistDestruct: cannot destruct"
P
|];
let
y
:=
fresh
in
let
y
:=
fresh
in
intros
y
;
eexists
;
split
;
intros
y
;
eexists
;
split
;
[
env_reflexivity
||
fail
"iExistDestruct:"
Hx
"not fresh"
[
env_reflexivity
||
fail
"iExistDestruct:"
Hx
"not fresh"
...
@@ -747,15 +783,17 @@ Tactic Notation "iNext":= iNext _.
...
@@ -747,15 +783,17 @@ Tactic Notation "iNext":= iNext _.
Tactic
Notation
"iModIntro"
:=
Tactic
Notation
"iModIntro"
:=
iStartProof
;
iStartProof
;
eapply
tac_modal_intro
;
eapply
tac_modal_intro
;
[
let
P
:=
match
goal
with
|
-
FromModal
?P
_
=>
P
end
in
[
apply
_
||
apply
_
||
fail
"iModIntro:"
P
"not a modality"
|]
.
let
P
:=
match
goal
with
|
-
FromModal
?P
_
=>
P
end
in
fail
"iModIntro:"
P
"not a modality"
|]
.
Tactic
Notation
"iModCore"
constr
(
H
)
:=
Tactic
Notation
"iModCore"
constr
(
H
)
:=
eapply
tac_modal_elim
with
_
H
_
_
_
_;
eapply
tac_modal_elim
with
_
H
_
_
_
_;
[
env_reflexivity
||
fail
"iMod:"
H
"not found"
[
env_reflexivity
||
fail
"iMod:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
ElimModal
?P
_
_
_
=>
P
end
in
|
apply
_
||
let
P
:=
match
goal
with
|
-
ElimModal
?P
_
_
_
=>
P
end
in
let
Q
:=
match
goal
with
|
-
ElimModal
_
_
?Q
_
=>
Q
end
in
let
Q
:=
match
goal
with
|
-
ElimModal
_
_
?Q
_
=>
Q
end
in
apply
_
||
fail
"iMod: cannot eliminate modality "
P
"in"
Q
fail
"iMod: cannot eliminate modality "
P
"in"
Q
|
env_reflexivity
|]
.
|
env_reflexivity
|]
.
(** * Basic destruct tactic *)
(** * Basic destruct tactic *)
...
@@ -1386,8 +1424,9 @@ Local Tactic Notation "iRewriteCore" constr(lr) open_constr(lem) "in" constr(H)
...
@@ -1386,8 +1424,9 @@ Local Tactic Notation "iRewriteCore" constr(lr) open_constr(lem) "in" constr(H)
eapply
(
tac_rewrite_in
_
Heq
_
_
H
_
_
lr
);
eapply
(
tac_rewrite_in
_
Heq
_
_
H
_
_
lr
);
[
env_reflexivity
||
fail
"iRewrite:"
Heq
"not found"
[
env_reflexivity
||
fail
"iRewrite:"
Heq
"not found"
|
env_reflexivity
||
fail
"iRewrite:"
H
"not found"
|
env_reflexivity
||
fail
"iRewrite:"
H
"not found"
|
let
P
:=
match
goal
with
|
-
?P
⊢
_
=>
P
end
in
|
apply
:
reflexivity
||
apply
:
reflexivity
||
fail
"iRewrite:"
P
"not an equality"
let
P
:=
match
goal
with
|
-
?P
⊢
_
=>
P
end
in
fail
"iRewrite:"
P
"not an equality"
|
iRewriteFindPred
|
iRewriteFindPred
|
intros
???
->
;
reflexivity
|
intros
???
->
;
reflexivity
|
env_reflexivity
|
lazy
beta
;
iClear
Heq
])
.
|
env_reflexivity
|
lazy
beta
;
iClear
Heq
])
.
...
...
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