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