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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Glen Mével
stdpp
Commits
e81900e1
Commit
e81900e1
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Simplify f_equiv a bit.
parent
b9171858
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/tactics.v
+5
-17
5 additions, 17 deletions
theories/tactics.v
with
5 additions
and
17 deletions
theories/tactics.v
+
5
−
17
View file @
e81900e1
...
...
@@ -233,7 +233,7 @@ Ltac setoid_subst :=
If it cannot solve an equality, it will leave that to the user. *)
Ltac
f_equiv
:=
(* Deal with "pointwise_relation" *)
try
lazymatch
goal
with
repeat
lazymatch
goal
with
|
|
-
pointwise_relation
_
_
_
_
=>
intros
?
end
;
(* Normalize away equalities. *)
...
...
@@ -249,13 +249,9 @@ Ltac f_equiv :=
destruct
x
;
f_equiv
(* First assume that the arguments need the same relation as the result *)
|
|
-
?R
(
?f
?x
)
(
?f
_)
=>
let
H
:=
fresh
"Proper"
in
assert
(
Proper
(
R
==>
R
)
f
)
as
H
by
(
eapply
_);
apply
H
;
clear
H
;
f_equiv
apply
(_
:
Proper
(
R
==>
R
)
f
);
f_equiv
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
let
H
:=
fresh
"Proper"
in
assert
(
Proper
(
R
==>
R
==>
R
)
f
)
as
H
by
(
eapply
_);
apply
H
;
clear
H
;
f_equiv
apply
(_
:
Proper
(
R
==>
R
==>
R
)
f
);
f_equiv
(* Next, try to infer the relation. Unfortunately, there is an instance
of Proper for (eq ==> _), which will always be matched. *)
(* TODO: Can we exclude that instance? *)
...
...
@@ -263,17 +259,9 @@ Ltac f_equiv :=
query for "pointwise_relation"'s. But that leads to a combinatorial
explosion about which arguments are and which are not the same. *)
|
|
-
?R
(
?f
?x
)
(
?f
_)
=>
let
R1
:=
fresh
"R"
in
let
H
:=
fresh
"HProp"
in
let
T
:=
type
of
x
in
evar
(
R1
:
relation
T
);
assert
(
Proper
(
R1
==>
R
)
f
)
as
H
by
(
subst
R1
;
eapply
_);
subst
R1
;
apply
H
;
clear
H
;
f_equiv
apply
(_
:
Proper
(_
==>
R
)
f
);
f_equiv
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
let
R1
:=
fresh
"R"
in
let
R2
:=
fresh
"R"
in
let
H
:=
fresh
"HProp"
in
let
T1
:=
type
of
x
in
evar
(
R1
:
relation
T1
);
let
T2
:=
type
of
y
in
evar
(
R2
:
relation
T2
);
assert
(
Proper
(
R1
==>
R2
==>
R
)
f
)
as
H
by
(
subst
R1
R2
;
eapply
_);
subst
R1
R2
;
apply
H
;
clear
H
;
f_equiv
apply
(_
:
Proper
(_
==>
_
==>
R
)
f
);
f_equiv
(* In case the function symbol differs, but the arguments are the same,
maybe we have a pointwise_relation in our context. *)
|
H
:
pointwise_relation
_
?R
?f
?g
|
-
?R
(
?f
?x
)
(
?g
?x
)
=>
...
...
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