feat: Generate sort poly scheme with elim constraints#21567
feat: Generate sort poly scheme with elim constraints#21567TDiazT wants to merge 3 commits intorocq-prover:masterfrom
Conversation
| | Qual (QVar _ as q) -> Some (if dep then case_poly_dep q else case_poly_nodep q) | ||
| | Set | Qual (QConstant QSProp) -> |
There was a problem hiding this comment.
Need to recheck this. Probably extend build_case_analysis_scheme_in_type in the same way as the other.
There was a problem hiding this comment.
looks alright to me
| val case_poly_dep : Sorts.Quality.t -> individual scheme_kind | ||
| val case_poly_nodep : Sorts.Quality.t -> individual scheme_kind |
| (UnivGen.QualityOrSet.sprop, "sind")] | ||
| in | ||
| let elims = List.map (fun (to_kind, dflt_suff) -> | ||
| if from_prop then elim_scheme ~dep:false ~to_kind, Some dflt_suff |
There was a problem hiding this comment.
This is not in your code, you do dependent by default
There was a problem hiding this comment.
Can't you mege both functions as before by simply adding an element to elims ?
There was a problem hiding this comment.
Yup, that's what I was doing before but, to be honest, a lot of the code in the original declare_one_induction_scheme was really adhoc for handling Type, Prop, and SProp specific cases.
For sort variables it's really short actually, so I preferred to separate them, making it easier to understand imo. I just renamed the original declare_one_induction_scheme to declare_one_induction_scheme_const but otherwise is the same code.
Co-authored-by: Thomas Lamiaux <85848641+thomas-lamiaux@users.noreply.github.com>
This PR adds the generation of an eliminator "_poly_rec" to sort-polymorphic inductives, leveraging elimination constraints to support any input and output sorts.
Existing "_rect", "_ind", etc., could be defined in terms of this one (for any sort, not just sort variables), but I think that'd be best in a separate PR.
Example:
make doc_gram_rsts.