Contextual Natural Language Processing and DAML for Understanding Software Requirements Specifications

Beum-Seuk Lee, Barrett R. BryantCOLING 2002

TL;DR

This paper presents a novel approach to automatically convert natural language software requirements into formal specifications. By combining Contextual Natural Language Processing (CNLP) to resolve ambiguities and domain knowledge representation in DAML, the system aims to bridge the gap between human-readable requirements and machine-executable code, enabling faster prototyping and implementation.

What Problem Does This Paper Address?

Software development still heavily relies on natural language (NL) for specifying system requirements, despite the existence of formal specification languages. This is because NL is more accessible to domain experts. However, NL's inherent ambiguity and reliance on implicit domain knowledge make direct machine processing for verification, prototyping, or implementation extremely challenging and error-prone. Manually translating these requirements into formal languages is a significant bottleneck. Existing approaches either try to force developers to write in restricted "controlled" natural languages or focus on quality analysis, but none fully automate the conversion to a formal specification for implementation.

Methods

The authors propose a system that tackles this problem in several stages:

  1. NL to XML Conversion: The initial requirements document in NL is first converted into Extensible Markup Language (XML).
  2. Contextual Natural Language Processing (CNLP) for Knowledge Base Construction: CNLP is employed to parse the XML document, extracting and storing linguistic information (syntax, semantics, pragmatics). This phase is crucial for detecting and resolving ambiguities. The system uses a bottom-up approach for part-of-speech tagging and a top-down approach for determining sentence parts (subject, object). Statistical ordering of parts of speech and discourse-level information are used to resolve syntactic ambiguities and anaphoric references (pronouns).
  3. Domain Knowledge Representation in DAML: Domain-specific knowledge, which is often implicit in NL requirements, is explicitly represented using DARPA Agent Markup Language (DAML). DAML, a frame-based language, allows for rich semantic representation of relationships, constraints, and synonyms, supplementing the information extracted from the NL text.
  4. Knowledge Base to Two-Level Grammar (TLG): The contextual knowledge base is then transformed into a Two-Level Grammar (TLG). TLG is chosen for its NL-like syntax and formal semantics, acting as a bridge between the informal NL and formal specifications.
  5. TLG to VDM++ Specification: Finally, the TLG specification is translated into VDM++ (an object-oriented extension of the Vienna Development Method), a formal specification language. VDM++ was chosen for its structural similarities to TLG and its available tools for analysis and code generation.

The system also leverages external resources like WordNet for lexical information and hypernyms to aid in disambiguation and classification.

Datasets

Not discussed in the paper. The paper uses an "Automatic Teller Machine (ATM)" example to illustrate the approach, but this is a custom example, not a formal dataset.

Key Insights and Ideas

  • Context is King for Ambiguity Resolution: The paper emphasizes that resolving ambiguity in NL requires understanding the broader context, not just individual sentences. Their CNLP approach explicitly models this contextual information.
  • DAML as a Crucial Knowledge Augmenter: Implicit domain knowledge is a major hurdle. Using DAML to explicitly represent this knowledge (e.g., synonyms, component relationships) is key to making the formalization process robust.
  • TLG as a Formalization Bridge: TLG's dual nature—NL-like syntax with formal semantics—makes it an ideal intermediate representation for translating between the highly informal NL and the strictly formal VDM++.
  • Requirements Documents are "Easier" than General Text: The authors note that requirements documents, due to their structured nature and less frequent pronoun use, are generally easier to process than other types of textual documents.

Key Results

The paper demonstrates the system's capability to convert an example NL requirements document for an ATM system into a formal VDM++ specification. This formal specification can then be used for:

  • Prototyping: Using a VDM++ interpreter.
  • Code Generation: Translating into high-level languages like Java or C++.
  • Analysis: Discovering logical inconsistencies and contradictions using the VDM++ Toolkit.
  • Modeling: Generating UML diagrams.

The authors claim the system can handle the presented example completely and are performing further evaluations.

Limitations and Future Work

  • System Usability and Robustness: The authors acknowledge that improving system usability and robustness with respect to a wider range of requirements documents is a key area for future work.
  • Coverage of Requirements Documents: Expanding the system's ability to handle more complex and varied requirements documents is an ongoing effort.
  • Executable NL Specifications: The ultimate goal is to achieve executable NL specifications for rapid prototyping and development.
  • Additional Evaluations: The paper mentions performing additional evaluations on other requirements documents, including those for U.S. Army systems.

Summary updated

BibTeX
@inproceedings{lee2002contextual,
  author = {Beum-Seuk Lee and Barrett R. Bryant},
  title = {{Contextual Natural Language Processing and DAML for Understanding Software Requirements Specifications}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2002},
}
Figure