Abstract
One important quest in software development is to be able to translate natural language requirements into executable code. In this paper we address the issue of co-reference resolution, extending our previous work on a controlled natural language.
Introduction
A long-standing goal in software engineering is the automated translation of natural language (NL) requirements directly into executable code. However, human language is inherently ambiguous. One major hurdle is co-reference resolution: determining which entity a specific expression refers to. For example, in the requirement "when the car approaches the garage, it opens," does "it" refer to the car or the garage?
While general-purpose Natural Language Processing (NLP) tools exist, they often lack the precision required for critical software systems. This research tackles the challenge of resolving these ambiguities within the context of Controlled Natural Languages (CNL) used to generate Live Sequence Charts (LSC)—a visual programming language for reactive systems.
Methodology
The authors propose a novel approach called System Model Inference. The core idea is that the structural model of the software (the "system model")—the blueprint of objects, properties, and methods—provides essential clues for resolving ambiguity.
Structural Constraints
The algorithm uses the system's API to prune impossible candidates based on the following logic:
- Property-Related Constraint: If a pronoun is followed by a property (e.g., "its temperature"), the referent must be an object that actually possesses a "temperature" property in the system model.
- Method-Related Constraint: If a pronoun is the subject of a verb (e.g., "it beeps"), the referent must be an object that has a corresponding "beep" method.
Algorithms and Integration
The System-Model-Based (SMB) algorithm filters out incompatible candidates and selects the most likely remaining antecedent. The authors also developed hybrid variants, SMBcSDE and SMBcSST, where system model constraints act as a filter on top of standard syntactic and statistical NLP results from the Stanford CoreNLP toolkit.
Datasets
Because no standard annotated corpus existed for software requirement co-reference, the authors built and annotated their own. The dataset consists of 68 paragraphs containing 107 pronouns, derived from LSC programs and corresponding CNL sentences centered around a "smart home" simulation domain (controlling lights, AC, blinds, etc.).
Results and Discussion
The results demonstrate that incorporating system models provides a massive performance boost over generic resolvers. As shown in Table 1, the baseline Stanford Deterministic (SDE) resolver achieved only 44.85% accuracy. In contrast, the standalone SMB algorithm reached 81.3% accuracy, while the best-performing hybrid model (SMBcSST) reached 87.85%.
The study highlights that domain knowledge acts as a powerful logical filter that general-purpose NLP models lack. The most effective models were those that combined domain-specific structural knowledge with general-purpose statistical NLP. Furthermore, the authors found that relaxing standard "mention extraction" rules allowed the system to resolve references that standard tools typically ignore.
Conclusion
While the system model currently requires manual construction, the results show that leveraging structural constraints significantly improves co-reference resolution in software requirements. Future work will explore automatic extraction of system models from requirements and extending the approach to unrestricted natural language and more complex linguistic phenomena like cataphora.
Summary updated