OCL2NL: Automatic Generation Natural Language Description from OCL Contracts

preprint OA: closed CC-BY-4.0
📄 Open PDF View at publisher

Abstract

Formal contracts play a crucial role in precisely specifying system requirements and facilitating the verification of system implementation through automated test case generation or formal verification techniques, particularly in the development of safety-critical systems. The Object Constraint Language (OCL) is a lightweight formal language widely utilized for expressing constraints in UML-based models. However, due to the semantic gap between OCL expressions and their interpretations, comprehending OCL contracts can be challenging.In this paper, we propose a novel approach called OCL2NL, which enables the automatic generation of natural language descriptions from OCL contracts. OCL2NL encompasses a comprehensive set of translation rules and algorithms that map OCL contracts to semantic and signature descriptions of system operations. To validate our approach, we conduct four case studies. The results demonstrate a high success rate, with 97.06% of the OCL expressions and 87.68% of the signatures generating accurate descriptions. Moreover, domain experts evaluate that 50 out of 52 descriptions of OCL expressions and 11 out of 12 signature descriptions effectively capture essential information about the corresponding OCL contracts. The natural language descriptions significantly enhance the understanding of OCL contracts when compared to the contracts alone. Overall, the results are promising, indicating the potential extension of our proposed approach within the software industry.

My notes (saved in your browser only)

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. The paper's references may be in our DB but unresolved to ``paper_id`` (resolution happens at ingest when the cited DOI matches a row we already have). Run the cross-source citation reconcile pass to retry.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-29T02:00:03.542394+00:00
License: CC-BY-4.0