English

Fast Deterministic Black-box Context-free Grammar Inference

Software Engineering 2024-01-18 v2 Programming Languages

Abstract

Black-box context-free grammar inference is a hard problem as in many practical settings it only has access to a limited number of example programs. The state-of-the-art approach Arvada heuristically generalizes grammar rules starting from flat parse trees and is non-deterministic to explore different generalization sequences. We observe that many of Arvada's generalization steps violate common language concept nesting rules. We thus propose to pre-structure input programs along these nesting rules, apply learnt rules recursively, and make black-box context-free grammar inference deterministic. The resulting TreeVada yielded faster runtime and higher-quality grammars in an empirical comparison. The TreeVada source code, scripts, evaluation parameters, and training data are open-source and publicly available (https://doi.org/10.6084/m9.figshare.23907738).

Keywords

Cite

@article{arxiv.2308.06163,
  title  = {Fast Deterministic Black-box Context-free Grammar Inference},
  author = {Mohammad Rifat Arefin and Suraj Shetiya and Zili Wang and Christoph Csallner},
  journal= {arXiv preprint arXiv:2308.06163},
  year   = {2024}
}

Comments

12 pages, 6 figures, accepted at ICSE 2024, camera ready version

R2 v1 2026-06-28T11:53:43.887Z