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

Improve Quoting to also quote uniform parameters #1120

Open
thomas-lamiaux opened this issue Nov 21, 2024 · 2 comments
Open

Improve Quoting to also quote uniform parameters #1120

thomas-lamiaux opened this issue Nov 21, 2024 · 2 comments

Comments

@thomas-lamiaux
Copy link

From what I understand, uniform and non-uniform parameters are distinguished in the kernel but not in MetaCoq because it does not matter for typing. However, it matters for meta-programming so:

  1. quoting should split the context of parameters in uniform and non-uniform one
  2. adapt the functions between Template and PCUIC accordingly
    • Template -> PCUIC is trivial, it is just merging back
    • For PCUIC -> template, one will need a function to compute uniform parameters back
      I have one but it relies on my interface, though it should be easily adaptable as it's just reading
      It suffices to replace the state interface by a shift to keep track of the scope
@MevenBertrand
Copy link
Member

Alternative approach: make the difference also in PCUIC, and redefine the current field accessors to functions which do the merging (or keep them as fields + proofs that they correspond to the right thing, like we do with the number of parameters). Hopefully we can keep a mostly unchanged interface for the rest of PCUIC, but keeping that information around seems more future-proof: we don't know where/when we'll need that distinction in PCUIC, but I am sure it will happen (honestly, I am surprised it does not already appears in environment typing somehow).

@thomas-lamiaux
Copy link
Author

thomas-lamiaux commented Nov 26, 2024

It seems that definitions of inductive types are actually shared between both in Template and PCUIC

(** See [mutual_inductive_body] from [declarations.ml]. *)
Record mutual_inductive_body := {
ind_finite : recursivity_kind;
ind_npars : nat;
ind_params : context;
ind_bodies : list one_inductive_body ;
ind_universes : universes_decl;
ind_variance : option (list Universes.Variance.t) }.

So if you want to change one, you have to change both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants