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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
Iris
Iris
Commits
e3fb7049
There was a problem fetching the pipeline metadata.
Commit
e3fb7049
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue #80: better error message when hyps are missing.
parent
e78dfb5f
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/proofmode/tactics.v
+34
-12
34 additions, 12 deletions
theories/proofmode/tactics.v
with
34 additions
and
12 deletions
theories/proofmode/tactics.v
+
34
−
12
View file @
e3fb7049
...
@@ -32,6 +32,15 @@ Ltac iFresh' H :=
...
@@ -32,6 +32,15 @@ Ltac iFresh' H :=
end
.
end
.
Ltac
iFresh
:=
iFresh'
"~"
.
Ltac
iFresh
:=
iFresh'
"~"
.
Ltac
iMissingHyps
Hs
:=
let
Δ
:=
lazymatch
goal
with
|
|
-
of_envs
?Δ
⊢
_
=>
Δ
|
|
-
context
[
envs_split
_
_
?Δ
]
=>
Δ
end
in
let
Hhyps
:=
eval
env_cbv
in
(
envs_dom
Δ
)
in
eval
vm_compute
in
(
list_difference
Hs
Hhyps
)
.
Tactic
Notation
"iTypeOf"
constr
(
H
)
tactic
(
tac
):=
Tactic
Notation
"iTypeOf"
constr
(
H
)
tactic
(
tac
):=
let
Δ
:=
match
goal
with
|
-
of_envs
?Δ
⊢
_
=>
Δ
end
in
let
Δ
:=
match
goal
with
|
-
of_envs
?Δ
⊢
_
=>
Δ
end
in
lazymatch
eval
env_cbv
in
(
envs_lookup
H
Δ
)
with
lazymatch
eval
env_cbv
in
(
envs_lookup
H
Δ
)
with
...
@@ -238,7 +247,7 @@ Tactic Notation "iFrame" "(" constr(t1) constr(t2) constr(t3) constr(t4)
...
@@ -238,7 +247,7 @@ Tactic Notation "iFrame" "(" constr(t1) constr(t2) constr(t3) constr(t4)
Tactic
Notation
"iFrame"
constr
(
Hs
)
:=
Tactic
Notation
"iFrame"
constr
(
Hs
)
:=
let
rec
go
Hs
:=
let
rec
go
Hs
:=
match
Hs
with
lazy
match
Hs
with
|
[]
=>
idtac
|
[]
=>
idtac
|
SelPure
::
?Hs
=>
iFrameAnyPure
;
go
Hs
|
SelPure
::
?Hs
=>
iFrameAnyPure
;
go
Hs
|
SelPersistent
::
?Hs
=>
iFrameAnyPersistent
;
go
Hs
|
SelPersistent
::
?Hs
=>
iFrameAnyPersistent
;
go
Hs
...
@@ -357,7 +366,7 @@ Notation "( H 'with' pat )" := (ITrm H hnil pat) (at level 0).
...
@@ -357,7 +366,7 @@ Notation "( H 'with' pat )" := (ITrm H hnil pat) (at level 0).
Local
Tactic
Notation
"iSpecializeArgs"
constr
(
H
)
open_constr
(
xs
)
:=
Local
Tactic
Notation
"iSpecializeArgs"
constr
(
H
)
open_constr
(
xs
)
:=
let
rec
go
xs
:=
let
rec
go
xs
:=
match
xs
with
lazy
match
xs
with
|
hnil
=>
idtac
|
hnil
=>
idtac
|
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) *)
...
@@ -420,7 +429,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) :=
...
@@ -420,7 +429,9 @@ 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
|
env_reflexivity
||
fail
"iSpecialize:"
Hs
"not found"
|
env_reflexivity
||
let
Hs'
:=
iMissingHyps
Hs'
in
fail
"iSpecialize: hypotheses"
Hs'
"not found in the context"
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
go
H1
pats
]
|
go
H1
pats
]
|
SAutoFrame
GPersistent
::
?pats
=>
|
SAutoFrame
GPersistent
::
?pats
=>
...
@@ -674,8 +685,11 @@ Tactic Notation "iSplitL" constr(Hs) :=
...
@@ -674,8 +685,11 @@ Tactic Notation "iSplitL" constr(Hs) :=
[
apply
_
||
[
apply
_
||
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
fail
"iSplitL:"
P
"not a separating conjunction"
fail
"iSplitL:"
P
"not a separating conjunction"
|
env_reflexivity
||
fail
"iSplitL: hypotheses"
Hs
|
env_reflexivity
||
"not found in the context"
|
|]
.
let
Hs
:=
iMissingHyps
Hs
in
fail
"iSplitL: hypotheses"
Hs
"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
...
@@ -683,8 +697,10 @@ Tactic Notation "iSplitR" constr(Hs) :=
...
@@ -683,8 +697,10 @@ Tactic Notation "iSplitR" constr(Hs) :=
[
apply
_
||
[
apply
_
||
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
let
P
:=
match
goal
with
|
-
FromSep
?P
_
_
=>
P
end
in
fail
"iSplitR:"
P
"not a separating conjunction"
fail
"iSplitR:"
P
"not a separating conjunction"
|
env_reflexivity
||
fail
"iSplitR: hypotheses"
Hs
|
env_reflexivity
||
"not found in the context"
|
|]
.
let
Hs
:=
iMissingHyps
Hs
in
fail
"iSplitR: hypotheses"
Hs
"not found in the context"
|
|]
.
Tactic
Notation
"iSplitL"
:=
iSplitR
""
.
Tactic
Notation
"iSplitL"
:=
iSplitR
""
.
Tactic
Notation
"iSplitR"
:=
iSplitL
""
.
Tactic
Notation
"iSplitR"
:=
iSplitL
""
.
...
@@ -709,7 +725,9 @@ Local Tactic Notation "iAndDestructChoice" constr(H) "as" constr(lr) constr(H')
...
@@ -709,7 +725,9 @@ Local Tactic Notation "iAndDestructChoice" constr(H) "as" constr(lr) constr(H')
Tactic
Notation
"iCombine"
constr
(
Hs
)
"as"
constr
(
H
)
:=
Tactic
Notation
"iCombine"
constr
(
Hs
)
"as"
constr
(
H
)
:=
let
Hs
:=
words
Hs
in
let
Hs
:=
words
Hs
in
eapply
tac_combine
with
_
_
Hs
_
_
H
_;
eapply
tac_combine
with
_
_
Hs
_
_
H
_;
[
env_reflexivity
||
fail
"iCombine:"
Hs
"not found"
[
env_reflexivity
||
let
Hs
:=
iMissingHyps
Hs
in
fail
"iCombine: hypotheses"
Hs
"not found in the context"
|
apply
_
|
apply
_
|
env_reflexivity
||
fail
"iCombine:"
H
"not fresh"
|]
.
|
env_reflexivity
||
fail
"iCombine:"
H
"not fresh"
|]
.
...
@@ -1326,20 +1344,24 @@ Tactic Notation "iAssertCore" open_constr(Q)
...
@@ -1326,20 +1344,24 @@ Tactic Notation "iAssertCore" open_constr(Q)
|
[
SGoal
(
SpecGoal
?m
?lr
?Hs_frame
?Hs
?d
)]
=>
|
[
SGoal
(
SpecGoal
?m
?lr
?Hs_frame
?Hs
?d
)]
=>
let
Hs'
:=
eval
cbv
in
(
if
lr
then
Hs
else
Hs_frame
++
Hs
)
in
let
Hs'
:=
eval
cbv
in
(
if
lr
then
Hs
else
Hs_frame
++
Hs
)
in
let
p'
:=
eval
cbv
in
(
match
m
with
GModal
=>
false
|
_
=>
p
end
)
in
let
p'
:=
eval
cbv
in
(
match
m
with
GModal
=>
false
|
_
=>
p
end
)
in
match
p'
with
lazy
match
p'
with
|
false
=>
|
false
=>
eapply
tac_assert
with
_
_
_
lr
Hs'
H
Q
_;
eapply
tac_assert
with
_
_
_
lr
Hs'
H
Q
_;
[
lazymatch
m
with
[
lazymatch
m
with
|
GSpatial
=>
apply
elim_modal_dummy
|
GSpatial
=>
apply
elim_modal_dummy
|
GModal
=>
apply
_
||
fail
"iAssert: goal not a modality"
|
GModal
=>
apply
_
||
fail
"iAssert: goal not a modality"
end
end
|
env_reflexivity
||
fail
"iAssert:"
Hs
"not found"
|
env_reflexivity
||
let
Hs'
:=
iMissingHyps
Hs'
in
fail
"iAssert: hypotheses"
Hs'
"not found in the context"
|
env_reflexivity
|
env_reflexivity
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
iFrame
Hs_frame
;
done_if
d
(*goal*)
|
tac
H
]
|
tac
H
]
|
true
=>
|
true
=>
eapply
tac_assert_persistent
with
_
_
_
lr
Hs'
H
Q
;
eapply
tac_assert_persistent
with
_
_
_
lr
Hs'
H
Q
;
[
env_reflexivity
[
env_reflexivity
||
let
Hs'
:=
iMissingHyps
Hs'
in
fail
"iAssert: hypotheses"
Hs'
"not found in the context"
|
env_reflexivity
|
env_reflexivity
|
apply
_
||
fail
"iAssert:"
Q
"not persistent"
|
apply
_
||
fail
"iAssert:"
Q
"not persistent"
|
done_if
d
(*goal*)
|
done_if
d
(*goal*)
...
@@ -1350,7 +1372,7 @@ Tactic Notation "iAssertCore" open_constr(Q)
...
@@ -1350,7 +1372,7 @@ Tactic Notation "iAssertCore" open_constr(Q)
Tactic
Notation
"iAssertCore"
open_constr
(
Q
)
"as"
constr
(
p
)
tactic
(
tac
)
:=
Tactic
Notation
"iAssertCore"
open_constr
(
Q
)
"as"
constr
(
p
)
tactic
(
tac
)
:=
let
p
:=
intro_pat_persistent
p
in
let
p
:=
intro_pat_persistent
p
in
match
p
with
lazy
match
p
with
|
true
=>
iAssertCore
Q
with
"[#]"
as
p
tac
|
true
=>
iAssertCore
Q
with
"[#]"
as
p
tac
|
false
=>
iAssertCore
Q
with
"[]"
as
p
tac
|
false
=>
iAssertCore
Q
with
"[]"
as
p
tac
end
.
end
.
...
...
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