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
Snippets
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
Arthur Azevedo de Amorim
stdpp
Commits
b8ba5d8a
Commit
b8ba5d8a
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
factor out solve_proper preparation into a separate tactic
parent
461bc9c9
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
+14
-7
14 additions, 7 deletions
theories/tactics.v
with
14 additions
and
7 deletions
theories/tactics.v
+
14
−
7
View file @
b8ba5d8a
...
@@ -335,11 +335,10 @@ Ltac solve_proper_unfold :=
...
@@ -335,11 +335,10 @@ Ltac solve_proper_unfold :=
|
|
-
?R
(
?f
_
_)
(
?f
_
_)
=>
unfold
f
|
|
-
?R
(
?f
_
_)
(
?f
_
_)
=>
unfold
f
|
|
-
?R
(
?f
_)
(
?f
_)
=>
unfold
f
|
|
-
?R
(
?f
_)
(
?f
_)
=>
unfold
f
end
.
end
.
(* [solve_proper_prepare] does some preparation work before the main
(** The tactic [solve_proper_core tac] solves goals of the form "Proper (R1 ==> R2)", for
[solve_proper] loop. Having this as a separate tactic is useful for
any number of relations. The actual work is done by repeatedly applying
debugging [solve_proper] failure. *)
[tac]. *)
Ltac
solve_proper_prepare
:=
Ltac
solve_proper_core
tac
:=
(* Introduce everything *)
(* Introduce everything *)
intros
;
intros
;
repeat
lazymatch
goal
with
repeat
lazymatch
goal
with
...
@@ -348,10 +347,18 @@ Ltac solve_proper_core tac :=
...
@@ -348,10 +347,18 @@ Ltac solve_proper_core tac :=
|
|
-
pointwise_relation
_
_
_
_
=>
intros
?
|
|
-
pointwise_relation
_
_
_
_
=>
intros
?
|
|
-
?R
?f
_
=>
try
let
f'
:=
constr
:(
λ
x
,
f
x
)
in
intros
?
|
|
-
?R
?f
_
=>
try
let
f'
:=
constr
:(
λ
x
,
f
x
)
in
intros
?
end
;
simplify_eq
;
end
;
simplify_eq
;
(*
Now do the job.
We try with and without unfolding. We have to backtrack on
(* We try with and without unfolding. We have to backtrack on
that because unfolding may succeed, but then the proof may fail. *)
that because unfolding may succeed, but then the proof may fail. *)
(
solve_proper_unfold
+
idtac
);
simpl
;
(
solve_proper_unfold
+
idtac
);
simpl
.
(** The tactic [solve_proper_core tac] solves goals of the form "Proper (R1 ==> R2)", for
any number of relations. The actual work is done by repeatedly applying
[tac]. *)
Ltac
solve_proper_core
tac
:=
solve_proper_prepare
;
(* Now do the job. *)
solve
[
repeat
first
[
eassumption
|
tac
()]
]
.
solve
[
repeat
first
[
eassumption
|
tac
()]
]
.
(** Finally, [solve_proper] tries to apply [f_equiv] in a loop. *)
Ltac
solve_proper
:=
solve_proper_core
ltac
:(
fun
_
=>
f_equiv
)
.
Ltac
solve_proper
:=
solve_proper_core
ltac
:(
fun
_
=>
f_equiv
)
.
(** The tactic [intros_revert tac] introduces all foralls/arrows, performs tac,
(** The tactic [intros_revert tac] introduces all foralls/arrows, performs 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