Ad Hoc Syntax-Guided Program Reduction
Jia Le Tian, Mengxiao Zhang, Zhenyang Xu, Yongqiang Tian, Yiwen Dong, C. P. Sun Β· 2023
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.