课题基金 / 基金详情

Free Extensions of Second-Order Algebras

Free Extensions of Second-Order Algebras
二阶代数的自由扩展
批准号:
2741288
负责人:
金额:
$0.0万
依托单位:
依托单位国家:
英国
项目类别:
Studentship
财政年份:
2022
资助国家:
英国
项目状态:
未结题
起止时间:
2022 至 --

项目摘要

项目成果

相似基金

相关文献

中文摘要
翻译
了解两个程序何时在行为上等价,对于代码生成和优化编译器非常有用。遗憾的是,无法确定通用编程语言中任意一对程序的行为等价性。编译器将程序简化为中间表示(IR),在其中它们可以应用本地等价来优化表达式。FREX项目为统一处理某些数据类型(如整数和列表)的IRS提供了一个框架。我将通过开发frex^2来扩展这项工作,它将允许对更复杂的代数表达式的IRS进行统一处理。*背景**frex^1frex项目产生了一个我将称为frex^1的结果:一阶代数的自由扩展。这些是数据结构和算法,它们采用有限的程序术语集并产生标准化结果。然后可以产生一个行为等价且更高效的新表达式。frex^1由数据结构和归一化算法组成。该算法可以接受由一阶代数运算、变量和静态值组成的程序项,并产生数据结构的值。一阶代数可以表示表达式语言,如整数上的算术、列表上的运算和矩阵乘法。**二阶代数现代编程语言具有函数、I/O、模式匹配和全局状态。所有这些都构成了二阶代数,其中运算可以将变量绑定到它们的自变量中。例如,lambda演算是一个具有两个操作的二阶代数:抽象,它将变量绑定到它的唯一参数中以创建匿名函数;以及应用程序,它不绑定两个参数中的任何一个参数中的变量,将值应用到一个函数。Frex^2将把一阶代数上的frex^1的结构推广到二阶代数上的结构。*work Plani将分三个主要阶段进行工作:-frex^2数学理论的发展-为一些代数设计和实现frex^2-将frex^2应用于编译基础结构**理论众所周知,二阶代数是包含一阶代数。我将调查frex^2是否以同样的方式包含frex^1。我还将考虑将用于微积分的frex^2与用于基类型的frex^1组合,以形成一个新的frex^2。该领域的另一个最新发展是frex^gen。这些是多排序frex^1,其变量的排序依赖于其他变量。例如,其属性域或上域依赖于变量的函数。FREX^Gen可能包含FREX^2,但具有对FREX^2不必要的大量技术开销。我将探索使用FREX^2与FREX^Gen之间的关系以及使用FREX^2的潜在效率。**算法我将调查编译器中使用的求值算法的规范化是如何实现其底层演算的FREX^2。这将需要实现FREX^2的标准形式的数据结构和算法。然后,我可以产生这些结构是等价的机械化证明。我还将提供一个证明综合框架,该框架给定合适的FREX^2可以构造程序片段的等价性证明。这种框架在依赖类型的编程语言中很有用,在依赖类型的编程语言中,语言中的类型可以依赖于两个嵌入的程序片段的相等。**应用程序现代优化编译器生成不同形式的IR,以应用不同的优化。我将调查IRS在多大程度上是frex^2的实现,并尝试为不同的优化创建frex^2的框架。我将演示如何使用frex^2而不是显式的IRS来生成更简洁的代码。我还将运行一套基准测试来评估使用frex^2相对于同等的IRS的性能差异。
英文摘要
Knowing when two programs are behaviourally equivalent is useful in code generation and optimising compilers. It is unfortunately impossible to determine behavioural equivalence for an arbitrary pair of programs in general purpose programming languages. Compilers reduce programs into an intermediate representation (IR), where they can apply local equivalences to optimise expressions. The Frex project has produced a framework for unifying the treatment of IRs for some data types, like integers and lists. I will extend this work by developing Frex^2, which will allow for a unified treatment for the IRs of more complex algebraic expressions.* Background** Frex^1The Frex project has produced a result I will call Frex^1: free extensions of first-order algebra. These are data structures and algorithms that take a limited set of program terms and produce a normalised result. A new expression can then be produced that is both behaviourally equivalent and more efficient.A Frex^1 consists of a data structure and a normalisation algorithm. This algorithm can take program terms consisting of first-order algebraic operations, variables, and static values, and produce a value of the data structure. First-order algebras can express expression languages such as arithmetic on integers, operations on lists, and matrix multiplications.** Second-Order AlgebraModern programming languages feature functions, I/O, pattern matching and global state. All of these constitute second-order algebras, where operations can bind variables in their arguments. For instance, the lambda calculus is a second-order algebra with two operations: abstraction which binds a variable in its sole argument to create an anonymous function; and application which does not bind variables in either of two arguments, applying a value to a function.Frex^2 will generalise the structures from Frex^1 over first-order algebras into structures over second-order algebras.* Work PlanI will perform work in three main phases:- Development of the mathematical theory of Frex^2- Design and implementation of Frex^2 for some algebras- Applying Frex^2 to compiler infrastructure** TheoryIt is well understood that second-order algebras subsume first-order algebras. I will investigate whether Frex^2 subsume Frex^1 in the same way. I will also look at combining Frex^2 for a calculus with Frex^1 for base types to form a new Frex^2.Another recent development in the area is Frex^Gen. These are multi-sorted Frex^1, with variables whose sorts depend on other variables. For example, functions whose domain or codomain depend on variables. Frex^Gen likely subsumes Frex^2, but features a large technical overhead unnecessary for Frex^2. I will explore both the relationship between and the potential efficiencies of using Frex^2 over Frex^Gen.** AlgorithmsI will investigate how normalisation by evaluation algorithms used in compilers are the implementation of a Frex^2 for their underlying calculi. This will require implementing data structures and algorithms for the standard-form of the Frex^2. I can then produce mechanised proofs that the structures are equivalent.I will also provide a proof synthesis framework that given a suitable Frex^2 can construct equality proofs for program fragments. Such a framework is useful in dependently-typed programming languages, where types in the language can depend on the equality of two embedded program fragments.** ApplicationModern optimising compilers produce IRs in different forms for applying different optimisations. I will investigate the extent to which IRs are implementations of a Frex^2, and attempt to produce a framework for creating a Frex^2 for different optimisations.I will demonstrate how using Frex^2 instead of explicit IRs can leads to more succinct code. I will also run a suite of benchmarks to evaluate the performance difference of using Frex^2 over equivalent IRs.
期刊论文(0)
专著(0)
科研奖励(0)
会议论文
海外基金