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

Ltac2 Constr.Unsafe.case type should expose the inductive and the number of parameters #10940

Open
JasonGross opened this issue Oct 23, 2019 · 7 comments
Labels
kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. part: ltac2 Issues and PRs related to the (in development) Ltac2 tactic langauge.
Projects

Comments

@JasonGross
Copy link
Member

JasonGross commented Oct 23, 2019

Description of the problem

It is useful when writing inversion-style automation to know how many parameters an inductive type should have. It is also sometimes important to know, given a match statement, which inductive is being matched. Hence there should be projections case -> inductive and case -> int (perahaps inductive_of_case and nbparameters_of_case?) which correspond to ci_ind and ci_npar in constr.mli¹ and to the tuple ind_and_nbparams in template-coq².

¹

coq/kernel/constr.mli

Lines 38 to 39 in e6991dc

{ ci_ind : inductive; (* inductive type to which belongs the value that is being matched *)
ci_npar : int; (* number of parameters of the above inductive type *)

² https://github.com/MetaCoq/metacoq/blob/1086391b66b82d10e9aa8d23411344ae9a49bbd4/template-coq/theories/Ast.v#L52

cc @ppedrot @andres-erbsen

Coq Version

master

@JasonGross JasonGross added kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. part: ltac2 Issues and PRs related to the (in development) Ltac2 tactic langauge. labels Oct 23, 2019
@JasonGross JasonGross added this to the 8.11+beta1 milestone Oct 23, 2019
@ppedrot ppedrot modified the milestones: 8.11+beta1, 8.12+beta1 Oct 31, 2019
@Zimmi48
Copy link
Member

Zimmi48 commented May 12, 2020

@ppedrot Do you intend to address this in time for 8.12? If that's the case, there should be an assignee. If not, please remove or adjust the milestone.

@ppedrot ppedrot modified the milestones: 8.12+beta1, 8.13+beta1 May 12, 2020
@ppedrot
Copy link
Member

ppedrot commented May 12, 2020

This is not urgent, so postponing.

@Zimmi48
Copy link
Member

Zimmi48 commented May 13, 2020

This was already postponed once. Not a problem, but maybe the milestone could be simply removed?

@samuelgruetter
Copy link
Contributor

Having access to the number of parameters of an Inductive would be a useful feature!
Lack of this feature in Ltac 1 made me come up with hacks like this one, where I derive the number of parameters by checking for how many arguments passed to a constructor, the induction principle can be specialized with the argument (which is only the case for parameters, but not for indices).

@gares
Copy link
Member

gares commented Nov 18, 2020

@ppedrot I'd like an update w.r.t. this PR and its milestone

@ppedrot
Copy link
Member

ppedrot commented Nov 18, 2020

It's an issue, not a PR, so postpone.

@gares gares removed this from the 8.13+beta1 milestone Nov 18, 2020
@gares
Copy link
Member

gares commented Nov 18, 2020

My interpretation of milestoned issues, is that they have something to do with that release. So I'm not postponing, but rather clearing the milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. part: ltac2 Issues and PRs related to the (in development) Ltac2 tactic langauge.
Projects
Ltac2
  
Parking lot
Development

Successfully merging a pull request may close this issue.

5 participants