Polytypic programming in COQ

Wendy Verbruggen, Edsko de Vries, Arthur Hughes
2008 Proceedings of the ACM SIGPLAN workshop on Generic programming - WGP '08  
The aim of our work is to provide an infrastructure for formal proofs over Generic Haskell-style polytypic programs. For this goal to succeed, we must have a definition of polytypic programming which is both fully formal and as close as possible to the definition in Generic Haskell. In this paper we show a formalization in the proof assistant Coq of type and term specialization. Our definition of term specialization can be interpreted as a formal proof that the result of term specialization has
more » ... the type computed by type specialization. Inductive type : ∀ (nv:nat), envk nv → kind → Set := | tconst : ∀ (nv:nat) (ek:envk nv) (k:kind), type_constant k → type nv ek k | tvar : ∀ (nv:nat) (ek:envk nv) (i:Fin nv), type nv ek (getS i ek) | tapp : ∀ (nv:nat) (ek:envk nv) (k1 k2:kind), type nv ek (karr k1 k2) → type nv ek k1 → type nv ek k2 | tlam : ∀ (nv:nat) (ek:envk nv) (k1 k2:kind), type (S nv) (k1, ek) k2 → type nv ek (karr k1 k2). ( * Syntactic sugar for types with no free variables * ) Definition closed_type (k:kind) : Set := type 0 tt k. ( * Syntactic sugar for type constants * ) Definition tunit := tconst 0 tt tc_unit. Definition tint := tconst 0 tt tc_int. Definition tprod := tconst 0 tt tc_prod. Definition tsum := tconst 0 tt tc_sum
doi:10.1145/1411318.1411326 dblp:conf/icfp/VerbruggenVH08 fatcat:jvsglnjpena5phel2b2xfxsr6m