Skip to content

Decouple Ltac2 from Corelib #20385

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

Open
patrick-nicodemus opened this issue Mar 23, 2025 · 3 comments
Open

Decouple Ltac2 from Corelib #20385

patrick-nicodemus opened this issue Mar 23, 2025 · 3 comments
Labels
kind: wish Feature or enhancement requests.

Comments

@patrick-nicodemus
Copy link
Contributor

Is your feature request related to a problem?

This is a feature request to remove the dependencies of Ltac2 on Corelib so that Corelib is not loaded when Ltac2 is loaded, motivated by the desire to be as compatible as possible with the CoqHoTT library.

Ideally Require Ltac2.Ltac2 would not cause Corelib.Init.Logic to be loaded. The modules are all qualified so it's unlikely that the Prop-valued equality would be used accidentally, but it would still be preferable not to load the files defining Prop-valued equality at all.

I'm not sure how realistic this is. Probably an easier target would be to remove the dependence of Ltac2 on the various plugins implementing powerful tactics:

[Loading ML file rocq-runtime.plugins.tauto ...
[Loading ML file rocq-runtime.plugins.cc_core ...
[Loading ML file rocq-runtime.plugins.cc ...
[Loading ML file rocq-runtime.plugins.firstorder_core ...
[Loading ML file rocq-runtime.plugins.firstorder ...

Proposed solution

No response

Alternative solutions

No response

Additional context

No response

@patrick-nicodemus patrick-nicodemus added kind: wish Feature or enhancement requests. needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Mar 23, 2025
@SkySkimmer
Copy link
Contributor

SkySkimmer commented Mar 23, 2025

I think currently the main obstacle is that Ltac2 provides now which needs Logic etc
https://github.com/coq/coq/blob/89b24b812f89a1a8e8fd72ea10182b46f220e75e/user-contrib/Ltac2/Notations.v#L624
https://github.com/coq/coq/blob/89b24b812f89a1a8e8fd72ea10182b46f220e75e/theories/Init/Tactics.v#L158

Maybe we could reduce the ltac2 dependency to just Corelib.Init.Ltac using an indirection, something like

(* Corelib.Init.Ltac *)
(* current content + *)
Ltac easy := fail "Corelib.Init.Tactics not loaded".

(* Corelib.Init.Tactics *)
(* after Ltac easy := big code: *)
Ltac Ltac.easy ::= easy.

and use Corelib.Init.Ltac in Ltac2.Notations.

@SkySkimmer SkySkimmer removed the needs: triage The validity of this issue needs to be checked, or the issue itself updated. label Mar 23, 2025
@patrick-nicodemus
Copy link
Contributor Author

patrick-nicodemus commented Mar 23, 2025

Okay, cool. I see the use of conjunction in that tactic. Are any other tactics in easy heavily dependent on Init stuff? (inversion strikes me as complicated so i'm wondering if that relies on anything in Init)

Or maybe the Ltac2 easy could be rewritten slightly differently, so that instead of [ |- _ /\ _ ] => it was something like "if the goal is an inductive type with a single constructor that takes two arguments, apply the constructor". It would probably be difficult to do that in a backwards compatible way.

SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Mar 24, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
@SkySkimmer
Copy link
Contributor

#20387

SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Mar 24, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Mar 24, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
JasonGross added a commit to JasonGross/coq that referenced this issue Mar 25, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Mar 26, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Apr 2, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Apr 2, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
SkySkimmer added a commit to SkySkimmer/rocq that referenced this issue Apr 3, 2025
This does not entirely remove the dependency on corelib as we still
need ltac1.

We also add a forward declaration for `easy` in Init.Ltac as it is
used in Ltac2.Notations.

cf rocq-prover#20385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: wish Feature or enhancement requests.
Projects
None yet
Development

No branches or pull requests

2 participants