We show how to apply forward and reverse mode Combinatory Homomorphic Automatic Differentiation (CHAD) to total functional programming languages with expressive type systems featuring the combination of - tuple types; - sum types; - inductive types; - coinductive types; - function types. We achieve this by analysing the categorical semantics of such types in $\Sigma$-types (Grothendieck constructions) of suitable categories. Using a novel categorical logical relations technique for such expressive type systems, we give a correctness proof of CHAD in this setting by showing that it computes the usual mathematical derivative of the function that the original program implements. The result is a principled, purely functional and provably correct method for performing forward and reverse mode automatic differentiation (AD) on total functional programming languages with expressive type systems.
翻译:我们展示了如何将前向和反向模式混合式自动差异(CHAD)应用到具有表达型系统,具有全功能性编程语言的全功能式系统,其特点是组合型号:图普尔类型;总类型;感应类型;创用类型;创用类型;功能类型;功能类型。我们通过分析这类类型在适当类别中的绝对语义(Grothendieck complications)来实现这一目标。我们使用一种新型绝对逻辑关系技术来为这种表达型系统提供中国语的正确性证明,显示它计算了原程序所执行功能的通常数学衍生物。结果是一种原则性、纯功能性和可被证实正确无误的方法,用于对带有表达型系统的全部功能性编程语言进行前向和反向模式自动区分(AD)。