Compiler optimizations, usually expressed as rewrites on program graphs, are a core part of all modern compilers. However, even production compilers have bugs, and these bugs are difficult to detect and resolve. The problem only becomes more complex when compiling parallel programs; from the choice of graph representation to the possibility of race conditions, optimization designers have a range of factors to consider that do not appear when dealing with single-threaded programs. In this paper we present PTRANS, a domain-specific language for formal specification of compiler transformations, and describe its executable semantics. The fundamental approach of PTRANS is to describe program transformations as rewrites on control flow graphs with temporal logic side conditions. The syntax of PTRANS allows cleaner, more comprehensible specification of program optimizations; its executable semantics allows these specifications to act as prototypes for the optimizations themselves, so that candidate optimizations can be tested and refined before going on to include them in a compiler. We demonstrate the use of PTRANS to state, test, and refine the specification of a redundant store elimination optimization on parallel programs.
A Logical Programming Language as an Instrument for Specifying and Verifying Dynamic Memory
这项工作提出了一个Prolog方言的表达性和自动化的发现和优先级的问题。给定某个类C程序,如果动态内存在运行时被分配、更改和释放,那么对所需动态内存的描述就是堆规范。根据给定规范检查计算的存储器状态是动态存储器验证。本文只考虑了Hoare演算中的形式规范和验证。发现的问题包括:无效分配、存储单元中的(临时)不可用数据、过多的存储器分配、意外区域中的(意外)堆更改等。过多的内存分配现在已经被像Valgrind这样的内存分析器成功地解决了。从本质上讲,这些领域的论文并没有带来任何大的突破。可能的原因还包括由于更多的可用内存和并行线程而导致的张力降低。然而,从Apt开始,与可变模式有关的问题尚未得到解决-既没有完全解决,也没有以可接受的方式解决。过去几十年的研究成果一次又一次地表明,堆问题仍然存在,仍然很复杂,仍然很重要。Peter O 'Hearn在2016年做出了重大贡献,他因其空间堆操作的并行方法而获得哥德尔奖。