<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Comput. Sci.</journal-id>
<journal-title>Frontiers in Computer Science</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Comput. Sci.</abbrev-journal-title>
<issn pub-type="epub">2624-9898</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fcomp.2025.1516410</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Computer Science</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>A comparison of large language models and model-driven reverse engineering for reverse engineering</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name><surname>Siala</surname> <given-names>Hanan</given-names></name>
<uri xlink:href="http://loop.frontiersin.org/people/3104006/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Lano</surname> <given-names>Kevin</given-names></name>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/2561184/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
</contrib-group>
<aff><institution>Informatics Department, King&#x00027;s College London</institution>, <addr-line>London</addr-line>, <country>United Kingdom</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Hongji Yang, University of Leicester, United Kingdom</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Manolis Tzagarakis, University of Patras, Greece</p>
<p>Kunal Rao, NEC Laboratories America Inc, United States</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Kevin Lano <email>kevin.lano&#x00040;kcl.ac.uk</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>25</day>
<month>07</month>
<year>2025</year>
</pub-date>
<pub-date pub-type="collection">
<year>2025</year>
</pub-date>
<volume>7</volume>
<elocation-id>1516410</elocation-id>
<history>
<date date-type="received">
<day>24</day>
<month>10</month>
<year>2024</year>
</date>
<date date-type="accepted">
<day>08</day>
<month>07</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2025 Siala and Lano.</copyright-statement>
<copyright-year>2025</copyright-year>
<copyright-holder>Siala and Lano</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<p>Large language models (LLMs) have been extensively researched for programming-related tasks, including program summarisation, over recent years. However, the task of abstracting formal specifications from code using LLMs has been less explored. Precise program analysis approaches based on model-driven reverse engineering (MDRE) have also been researched, and in this paper we compare the results of the LLM and MDRE approaches on tasks of abstracting Python and Java programs to the OCL formal language. We also define a combined approach which achieves improved results.</p></abstract>
<kwd-group>
<kwd>program abstraction</kwd>
<kwd>reverse engineering</kwd>
<kwd>LLMS</kwd>
<kwd>model-driven reverse engineering (MDRE)</kwd>
<kwd>Object Constraint Language</kwd>
</kwd-group>
<counts>
<fig-count count="4"/>
<table-count count="7"/>
<equation-count count="2"/>
<ref-count count="39"/>
<page-count count="14"/>
<word-count count="8039"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Software</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1 Introduction</title>
<p><italic>Reverse-engineering</italic> is the extraction of design, specification or requirements level information from software applications, including abstractions or models of the application semantics, which may be expressed as textual explanations, formal specifications, or repositories of information about program elements (Bowen J. et al., <xref ref-type="bibr" rid="B3">1993</xref>; Marco et al., <xref ref-type="bibr" rid="B25">2018</xref>; Sneed and Jandrasics, <xref ref-type="bibr" rid="B35">1987</xref>; Sneed, <xref ref-type="bibr" rid="B34">2011</xref>).</p>
<p><italic>Re-engineering</italic> applies forward engineering to the reverse-engineered abstractions of a source application, in order to produce a new target version, in a different programming language or on a modernized platform (Bowen J. P. et al., <xref ref-type="bibr" rid="B4">1993</xref>), and may include design refactorings or design transformations for quality improvements (Lano and Malik, <xref ref-type="bibr" rid="B19">1999</xref>).</p>
<p>In this paper we focus upon reverse engineering to derive formal specifications from programs, in particular, our goal is to produce specifications in the OCL formal language used within the UML (OMG, <xref ref-type="bibr" rid="B27">2014</xref>). We evaluate and compare model-based and machine learning (ML) approaches for this reverse engineering task, in terms of their semantic quality and in terms of their utility as part of a re-engineering process. The outcome is a detailed analysis of the relative strengths and weaknesses of the approaches for the extraction of OCL specifications from Java and Python code.</p>
<p>Model-driven reverse engineering (MDRE) (Siala et al., <xref ref-type="bibr" rid="B33">2024</xref>), is a reverse-engineering approach which extracts software models from programs, including visual models such as UML class diagrams and state machines. The Object Management Group (OMG) has defined standard modeling representations for MDRE as part of its Architecture-driven Modernization (ADM) re-engineering approach (Krasteva et al., <xref ref-type="bibr" rid="B15">2013</xref>; Perez-Castillo et al., <xref ref-type="bibr" rid="B29">2010</xref>, <xref ref-type="bibr" rid="B30">2011</xref>). These include the Knowledge Discovery Metamodel (KDM) for representing source code elements and their inter-relationships, and the Abstract Syntax Tree Metamodel (ASTM) for source code representation as parse trees. The intention of the ADM process is that language-specific parsers produce ASTM models, which are then abstracted to KDM models by reverse-engineering model transformations between the respective models.</p>
<p>However, the use of ADM implies the establishment of a full model-driven engineering (MDE) process with supporting tools, requiring reverse-engineers to have MDE skills and knowledge of the specialized metamodels (KDM and ASTM) involved, and thus to date most of the use of ADM has been in research projects such as REMICS and MoDisco. An alternative to ADM is a lightweight MDRE process, such as AMDRE (Lano and Siala, <xref ref-type="bibr" rid="B20">2024a</xref>; Lano et al., <xref ref-type="bibr" rid="B17">2024</xref>), which performs an abstraction transformation from program code to UML and OCL specifications using pattern matching on abstract syntax trees (ASTs), without the need for metamodelling knowledge.</p>
<p>Machine learning (ML) approaches have been applied extensively for the task of <italic>program translation</italic>: translating a program in one programming language into a semantically equivalent version in another programming language. This can be regarded as a specialized form of re-engineering, however in such approaches the intermediate abstraction is usually not explicitly created or accessible to users. To date, there have been few reverse engineering approaches using ML for the production of a formal specification from program code (Siala et al., <xref ref-type="bibr" rid="B33">2024</xref>). Although general code-aware LLMs such as GPT-4 and Mistral can be directly used for the task of extracting OCL specifications from code, they have limitations, such as imperfect knowledge of OCL, hallucinations (production of plausible but incorrect output) and unreliability (Ouyang et al., <xref ref-type="bibr" rid="B28">2023</xref>; Zhao et al., <xref ref-type="bibr" rid="B38">2023</xref>). In our initial work on the baseline capabilities of LLMs, we found that they also tend to produce abstract and implicit OCL specifications, which are not suitable for use in forward engineering without manual refinement (Siala and Lano, <xref ref-type="bibr" rid="B32">2025</xref>).</p>
<p>To improve the quality and utility of OCL production by LLMs used for reverse engineering, we propose the use of LLM <italic>fine-tuning</italic> to adapt a general-purpose LLM to the reverse engineering task (Siala, <xref ref-type="bibr" rid="B31">2024</xref>). The resulting fine-tuned model is termed LLM4Models. We apply this LLM for the reverse-engineering of OCL specifications from Java (versions 5 to 8) and Python (versions 2.7 and 3.*) source codes.</p>
<p>In Section 2 we define the MDRE and LLM-based techniques which we use for reverse engineering, and we identify the evaluation criteria used to compare them. The criteria evaluate both the semantic accuracy of the extracted OCL specifications, with respect to the source programs, and the utility of these specifications for forward engineering.</p>
<p>In Section 3 we compare the selected MDRE approach with general purpose and fine-tuned LLMs for the task of extracting OCL specifications from code.</p>
<p>In Section 4 we survey related work, and consider how the work presented here may be extended and how the specification extraction process can be further enhanced.</p></sec>
<sec id="s2">
<title>2 Material and methods</title>
<p>In this section we describe the specific reverse-engineering technologies used in our work, how they are applied, and the critera used to compare them.</p>
<sec>
<title>2.1 LLMs for reverse engineering</title>
<p>Large Language Models (LLMs) are a specific type of machine learning (ML) technology that can learn a variety of knowledge representations from large and complex datasets (Zhao et al., <xref ref-type="bibr" rid="B38">2023</xref>). Once trained, the LLM can be utilized to accomplish specific downstream tasks by using additional specialized training (<italic>fine-tuning</italic>) on demonstration examples of the specialized task. Widely known examples of LLMs include GPT3&#x00026;4, Bard, LLaMA, Mistral, BERT, and T5. LLMs have had a major impact on many fields, including software engineering, where researchers have explored using them for a variety of tasks (Hou et al., <xref ref-type="bibr" rid="B11">2023</xref>).</p>
<p>Code-aware LLMs such as Mistral and GPT4 can be used directly for reverse-engineering of Java and Python to OCL, however the results are often unsatisfactory for use in re-engineering, because the produced specifications contain errors in OCL usage, are too abstract and implicit, or make simplifying assumptions that are not present in the code (Siala and Lano, <xref ref-type="bibr" rid="B32">2025</xref>). For example, a search algorithm that searches a specified portion of a list may be abstracted to a simplified version that only searches the entire list.</p>
<p>Thus we considered improvement of a pre-trained LLM by fine-tuning using datasets of (i) Python programs and corresponding OCL specifications; (ii) Java programs and corresponding OCL specifications.</p>
<p>LLMs come in different sizes, where larger models may be more accurate, but also require more processing power, memory, training times, and other resources. GPT4 is the most widely-used current LLM for SE tasks, and we therefore selected this as the example untrained general LLM for reverse engineering. However, fine-tuning of GPT4 requires significant resources. Therefore we selected <bold>Mistral-7B-v0.3</bold><xref ref-type="fn" rid="fn0001"><sup>1</sup></xref> as the baseline LLM for fine-tuning because of limited financial and computational resources. In addition, the performance of Mistral-7B is better than Llama 2 13B (Jiang et al., <xref ref-type="bibr" rid="B14">2023</xref>), which was the other main LLM we considered for fine-tuning.</p>
<p>We considered three main ways to fine-tune an LLM for the reverse engineering task using supervised fine-tuning (SFT), which are: (i) Full fine-tuning, (ii) LoRA (Hu et al., <xref ref-type="bibr" rid="B12">2022</xref>), and (iii) QLoRA (Dettmers et al., <xref ref-type="bibr" rid="B8">2024</xref>). Full fine-tuning is expensive, because it involves possible modification of all the weights in the pre-trained LLM by the re-training. In LoRA, some extra weights (adapters) in some layers are added and trained while freezing most of the parameters of the selected LLM to reduce the cost of training the original weights and to prevent <italic>catastrophic forgetting</italic> that may occur during full fine-tuning (Zhao et al., <xref ref-type="bibr" rid="B38">2023</xref>). QLoRA is a quantized version of LoRA, which optimizes LoRA to reduce the resources used. We selected QLoRA as our approach to fine-tune the LLM.</p>
<p>Source Java and Python programs for the training dataset were collected from sources such as the CoTran (Jana et al., <xref ref-type="bibr" rid="B13">2023</xref>) and AVATAR datasets.<xref ref-type="fn" rid="fn0002"><sup>2</sup></xref> The sources were pre-processed to put them in a consistent format. AgileUML was then applied to produce OCL specifications for each source program. The pairs of Java code and corresponding OCL specifications formed the dataset for LLM fine-tuning for Java reverse engineering, and the pairs of Python code and corresponding OCL specifications formed the dataset for LLM fine-tuning for Python reverse-engineering.</p>
<p>Following standard practice in ML, each fine-tuning dataset was divided into three sets:</p>
<list list-type="order">
<list-item><p>Training examples, &#x0007E;80% of the total.</p></list-item>
<list-item><p>Validation examples, &#x0007E;10% of the total.</p></list-item>
<list-item><p>Test examples, also 10% of the total.</p></list-item>
</list>
<p>For Java, there were 20,580 samples, divided into: training data = 16,670 cases; validation data = 1,852 cases; test data = 2,058 cases.</p>
<p>For Python, there were 25,684 samples, divided into: training data = 20,805 cases; validation data = 2,311 cases; test data = 2,568 cases.</p>
<p>The training set is directly used to fine-tune the model. The validation set is used to monitor and optimize the model performance during training for each epoch or for a specified number of iterations using metrics such as loss and accuracy. At this stage, changes may be applied to the model&#x00027;s hyperparameters or to the training process to improve performance. The test set is used to evaluate the LLM performance on unseen data.</p>
<p>The training was distributed over four GPUs where PyTorch FSDP and Q-LoRA were utilized. The resulting fine-tuned LLM is referred to as LLM4Models.</p>
<p>The LLM prompt used to abstract Java program code to OCL is:</p>
<preformat>
&#x000A0;&#x000A0;&#x02018;&#x02018;&#x00027;&#x00027;&#x02018;&#x02018; &#x0003C; s&#x0003E;[INST]&#x000A0;Below&#x000A0;is&#x000A0;an&#x000A0;instruction&#x000A0;that&#x000A0;describes
&#x000A0;&#x000A0;a&#x000A0;task,
&#x000A0;&#x000A0;paired&#x000A0;with&#x000A0;an&#x000A0;input&#x000A0;that&#x000A0;provides&#x000A0;further&#x000A0;context.
&#x000A0;&#x000A0;Write&#x000A0;a&#x000A0;response&#x000A0;that&#x000A0;appropriately&#x000A0;solves&#x000A0;the
&#x000A0;&#x000A0;following&#x000A0;Task:
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;&#x00023;&#x00023;&#x00023;&#x000A0;Instruction:
&#x000A0;&#x000A0;Generate&#x000A0;an&#x000A0;Object&#x000A0;Constraint&#x000A0;Language&#x000A0;(OCL)
&#x000A0;&#x000A0;&#x000A0;specification&#x000A0;for
&#x000A0;&#x000A0;the&#x000A0;provided&#x000A0;Java&#x000A0;code.&#x000A0;The&#x000A0;output&#x000A0;should:
&#x000A0;&#x000A0;1.&#x000A0;Ensure&#x000A0;no&#x000A0;repeated&#x000A0;or&#x000A0;redundant&#x000A0;operations&#x000A0;or
&#x000A0;&#x000A0;classes.
&#x000A0;&#x000A0;2.&#x000A0;Include&#x000A0;only&#x000A0;the&#x000A0;OCL&#x000A0;code&#x000A0;for&#x000A0;the&#x000A0;provided
&#x000A0;&#x000A0;Java&#x000A0;code.
&#x000A0;&#x000A0;3.&#x000A0;Do&#x000A0;not&#x000A0;include&#x000A0;statements&#x000A0;for&#x000A0;items&#x000A0;not&#x000A0;found&#x000A0;in
&#x000A0;&#x000A0;the&#x000A0;Java&#x000A0;code.
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;&#x00023;&#x00023;&#x00023;&#x000A0;Input:
&#x000A0;&#x000A0;...&#x000A0;source&#x000A0;code&#x000A0;...
&#x000A0;&#x000A0;[/INST]
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;&#x00023;&#x00023;&#x00023;&#x000A0;Response:&#x000A0;&#x00027;&#x00027;&#x02018;&#x02018;&#x00027;&#x00027;&#x02018;&#x02018;
</preformat> 
<p>The same prompt, with &#x0201C;Python&#x0201D; instead of &#x0201C;Java," is used for Python abstraction. These prompts were determined through a systematic process of prompt engineering to identify the most appropriate instructions to obtain accurate and high-quality results.</p></sec>
<sec>
<title>2.2 AgileUML</title>
<p>AgileUML is an Eclipse MDE toolset<xref ref-type="fn" rid="fn0003"><sup>3</sup></xref> that supports the agile methodology and MDRE. It provides visual and textual editing of specifications using UML class diagrams and OCL constraints. These specifications can be analyzed and forward engineered to generate code in Java, Python, Swift, C&#x0002B;&#x0002B;, C&#x00023;, Go, and ANSI C.</p>
<p>For MDRE, the AgileUML toolset uses a set of manually-coded pattern-matching rules in the <italic>CSTL</italic> notation to abstract UML class diagrams and OCL constraints from the abstract syntax trees of Java, Python, C, JavaScript, VB, COBOL, and Pascal programs (Lano and Siala, <xref ref-type="bibr" rid="B20">2024a</xref>). Also, it defines various supporting OCL library components not found in standard OCL, in order to represent programming language facilities, such as dates, times, iterators, files, and exceptions. The OCL extensions and libraries supported by the AgileUML toolset are detailed in Lano et al. (<xref ref-type="bibr" rid="B18">2022</xref>) and Lano and Siala (<xref ref-type="bibr" rid="B21">2024b</xref>). The resulting specifications are expressed in an explicit style of OCL, with computational steps defined using a procedural extension of OCL, similar to the SOIL formalism (Buttner and Gogolla, <xref ref-type="bibr" rid="B5">2014</xref>).</p>
<p>We selected AgileUML as the example MDRE approach because it is one of the most accurate and versatile MDRE tools, with superior performance compared to other approaches for program translation and other forms of re-engineering (Lano and Siala, <xref ref-type="bibr" rid="B20">2024a</xref>; Lano et al., <xref ref-type="bibr" rid="B17">2024</xref>).</p>
<p>In our work, AgileUML is utilized firstly to provide a baseline MDRE approach to compare with untrained and fine-tuned LLMs for the Java and Python reverse engineering tasks. Secondly, it is used to create training datasets for LLM fine-tuning for reverse engineering. The datasets are produced by applying the AgileUML reverse engineering process to the selected Java and Python programs. This provides two datasets: (i) of pairs of Java programs and their corresponding OCL specifications; (ii) of pairs of Python programs and corresponding OCL specifications.</p>
<p>These training datasets are then used to fine-tune a pre-trained LLM, in our case Mistral, in order that the LLM (i) can create specifications in the same explicit style as AgileUML, but for a wider range of input programs, and (ii) so that the LLM can use the AgileUML extended OCL and OCL libraries to produce simpler and more concise specifications than those expressed in standard OCL. In this work, we opted to use the extended OCL introduced by AgileUML in our approach because this provides many aspects needed to represent program semantics that are missing from standard OCL. For example, the OCL standard provides Integer and Real to represent mathematical numeric datatypes, but AgileUML provides int, long, and double as basic types, which are more aligned with program datatypes. Likewise, an extensive set of file operations are provided by the <italic>OclFile</italic> library, which are not provided by standard OCL.</p></sec>
<sec>
<title>2.3 Object Constraint Language</title>
<p>The following are the elements of standard OCL (OMG, <xref ref-type="bibr" rid="B27">2014</xref>) specifications:</p>
<list list-type="order">
<list-item><p>Data types: Different types of data are included in OCL constraints, including:</p></list-item></list>
<list list-type="simple">
<list-item><p>Primitive types: Integer, Real, String, enumeration types and Boolean.</p></list-item>
<list-item><p>Collection types: Bag, Set, Sequence, and OrderedSet.</p></list-item>
<list-item><p>User-defined types: User-defined types represent classes and their attributes. For example:</p></list-item>
<list-item><p>context Student</p></list-item>
</list>
<p>These types correspond in general to types in Java and Python. For example, array or list types in Java and list types in Python can be represented using OCL Sequence types.</p>
<list list-type="simple">
<list-item><p>2. Operators and operations: OCL operations include:</p></list-item></list>
<list list-type="bullet">
<list-item><p>Standard operators: Standard operators for numbers, strings, Booleans, and collections include &#x0002B;, -, *, / on numbers, <italic>substring</italic> and <italic>concat</italic> on strings, <italic>and</italic>, <italic>or</italic>, <italic>not</italic> on Booleans, and &#x02192; <italic>exists</italic>(), &#x02192; <italic>forAll</italic>(), and &#x02192; <italic>size</italic>() on collections.</p></list-item>
<list-item><p>User-defined operations: User-defined operations of classes can be represented as, for example:</p></list-item>
<list-item><p>context Person::walk()</p></list-item>
</list>
<p>These elements also correspond to Python and Java elements. For example, <monospace>any Col</monospace> in Python corresponds to <italic>Col</italic>&#x02192;<italic>exists</italic>(<italic>x</italic> | <italic>x</italic> &#x0003D; <italic>true</italic>) in OCL.</p>
<list list-type="simple">
<list-item><p>3. Expressions: Java and Python expressions can in principle be abstracted to OCL expressions. Program constraints and conditions may be expressed as arithmetic expressions (e.g., <italic>self</italic>.<italic>balance</italic>&#x0002B;<italic>amount</italic>), Boolean expressions (e.g., <italic>self</italic>.<italic>age</italic>&#x02265;18), or collection expressions [e.g., <italic>self</italic>.<italic>retiredPeople</italic>&#x02192;<italic>forAll</italic>(<italic>c</italic> | <italic>c</italic>.<italic>age</italic> &#x0003E; &#x0003D; 65)].</p></list-item>
</list>
<p>Standard OCL was found to be inadequate for use to express the semantics of program code, and various extensions were added in AgileUML to support MDRE (Lano and Siala, <xref ref-type="bibr" rid="B21">2024b</xref>):</p>
<list list-type="order">
<list-item><p>Map and function types, together with operators such as lambda abstraction: <monospace>lambda x : T in expr</monospace> and function application <monospace>f-&#x0003E;apply(x)</monospace>.</p></list-item>
<list-item><p>Statements: procedural OCL statements based on those of SOIL (Buttner and Gogolla, <xref ref-type="bibr" rid="B5">2014</xref>) (<xref ref-type="table" rid="T1">Table 1</xref>).</p></list-item>
<list-item><p>OCL extension libraries <italic>OclFile</italic>, <italic>OclRandom</italic>, <italic>OclProcess</italic>, <italic>MathLib</italic>, <italic>StringLib</italic>, <italic>MatrixLib</italic>, and others (Lano et al., <xref ref-type="bibr" rid="B18">2022</xref>).</p></list-item></list>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>AgileUML structured activities: procedural OCL statements.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Statement</bold></th>
<th valign="top" align="left"><bold>Meaning</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left"><italic>x</italic> := <italic>e</italic></td>
<td valign="top" align="left">Assignment</td>
</tr> <tr>
<td valign="top" align="left">var <italic>x</italic> : <italic>t</italic></td>
<td valign="top" align="left">Variable declaration</td>
</tr> <tr>
<td valign="top" align="left"><italic>s</italic>1 ; <italic>s</italic>2</td>
<td valign="top" align="left">Sequencing</td>
</tr> <tr>
<td valign="top" align="left">if <italic>e</italic> then <italic>s</italic>1 else <italic>s</italic>2</td>
<td valign="top" align="left">Conditional</td>
</tr> <tr>
<td valign="top" align="left">while <italic>e</italic> do <italic>s</italic></td>
<td valign="top" align="left">Unbounded loop</td>
</tr> <tr>
<td valign="top" align="left">repeat <italic>s</italic> until <italic>e</italic></td>
<td valign="top" align="left">Unbounded loop</td>
</tr> <tr>
<td valign="top" align="left">for <italic>ident</italic>:<italic>e</italic> do <italic>s</italic></td>
<td valign="top" align="left">Bounded loop</td>
</tr> <tr>
<td valign="top" align="left">return</td>
<td valign="top" align="left">Return statement</td>
</tr> <tr>
<td valign="top" align="left">return <italic>e</italic></td>
<td valign="top" align="left">Return value statement</td>
</tr> <tr>
<td valign="top" align="left">( <italic>s</italic> )</td>
<td valign="top" align="left">Statement group</td>
</tr> <tr>
<td valign="top" align="left">break</td>
<td valign="top" align="left">Break statement</td>
</tr> <tr>
<td valign="top" align="left">continue</td>
<td valign="top" align="left">Continue statement</td>
</tr> <tr>
<td valign="top" align="left"><italic>e</italic></td>
<td valign="top" align="left">Operation call, <italic>e</italic> is <italic>obj</italic>.<italic>op</italic>(<italic>pars</italic>), <italic>ClassName</italic>.<italic>op</italic>(<italic>pars</italic>) or <italic>op</italic>(<italic>pars</italic>)</td>
</tr>
<tr>
<td valign="top" align="left">skip</td>
<td valign="top" align="left">No-op</td>
</tr></tbody>
</table>
</table-wrap></sec>
<sec>
<title>2.4 Program abstraction rules</title>
<p>The following rules (<xref ref-type="table" rid="T2">Tables 2</xref>, <xref ref-type="table" rid="T3">3</xref>) are encoded in the <italic>CSTL</italic> scripts used by AgileUML for the MDRE of Python and Java programs to UML/OCL. They are also used to generate the datasets to fine-tune Mistral to produce the LLM4Models LLM.</p>
<table-wrap position="float" id="T2">
<label>Table 2</label>
<caption><p>Abstraction rules from Python to UML/OCL.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Python element</bold></th>
<th valign="top" align="left"><bold>UML/OCL</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Program</td>
<td valign="top" align="left">Package and main class</td>
</tr> <tr>
<td valign="top" align="left">Class</td>
<td valign="top" align="left">Class</td>
</tr> <tr>
<td valign="top" align="left">Inheritance</td>
<td valign="top" align="left">Inheritance</td>
</tr> <tr>
<td valign="top" align="left">Global variable</td>
<td valign="top" align="left">Attribute of main class</td>
</tr> <tr>
<td valign="top" align="left">Instance-scope attribute</td>
<td valign="top" align="left">Non-static attribute</td>
</tr> <tr>
<td valign="top" align="left">Class-scope attribute</td>
<td valign="top" align="left">Static attribute</td>
</tr> <tr>
<td valign="top" align="left">Local variable</td>
<td valign="top" align="left">Local variable</td>
</tr> <tr>
<td valign="top" align="left">Function</td>
<td valign="top" align="left">Operation</td>
</tr> <tr>
<td valign="top" align="left">Assignment</td>
<td valign="top" align="left">Assignment/declaration</td>
</tr> <tr>
<td valign="top" align="left">Sequencing, blocks</td>
<td valign="top" align="left">Sequencing, blocks</td>
</tr> <tr>
<td valign="top" align="left">Function calls</td>
<td valign="top" align="left">Operation calls</td>
</tr> <tr>
<td valign="top" align="left">Object creation <italic>x</italic> &#x0003D; <italic>C</italic>()</td>
<td valign="top" align="left">Call <italic>x</italic>: &#x0003D; <italic>C</italic>.<italic>newC</italic>()</td>
</tr> <tr>
<td valign="top" align="left">If, for, while</td>
<td valign="top" align="left">if, for, while</td>
</tr> <tr>
<td valign="top" align="left">Continue, break, pass</td>
<td valign="top" align="left">continue, break, skip</td>
</tr> <tr>
<td valign="top" align="left">Raise, try, except</td>
<td valign="top" align="left">Error, try, catch</td>
</tr> <tr>
<td valign="top" align="left">Assert</td>
<td valign="top" align="left">Assert</td>
</tr> <tr>
<td valign="top" align="left">With</td>
<td valign="top" align="left">Try/catch</td>
</tr> <tr>
<td valign="top" align="left">Int/float</td>
<td valign="top" align="left">Int/double</td>
</tr> <tr>
<td valign="top" align="left">Str/bool</td>
<td valign="top" align="left">String/Boolean</td>
</tr> <tr>
<td valign="top" align="left">List, tuple types</td>
<td valign="top" align="left">Sequence types</td>
</tr> <tr>
<td valign="top" align="left">Numpy matrix</td>
<td valign="top" align="left">Nested sequences</td>
</tr> <tr>
<td valign="top" align="left">Dict type</td>
<td valign="top" align="left">Map type</td>
</tr> <tr>
<td valign="top" align="left">Set type</td>
<td valign="top" align="left">Set type</td>
</tr>
<tr>
<td valign="top" align="left">Files</td>
<td valign="top" align="left">OclFile</td>
</tr></tbody>
</table>
</table-wrap>
<table-wrap position="float" id="T3">
<label>Table 3</label>
<caption><p>Abstraction rules from Java to UML/OCL.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Java element</bold></th>
<th valign="top" align="left"><bold>UML/OCL</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Program</td>
<td valign="top" align="left">Specification</td>
</tr> <tr>
<td valign="top" align="left">Package</td>
<td valign="top" align="left">Package</td>
</tr> <tr>
<td valign="top" align="left">Class, abstract class</td>
<td valign="top" align="left">Class, abstract class</td>
</tr> <tr>
<td valign="top" align="left">Interface</td>
<td valign="top" align="left">Interface</td>
</tr> <tr>
<td valign="top" align="left">Extends, implements</td>
<td valign="top" align="left">Extends, implements</td>
</tr> <tr>
<td valign="top" align="left">Nested classes</td>
<td valign="top" align="left">Associated classes</td>
</tr> <tr>
<td valign="top" align="left">Generic classes</td>
<td valign="top" align="left">Generic classes</td>
</tr> <tr>
<td valign="top" align="left">Field, static field</td>
<td valign="top" align="left">Attribute, static attribute</td>
</tr> <tr>
<td valign="top" align="left">Method, static method</td>
<td valign="top" align="left">Operation, static operation</td>
</tr> <tr>
<td valign="top" align="left">Generic method</td>
<td valign="top" align="left">Generic operation</td>
</tr> <tr>
<td valign="top" align="left">Constructor C(pars)</td>
<td valign="top" align="left">Static operation newC(pars)</td>
</tr> <tr>
<td valign="top" align="left">This, super</td>
<td valign="top" align="left">Self, super</td>
</tr> <tr>
<td valign="top" align="left">Method overriding, overloading</td>
<td valign="top" align="left">Operation overriding, overloading</td>
</tr> <tr>
<td valign="top" align="left">Assignment, sequencing, blocks</td>
<td valign="top" align="left">Assignment, sequencing, blocks</td>
</tr> <tr>
<td valign="top" align="left">If, while, do, return</td>
<td valign="top" align="left">If, while, repeat, return</td>
</tr> <tr>
<td valign="top" align="left">Expression statements</td>
<td valign="top" align="left">Operation calls/assignments</td>
</tr> <tr>
<td valign="top" align="left">General for loop</td>
<td valign="top" align="left">For, while</td>
</tr> <tr>
<td valign="top" align="left">Enhanced for loop</td>
<td valign="top" align="left">For</td>
</tr> <tr>
<td valign="top" align="left">Switch</td>
<td valign="top" align="left">If</td>
</tr> <tr>
<td valign="top" align="left">Simple continue, break</td>
<td valign="top" align="left">Continue, break</td>
</tr> <tr>
<td valign="top" align="left">Int, short, byte</td>
<td valign="top" align="left">Int</td>
</tr> <tr>
<td valign="top" align="left">Long</td>
<td valign="top" align="left">long</td>
</tr> <tr>
<td valign="top" align="left">Double, float</td>
<td valign="top" align="left">Double</td>
</tr> <tr>
<td valign="top" align="left">String, char, StringBuffer</td>
<td valign="top" align="left">String</td>
</tr> <tr>
<td valign="top" align="left">Object, Class</td>
<td valign="top" align="left">OclAny, OclType</td>
</tr> <tr>
<td valign="top" align="left">Simple enum definitions</td>
<td valign="top" align="left">Enumerated types</td>
</tr> <tr>
<td valign="top" align="left">Classlike enum definitions</td>
<td valign="top" align="left">Classes</td>
</tr> <tr>
<td valign="top" align="left">Array types, Vector, List, etc</td>
<td valign="top" align="left">Sequence types</td>
</tr> <tr>
<td valign="top" align="left">Set, HashSet, TreeSet, etc</td>
<td valign="top" align="left">Set types</td>
</tr> <tr>
<td valign="top" align="left">Map, HashMap, TreeMap, etc</td>
<td valign="top" align="left">Map types</td>
</tr>
<tr>
<td valign="top" align="left">Function, Predicate</td>
<td valign="top" align="left">Function types</td>
</tr></tbody>
</table>
</table-wrap>
</sec>
<sec>
<title>2.5 Correctness and quality measures</title>
<p>We evaluate the syntactic correctness of the results produced by each reverse-engineering approach by attempting to parse them using the ANTLR OCL parser.<xref ref-type="fn" rid="fn0004"><sup>4</sup></xref></p>
<p>For semantic correctness, we evaluate firstly the <italic>completeness</italic> of each reverse engineering approach, where completeness is defined as the proportion of source code elements that are correctly represented as UML/OCL elements in the generated specifications. This is the ratio</p>
<disp-formula id="E1"><mml:math id="M1"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>F</mml:mi><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p>where a true positive (TP) is an element correctly translated from code to OCL, and a false negative (FN) is an element that is not translated, or is translated incorrectly. Completeness in this sense is also known as <italic>recall</italic>.</p>
<p>Secondly we evaluate the <italic>consistency</italic> of each approach, where this is the proportion of elements in the generated specifications which are correctly derived from elements in the source programs. Consistency is important for ensuring traceability and alignment of the derived specification with respect to the source.</p>
<p>Consistency is also referred to as <italic>precision</italic>, the ratio</p>
<disp-formula id="E2"><mml:math id="M2"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>F</mml:mi><mml:mi>P</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p>where a false positive (FP) is an element that appears in the specification that is not correctly derived from a source code element.</p>
<p>Completeness measures the extent to which the abstraction process correctly processes source elements, whilst consistency measures the quality of the generated specification in terms of absence of spurious elements not derived from the source.</p>
<p>A combined measure is the <italic>F</italic>1 metric <inline-formula><mml:math id="M3"><mml:mfrac><mml:mrow><mml:mn>2</mml:mn><mml:mo>*</mml:mo><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>l</mml:mi><mml:mo>*</mml:mo><mml:mi>p</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>i</mml:mi><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>l</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>p</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>i</mml:mi><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:mfrac></mml:math></inline-formula>.</p>
<p>The specifications produced by the reverse engineering of program code can also be expressed in different styles, and at different levels of formality. We distinguish several cases for UML/OCL specifications:</p>
<list list-type="order">
<list-item><p>Informal&#x02014;Specifications expressed using natural language.</p></list-item>
<list-item><p>Semi-formal&#x02014;Specifications partly expressed using natural language and partly with formal OCL constraints.</p></list-item>
<list-item><p>Fully formal Specifications, which can be subdivided into:</p></list-item></list>
<list list-type="simple">
<list-item><p>(a) Implicit&#x02014;Formal specifications expressed at a high level of abstraction, specifying properties of a computational result, but not the process of constructing the result.</p></list-item>
<list-item><p>(b) Explicit&#x02014;Formal specifications which define explicitly how results are computed, using OCL and procedural OCL.</p></list-item>
</list>
<p>To facilitate re-engineering, fully formal and explicit specification forms are preferred, although for other purposes, such as code explanation or summarisation, implicit, semiformal or informal forms may be more appropriate.</p></sec></sec>
<sec sec-type="results" id="s3">
<title>3 Results</title>
<p>We evaluated and compared the AgileUML, untrained LLM and LLM4Models approaches for program abstraction on 20 randomly-selected Python and Java examples from the test sets of the training datasets. We evaluated the syntactic correctness, completeness and consistency of the approaches (<xref ref-type="table" rid="T4">Tables 4</xref>, <xref ref-type="table" rid="T5">5</xref>). We also evaluated the quality of the produced specifications, in terms of their level of formality and explicitness. The percentage of explicit specifications is shown in the final columns of <xref ref-type="table" rid="T4">Tables 4</xref>, <xref ref-type="table" rid="T5">5</xref>. All other produced specifications were implicit in style.</p>
<table-wrap position="float" id="T4">
<label>Table 4</label>
<caption><p>Evaluation of approaches for Python abstraction.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Approach</bold></th>
<th valign="top" align="center"><bold>Syntax</bold></th>
<th valign="top" align="center"><bold>Completeness</bold></th>
<th valign="top" align="center"><bold>Consistency</bold></th>
<th valign="top" align="center"><bold>F1</bold></th>
<th valign="top" align="center"><bold>Explicit</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">AgileUML</td>
<td valign="top" align="center">86%</td>
<td valign="top" align="center">98%</td>
<td valign="top" align="center">97%</td>
<td valign="top" align="center">0.975</td>
<td valign="top" align="center">100%</td>
</tr> <tr>
<td valign="top" align="left">Untrained LLM</td>
<td valign="top" align="center">36%</td>
<td valign="top" align="center">60%</td>
<td valign="top" align="center">68%</td>
<td valign="top" align="center">0.64</td>
<td valign="top" align="center">64%</td>
</tr>
<tr>
<td valign="top" align="left">LLM4Models</td>
<td valign="top" align="center">79%</td>
<td valign="top" align="center">88%</td>
<td valign="top" align="center">85%</td>
<td valign="top" align="center">0.865</td>
<td valign="top" align="center">100%</td>
</tr></tbody>
</table>
</table-wrap>
<table-wrap position="float" id="T5">
<label>Table 5</label>
<caption><p>Evaluation of approaches for Java abstraction.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Approach</bold></th>
<th valign="top" align="center"><bold>Syntax</bold></th>
<th valign="top" align="center"><bold>Completeness</bold></th>
<th valign="top" align="center"><bold>Consistency</bold></th>
<th valign="top" align="center"><bold>F1</bold></th>
<th valign="top" align="center"><bold>Explicit</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">AgileUML</td>
<td valign="top" align="center">83%</td>
<td valign="top" align="center">87%</td>
<td valign="top" align="center">99%</td>
<td valign="top" align="center">0.93</td>
<td valign="top" align="center">100%</td>
</tr> <tr>
<td valign="top" align="left">Untrained LLM</td>
<td valign="top" align="center">33%</td>
<td valign="top" align="center">65%</td>
<td valign="top" align="center">71%</td>
<td valign="top" align="center">0.68</td>
<td valign="top" align="center">83%</td>
</tr>
<tr>
<td valign="top" align="left">LLM4Models</td>
<td valign="top" align="center">83%</td>
<td valign="top" align="center">96%</td>
<td valign="top" align="center">96%</td>
<td valign="top" align="center">0.96</td>
<td valign="top" align="center">100%</td>
</tr></tbody>
</table>
</table-wrap>
<p>The AgileUML Java abstractions were produced by using the ANTLR version 4 command line</p>
<preformat>
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;grun&#x000A0;Java&#x000A0;compilationUnit&#x000A0;-tree
</preformat> 
<p>to produce an abstract syntax tree of a source Java program, and then by applying the Java to UML CSTL abstraction script via the command</p>
<preformat>
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;cgtl&#x000A0;cg/cgJava2UML.cstl&#x000A0;output/ast.txt
</preformat> 
<p>where <italic>ast</italic>.<italic>txt</italic> contains the abstract syntax tree from the first step. Likewise, for Python, the commands</p>
<preformat>
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;grun&#x000A0;Python&#x000A0;file_input&#x000A0;-tree
</preformat> 
<p>and</p>
<preformat>
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;cgtl&#x000A0;cg/python2UML.cstl&#x000A0;output/ast.txt
</preformat> 
<p>are used to obtain a UML/OCL specification from Python source code.</p>
<p>All examples, training data and analysis results can be obtained from the repository (<ext-link ext-link-type="uri" xlink:href="https://zenodo.org/records/14988622">https://zenodo.org/records/14988622</ext-link>).</p>
<p><xref ref-type="table" rid="T4">Tables 4</xref>, <xref ref-type="table" rid="T5">5</xref> show that the LLM4Models LLM has substantially improved syntax correctness, completeness, consistency and F1 measures compared to the untrained LLM, for both Java and Python abstraction. In addition, the completeness improves on that of AgileUML for Java abstraction. The specifications produced by LLM4Models are all explicit in style, which represents a significant improvement over the untrained LLM.</p>
<p><xref ref-type="fig" rid="F1">Figures 1</xref>, <xref ref-type="fig" rid="F2">2</xref> give a detailed comparison of the three reverse-engineering approaches for Python.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>Completeness results for Python examples, numbered 1 to 14.</p></caption>
<alt-text>Line graph titled &#x0201C;Completeness&#x0201D; comparing AgileUML, LLM4Models, and GPT4 across 14 cases. AgileUML maintains a consistency at 1, LLM4Models varies, primarily between 0.8 and 1, and GPT4 fluctuates below 0.7.</alt-text>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1516410-g0001.tif"/>
</fig>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Consistency results for Python examples, numbered 1 to 14.</p></caption>
<alt-text>Line graph depicting consistency across 14 cases for AgileUML, LLM4 models, and GPT4. AgileUML shows a constant value near 1. LLM4 models fluctuate between 0.6 and 1, while GPT4 displays significant variability, particularly dropping below 0.2 in cases 4 and 5.</alt-text>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1516410-g0002.tif"/>
</fig>
<p>It can be seen that for 13 of 14 Python cases, the LLM4Models completeness and consistency are lower or equal to that obtained by AgileUML. However, for 12 of 14 cases, the LLM4Models completeness and consistency is at least as high as that obtained by the untrained LLM.</p>
<p><xref ref-type="fig" rid="F3">Figures 3</xref>, <xref ref-type="fig" rid="F4">4</xref> give a detailed comparison of the three reverse-engineering approaches for Java.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Completeness results for Java examples, numbered 1 to 6.</p></caption>
<alt-text>Line graph showing completeness against case numbers one to six. AgileUML is depicted with a blue dashed line gradually rising. LLM4Models, represented by an orange solid line, remains mostly constant with a slight dip at case five. GPT-4, shown as a gray dotted line, decreases steeply at cases three and four before slightly rising.</alt-text>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1516410-g0003.tif"/>
</fig>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Consistency results for Java examples, numbered 1 to 6.</p></caption>
<alt-text>Line graph comparing consistency across six cases for AgileUML, LLM4Models, and GPT4. LLM4Models maintains a consistent value of 1, AgileUML varies around 0.96, and GPT4 fluctuates significantly, reaching a low of 0.5.</alt-text>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1516410-g0004.tif"/>
</fig>
<p>It can be seen that for all Java cases, the LLM4Models completeness is at least as high as that obtained by AgileUML, whilst the LLM4Models consistency is always lower or equal to that obtained by AgileUML. For each Java case, the AgileUML and LLM4Models completeness and consistency are always greater than or equal to the values obtained using the untrained LLM.</p>
<p>An example of Java abstraction is given by the following CoTran dataset example (Java evaluation case number 3):</p>
<preformat>
&#x000A0;&#x000A0;public&#x000A0;class&#x000A0;EQUILIBRIUM_INDEX_OF_AN_ARRAY_1&#x000A0;{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;static&#x000A0;int&#x000A0;M209(int&#x000A0;arr[],&#x000A0;int&#x000A0;n)&#x000A0;{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;int&#x000A0;sum&#x000A0;=&#x000A0;0;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;int&#x000A0;leftsum&#x000A0;=&#x000A0;0;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;for&#x000A0;(int&#x000A0;i&#x000A0;=&#x000A0;0;&#x000A0;i&#x000A0; &#x0003C; &#x000A0;n;&#x000A0;&#x0002B;&#x0002B;i)
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;sum&#x000A0;&#x0002B;=&#x000A0;arr[i];
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;for&#x000A0;(int&#x000A0;i&#x000A0;=&#x000A0;0;&#x000A0;i&#x000A0; &#x0003C; &#x000A0;n;&#x000A0;&#x0002B;&#x0002B;i)&#x000A0;{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;sum&#x000A0;-=&#x000A0;arr[i];
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;if&#x000A0;(leftsum&#x000A0;==&#x000A0;sum)
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;i;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;leftsum&#x000A0;&#x0002B;=&#x000A0;arr[i];
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;}
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;-1;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;}
&#x000A0;&#x000A0;}
</preformat> 
<p>AgileUML produces the following explicit specification in UML and procedural OCL:</p>
<preformat>
&#x000A0;&#x000A0;class&#x000A0;EQUILIBRIUM_INDEX_OF_AN_ARRAY_1&#x000A0;{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;static&#x000A0;operation&#x000A0;M209(&#x000A0;arr&#x000A0;:&#x000A0;Sequence(int),&#x000A0;n&#x000A0;:&#x000A0;int)
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;:&#x000A0;int
&#x000A0;&#x000A0;&#x000A0;&#x000A0;pre:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;post:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;activity:&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;sum&#x000A0;:&#x000A0;int&#x000A0;;&#x000A0;sum&#x000A0;:=&#x000A0;0&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;leftsum&#x000A0;:&#x000A0;int&#x000A0;;&#x000A0;leftsum&#x000A0;:=&#x000A0;0&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;for&#x000A0;i&#x000A0;:&#x000A0;Integer.subrange(0,&#x000A0;(n)-1)&#x000A0;do&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;sum&#x000A0;:=&#x000A0;sum&#x0002B;(arr[i&#x0002B;1])
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;for&#x000A0;i&#x000A0;:&#x000A0;Integer.subrange(0,&#x000A0;(n)-1)&#x000A0;do&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;(&#x000A0;sum&#x000A0;:=&#x000A0;sum-(arr[i&#x0002B;1])&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;if&#x000A0;(leftsum&#x000A0;=&#x000A0;sum)&#x000A0;then
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;i&#x000A0;else&#x000A0;skip&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;leftsum&#x000A0;:=&#x000A0;leftsum&#x0002B;(arr[i&#x0002B;1])&#x000A0;)
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;-1
&#x000A0;&#x000A0;&#x000A0;);
&#x000A0;&#x000A0;}
</preformat> 
<p>An almost identical specification (using <italic>while</italic> loops instead of <italic>for</italic> loops) is produced by LLM4Models. These specifications are explicit and semantically correct.</p>
<p>However, the untrained LLM (GPT4) produces an implicit-style specification with semantic errors:</p>
<preformat>
&#x000A0;&#x000A0;context&#x000A0;EQUILIBRIUM_INDEX_OF_AN_ARRAY_1::M209
&#x000A0;&#x000A0;(arr:&#x000A0;Sequence(Integer),
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;n:&#x000A0;Integer)&#x000A0;:&#x000A0;Integer
&#x000A0;&#x000A0;pre:&#x000A0;n&#x000A0;&#x0003E;&#x000A0;0&#x000A0;--&#x000A0;The&#x000A0;array&#x000A0;must&#x000A0;have&#x000A0;at&#x000A0;least&#x000A0;one&#x000A0;element
&#x000A0;&#x000A0;post:&#x000A0;if&#x000A0;result&#x000A0; &#x0003C; &#x0003E;&#x000A0;-1&#x000A0;then
&#x000A0;&#x000A0;&#x000A0;&#x000A0;--&#x000A0;If&#x000A0;an&#x000A0;equilibrium&#x000A0;index&#x000A0;is&#x000A0;found,&#x000A0;the&#x000A0;sum&#x000A0;of
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;elements&#x000A0;to&#x000A0;the&#x000A0;left
&#x000A0;&#x000A0;&#x000A0;&#x000A0;--&#x000A0;of&#x000A0;index&#x000A0;i&#x000A0;should&#x000A0;equal&#x000A0;the&#x000A0;sum&#x000A0;of&#x000A0;elements
&#x000A0;&#x000A0;&#x000A0;&#x000A0;to&#x000A0;the&#x000A0;right
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;arr-&#x0003E;subSequence(1,&#x000A0;result&#x000A0;-&#x000A0;1)-&#x0003E;sum()&#x000A0;=
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;arr-&#x0003E;subSequence(result&#x000A0;&#x0002B;&#x000A0;1,&#x000A0;n)-&#x0003E;sum()
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;else
&#x000A0;&#x000A0;&#x000A0;&#x000A0;--&#x000A0;If&#x000A0;no&#x000A0;equilibrium&#x000A0;index&#x000A0;is&#x000A0;found,&#x000A0;the&#x000A0;result&#x000A0;is&#x000A0;-1
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;endif
</preformat> 
<p>Here, the value of <italic>result</italic> is only expressed implicitly in the postcondition. Moreover, a precondition that <italic>n</italic> &#x02264; <italic>arr</italic>&#x02192;<italic>size</italic>() is needed in order that this specification has the same functionality as the source code.</p>
<p>For more complex cases, a simple implicit specification is not possible. For example, consider the following CoTran Java case (number 6 in the Java evaluation examples):</p>
<preformat>
&#x000A0;&#x000A0;public&#x000A0;class&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING_
&#x000A0;&#x000A0;NUMBERS_WITH_N_DIGITS_1{
&#x000A0;&#x000A0;static&#x000A0;long&#x000A0;aaa(int&#x000A0;n){
&#x000A0;&#x000A0;&#x000A0;&#x000A0;int&#x000A0;N=10;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;long&#x000A0;count=1;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;for(int&#x000A0;i=1;i &#x0003C; =n;i&#x0002B;&#x0002B;){
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;count=(int)count*(N&#x0002B;i-1);
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;count=(int)count/i;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;}
&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;count;
&#x000A0;&#x000A0;}
&#x000A0;&#x000A0;}
</preformat> 
<p>The untrained LLM produces a procedural version using the OCL &#x02192; <italic>iterate</italic> operator:</p>
<preformat>
&#x000A0;&#x000A0;--&#x000A0;Context:&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING
&#x000A0;&#x000A0;_NUMBERS_WITH_N_DIGITS_1&#x000A0;class
&#x000A0;&#x000A0;context&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_
&#x000A0;&#x000A0;WITH_N_DIGITS_1
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Operation:&#x000A0;aaa(n:&#x000A0;Integer):&#x000A0;Long
&#x000A0;&#x000A0;inv:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;let&#x000A0;N:&#x000A0;Integer&#x000A0;=&#x000A0;10&#x000A0;in
&#x000A0;&#x000A0;&#x000A0;&#x000A0;let&#x000A0;count:&#x000A0;Long&#x000A0;=&#x000A0;1&#x000A0;in
&#x000A0;&#x000A0;&#x000A0;&#x000A0;count&#x000A0;=&#x000A0;self.aaa(n)
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;The&#x000A0;operation&#x000A0;specification&#x000A0;in&#x000A0;OCL
&#x000A0;&#x000A0;context&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING_
&#x000A0;&#x000A0;NUMBERS_WITH_N_DIGITS_1::
&#x000A0;&#x000A0;&#x000A0;&#x000A0;aaa(n:&#x000A0;Integer):&#x000A0;Long
&#x000A0;&#x000A0;pre:&#x000A0;n&#x000A0;&#x0003E;&#x000A0;0&#x000A0;--&#x000A0;The&#x000A0;number&#x000A0;of&#x000A0;digits&#x000A0;(n)&#x000A0;must
&#x000A0;&#x000A0;&#x000A0;be&#x000A0;positive
&#x000A0;&#x000A0;post:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;result&#x000A0;=&#x000A0;(Sequence{1..n}-&#x0003E;iterate(i;&#x000A0;count:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;Long&#x000A0;=&#x000A0;1&#x000A0;|
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;(count&#x000A0;*&#x000A0;(N&#x000A0;&#x0002B;&#x000A0;i&#x000A0;-&#x000A0;1))&#x000A0;/&#x000A0;i))&#x000A0;--&#x000A0;Iterative
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;calculation&#x000A0;of&#x000A0;count
</preformat> 
<p>Apart from the use of <italic>iterate</italic>, another issue with this specification is that the <italic>let</italic> statements are ineffective and redundant: <italic>count</italic> is initialized to 1 in the <italic>iterate</italic> loop, and <italic>N</italic> should be passed as a parameter of the <italic>aaa</italic> operation.</p>
<p>In contrast to the GPT-4 solution, the AgileUML and LLM4Models tools produce program abstractions which use <italic>for</italic> or <italic>while</italic> loop constructs, which are more familiar to software practitioners in general than <italic>iterate</italic>:</p>
<preformat>
&#x000A0;&#x000A0;class&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_
&#x000A0;&#x000A0;WITH_N_DIGITS{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;static&#x000A0;operation&#x000A0;aaa(&#x000A0;n&#x000A0;:&#x000A0;int)&#x000A0;:&#x000A0;long
&#x000A0;&#x000A0;&#x000A0;&#x000A0;pre:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;post:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;activity:&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;N&#x000A0;:&#x000A0;int&#x000A0;;&#x000A0;N&#x000A0;:=&#x000A0;10&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;count&#x000A0;:&#x000A0;long&#x000A0;;&#x000A0;count&#x000A0;:=&#x000A0;1&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;for&#x000A0;i&#x000A0;:&#x000A0;Integer.subrange(1,&#x000A0;n)&#x000A0;do&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;(&#x000A0;count&#x000A0;:=&#x000A0;count-&#x0003E;oclAsType(int)&#x000A0;*&#x000A0;(N&#x000A0;&#x0002B;&#x000A0;i&#x000A0;-&#x000A0;1)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;count&#x000A0;:=&#x000A0;count-&#x0003E;oclAsType(int)&#x000A0;/&#x000A0;i&#x000A0;)
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;count
&#x000A0;&#x000A0;&#x000A0;&#x000A0;);
&#x000A0;&#x000A0;}
</preformat> 
<p>in the case of AgileUML, and:</p>
<preformat>
&#x000A0;&#x000A0;class&#x000A0;TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_
&#x000A0;&#x000A0;WITH_N_DIGITS_1&#x000A0;{
&#x000A0;&#x000A0;&#x000A0;&#x000A0;static&#x000A0;operation&#x000A0;aaa(&#x000A0;n&#x000A0;:&#x000A0;int)&#x000A0;:&#x000A0;long
&#x000A0;&#x000A0;&#x000A0;&#x000A0;pre:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;post:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;activity:&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;N&#x000A0;:&#x000A0;int&#x000A0;;&#x000A0;N&#x000A0;:=&#x000A0;10&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;count&#x000A0;:&#x000A0;long&#x000A0;;&#x000A0;count&#x000A0;:=&#x000A0;1&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;i&#x000A0;:&#x000A0;int&#x000A0;;&#x000A0;i&#x000A0;:=&#x000A0;1&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;while&#x000A0;i&#x000A0; &#x0003C; =&#x000A0;n&#x000A0;do&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;count&#x000A0;:=&#x000A0;count-&#x0003E;oclAsType(int)&#x000A0;*&#x000A0;(N&#x000A0;&#x0002B;&#x000A0;i&#x000A0;-&#x000A0;1)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;count&#x000A0;:=&#x000A0;count-&#x0003E;oclAsType(int)&#x000A0;/&#x000A0;i&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;:=&#x000A0;i&#x000A0;&#x0002B;&#x000A0;1&#x000A0;)&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;return&#x000A0;count
&#x000A0;&#x000A0;&#x000A0;&#x000A0;);
&#x000A0;&#x000A0;}
</preformat> 
<p>in the case of LLM4Models.</p>
<p>Similar issues arise with Python program abstraction. For simple cases, the untrained LLM can produce accurate and useful abstractions, but more complex cases lead to errors or poorly-aligned specifications.</p>
<p>One example is the Python program:</p>
<preformat>
&#x000A0;&#x000A0;i&#x000A0;=&#x000A0;0
&#x000A0;&#x000A0;while&#x000A0;i&#x000A0; &#x0003C; &#x000A0;100&#x000A0;:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;=&#x000A0;i&#x000A0;&#x0002B;&#x000A0;1
&#x000A0;&#x000A0;&#x000A0;&#x000A0;print(i*i)
</preformat> 
<p>This is the Python evaluation case 13.</p>
<p>AgileUML and LLM4Models produce the output:</p>
<preformat>
&#x000A0;&#x000A0;&#x000A0;class&#x000A0;FromPython&#x000A0;{
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;operation&#x000A0;initialise()
&#x000A0;&#x000A0;&#x000A0;&#x000A0;pre:&#x000A0;true&#x000A0;post:&#x000A0;true
&#x000A0;&#x000A0;&#x000A0;&#x000A0;activity:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;var&#x000A0;i&#x000A0;:&#x000A0;int&#x000A0;:=&#x000A0;0&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;while&#x000A0;i&#x000A0; &#x0003C; &#x000A0;100&#x000A0;do&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;:=&#x000A0;i&#x000A0;&#x0002B;&#x000A0;1&#x000A0;;
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;execute&#x000A0;(i&#x000A0;*&#x000A0;i)-&#x0003E;display());
&#x000A0;&#x000A0;}
</preformat> 
<p>This is a correct semantic representation of the source code, and can directly be used for forward engineering.</p>
<p>However the untrained LLM produces a more declarative and implicit specification of the same program:</p>
<preformat>
&#x000A0;&#x000A0;--&#x000A0;Context:&#x000A0;Describing&#x000A0;the&#x000A0;behavior&#x000A0;of&#x000A0;the&#x000A0;loop
&#x000A0;&#x000A0;&#x000A0;and&#x000A0;its&#x000A0;constraints
&#x000A0;&#x000A0;context&#x000A0;LoopOperation
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Initial&#x000A0;condition:&#x000A0;i&#x000A0;starts&#x000A0;at&#x000A0;0
&#x000A0;&#x000A0;inv&#x000A0;Initialization:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;=&#x000A0;0
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Loop&#x000A0;invariant:&#x000A0;While&#x000A0;i&#x000A0;is&#x000A0;less&#x000A0;than&#x000A0;100,&#x000A0;the
&#x000A0;&#x000A0;&#x000A0;loop&#x000A0;continues
&#x000A0;&#x000A0;inv&#x000A0;LoopCondition:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;&#x0003E;=&#x000A0;0&#x000A0;and&#x000A0;i&#x000A0; &#x0003C; =&#x000A0;100
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Postcondition:&#x000A0;After&#x000A0;each&#x000A0;iteration,&#x000A0;i&#x000A0;is
&#x000A0;&#x000A0;&#x000A0;incremented&#x000A0;by&#x000A0;1
&#x000A0;&#x000A0;post&#x000A0;Increment:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;=&#x000A0;i&#x00040;pre&#x000A0;&#x0002B;&#x000A0;1
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Iteration&#x000A0;constraint:&#x000A0;For&#x000A0;each&#x000A0;iteration,
&#x000A0;&#x000A0;--&#x000A0;print&#x000A0;the&#x000A0;square&#x000A0;of&#x000A0;the&#x000A0;current&#x000A0;i
&#x000A0;&#x000A0;inv&#x000A0;Iteration:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;&#x0003E;=&#x000A0;0&#x000A0;and&#x000A0;i&#x000A0; &#x0003C; =&#x000A0;100&#x000A0;implies&#x000A0;print(i&#x000A0;*&#x000A0;i)
&#x000A0;&#x000A0;
&#x000A0;&#x000A0;--&#x000A0;Final&#x000A0;state:&#x000A0;Once&#x000A0;i&#x000A0;reaches&#x000A0;100,&#x000A0;the
&#x000A0;&#x000A0;&#x000A0;loop&#x000A0;terminates
&#x000A0;&#x000A0;post&#x000A0;FinalState:
&#x000A0;&#x000A0;&#x000A0;&#x000A0;i&#x000A0;=&#x000A0;100
</preformat> 
<p>This describes the computation, rather than explicitly expressing its semantics, and is not in a form suitable for forward engineering.</p>
<p>AgileUML and LLM4Models tend to make similar mistakes to each other, for example, both fail to deduce the types of Python variables in many cases. However, LLM4Models can be more creative than AgileUML, for example, introducing new OCL operators (such as &#x02192; <italic>capitalize</italic> for strings or &#x02192; <italic>mean</italic> for collections) which are needed to represent the program semantics of examples that have not been seen in the LLM training data.</p></sec>
<sec sec-type="discussion" id="s4">
<title>4 Discussion</title>
<p>In this section we give a detailed comparison of the reverse-engineering methods, survey related work, relate our work to the state of the art, consider threats to validity, summarize our contributions, and consider future areas for further development and extension of our research.</p>
<sec>
<title>4.1 Detailed comparison of methods</title>
<p>The three reverse engineering approaches have different strengths and weaknesses for reverse engineering. <xref ref-type="table" rid="T6">Table 6</xref> gives the frequencies of different types of errors that arise in reverse engineering of the Python test cases to OCL.</p>
<table-wrap position="float" id="T6">
<label>Table 6</label>
<caption><p>Flaws in Python reverse-engineering.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Approach</bold></th>
<th valign="top" align="center"><bold>Incompleteness</bold></th>
<th valign="top" align="center"><bold>Hallucination</bold></th>
<th valign="top" align="center"><bold>Spurious elements</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">AgileUML</td>
<td valign="top" align="center">0.14</td>
<td valign="top" align="center">0</td>
<td valign="top" align="center">0.14</td>
</tr> <tr>
<td valign="top" align="left">Untrained LLM</td>
<td valign="top" align="center">0.36</td>
<td valign="top" align="center">0.14</td>
<td valign="top" align="center">0.43</td>
</tr>
<tr>
<td valign="top" align="left">LLM4Models</td>
<td valign="top" align="center">0.14</td>
<td valign="top" align="center">0.07</td>
<td valign="top" align="center">0.28</td>
</tr></tbody>
</table>
</table-wrap>
<p>The principal cause of incompleteness in AgileUML and the trained LLM is the difficulty of deriving types for untyped variables in Python. The untrained LLM also omits other forms of information, particularly procedural information about the sequencing of processing. The untrained LLM is also more prone to introduce spurious elements, particularly additional invariants or constraints which are more restrictive than those in the source code. For example, introducing a spurious constraint that an integer-typed variable is non-negative. Overall, the untrained LLM produces results which are further removed in structure and content from the source, compared to the other two approaches, which may impair traceability. However, in some cases the untrained LLM can infer higher-level abstractions, for example, it produces the declarative result</p>
<preformat>
context A : Integer
inv: let B : Integer =
&#x000A0;&#x000A0;&#x000A0;&#x000A0;if A &#x0003E; 10 then
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;A * A
&#x000A0;&#x000A0;&#x000A0;&#x000A0;else if A &#x0003E; 0 then
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;A * A * A
&#x000A0;&#x000A0;&#x000A0;&#x000A0;else
&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;-A
&#x000A0;&#x000A0;&#x000A0;&#x000A0;endif
&#x000A0;&#x000A0;&#x000A0;&#x000A0;endif
</preformat>
<p>for the Python program</p>
<preformat>
A = 11
 if A &#x0003E; 10 :
&#x000A0;&#x000A0;B = A*A
elif A &#x0003E; 0 :
&#x000A0;&#x000A0;B = A*A*A
else :
&#x000A0;&#x000A0;B = -A
print(B)
</preformat>
<p>In contrast the other two approaches produce a procedural version that closely imitates the source:</p>
<preformat>
operation initialise()
pre: true post: true
activity:
&#x000A0;&#x000A0;var A : int := 11 ;
&#x000A0;&#x000A0;if A &#x0003E; 10 then (
&#x000A0;&#x000A0;&#x000A0;&#x000A0;var B : int := A * A
&#x000A0;&#x000A0;) 
&#x000A0;&#x000A0;else (if A &#x0003E; 0 then
&#x000A0;&#x000A0;(
&#x000A0;&#x000A0;&#x000A0;&#x000A0;B := A * A * A
&#x000A0;&#x000A0;)
&#x000A0;&#x000A0;else (
&#x000A0;&#x000A0;&#x000A0;&#x000A0;B := -A
&#x000A0;&#x000A0;) );
&#x000A0;&#x000A0;execute (B)-&#x0003E;display();
}
 }</preformat> 
