Library MetaCoq.PCUIC.PCUICAst
AST of the Polymorphic Cumulative Calculus of Inductive Constructions
Inductive term : Set :=
| tRel (n : nat)
| tVar (i : ident)
| tEvar (n : nat) (l : list term)
| tSort (u : universe)
| tProd (na : name) (A B : term)
| tLambda (na : name) (A t : term)
| tLetIn (na : name) (b B t : term)
| tApp (u v : term)
| tConst (k : kername) (ui : universe_instance)
| tInd (ind : inductive) (ui : universe_instance)
| tConstruct (ind : inductive) (n : nat) (ui : universe_instance)
| tCase (indn : inductive × nat) (p c : term) (brs : list (nat × term))
| tProj (p : projection) (c : term)
| tFix (mfix : mfixpoint term) (idx : nat)
| tCoFix (mfix : mfixpoint term) (idx : nat).
Fixpoint mkApps t us :=
match us with
| nil ⇒ t
| u :: us ⇒ mkApps (tApp t u) us
end.
Definition isApp t :=
match t with
| tApp _ _ ⇒ true
| _ ⇒ false
end.
Definition isLambda t :=
match t with
| tLambda _ _ _ ⇒ true
| _ ⇒ false
end.
Entries
Constant and axiom entries
Record parameter_entry := {
parameter_entry_type : term;
parameter_entry_universes : universes_decl }.
Record definition_entry := {
definition_entry_type : term;
definition_entry_body : term;
definition_entry_universes : universes_decl;
definition_entry_opaque : bool }.
Inductive constant_entry :=
| ParameterEntry (p : parameter_entry)
| DefinitionEntry (def : definition_entry).
Inductive entries
Inductive I1 (x1:X1) ... (xn:Xn) : A1 := c11 : T11 | ... | c1n1 : T1n1
...
with Ip (x1:X1) ... (xn:Xn) : Ap := cp1 : Tp1 ... | cpnp : Tpnp.
Inductive local_entry : Set :=
| LocalDef : term → local_entry
| LocalAssum : term → local_entry.
Record one_inductive_entry : Set := {
mind_entry_typename : ident;
mind_entry_arity : term;
mind_entry_template : bool;
mind_entry_consnames : list ident;
mind_entry_lc : list term }.
Record mutual_inductive_entry := {
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_universes : universes_decl;
mind_entry_private : option bool
}.
Local (de Bruijn) variable binding
Local (de Bruijn) let-binding
Local (de Bruijn) context
Last declaration first
Definition snoc {A} (Γ : list A) (d : A) := d :: Γ.
Notation " Γ ,, d " := (snoc Γ d) (at level 20, d at next level) : pcuic.
Record one_inductive_body := {
ind_name : ident;
ind_type : term;
ind_kelim : list sort_family;
ind_ctors : list (ident × term
× nat );
ind_projs : list (ident × term) }.
ind_name : ident;
ind_type : term;
ind_kelim : list sort_family;
ind_ctors : list (ident × term
× nat );
ind_projs : list (ident × term) }.
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_finite : recursivity_kind;
ind_npars : nat;
ind_params : context;
ind_bodies : list one_inductive_body ;
ind_universes : universes_decl }.
See constant_body from declarations.ml
Record constant_body := {
cst_type : term;
cst_body : option term;
cst_universes : universes_decl }.
Inductive global_decl :=
| ConstantDecl : kername → constant_body → global_decl
| InductiveDecl : kername → mutual_inductive_body → global_decl.
Definition global_env := list global_decl.
cst_type : term;
cst_body : option term;
cst_universes : universes_decl }.
Inductive global_decl :=
| ConstantDecl : kername → constant_body → global_decl
| InductiveDecl : kername → mutual_inductive_body → global_decl.
Definition global_env := list global_decl.
A context of global declarations + global universe constraints,
i.e. a global environment