[Paper Review] Specifying Logic Programs in Controlled Natural Language
This paper proposes using controlled natural language (CNL) as a declarative, application-specific specification language for logic programs, enabling non-specialists to write human-readable specifications that are automatically translated into executable Prolog clauses. The system uses a definite clause grammar enhanced with feature structures and discourse representation theory to resolve anaphora and temporal dependencies, successfully prototyping a simple automated teller machine with full translation, querying, and execution capabilities.
Writing specifications for computer programs is not easy since one has to take into account the disparate conceptual worlds of the application domain and of software development. To bridge this conceptual gap we propose controlled natural language as a declarative and application-specific specification language. Controlled natural language is a subset of natural language that can be accurately and efficiently processed by a computer, but is expressive enough to allow natural usage by non-specialists. Specifications in controlled natural language are automatically translated into Prolog clauses, hence become formal and executable. The translation uses a definite clause grammar (DCG) enhanced by feature structures. Inter-text references of the specification, e.g. anaphora, are resolved with the help of discourse representation theory (DRT). The generated Prolog clauses are added to a knowledge base. We have implemented a prototypical specification system that successfully processes the specification of a simple automated teller machine.
Motivation & Objective
- To bridge the conceptual gap between application domain specialists and software developers by enabling non-specialists to write formal logic program specifications in natural language.
- To develop a specification language that is both human-readable and machine-processable, ensuring formal semantics and executability.
- To support validation and prototyping by enabling simulation and query execution on the level of natural language specifications.
- To reduce the cognitive burden of formal specification by using a controlled subset of natural language with restricted grammar and domain-specific vocabulary.
- To demonstrate the feasibility of translating CNL specifications into Prolog while preserving meaning through discourse representation structures and paraphrasing.
Proposed method
- The system uses a definite clause grammar (DCG) enhanced with feature structures to parse controlled natural language specifications into formal representations.
- Discourse representation theory (DRT) is applied to resolve anaphoric references and model temporal relationships between events and states.
- Event structures (events and states) are encoded in discourse representation structures (DRS) to capture temporal ordering and dependencies.
- The parsed DRS is translated into equivalent Prolog clauses, which are added to a knowledge base for execution and querying.
- A paraphrasing mechanism maps Prolog clauses back into controlled natural language using schema-based templates and lexical mappings.
- A forward-chaining meta-interpreter executes the Prolog clauses in the correct temporal order, supporting simulation of dynamic behaviors like those in an automated teller machine.
Experimental results
Research questions
- RQ1Can controlled natural language serve as a viable, formal, and executable specification language for logic programs?
- RQ2How can anaphoric references and discourse relations in natural language be accurately resolved to preserve semantic meaning in program specifications?
- RQ3To what extent can discourse representation structures model temporal dependencies and event ordering in natural language specifications?
- RQ4Can the translation from controlled natural language to Prolog be both reliable and reversible, enabling paraphrasing and validation?
- RQ5How can the resulting Prolog knowledge base support simulation and execution of dynamic system behaviors?
Key findings
- The system successfully translates a controlled natural language specification of a simple automated teller machine into a formal, executable Prolog knowledge base.
- Anaphora and discourse references in the specification are resolved accurately using discourse representation theory, ensuring semantic coherence.
- The generated Prolog clauses support both querying and execution, enabling simulation of system behavior through a forward-chaining meta-interpreter.
- The system supports paraphrasing of Prolog clauses back into controlled natural language using schema-based templates, enhancing readability and validation.
- Temporal ordering of events is implicitly captured through DRS-based event modeling, allowing correct execution order without explicit control structures.
- The integration of controlled natural language with logic programming enables dual-faced informal/formal specification, reducing the gap between domain experts and developers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.