(* Pretty-normal form (PNF) subset of core-calculus, explicitly typed, with subtyping *) module Pnf = struct type id = Tcore.id type label = Tcore.label type var = Tcore.var * Tcore.typ and typ = Tcore.typ = IntT | ArrowT of typ * typ | RecordT of rtyp | SumT of rtyp and rtyp = (label * typ) list (* labels are sorted and unique *) type trexp = Var of var | Abs of var * exp | Int of int and exp = Triv of trexp | Let of var * exp * exp | App of trexp * trexp | Fix of (var * trexp) list * exp | Record of row | Select of label * trexp | Variant of label * trexp | Switch of trexp * row and row = (label * trexp) list let gensym (t:typ) : var = (Tcore.gensym(),t) end