Lossless Semantic Round-Tripping in PENG ASP

Rolf SchwitterIJCAI 2020 · DOI

TL;DR

This paper introduces PENGASP, a system that bridges the gap between informal, natural language specifications and formal, executable Answer Set Programs (ASP). It achieves "lossless semantic round-tripping," meaning specifications can be translated to ASP and back without losing meaning, enabling domain specialists and developers to collaborate more effectively.

What Problem Does This Paper Address?

Software development often faces a disconnect between domain specialists, who prefer natural language, and software engineers, who need formal, unambiguous specifications. Natural language, while accessible, is inherently ambiguous. Formal notations, while precise, can be a barrier for non-experts. This paper addresses the challenge of creating a system that allows for the creation of formal specifications using a controlled natural language (CNL) that is both understandable to domain experts and precisely translatable into executable logic programs, specifically Answer Set Programs (ASP). The goal is to enable a seamless, two-way translation process where a natural language specification can be converted into an ASP program, and vice-versa, without any loss of semantic meaning.

Methods

The core of the PENGASP system is a smart text editor integrated with a language processor. This processor utilizes a bi-directional unification-based logic grammar, which is the key innovation. This grammar acts as both a text processor and a text generator.

  • Text Processing: When a user writes in the controlled natural language, the language processor translates it into an internal ASP format. This format is then passed to a "writer module" which converts it into an executable ASP program. This process is supported by a reasoning service (clingo) and an ASP implementation of the event calculus for temporal reasoning.
  • Text Generation: Conversely, an ASP program can be verbalized. A "reader module" reconstructs the internal ASP format from the ASP program, and a "planner module" aggregates this format for optimized linguistic rendering into CNL.

The system also features a smart text editor that provides lookahead information and suggests completions, and an anaphora resolution module to handle pronouns and other referring expressions, further aiding the writing process.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • Lossless Semantic Round-Tripping: The most significant insight is the achievement of true "lossless semantic round-tripping." This means the system can translate a specification from CNL to ASP and then back to CNL, resulting in the exact same specification. This is crucial for maintaining consistency and trust between different representations.
  • Controlled Natural Language as an Ontology Language: The paper demonstrates that PENGASP can be used not only for writing specifications but also as an ontology specification language. This allows for the integration of domain knowledge directly into the formal specification process.
  • Bridging the Gap: The system effectively bridges the gap between informal, human-readable specifications and formal, executable programs, making formal methods more accessible to a wider range of users.
  • Bi-directional Grammar: The use of a single, bi-directional logic grammar is a clever approach that simplifies the system's architecture and enables both processing and generation capabilities from a unified linguistic foundation.

Key Results

The paper demonstrates the system's functionality through a scenario involving a person picking up, delivering, and transporting an object. The PENGASP system successfully translates this scenario, including factual information, ontological knowledge, effect axioms, and constraints, into an ASP program. The system can then answer queries about the scenario, such as "Where is the parcel at 09:25?", with the correct answer (Eastwood) being derived from the ASP program. The paper also shows an example of verbalizing an ASP constraint back into CNL.

Limitations and Future Work

  • Timestamp Abbreviation: The paper notes that timestamps in the generated ASP program are abbreviated for space, implying that full timestamps are handled internally.
  • Future Work: While not explicitly detailed, the success of this system suggests future work could involve expanding the expressiveness of the CNL, integrating with other formal methods or programming paradigms, and further refining the user interface for even greater ease of use. The ability to verbalize ASP programs also opens avenues for automated documentation generation.

Summary updated

BibTeX
@inproceedings{schwitter2020lossless,
  author = {Rolf Schwitter},
  title = {{Lossless Semantic Round-Tripping in PENG ASP}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.24963/ijcai.2020/773},
}
Figure