<p>This version needs further post-processing in order to conform to OCL semantics (the declaration of <italic>B</italic> needs to be moved to the outer scope of the operation activity).</p>
<p>The situation for the abstraction of Java to OCL is similar. <xref ref-type="table" rid="T7">Table 7</xref> lists the types of errors that arise in the different abstraction methods when applied to Java programs.</p>
<table-wrap position="float" id="T7">
<label>Table 7</label>
<caption><p>Flaws in Java reverse-engineering.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Approach</bold></th>
<th valign="top" align="center"><bold>Incompleteness</bold></th>
<th valign="top" align="center"><bold>Hallucination</bold></th>
<th valign="top" align="center"><bold>Spurious elements</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">AgileUML</td>
<td valign="top" align="center">0.33</td>
<td valign="top" align="center">0</td>
<td valign="top" align="center">0</td>
</tr> <tr>
<td valign="top" align="left">Untrained LLM</td>
<td valign="top" align="center">0.33</td>
<td valign="top" align="center">0</td>
<td valign="top" align="center">0.67</td>
</tr>
<tr>
<td valign="top" align="left">LLM4Models</td>
<td valign="top" align="center">0.17</td>
<td valign="top" align="center">0</td>
<td valign="top" align="center">0</td>
</tr></tbody>
</table>
</table-wrap>
<p>Again, the main problem with the untrained LLM is the production of spurious invariants, preconditions or postconditions. It is difficult to automatically detect such errors, and hence correction of the output would need to involve human expertise.</p></sec>
<sec>
<title>4.2 Related work</title>
<p>In this section we review related work in MDRE and ML-based program translation and code abstraction approaches.</p>
<sec>
<title>4.2.1 Model-driven reverse engineering</title>
<p>Early work on MDRE considered the extraction of formal specifications from code, either represented in state-based formal languages such as Z, or in other formalisms such as algebraic specification languages (Bowen J. et al., <xref ref-type="bibr" rid="B3">1993</xref>; Liu et al., <xref ref-type="bibr" rid="B23">1997</xref>).</p>
<p>MDRE was combined with model-driven forward engineering to support <italic>model-driven modernization</italic> (MDM) (Bowen J. P. et al., <xref ref-type="bibr" rid="B4">1993</xref>; Lano and Malik, <xref ref-type="bibr" rid="B19">1999</xref>). MDM was standardized by the Object Management Group (OMG) in their Architecture-driven modernization (ADM) framework (Perez-Castillo et al., <xref ref-type="bibr" rid="B30">2011</xref>). ADM supports in principle a &#x0201C;horseshoe modernization model" whereby the starting point is the legacy system source artifacts at a low level of abstraction, these are then reverse-engineered to higher levels of abstraction, e.g., Platform-specific, Platform-independent and Computation independent models (PSMs, PIMs, CIMs), and then forward-engineered to a target platform (Deltombe et al., <xref ref-type="bibr" rid="B7">2012</xref>; Perez-Castillo et al., <xref ref-type="bibr" rid="B30">2011</xref>). MDM in general enables multi-lingual translation between multiple programming languages, with some degree of assurance of semantic preservation (Krasteva et al., <xref ref-type="bibr" rid="B15">2013</xref>; Lano and Siala, <xref ref-type="bibr" rid="B20">2024a</xref>; Lano et al., <xref ref-type="bibr" rid="B17">2024</xref>). However, as with other forms of model-driven engineering, MDM and MDRE requires the availability of practitioners with appropriate MDE knowledge and skills, including metamodelling and model transformation development. Thus, despite the potential of MDRE and MDM for supporting highly rigorous re-engineering, there has been limited use of MDRE and MDM in practice. Instead, customized re-engineering processes have been used, specifically created for each re-engineering project (Marco et al., <xref ref-type="bibr" rid="B25">2018</xref>; Sneed, <xref ref-type="bibr" rid="B34">2011</xref>).</p></sec>
<sec>
<title>4.2.2 ML approaches for program translation and abstraction</title>
<p>Based on the successful use of ML for neural machine translation (NMT) of natural languages, similar NMT approaches were applied to the translation of software languages (Nguyen et al., <xref ref-type="bibr" rid="B26">2015</xref>; Chen et al., <xref ref-type="bibr" rid="B6">2018</xref>). However, these approaches used supervised learning and required the existence or creation of large scale parallel code datasets. A key advance was the application of unsupervised language modeling training to program translation in Transcoder (Lachaux et al., <xref ref-type="bibr" rid="B16">2020</xref>). This enabled the use of large monolingual code datasets to train an ML model with knowledge of the individual programming languages together with knowledge of language correspondences. Specifically, masked language modeling and denoising auto-encoding learning objectives were used together with coupled target-to-source and source-to-target training. The result was a pre-trained language model (PLM) with significantly higher translation performance than manually-coded program translators. Nevertheless, such an approach has limitations: it utilizes common syntactic anchor points between programming languages, such as similar keywords <italic>if</italic>, <italic>while</italic>, etc., in different languages, and operates in a stochastic manner. It is noticeable that the Transcoder translation accuracy is lower for more dissimilar languages (such as Python and Java) compared to more similar pairs (Java and C&#x0002B;&#x0002B;). The scale of the back-translation training grows quadratically with the number of languages being considered. Deficiencies with the Transcoder results are discussed by Malyaya et al. (<xref ref-type="bibr" rid="B24">2023</xref>).</p>
<p>Subsequent PLM approaches to program translation include GraphCodeBERT (Guo et al., <xref ref-type="bibr" rid="B10">2021</xref>), the Transcoder-IR approach of Szafraniec et al. (<xref ref-type="bibr" rid="B36">2023</xref>), the CoTran approach of Jana et al. (<xref ref-type="bibr" rid="B13">2023</xref>), and approaches utilizing fine-tuning of PLMs (Ahmad et al., <xref ref-type="bibr" rid="B1">2023</xref>; Zhu et al., <xref ref-type="bibr" rid="B39">2022</xref>). GraphCodeBERT uses data flow information to enable a PLM to learn more semantically-meaningful programming knowledge during pre-training. In Szafraniec et al. (<xref ref-type="bibr" rid="B36">2023</xref>), pre-training is enriched by the use of compiler intermediate representations, to increase the semantic awareness of the trained model. CoTran (Jana et al., <xref ref-type="bibr" rid="B13">2023</xref>) incorporates semantic equivalence into the training objective by utilizing automated test case generation. In order to improve the accuracy of Java-Python translation, a large parallel dataset for fine-tuning (supervised re-training) of a PLM was created by Ahmad et al. (<xref ref-type="bibr" rid="B1">2023</xref>). A similar fine-tuning approach was applied with a dataset of 7 programming languages in Zhu et al. (<xref ref-type="bibr" rid="B39">2022</xref>). These approaches produced improved results compared to Transcoder, but still focussed on relatively similar pairs or groups of languages such as Java, JavaScript, C&#x0002B;&#x0002B;, Go, Rust, Python, C&#x00023;, etc, all with a common C-based heritage.</p>
<p>The advent of large language models (PLMs with at least 10 billion parameters (Zhao et al., <xref ref-type="bibr" rid="B38">2023</xref>)) brought a further change to the program translation landscape. Although LLMs are typically pre-trained on large general purpose datasets, and with simple language modeling objectives such as next token prediction, they have proven to be capable of carrying out diverse tasks as well as, or better, than specialized smaller-scale PLMs (Zhao et al., <xref ref-type="bibr" rid="B38">2023</xref>). Apart from their baseline capabilities for program translation, general purpose LLMs such as ChatGPT can be enhanced for this task by fine-tuning, prompt tuning or refinement (Li et al., <xref ref-type="bibr" rid="B22">2024</xref>; Gandhi et al., <xref ref-type="bibr" rid="B9">2024</xref>).</p>
<p>ML approaches can also be used to derive specification-level documentation from programs by automated <italic>code summarisation</italic>, whereby natural language explanations are generated from program code (Zhang et al., <xref ref-type="bibr" rid="B37">2022</xref>). Code summarisation techniques have mainly focussed upon modern programming languages, and there is a lack of datasets and tools for COBOL and VB (Gandhi et al., <xref ref-type="bibr" rid="B9">2024</xref>). The approach of Boronat and Mustafa (<xref ref-type="bibr" rid="B2">2025</xref>) derives UML class diagram models from Java code using Retrieval-Augmented Generation (RAG) techniques to reduce LLM errors. This approach does not generate explicit semantic representations of the code, so it is mainly applicable to enhance code comprehension at a structural level, rather than as a basis for code migration.</p></sec></sec>
<sec>
<title>4.3 Threats to validity</title>
<p>Threats to validity include bias in the construction of the evaluation, inability to generalize the results, inappropriate constructs and inappropriate measures.</p>
<sec>
<title>4.3.1 Instrumental bias</title>
<p>This concerns the consistency of measures over the course of the analysis. To ensure consistency, all analysis and measurement of the results was carried out in the same manner by a single individual (the second author) on all cases. Analysis and measurement for the results of <xref ref-type="table" rid="T4">Tables 4</xref>, <xref ref-type="table" rid="T5">5</xref> were repeated in order to ensure the consistency of the results.</p></sec>
<sec>
<title>4.3.2 Selection bias</title>
<p>For the training datasets we chose Java and Python examples which covered the core statements and features of the languages. The source codes were taken from established datasets such as AVATAR (Ahmad et al., <xref ref-type="bibr" rid="B1">2023</xref>) and CoTran (Jana et al., <xref ref-type="bibr" rid="B13">2023</xref>) which have been used in other research. In addition we created our own examples to ensure completeness of grammar coverage. Care was taken to ensure that there was no duplication of examples within the training datasets.</p></sec>
<sec>
<title>4.3.3 Generalization to different samples</title>
<p>We found a high degree of consistency of our results across different examples, as shown in <xref ref-type="fig" rid="F1">Figures 1</xref>&#x02013;<xref ref-type="fig" rid="F4">4</xref>. Since these were randomly-chosen examples, this consistency in the relative performance of the approaches also suggests that the same relations would hold between the approaches when applied to other random subsets of the test data.</p></sec>
<sec>
<title>4.3.4 Inexact characterization of constructs</title>
<p>We have used established metrics such as precision, recall and F1 measure in our evaluation, in order to measure the completeness, consistency and quality of the reverse-engineering process. These metrics however involve a subjective aspect (the human evaluator has to determine if program elements have been translated correctly or not). Alternative and more objective measures, such as equivalent behavior on a set of test cases, could also be considered for future work, however there is currently no means to directly execute AgileUML OCL specifications. Thus an execution-based measure such as computational accuracy (Lachaux et al., <xref ref-type="bibr" rid="B16">2020</xref>) or runtime equivalence (Jana et al., <xref ref-type="bibr" rid="B13">2023</xref>) could not be used.</p></sec>
<sec>
<title>4.3.5 Relevance</title>
<p>The LLM4Models reverse engineering approach has been shown to be applicable to the analysis of Java (Java versions from 5 to 8) and Python (versions 2.7 and 3.*). In principle, reverse engineering of other versions of these languages, or other programming languages, could be addressed by using the same model training procedures.</p></sec>
<sec>
<title>4.3.6 Representativeness</title>
<p>The Java and Python examples were selected to be representative of real-world Java and Python coding, rather than artificial examples constructed by the authors. The datasets used included programmer solutions from websites of programming tasks/solutions, such as AtCoder, used by AVATAR. The examples considered in Section 3, such as <monospace>EQUILIBRIUM_INDEX_OF_AN_ARRAY_1</monospace>, are of this kind.</p></sec>
<sec>
<title>4.3.7 Threats to conclusion validity</title>
<p>The consistency of our comparison results across different examples, as shown in <xref ref-type="fig" rid="F1">Figures 1</xref>&#x02013;<xref ref-type="fig" rid="F4">4</xref> demonstrates that there are consistent differences in the results of the three different reverse-engineering approaches.</p></sec></sec>
<sec>
<title>4.4 Relation to the state of the art</title>
<p>AgileUML is one of the leading MDE approaches for program translation in terms of semantic accuracy, and it also exhibits higher translation accuracy than ML-based approaches such as CoTran (Lano et al., <xref ref-type="bibr" rid="B17">2024</xref>). This indicates that AgileUML also has high semantic accuracy as a MDRE approach abstracting from code to UML/OCL. Our evaluation results in Section 3 support this claim, and also show that the AgileUML abstraction rules have been successfully transferred to the Mistral LLM via fine-tuning, to produce an LLM, LLM4Models, with similar abstraction quality to AgileUML, and substantially improving on the quality of an untrained LM.</p>
<p>Although the untrained LLM is able to produce formal specifications for simple source programs, we found that it had significant deficiencies for more general use in program abstraction:</p>
<list list-type="bullet">
<list-item><p>Creation of implicit-style specifications which are not well-suited for forward engineering.</p></list-item>
<list-item><p>Incorrect use of OCL types and syntax. For example, introducing a type <italic>Long</italic>, which is not in the OCL standard, and using the notation</p></list-item>
<list-item><p>x^p</p></list-item>
<list-item><p>for exponentiation, which is also not in the OCL standard.</p></list-item>
<list-item><p>Incompleteness, with only specific cases of the program functionality being expressed in the derived OCL, or with certain functions omitted. This particularly occurred with program aspects (such as file processing) not covered by the OCL standard.</p></list-item>
<list-item><p>Spurious elements being introduced, particularly additional restrictions on functionality via preconditions or invariants.</p></list-item>
</list>
<p>These issues were all reduced significantly by the use of fine-tuning to produce the LLM4Models LLM.</p>
<p>LLM4Models has superior usability compared to AgileUML, because no MDE technical knowledge is needed to use the LLM, instead a user only needs to know how to query the LLM with the standard prompt for reverse-engineering and the specific program to be analyzed.</p></sec>
<sec>
<title>4.5 Summary of contributions</title>
<p>In this paper, we have:</p>
<list list-type="order">
<list-item><p>Provided the first rigorous comparison of an MDRE program abstraction approach with LLM-based program abstraction.</p></list-item>
<list-item><p>Used an MDRE approach to fine-tune a general purpose LLM to enhance its accuracy and quality for reverse engineering in a re-engineering context.</p></list-item>
<list-item><p>Enabled reverse-engineering practitioners to use an LLM with a conversational interface for accurate program abstraction, in place of MDRE tools requiring specialized skills to utilize.</p></list-item>
</list></sec>
<sec>
<title>4.6 Future work and extensions</title>
<p>The work presented here may be extended in various directions:</p>
<list list-type="bullet">
<list-item><p>By using larger training datasets, a wider range of source programs may be brought into the scope of LLM4Models, in particular, Java or Python programs using specialized libraries and facilities could be handled.</p></list-item>
<list-item><p>The same approach could be used to address other source programming languages, such as COBOL and VB, for which AgileUML provides abstractors, but for which LLM program translation or reverse-engineering support is currently lacking (Gandhi et al., <xref ref-type="bibr" rid="B9">2024</xref>).</p></list-item>
<list-item><p>Further post-processing checks and corrections could be applied to detect and remove spurious model elements produced by the LLM, thus improving the consistency results.</p></list-item>
</list></sec></sec>
</body>
<back>
<sec sec-type="data-availability" id="s5">
<title>Data availability statement</title>
<p>The datasets presented in this study can be found in online repositories. The names of the repository/repositories and accession number(s) can be found in the article/supplementary material.</p>
</sec>
<sec sec-type="author-contributions" id="s6">
<title>Author contributions</title>
<p>HS: Writing &#x02013; original draft, Writing &#x02013; review &#x00026; editing. KL: Writing &#x02013; original draft, Writing &#x02013; review &#x00026; editing.</p>
</sec>
<sec sec-type="funding-information" id="s7">
<title>Funding</title>
<p>The author(s) declare that no financial support was received for the research and/or publication of this article.</p>
</sec>
<ack><p>Hanan Siala would like to thank the Libyan Ministry of Higher Education and Scientific Research for its financial support.</p>
</ack>
<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="ai-statement" id="s8">
<title>Generative AI statement</title>
<p>The author(s) declare that no Gen AI was used in the creation of this manuscript.</p></sec>
<sec sec-type="disclaimer" id="s9">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<fn-group>
<fn id="fn0001"><p><sup>1</sup><ext-link ext-link-type="uri" xlink:href="https://huggingface.co/mistralai/Mistral-7B-v0.3">https://huggingface.co/mistralai/Mistral-7B-v0.3</ext-link></p></fn>
<fn id="fn0002"><p><sup>2</sup><ext-link ext-link-type="uri" xlink:href="https://github.com/wasiahmad/AVATAR">https://github.com/wasiahmad/AVATAR</ext-link></p></fn>
<fn id="fn0003"><p><sup>3</sup><ext-link ext-link-type="uri" xlink:href="https://projects.eclipse.org/projects/modeling.agileuml">https://projects.eclipse.org/projects/modeling.agileuml</ext-link> (Accessed August 1, 2024).</p></fn>
<fn id="fn0004"><p><sup>4</sup><ext-link ext-link-type="uri" xlink:href="https://github.com/antlr/grammars-v4">https://github.com/antlr/grammars-v4</ext-link></p></fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ahmad</surname> <given-names>W.</given-names></name> <name><surname>Tushar</surname> <given-names>M.</given-names></name> <name><surname>Chakraborty</surname> <given-names>S.</given-names></name> <name><surname>Chang</surname> <given-names>K.-W.</given-names></name></person-group> (<year>2023</year>). <article-title>AVATAR: a parallel corpus for Java-Python program translation</article-title>. <source>arXiv</source> [Preprint]. arXiv:2108.11590. <pub-id pub-id-type="doi">10.48550/arXiv.2108.11590</pub-id></citation>
</ref>
<ref id="B2">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Boronat</surname> <given-names>A.</given-names></name> <name><surname>Mustafa</surname> <given-names>J.</given-names></name></person-group> (<year>2025</year>). <article-title>&#x0201C;MDRE-LLM: a tool for analysing and applying LLMs in software reverse engineering,&#x0201D;</article-title> in <source>SANER &#x02018;25</source> (<publisher-loc>Montreal, QC</publisher-loc>: <publisher-name>IEEE</publisher-name>). <pub-id pub-id-type="doi">10.1109/SANER64311.2025.00090</pub-id></citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bowen</surname> <given-names>J.</given-names></name> <name><surname>Breuer</surname> <given-names>P.</given-names></name> <name><surname>Lano</surname> <given-names>K.</given-names></name></person-group> (<year>1993a</year>). <article-title>A compendium of formal techniques for software maintenance</article-title>. <source>IEE/BCS Softw. Eng. J</source>. <volume>8</volume>, <fpage>253</fpage>&#x02013;<lpage>262</lpage>. <pub-id pub-id-type="doi">10.1049/sej.1993.0031</pub-id></citation>
</ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bowen</surname> <given-names>J. P.</given-names></name> <name><surname>Breuer</surname> <given-names>P.</given-names></name> <name><surname>Lano</surname> <given-names>K.</given-names></name></person-group> (<year>1993b</year>). <article-title>Formal specifications in software maintenance: from code to Z&#x0002B;&#x0002B; and back again</article-title>. <source>Inf. Softw. Technol</source>. <volume>35</volume>, <fpage>679</fpage>&#x02013;<lpage>690</lpage>. <pub-id pub-id-type="doi">10.1016/0950-5849(93)90083-F</pub-id></citation>
</ref>
<ref id="B5">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Buttner</surname> <given-names>F.</given-names></name> <name><surname>Gogolla</surname> <given-names>M.</given-names></name></person-group> (<year>2014</year>). <article-title>On OCL-based imperative languages</article-title>. <source>Sci. Comput. Program</source>. <volume>92</volume>, <fpage>162</fpage>&#x02013;<lpage>178</lpage>. <pub-id pub-id-type="doi">10.1016/j.scico.2013.10.003</pub-id></citation>
</ref>
<ref id="B6">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Chen</surname> <given-names>X.</given-names></name> <name><surname>Liu</surname> <given-names>C.</given-names></name> <name><surname>Song</surname> <given-names>D.</given-names></name></person-group> (<year>2018</year>). <article-title>&#x0201C;Tree-to-tree neural networks for program translation,&#x0201D;</article-title> in <source>Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS&#x00027;18</source> (<publisher-loc>Red Hook, NY</publisher-loc>: <publisher-name>Curran Associates Inc</publisher-name>), <fpage>2552</fpage>&#x02013;<lpage>2562</lpage>.</citation>
</ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Deltombe</surname> <given-names>G.</given-names></name> <name><surname>Goaer</surname> <given-names>O. L.</given-names></name> <name><surname>Barbier</surname> <given-names>F.</given-names></name></person-group> (<year>2012</year>). <article-title>&#x0201C;Bridging KDM and ASTM for model-driven software modernization,&#x0201D;</article-title> in <source>SEKE</source> 2012 (Pau).</citation>
</ref>
<ref id="B8">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Dettmers</surname> <given-names>T.</given-names></name> <name><surname>Pagnoni</surname> <given-names>A.</given-names></name> <name><surname>Holtzman</surname> <given-names>A.</given-names></name> <name><surname>Zettlemoyer</surname> <given-names>L.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;QLoRA: efficient fine-tuning of quantized LLMs,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems, Vol. 36</source> (<publisher-loc>Cambridge, MA</publisher-loc>: <publisher-name>MIT Press</publisher-name>).<pub-id pub-id-type="pmid">39523408</pub-id></citation></ref>
<ref id="B9">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Gandhi</surname> <given-names>S.</given-names></name> <name><surname>Patwardhan</surname> <given-names>M.</given-names></name> <name><surname>Khatri</surname> <given-names>J.</given-names></name> <name><surname>Vig</surname> <given-names>L.</given-names></name> <name><surname>Medicherla</surname> <given-names>R. K.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Translation of low-resource COBOL to logically-correct and readable Java leveraging high-resource Java refinement,&#x0201D;</article-title> in <source>LLM4Code</source> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>IEEE</publisher-name>). <pub-id pub-id-type="doi">10.1145/3643795.3648388</pub-id></citation>
</ref>
<ref id="B10">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Guo</surname> <given-names>D.</given-names></name> <name><surname>Ren</surname> <given-names>S.</given-names></name> <name><surname>Lu</surname> <given-names>S.</given-names></name> <name><surname>Feng</surname> <given-names>Z.</given-names></name> <name><surname>Tang</surname> <given-names>D.</given-names></name> <name><surname>Liu</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2021</year>). <article-title>&#x0201C;GraphCodeBERT: pre-training code representations with dataflow,&#x0201D;</article-title> in <source>ICLR 2021</source> (<publisher-loc>Cambridge, MA</publisher-loc>: <publisher-name>Microsoft Research</publisher-name>).</citation>
</ref>
<ref id="B11">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hou</surname> <given-names>X.</given-names></name> <name><surname>Zhao</surname> <given-names>Y.</given-names></name> <name><surname>Liu</surname> <given-names>Y.</given-names></name> <name><surname>Yang</surname> <given-names>Z.</given-names></name> <name><surname>Wang</surname> <given-names>K.</given-names></name> <name><surname>Li</surname> <given-names>L.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>LLMs for software engineering: a systematic literature review</article-title>. <source>arXiv</source> [Preprint]. arXiv:2308.10620. <pub-id pub-id-type="doi">10.48550/arXiv.2308.10620</pub-id></citation>
</ref>
<ref id="B12">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Hu</surname> <given-names>E.</given-names></name> <name><surname>Shen</surname> <given-names>Y.</given-names></name> <name><surname>Wallis</surname> <given-names>P.</given-names></name> <name><surname>Allen-Zhu</surname> <given-names>Z.</given-names></name> <name><surname>Li</surname> <given-names>Y.</given-names></name> <name><surname>Wang</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2022</year>). <article-title>&#x0201C;LoRA: low-rank adaptation of large language models,&#x0201D;</article-title> in <source>ICLR 2022</source> (<publisher-loc>Cambridge, MA</publisher-loc>: <publisher-name>Microsoft Research</publisher-name>).</citation>
</ref>
<ref id="B13">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jana</surname> <given-names>P.</given-names></name> <name><surname>Jha</surname> <given-names>P.</given-names></name> <name><surname>Ju</surname> <given-names>H.</given-names></name> <name><surname>Kishore</surname> <given-names>G.</given-names></name> <name><surname>Mahajan</surname> <given-names>A.</given-names></name> <name><surname>Ganesh</surname> <given-names>V.</given-names></name></person-group> (<year>2023</year>). <article-title>Attention, compilation, and solver-based symbolic analysis are all you need</article-title>. <source>arXiv</source> [Preprint]. arXiv:2306.06755. <pub-id pub-id-type="doi">10.48550/arXiv.2306.06755</pub-id></citation>
</ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jiang</surname> <given-names>A. Q.</given-names></name> <name><surname>Sablayrolles</surname> <given-names>A.</given-names></name> <name><surname>Mensch</surname> <given-names>A.</given-names></name> <name><surname>Bamford</surname> <given-names>C.</given-names></name> <name><surname>Chaplot</surname> <given-names>D. S.</given-names></name> <name><surname>Casas</surname> <given-names>D.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Mistral 7b</article-title>. <source>arXiv</source> [Preprint]. arXiv:2310.06825. <pub-id pub-id-type="doi">10.48550/arXiv.2310.06825</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Krasteva</surname> <given-names>I.</given-names></name> <name><surname>Stavru</surname> <given-names>S.</given-names></name> <name><surname>Ilieva</surname> <given-names>S.</given-names></name></person-group> (<year>2013</year>). <article-title>&#x0201C;Agile software modernization to the service cloud,&#x0201D;</article-title> in <source>ICIW 2013</source> (<publisher-loc>Rome</publisher-loc>), <fpage>1</fpage>&#x02013;<lpage>9</lpage>.</citation>
</ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lachaux</surname> <given-names>M.-A.</given-names></name> <name><surname>Roziere</surname> <given-names>B.</given-names></name> <name><surname>Chanussot</surname> <given-names>L.</given-names></name> <name><surname>Lample</surname> <given-names>G.</given-names></name></person-group> (<year>2020</year>). <article-title>Unsupervised translation of programming languages</article-title>. <source>arXiv</source> [Preprint]. arXiv:2006.03511. <pub-id pub-id-type="doi">10.48550/arXiv.2006.03511</pub-id><pub-id pub-id-type="pmid">34251627</pub-id></citation></ref>
<ref id="B17">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Haughton</surname> <given-names>H.</given-names></name> <name><surname>Yuan</surname> <given-names>Z.</given-names></name> <name><surname>Alfraihi</surname> <given-names>H.</given-names></name></person-group> (<year>2024</year>). <article-title>Agile model-driven re-engineering</article-title>. <source>Innov. Syst. Softw. Eng</source>. <volume>20</volume>, <fpage>559</fpage>&#x02013;<lpage>584</lpage>. <pub-id pub-id-type="doi">10.1007/s11334-024-00568-z</pub-id></citation>
</ref>
<ref id="B18">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Kolahdouz-Rahimi</surname> <given-names>S.</given-names></name> <name><surname>Jin</surname> <given-names>K.</given-names></name></person-group> (<year>2022</year>). <article-title>&#x0201C;OCL libraries for software specification and representation,&#x0201D;</article-title> in <source>OCL 2022, MODELS 2022 Companion Proceedings</source> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>ACM</publisher-name>). <pub-id pub-id-type="doi">10.1145/3550356.3561565</pub-id></citation>
</ref>
<ref id="B19">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Malik</surname> <given-names>N.</given-names></name></person-group> (<year>1999</year>). <article-title>Mapping procedural patterns to object-oriented design patterns</article-title>. <source>Autom. Softw. Eng</source>. <volume>6</volume>, <fpage>265</fpage>&#x02013;<lpage>289</lpage>. <pub-id pub-id-type="doi">10.1023/A:1008708927260</pub-id></citation>
</ref>
<ref id="B20">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Siala</surname> <given-names>H. A.</given-names></name></person-group> (<year>2024a</year>). <article-title>Using MDE to automate software language translation</article-title>. <source>Autom. Softw. Eng</source>. <volume>31</volume>:<fpage>20</fpage>. <pub-id pub-id-type="doi">10.1007/s10515-024-00419-y</pub-id></citation>
</ref>
<ref id="B21">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Siala</surname> <given-names>H. A.</given-names></name></person-group> (<year>2024b</year>). <article-title>&#x0201C;Using OCL for verified re-engineering,&#x0201D;</article-title> in <source>MoDeVVa 2024, MODELS 2024</source> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>ACM</publisher-name>). <pub-id pub-id-type="doi">10.1145/3652620.3687824</pub-id></citation>
</ref>
<ref id="B22">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Li</surname> <given-names>X.</given-names></name> <name><surname>Yuan</surname> <given-names>S.</given-names></name> <name><surname>Gu</surname> <given-names>X.</given-names></name> <name><surname>Chen</surname> <given-names>Y.</given-names></name> <name><surname>Shen</surname> <given-names>B.</given-names></name></person-group> (<year>2024</year>). <article-title>Few-shot code translation via task-adapted prompt learning</article-title>. <source>J. Syst. Softw</source>. <volume>212</volume>:<fpage>112002</fpage>. <pub-id pub-id-type="doi">10.1016/j.jss.2024.112002</pub-id></citation>
</ref>
<ref id="B23">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>X.</given-names></name> <name><surname>Yang</surname> <given-names>H.</given-names></name> <name><surname>Zedan</surname> <given-names>H.</given-names></name></person-group> (<year>1997</year>). <article-title>&#x0201C;Formal methods for the re-engineering of computing systems,&#x0201D;</article-title> in <source>Compsac &#x02018;97</source> (<publisher-loc>Washington, DC</publisher-loc>: <publisher-name>IEEE</publisher-name>). <pub-id pub-id-type="doi">10.1109/CMPSAC.1997.625024</pub-id></citation>
</ref>
<ref id="B24">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Malyaya</surname> <given-names>A.</given-names></name> <name><surname>Zhou</surname> <given-names>K.</given-names></name> <name><surname>Ray</surname> <given-names>B.</given-names></name> <name><surname>Chakraborty</surname> <given-names>S.</given-names></name></person-group> (<year>2023</year>). <article-title>On ML-based program translation: perils and promises</article-title>. <source>arXiv</source> [Preprint]. arXiv:2302.10812. <pub-id pub-id-type="doi">10.48550/arXiv:2302.10812</pub-id></citation>
</ref>
<ref id="B25">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Marco</surname> <given-names>A. D.</given-names></name> <name><surname>Iancu</surname> <given-names>V.</given-names></name> <name><surname>Asinofsky</surname> <given-names>I.</given-names></name></person-group> (<year>2018</year>). <article-title>&#x0201C;COBOL to Java and newspapers still get delivered,&#x0201D;</article-title> in <source>Proceedings IEEE International Conference on Software Maintenance and Evolution</source> (<publisher-loc>Madrid</publisher-loc>: <publisher-name>IEEE Press</publisher-name>), <fpage>583</fpage>&#x02013;<lpage>586</lpage>. <pub-id pub-id-type="doi">10.1109/ICSME.2018.00055</pub-id></citation>
</ref>
<ref id="B26">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Nguyen</surname> <given-names>A. T.</given-names></name> <name><surname>Nguyen</surname> <given-names>T. T.</given-names></name> <name><surname>Nguyen</surname> <given-names>T. N.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;Divide-and-conquer approach for multi-phase statistical migration for source code,&#x0201D;</article-title> in <source>Proceedings of the 30th IEEE/ACM International Conference on Automated Software Engineering, ASE &#x00027;15</source> (<publisher-loc>Lincoln, NE</publisher-loc>: <publisher-name>IEEE Press</publisher-name>), <fpage>585</fpage>&#x02013;<lpage>596</lpage>. <pub-id pub-id-type="doi">10.1109/ASE.2015.74</pub-id></citation>
</ref>
<ref id="B27">
<citation citation-type="journal"><person-group person-group-type="author"><collab>OMG</collab></person-group> (<year>2014</year>). <source>Object Constraint Language (OCL) 2.4 Specification</source>. Milford, MA.</citation>
</ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ouyang</surname> <given-names>S.</given-names></name> <name><surname>Zhang</surname> <given-names>J.</given-names></name> <name><surname>Harman</surname> <given-names>M.</given-names></name> <name><surname>Wang</surname> <given-names>M.</given-names></name></person-group> (<year>2023</year>). <article-title>LLM is like a box of chocolates: the non-determinism of ChatGPT in code generation</article-title>. <source>arXiv</source> [Preprint]. arXiv:2308.02828. <pub-id pub-id-type="doi">10.48550/arXiv.2308.02828</pub-id></citation>
</ref>
<ref id="B29">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Perez-Castillo</surname> <given-names>R.</given-names></name> <name><surname>de Guzman</surname> <given-names>I. G.-R.</given-names></name> <name><surname>Piattini</surname> <given-names>M.</given-names></name></person-group> (<year>2010</year>). <article-title>&#x0201C;Implementing business process recovery patterns through QVT transformations,&#x0201D;</article-title> in <source>ICMT 2010</source> (<publisher-loc>Cham</publisher-loc>: <publisher-name>Springer</publisher-name>). <pub-id pub-id-type="doi">10.1007/978-3-642-13688-7_12</pub-id></citation>
</ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Perez-Castillo</surname> <given-names>R.</given-names></name> <name><surname>de Guzman</surname> <given-names>I. G.-R.</given-names></name> <name><surname>Piattini</surname> <given-names>M.</given-names></name></person-group> (<year>2011</year>). <article-title>Knowledge discovery metamodel ISO/IEC 19506: a standard to modernize legacy systems</article-title>. <source>Comput. Standar Interfaces</source> <volume>33</volume>, <fpage>519</fpage>&#x02013;<lpage>532</lpage>. <pub-id pub-id-type="doi">10.1016/j.csi.2011.02.007</pub-id></citation>
</ref>
<ref id="B31">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Siala</surname> <given-names>H. A.</given-names></name></person-group> (<year>2024</year>). <article-title>&#x0201C;Enhancing model-driven reverse-engineering using machine learning,&#x0201D;</article-title> in <source>Doctorial Symposium, ICSE 2024</source> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>ACM</publisher-name>). <pub-id pub-id-type="doi">10.1145/3639478.3639797</pub-id></citation>
</ref>
<ref id="B32">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Siala</surname> <given-names>H. A.</given-names></name> <name><surname>Lano</surname> <given-names>K.</given-names></name></person-group> (<year>2025</year>). <article-title>&#x0201C;Using LLMs to extract OCL specifications from Java and Python programs: an empirical study,&#x0201D;</article-title> in <source>Proceedings of the STAF 2025 Workshops: OCL 2025</source> (<publisher-loc>CEUR; RWTH</publisher-loc>).</citation>
</ref>
<ref id="B33">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Siala</surname> <given-names>H. A.</given-names></name> <name><surname>Lano</surname> <given-names>K.</given-names></name> <name><surname>Alfraihi</surname> <given-names>H.</given-names></name></person-group> (<year>2024</year>). <article-title>Model-driven approaches for reverse engineering-a systematic literature review</article-title>. <source>IEEE Access</source> <volume>12</volume>, <fpage>62558</fpage>&#x02013;<lpage>62580</lpage>. <pub-id pub-id-type="doi">10.1109/ACCESS.2024.3394732</pub-id></citation>
</ref>
<ref id="B34">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Sneed</surname> <given-names>H.</given-names></name></person-group> (<year>2011</year>). <article-title>&#x0201C;Migrating from COBOL to Java: a report from the field,&#x0201D;</article-title> in <source>IEEE Proc. of 26th ICSM</source> (<publisher-loc>Timisoara</publisher-loc>: <publisher-name>IEEE Press</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>7</lpage>. <pub-id pub-id-type="doi">10.1109/ICSM.2010.5609583</pub-id></citation>
</ref>
<ref id="B35">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Sneed</surname> <given-names>H.</given-names></name> <name><surname>Jandrasics</surname> <given-names>G.</given-names></name></person-group> (<year>1987</year>). <article-title>&#x0201C;Inverse transformation of software from code to specification,&#x0201D;</article-title> in <source>IEEE Conf. Soft. Maintenance</source> (<publisher-loc>Scottsdale, AZ</publisher-loc>: <publisher-name>IEEE</publisher-name>). <pub-id pub-id-type="doi">10.1109/ICSM.1988.10149</pub-id><pub-id pub-id-type="pmid">24289899</pub-id></citation></ref>
<ref id="B36">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Szafraniec</surname> <given-names>M.</given-names></name> <name><surname>Roziere</surname> <given-names>B.</given-names></name> <name><surname>Leather</surname> <given-names>H.</given-names></name> <name><surname>Charton</surname> <given-names>F.</given-names></name> <name><surname>Labatut</surname> <given-names>P.</given-names></name> <name><surname>Synnaeve</surname> <given-names>G.</given-names></name></person-group> (<year>2023</year>). <article-title>Code translations with compiler representations</article-title>. <source>arXiv</source> [Preprint]. arXiv:2207.03578. <pub-id pub-id-type="doi">10.48550/arXiv.2207.03578</pub-id></citation>
</ref>
<ref id="B37">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>C.</given-names></name> <name><surname>Wang</surname> <given-names>J.</given-names></name> <name><surname>Zhou</surname> <given-names>Q.</given-names></name> <name><surname>Xu</surname> <given-names>T.</given-names></name> <name><surname>Tang</surname> <given-names>K.</given-names></name> <name><surname>Gui</surname> <given-names>H.</given-names></name> <etal/></person-group>. (<year>2022</year>). <article-title>A survey of automated code summarization</article-title>. <source>Symmetry</source> <volume>14</volume>:<fpage>471</fpage>. <pub-id pub-id-type="doi">10.3390/sym14030471</pub-id></citation>
</ref>
<ref id="B38">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhao</surname> <given-names>W.</given-names></name> <name><surname>Zhou</surname> <given-names>K.</given-names></name> <name><surname>Li</surname> <given-names>J.</given-names></name> <name><surname>Tang</surname> <given-names>T.</given-names></name> <name><surname>Wang</surname> <given-names>X.</given-names></name> <name><surname>Hou</surname> <given-names>Y.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>A survey of large language models</article-title>. <source>arXiv</source> [Preprint]. arXiv:2303.18223. <pub-id pub-id-type="doi">10.48550/arXiv.2303.18223</pub-id></citation>
</ref>
<ref id="B39">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhu</surname> <given-names>M.</given-names></name> <name><surname>Suresh</surname> <given-names>K.</given-names></name> <name><surname>Reddy</surname> <given-names>C.</given-names></name></person-group> (<year>2022</year>). <article-title>Multilingual code snippets training for program translation</article-title>. <source>Proc. AAAI Conf. Artif. Intell</source>. <volume>36</volume>, <fpage>11783</fpage>&#x02013;<lpage>11790</lpage>. <pub-id pub-id-type="doi">10.1609/aaai.v36i10.21434</pub-id></citation>
</ref>
</ref-list>
</back>
</article> 