Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
Janno
iris-coq
Commits
9589d1ba
Commit
9589d1ba
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make identation of solve_proper and f_equiv more consistent.
parent
00a054f1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prelude/tactics.v
+33
-34
33 additions, 34 deletions
prelude/tactics.v
with
33 additions
and
34 deletions
prelude/tactics.v
+
33
−
34
View file @
9589d1ba
...
@@ -234,40 +234,39 @@ Ltac setoid_subst :=
...
@@ -234,40 +234,39 @@ Ltac setoid_subst :=
Ltac
f_equiv
:=
Ltac
f_equiv
:=
(* Deal with "pointwise_relation" *)
(* Deal with "pointwise_relation" *)
repeat
lazymatch
goal
with
repeat
lazymatch
goal
with
|
|
-
pointwise_relation
_
_
_
_
=>
intros
?
|
|
-
pointwise_relation
_
_
_
_
=>
intros
?
end
;
end
;
(* Normalize away equalities. *)
(* Normalize away equalities. *)
subst
;
subst
;
(* repeatedly apply congruence lemmas and use the equalities in the hypotheses. *)
(* repeatedly apply congruence lemmas and use the equalities in the hypotheses. *)
first
[
reflexivity
|
assumption
|
symmetry
;
assumption
|
try
match
goal
with
match
goal
with
|
_
=>
first
[
reflexivity
|
assumption
|
symmetry
;
assumption
]
(* We support matches on both sides, *if* they concern the same
(* We support matches on both sides, *if* they concern the same
variable.
variable.
TODO: We should support different variables, provided that we can
TODO: We should support different variables, provided that we can
derive contradictions for the off-diagonal cases. *)
derive contradictions for the off-diagonal cases. *)
|
|
-
?R
(
match
?x
with
_
=>
_
end
)
(
match
?x
with
_
=>
_
end
)
=>
|
|
-
?R
(
match
?x
with
_
=>
_
end
)
(
match
?x
with
_
=>
_
end
)
=>
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
_)
=>
apply
(_
:
Proper
(
R
==>
R
)
f
);
f_equiv
apply
(_
:
Proper
(
R
==>
R
)
f
);
f_equiv
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
apply
(_
:
Proper
(
R
==>
R
==>
R
)
f
);
f_equiv
apply
(_
:
Proper
(
R
==>
R
==>
R
)
f
);
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? *)
(* TODO: If some of the arguments are the same, we could also
(* TODO: If some of the arguments are the same, we could also
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
_)
=>
apply
(_
:
Proper
(_
==>
R
)
f
);
f_equiv
apply
(_
:
Proper
(_
==>
R
)
f
);
f_equiv
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
|
|
-
?R
(
?f
?x
?y
)
(
?f
_
_)
=>
apply
(_
:
Proper
(_
==>
_
==>
R
)
f
);
f_equiv
apply
(_
:
Proper
(_
==>
_
==>
R
)
f
);
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
)
=>
apply
H
;
f_equiv
apply
H
;
f_equiv
end
|
idtac
(* Let the user solve this goal *)
end
.
]
.
(** solve_proper solves goals of the form "Proper (R1 ==> R2)", for any
(** solve_proper solves goals of the form "Proper (R1 ==> R2)", for any
number of relations. All the actual work is done by f_equiv;
number of relations. All the actual work is done by f_equiv;
...
@@ -277,9 +276,9 @@ Ltac solve_proper :=
...
@@ -277,9 +276,9 @@ Ltac solve_proper :=
(* Introduce everything *)
(* Introduce everything *)
intros
;
intros
;
repeat
lazymatch
goal
with
repeat
lazymatch
goal
with
|
|
-
Proper
_
_
=>
intros
???
|
|
-
Proper
_
_
=>
intros
???
|
|
-
(_
==>
_)
%
signature
_
_
=>
intros
???
|
|
-
(_
==>
_)
%
signature
_
_
=>
intros
???
end
;
end
;
(* Unfold the head symbol, which is the one we are proving a new property about *)
(* Unfold the head symbol, which is the one we are proving a new property about *)
lazymatch
goal
with
lazymatch
goal
with
|
|
-
?R
(
?f
_
_
_
_
_
_
_
_)
(
?f
_
_
_
_
_
_
_
_)
=>
unfold
f
|
|
-
?R
(
?f
_
_
_
_
_
_
_
_)
(
?f
_
_
_
_
_
_
_
_)
=>
unfold
f
...
...
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