保护递归数据类型的类型推断
Type Inference for Guarded Recursive Data Types
摘要:
我们考虑保护递归数据类型(GRDT)的类型推断--代数数据类型的最新概括。我们减少类型推断GRDTs统一下的混合前缀。因此,我们得到有效的类型推断。推断是不完整的,因为允许出现在类型系统中的类型约束集只是由类型推断生成的那些类型约束的子集。因此,只有当程序被充分地类型注释时,推理才会成功。我们提出了完善的程序,逐步推断类型,并协助用户识别哪些类型的信息丢失。此外,我们还引入了一些过程来测试一个类型是否不是主体类型,并在存在主体类型时查找主体类型。
英文摘要:
We consider type inference for guarded recursive data types (GRDTs) -- a recent generalization of algebraic data types. We reduce type inference for GRDTs to unification under a mixed prefix. Thus, we obtain efficient type inference. Inference is incomplete because the set of type constraints allowed to appear in the type system is only a subset of those type constraints generated by type inference. Hence, inference only succeeds if the program is sufficiently type annotated. We present refined procedures to infer types incrementally and to assist the user in identifying which pieces of type information are missing. Additionally, we introduce procedures to test if a type is not principal and to find a principal type if one exists.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。