Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving general-purpose rapply from Programs to Init #17209

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions doc/sphinx/proof-engine/tactics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,6 @@ Applying theorems
:n:`@one_term` to arbitrarily many arguments without getting a type
error, :tacn:`rapply` will loop.

Note that you must :n:`Require Import Coq.Program.Tactics` to
use :tacn:`rapply`.

.. tacn:: simple apply {+, @one_term_with_bindings } {? @in_hyp_as }

Behaves like :tacn:`apply` but it reasons modulo conversion only on subterms
Expand Down
8 changes: 8 additions & 0 deletions theories/Init/Tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,11 @@ Create HintDb rewrite discriminated.
#[global]
Hint Variables Opaque : rewrite.
Create HintDb typeclass_instances discriminated.

(** A variant of [apply] using [refine], doing as much conversion as necessary. *)

Ltac rapply p :=
(** before we try to add more underscores, first ensure that adding such underscores is valid *)
(assert_succeeds (idtac; let __ := open_constr:(p _) in idtac);
rapply uconstr:(p _))
|| refine p.
8 changes: 0 additions & 8 deletions theories/Program/Tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@ Ltac on_application f tac T :=
| context [f ?x] => tac (f x)
end.

(** A variant of [apply] using [refine], doing as much conversion as necessary. *)

Ltac rapply p :=
(** before we try to add more underscores, first ensure that adding such underscores is valid *)
(assert_succeeds (idtac; let __ := open_constr:(p _) in idtac);
rapply uconstr:(p _))
|| refine p.

(** Tactical [on_call f tac] applies [tac] on any application of [f] in the hypothesis or goal. *)

Ltac on_call f tac :=
Expand Down