Ad Hoc Syntax-Guided Program Reduction
Abstract
Program reduction is a widely adopted, indispensable technique for debugging language implementations such as compilers and interpreters. Given a program ๐ and a bug triggered by ๐, a program reducer can produce a minimized program ๐โ that is derived from ๐ and still triggers the same bug. Perses is one of the state-of-the-art program reducers. It leverages the syntax of ๐ to guide the reduction process for efficiency and effectiveness. It is language-agnostic as its reduction algorithm is independent of any language-specific syntax. Conceptually to support a new language, Perses only needs the context-free grammar ๐บ of the language; in practice, it is not easy. One needs to first manually transform ๐บ into a special grammar form PNF with a tool provided by Perses, second manually change the code base of Perses to integrate the new language, and lastly build a binary of Perses.