forked from MetaCoq/metacoq
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added the ability to reflect Inductive definitions #32
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7c2969d
started work on reflecting inductive definitions.
aa755 4fac2ee
The command can now declare an empty inductive of a give name.
aa755 4a71321
documented a bug in unquoting. It incorrectly changes Prop to Set.
aa755 6a07c23
preliminary work on transparentification.
aa755 3e025d6
Defined kernel's representation of inductive datatypes.
aa755 1d75c3f
started populating the inductive entries properly.
aa755 70bfe07
bugfix : Prop and Set were switched
aa755 11e9c1c
unable to construct the type of constructors. error.
aa755 7ba3c4e
successfully reflected an inductive type : bool
aa755 7db60c9
unquoted params, tested mutual and parametrized inductives.
aa755 c66334d
Merge branch 'coq-8.5' of https://github.com/gmalecha/template-coq in…
aa755 24cdc10
cleaned up the demo
aa755 6506e45
more cleanup for PR
aa755 03905b7
clearnup for PR
aa755 834cbb1
removed the unused argument (name) in Make Inductive
aa755 bdc1171
exported all members of mutual entry, except universe contexts
aa755 2fa5fdc
properly unquoted mind_entry_record
aa755 10f3993
properly unquoted mind_entry_finite
aa755 596619d
properly unquoted mind_private
aa755 fac3650
Make Inductive does reduction
aa755 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,37 @@ Inductive program : Set := | |
list (ident * inductive_body) -> program -> program | ||
| PAxiom : ident -> term (* the type *) -> program -> program | ||
| PIn : term -> program. | ||
|
||
|
||
(** representation of mutual inductives. nearly copied from Coq/kernel/entries.mli | ||
*) | ||
|
||
Record one_inductive_entry : Set := { | ||
mind_entry_typename : ident; | ||
mind_entry_arity : term; | ||
mind_entry_template : bool; (* template polymorphism ? *) | ||
mind_entry_consnames : list ident; | ||
mind_entry_lc : list term}. | ||
|
||
|
||
Inductive local_entry : Set := | ||
| LocalDef : term -> local_entry (* local let binding *) | ||
| LocalAssum : term -> local_entry. | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (** The kind of definition. See kerne/....mli **) |
||
Inductive recursivity_kind := | ||
| Finite (** = inductive *) | ||
| CoFinite (** = coinductive *) | ||
| BiFinite (** = non-recursive, like in "Record" definitions *). | ||
|
||
|
||
(* kernel/entries.mli*) | ||
Record mutual_inductive_entry : Set := { | ||
mind_entry_record : option (option ident); | ||
mind_entry_finite : recursivity_kind; | ||
mind_entry_params : list (ident * local_entry); | ||
mind_entry_inds : list one_inductive_entry; | ||
mind_entry_polymorphic : bool; | ||
(* mind_entry_universes : Univ.universe_context; *) | ||
mind_entry_private : option bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed private is for the HIT trick |
||
}. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to
check_inside_section
here?