Synint.LF
Right-hand side of the turnstile for meta-types
Meta-types
and ctyp_decl =
| Decl of {
name : Syncom.Name.t;
typ : ctyp;
plicity : Syncom.Plicity.t;
inductivity : Syncom.Inductivity.t;
}
| DeclOpt of {
name : Syncom.Name.t;
plicity : Syncom.Plicity.t;
}
and typ =
| Atom of Syncom.Location.t * Syncom.Id.cid_typ * spine
| PiTyp of typ_decl * Syncom.Depend.t * Syncom.Plicity.t * typ
| Sigma of typ_rec
| TClo of typ * sub
and normal =
| Lam of Syncom.Location.t * Syncom.Name.t * normal
| Root of Syncom.Location.t * head * spine * Syncom.Plicity.t
| LFHole of Syncom.Location.t * Syncom.HoleId.t * Syncom.HoleId.name
| Clo of normal * sub
| Tuple of Syncom.Location.t * tuple
and head =
| BVar of Syncom.Id.offset
| Const of Syncom.Id.cid_term
| MMVar of mm_var_inst
| MPVar of mm_var_inst
| MVar of cvar * sub
| PVar of Syncom.Id.offset * sub
| AnnH of head * typ
| Proj of head * int
| FVar of Syncom.Name.t
| FMVar of fvarsub
| FPVar of fvarsub
| HClo of Syncom.Id.offset * Syncom.Id.offset * sub
| HMClo of Syncom.Id.offset * mm_var_inst
and fvarsub = Syncom.Name.t * sub
and sub =
| Shift of Syncom.Id.offset
| SVar of Syncom.Id.offset * int * sub
| FSVar of Syncom.Id.offset * fvarsub
| Dot of front * sub
| MSVar of Syncom.Id.offset * mm_var_inst
| EmptySub
| Undefs
and mm_var = {
name : Syncom.Name.t;
instantiation : iterm option Stdlib.ref;
cD : mctx;
mmvar_id : int;
typ : ctyp;
constraints : cnstr list Stdlib.ref;
plicity : Syncom.Plicity.t;
inductivity : Syncom.Inductivity.t;
}
and mm_var_inst = mm_var_inst' * sub
and cnstr = constrnt Stdlib.ref
and dctx_hat = ctx_var option * Syncom.Id.offset
val map_plicity : (Syncom.Plicity.t -> Syncom.Plicity.t) -> normal -> normal
Helper for forming TClo LF types, which avoids doing so if the substitution is the identity.
val mm_var_inst : mm_var -> msub -> sub -> mm_var_inst
Forms an MMVar instantiation by attaching an LF substitution and a meta-substituation to the variable.
val is_mmvar_instantiated : mm_var -> bool
val rename_ctyp_decl :
(Syncom.Name.t -> Syncom.Name.t) ->
ctyp_decl ->
ctyp_decl
Embeds a head into a normal by using an empty spine. Very useful for constructing variables as normals. Note that the normal will have a ghost location, as heads don't carry a location.
val mmvar : mm_var_inst -> head
val mpvar : mm_var_inst -> head
val require_decl :
ctyp_decl ->
Syncom.Name.t * ctyp * Syncom.Plicity.t * Syncom.Inductivity.t
Assert that the contextual type declaration be a real Decl, and not a DeclOpt. Raises a violation if it is a DeclOpt.
val null_hat : dctx_hat
val loc_of_normal : normal -> Syncom.Location.t
val blockLength : typ_rec -> int
val getIndex : typ_rec -> Syncom.Name.t -> int
val is_explicit : ctyp_decl -> bool
val name_of_ctyp_decl : ctyp_decl -> Syncom.Name.t
val variable_of_mfront :
mfront ->
(Syncom.Id.offset * Syncom.Id.offset option) option
Decides whether the given mfront is a variable, viz. projection of a
pattern variable, metavariable, or context variable. Returns the offset of the variable, and optionally the projection offset.
val get_constraint_id : constrnt -> constrnt_id