Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pretyping/vnorm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ module NamedDecl = Context.Named.Declaration
(* Calcul de la forme normal d'un terme *)
(*******************************************)

let e_whd_all = Reductionops.clos_whd_flags RedFlags.all
let e_whd_all env sigma t = match EConstr.kind sigma t with
| Sort _ | Meta _ | Ind _ | Construct _ | Prod _| Lambda _ | Fix _
| CoFix _ | Int _ | Float _ | String _ | Array _ as kind ->
EConstr.of_kind kind (* ensure head evar normalization *)
| App (c, _) as kind ->
begin match EConstr.kind sigma c with
| Ind _ | Construct _ | Meta _ | Int _ | Float _ | String _ | Array _ -> EConstr.of_kind kind
| Sort _ | Rel _ | Var _ | Evar _ | Cast _ | Prod _ | Lambda _ | LetIn _ | App _
| Const _ | Case _ | Fix _ | CoFix _ | Proj _ ->
Reductionops.clos_whd_flags RedFlags.all env sigma t
end
| Rel _ | Evar _ | Cast _ | LetIn _ | Case _ | Proj _ | Const _ | Var _ ->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't Evar in whnf? since it's from EConstr.kind it's undefined

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically in vnorm we only ever reduce types whose normal forms are either Π or (applied) inductives, so in practice it doesn't matter.

@SkySkimmer SkySkimmer Jun 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it also be worth checking definedness of Rel/Var/Const?

Reductionops.clos_whd_flags RedFlags.all env sigma t

let crazy_type = mkSet

Expand Down
Loading