Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
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
stdpp
Commits
e0492901
Commit
e0492901
authored
3 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add mk_evar tactic (to replace Coq's strange evar tactic) and use it
parent
fb2e3c8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!289
add mk_evar tactic (to replace Coq's strange evar tactic) and use it
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
theories/fin_maps.v
+4
-6
4 additions, 6 deletions
theories/fin_maps.v
theories/gmultiset.v
+3
-4
3 additions, 4 deletions
theories/gmultiset.v
theories/option.v
+2
-2
2 additions, 2 deletions
theories/option.v
theories/tactics.v
+10
-3
10 additions, 3 deletions
theories/tactics.v
with
19 additions
and
15 deletions
theories/fin_maps.v
+
4
−
6
View file @
e0492901
...
@@ -3198,10 +3198,9 @@ Tactic Notation "simpl_map" "by" tactic3(tac) := repeat
...
@@ -3198,10 +3198,9 @@ Tactic Notation "simpl_map" "by" tactic3(tac) := repeat
|
H
:
context
[
(_
<$>
_)
!!
_
]
|
-
_
=>
rewrite
lookup_fmap
in
H
|
H
:
context
[
(_
<$>
_)
!!
_
]
|
-
_
=>
rewrite
lookup_fmap
in
H
|
H
:
context
[
(
omap
_
_)
!!
_
]
|
-
_
=>
rewrite
lookup_omap
in
H
|
H
:
context
[
(
omap
_
_)
!!
_
]
|
-
_
=>
rewrite
lookup_omap
in
H
|
H
:
context
[
lookup
(
A
:=
?A
)
?i
(
?m1
∪
?m2
)
]
|
-
_
=>
|
H
:
context
[
lookup
(
A
:=
?A
)
?i
(
?m1
∪
?m2
)
]
|
-
_
=>
let
x
:=
fresh
in
evar
(
x
:
A
);
let
x
:=
mk_evar
A
in
let
x'
:=
eval
unfold
x
in
x
in
clear
x
;
let
E
:=
fresh
in
let
E
:=
fresh
in
assert
((
m1
∪
m2
)
!!
i
=
Some
x
'
)
as
E
by
(
clear
H
;
by
tac
);
assert
((
m1
∪
m2
)
!!
i
=
Some
x
)
as
E
by
(
clear
H
;
by
tac
);
rewrite
E
in
H
;
clear
E
rewrite
E
in
H
;
clear
E
|
|
-
context
[
∅
!!
_
]
=>
rewrite
lookup_empty
|
|
-
context
[
∅
!!
_
]
=>
rewrite
lookup_empty
|
|
-
context
[
(
<
[_:=_]
>_
)
!!
_
]
=>
|
|
-
context
[
(
<
[_:=_]
>_
)
!!
_
]
=>
...
@@ -3215,10 +3214,9 @@ Tactic Notation "simpl_map" "by" tactic3(tac) := repeat
...
@@ -3215,10 +3214,9 @@ Tactic Notation "simpl_map" "by" tactic3(tac) := repeat
|
|
-
context
[
(_
<$>
_)
!!
_
]
=>
rewrite
lookup_fmap
|
|
-
context
[
(_
<$>
_)
!!
_
]
=>
rewrite
lookup_fmap
|
|
-
context
[
(
omap
_
_)
!!
_
]
=>
rewrite
lookup_omap
|
|
-
context
[
(
omap
_
_)
!!
_
]
=>
rewrite
lookup_omap
|
|
-
context
[
lookup
(
A
:=
?A
)
?i
?m
]
=>
|
|
-
context
[
lookup
(
A
:=
?A
)
?i
?m
]
=>
let
x
:=
fresh
in
evar
(
x
:
A
);
let
x
:=
mk_evar
A
in
let
x'
:=
eval
unfold
x
in
x
in
clear
x
;
let
E
:=
fresh
in
let
E
:=
fresh
in
assert
(
m
!!
i
=
Some
x
'
)
as
E
by
tac
;
assert
(
m
!!
i
=
Some
x
)
as
E
by
tac
;
rewrite
E
;
clear
E
rewrite
E
;
clear
E
end
.
end
.
...
...
This diff is collapsed.
Click to expand it.
theories/gmultiset.v
+
3
−
4
View file @
e0492901
...
@@ -273,10 +273,9 @@ End multiset_unfold.
...
@@ -273,10 +273,9 @@ End multiset_unfold.
Ltac
multiset_instantiate
:=
Ltac
multiset_instantiate
:=
repeat
match
goal
with
repeat
match
goal
with
|
H
:
(
∀
x
:
?A
,
@
?P
x
)
|
-
_
=>
|
H
:
(
∀
x
:
?A
,
@
?P
x
)
|
-
_
=>
let
e
:=
fresh
in
evar
(
e
:
A
);
let
e
:=
mk_evar
A
in
let
e'
:=
eval
unfold
e
in
e
in
clear
e
;
lazymatch
constr
:(
P
e
)
with
lazymatch
constr
:(
P
e'
)
with
|
context
[
{[
+
?y
+
]}
]
=>
unify
y
e
;
learn_hyp
(
H
y
)
|
context
[
{[
+
?y
+
]}
]
=>
unify
y
e'
;
learn_hyp
(
H
y
)
end
end
|
H
:
(
∀
x
:
?A
,
_),
_
:
context
[
multiplicity
?y
_]
|
-
_
=>
learn_hyp
(
H
y
)
|
H
:
(
∀
x
:
?A
,
_),
_
:
context
[
multiplicity
?y
_]
|
-
_
=>
learn_hyp
(
H
y
)
|
H
:
(
∀
x
:
?A
,
_)
|
-
context
[
multiplicity
?y
_]
=>
learn_hyp
(
H
y
)
|
H
:
(
∀
x
:
?A
,
_)
|
-
context
[
multiplicity
?y
_]
=>
learn_hyp
(
H
y
)
...
...
This diff is collapsed.
Click to expand it.
theories/option.v
+
2
−
2
View file @
e0492901
...
@@ -360,8 +360,8 @@ Proof. intros [??]. repeat case_option_guard; intuition. Qed.
...
@@ -360,8 +360,8 @@ Proof. intros [??]. repeat case_option_guard; intuition. Qed.
Tactic
Notation
"simpl_option"
"by"
tactic3
(
tac
)
:=
Tactic
Notation
"simpl_option"
"by"
tactic3
(
tac
)
:=
let
assert_Some_None
A
mx
H
:=
first
let
assert_Some_None
A
mx
H
:=
first
[
let
x
:=
fresh
in
evar
(
x
:
A
);
let
x'
:=
eval
unfold
x
in
x
in
clear
x
;
[
let
x
:=
mk_evar
A
in
assert
(
mx
=
Some
x
'
)
as
H
by
tac
assert
(
mx
=
Some
x
)
as
H
by
tac
|
assert
(
mx
=
None
)
as
H
by
tac
]
|
assert
(
mx
=
None
)
as
H
by
tac
]
in
repeat
match
goal
with
in
repeat
match
goal
with
|
H
:
context
[
@
mret
_
_
?A
]
|
-
_
=>
|
H
:
context
[
@
mret
_
_
?A
]
|
-
_
=>
...
...
This diff is collapsed.
Click to expand it.
theories/tactics.v
+
10
−
3
View file @
e0492901
...
@@ -217,6 +217,14 @@ does the converse. *)
...
@@ -217,6 +217,14 @@ does the converse. *)
Ltac
var_eq
x1
x2
:=
match
x1
with
x2
=>
idtac
|
_
=>
fail
1
end
.
Ltac
var_eq
x1
x2
:=
match
x1
with
x2
=>
idtac
|
_
=>
fail
1
end
.
Ltac
var_neq
x1
x2
:=
match
x1
with
x2
=>
fail
1
|
_
=>
idtac
end
.
Ltac
var_neq
x1
x2
:=
match
x1
with
x2
=>
fail
1
|
_
=>
idtac
end
.
(** The tactic [mk_evar T] returns a new evar of type [T], without affecting the
current context.
This is usually a more useful behavior than Coq's [evar], which is a
side-effecting tactic (not returning anything) that introduces a local
definition into the context that holds the evar. *)
Ltac
mk_evar
T
:=
open_constr
:(_
:
T
)
.
(** The tactic [eunify x y] succeeds if [x] and [y] can be unified, and fails
(** The tactic [eunify x y] succeeds if [x] and [y] can be unified, and fails
otherwise. If it succeeds, it will instantiate necessary evars in [x] and [y].
otherwise. If it succeeds, it will instantiate necessary evars in [x] and [y].
...
@@ -483,9 +491,8 @@ Tactic Notation "efeed" constr(H) "using" tactic3(tac) "by" tactic3 (bytac) :=
...
@@ -483,9 +491,8 @@ Tactic Notation "efeed" constr(H) "using" tactic3(tac) "by" tactic3 (bytac) :=
let
HT1
:=
fresh
"feed"
in
assert
T1
as
HT1
;
let
HT1
:=
fresh
"feed"
in
assert
T1
as
HT1
;
[
bytac
|
go
(
H
HT1
);
clear
HT1
]
[
bytac
|
go
(
H
HT1
);
clear
HT1
]
|
?T1
→
_
=>
|
?T1
→
_
=>
let
e
:=
fresh
"feed"
in
evar
(
e
:
T1
);
let
e
:=
mk_evar
T1
in
let
e'
:=
eval
unfold
e
in
e
in
go
(
H
e
)
clear
e
;
go
(
H
e'
)
|
?T1
=>
tac
H
|
?T1
=>
tac
H
end
in
go
H
.
end
in
go
H
.
Tactic
Notation
"efeed"
constr
(
H
)
"using"
tactic3
(
tac
)
:=
Tactic
Notation
"efeed"
constr
(
H
)
"using"
tactic3
(
tac
)
:=
...
...
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