Skip to main content
QUICK REVIEW

[Paper Review] On Repair with Probabilistic Attribute Grammars

Manos Koukoutos, Mukund Raghothaman|arXiv (Cornell University)|Jul 13, 2017
Software Engineering ResearchComputer Science4 references4 citations
TL;DR

This paper presents a probabilistic attribute grammar framework that unifies syntactic and semantic specifications for efficient program repair. By combining input-output examples, pre- and post-conditions, and corpus-derived probabilistic grammars, the approach enables scalable, A*-guided search over program space, significantly outperforming non-probabilistic methods in repairing complex code fragments beyond their reach.

ABSTRACT

Program synthesis and repair have emerged as an exciting area of research, driven by the potential for revolutionary advances in programmer productivity. Among most promising ideas emerging for synthesis are syntax-driven search, probabilistic models of code, and the use of input-output examples. Our paper shows how to combine these techniques and use them for program repair, which is among the most relevant applications of synthesis to general-purpose code. Our approach combines semantic specifications, in the form of pre- and post-conditions and input-output examples with syntactic specifications in the form of term grammars and AST-level statistics extracted from code corpora. We show that synthesis in this framework can be viewed as an instance of graph search, permitting the use of well-understood families of techniques such as A*. We implement our algorithm in a framework for verification, synthesis and repair of functional programs, demonstrating that our approach can repair programs that are beyond the reach of previous tools.

Motivation & Objective

  • To address the scalability and precision challenges in program repair by unifying syntactic and semantic specifications.
  • To reduce the burden of manual specification by automatically deriving probabilistic grammars from code corpora.
  • To improve search efficiency in program synthesis by integrating dynamic input examples and probabilistic grammar biasing.
  • To enable repair of complex programs that exceed the capabilities of existing non-probabilistic repair tools.
  • To support both manual and automated grammar authoring using a domain-specific, extensible DSL in Scala.

Proposed method

  • The framework uses a probabilistic, polymorphic attribute grammar to restrict and prioritize the search space for program synthesis.
  • It employs a top-down, A*-style search algorithm with pruning via partial evaluation on known input examples.
  • Equivalence modulo input-output examples is integrated into the search to avoid redundant exploration of functionally identical expressions.
  • The system supports both manually authored grammars and automatically extracted grammars from PureScala program corpora.
  • Grammar rules are expressed as Scala functions annotated with @production and frequency weights, enabling dynamic rule instantiation.
  • The framework uses wrapper types with attributes to encode semantic constraints (e.g., operator associativity), improving search efficiency and expressiveness.

Experimental results

Research questions

  • RQ1Can probabilistic attribute grammars effectively reduce the search space in program repair while maintaining expressiveness?
  • RQ2How does corpus-derived grammar extraction improve synthesis performance compared to hand-authored or default grammars?
  • RQ3To what extent can dynamic input examples and constraint solvers enhance the precision of repair synthesis?
  • RQ4Can the integration of equivalence modulo input-output examples improve search efficiency in a top-down synthesis setting?
  • RQ5How does the use of domain-specific attributes in grammars impact the scalability and correctness of program repair?

Key findings

  • The framework successfully repairs programs that are beyond the reach of non-probabilistic repair tools, demonstrating scalability on complex code fragments.
  • Corpus-derived grammars significantly improve synthesis performance, reducing search time and increasing success rates on real-world repair tasks.
  • The integration of input-output examples enables efficient localization of faulty expressions and guides the synthesis toward correct repairs.
  • The use of probabilistic grammars with attributes allows for effective pruning of semantically redundant or invalid expressions, improving search efficiency.
  • The system’s top-down search with partial evaluation and equivalence handling achieves performance comparable to bottom-up methods, but with better space and time efficiency.
  • The framework supports both manual and automatic grammar authoring, enabling reuse across multiple synthesis problems with minimal user input.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.