Method for functional analysis of a source system
The method decomposes syntax trees and program code data into embeddings to identify functional units, addressing the limitations of existing methods by enhancing accuracy and reducing resource consumption, enabling comprehensive functional descriptions across diverse systems.
Patent Information
- Application Number
- PCT/AT2025/060255
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-25
- Filing Date
- 2025-06-24
- Publication Date
- 2026-01-02
AI Technical Summary
Existing methods for automated functional analysis of computer-implemented systems fail to adequately recognize related functional elements and achieve low abstraction levels, requiring manual intervention, especially with extensive program code data, due to limited dataset sizes and inaccuracies in large language models.
A method involving syntax and language embedding models to decompose syntax trees and program code data into individual embeddings, using similarity measures to identify related functional units, and generating comprehensive function descriptions with reduced resource consumption, incorporating additional documentation and utilizing a generic abstract syntax tree model to analyze diverse systems.
Enables efficient decomposition and comprehensive functional description of large program code data with reduced resources, improving accuracy and adaptability across different system architectures.
Smart Images

Figure AT2025060255_02012026_PF_FP_ABST
Abstract
Description
[0001] Procedures for one
[0002] Technical field
[0003] The invention relates to a method for functional analysis of a source system, wherein a syntax tree model is generated from the program code data of the source system.
[0004] State of the art
[0005] For the automated functional analysis of computer-implemented systems, it is known, for example, from US20220261241A1, to create a syntax tree from the system's program code data and to generate a function description text in natural language using a neural network. The neural network is trained using both known specifications of the programming language employed and a training set of open-source program code databases. A disadvantage of such a method is that it does not consider the documentation derived from the syntax tree, recognizes related functional elements only inadequately, and the function description text in natural language achieves only a low level of abstraction, so that manual analysis of the program code is often necessary.
[0006] US20240020116A1 discloses a method for generating natural language elements based on program code data from a system. A machine learning model is trained using program code data with known functionality and natural language elements associated with that program code data. Natural language elements are then generated from unknown program code data. Based on these generated elements, summaries, code documentation, or translations can be created using a large language model. Additionally, program code data can be generated from a natural language query. A disadvantage of this method is that it can only recognize language elements with a pre-known function.
[0007] Furthermore, it has already been proposed to generate a functional analysis of program code data directly through inference with a large language model. However, disadvantages of this approach include, on the one hand, the limited size of the inference dataset and, on the other hand, the hallucinations and inaccuracies in the functional description typical of large language models, which make the functional analysis of source systems with extensive program code data impossible.
[0008] Description of the invention
[0009] The invention is therefore based on the objective of proposing a method for the functional analysis of a source system of the type described above, in particular with extensive program code data, which makes it possible to better identify related functional units and to improve further processing by a large language model while maintaining high result quality and simultaneously requiring low resources.
[0010] The invention solves the stated problem by generating a syntax embedding model by a syntax analysis unit by decomposing the syntax tree model into individual syntax element embeddings, each representing a syntax element, and storing them in a syntax embedding model memory; and by generating a language embedding model by a language analysis unit by decomposing the program code data into individual language element embeddings, each representing a language element, and storing them in a language embedding model memory; after which a query unit generates at least one query embedding from a query representing a functional element of the source system; and retrieves from the syntax embedding model memory and the language embedding model memory those syntax element embeddings and language element embeddings that lie within a predefined similarity range to the query embedding.The syntax elements represented by the retrieved syntax element embeddings and the language elements represented by the retrieved language element embeddings are then passed as result elements to an output unit, which generates and outputs a function description record. As a result of these measures, even very large program code data can be decomposed into smaller function elements, both with regard to the program logic and any comments and documentation in natural language contained within the program code. The result elements characterize the aspects of the respective function element so comprehensively, even in distributed program code segments, that a complete function description record can be generated despite reduced resource consumption. The query unit can preferably generate two query embeddings from the query.where one query embedding can be provided for the language embedding model and one query embedding for the syntax embedding model. This is particularly necessary when the dimensions of the embedding models differ. Key-value mappings, which assign syntax and language elements to individual keys, can be used as the simplest embedding models. Vector space models can also be used as embedding models, so that the language and syntax element embeddings are implemented accordingly as language and syntax element vectors. In the case of vector space models as embedding models, the query embeddings can be implemented as query vectors, where the dimension of a first query vector corresponds to the dimension of the language vector space and the dimension of a second query vector corresponds to the dimension of the syntax vector space. Finally, graph embedding models can also be used as embedding models.The individual syntax and language elements are mapped via their relationships to other syntax and language elements. The similarity range, in particular the distance between the language and syntax element embeddings on the one hand and the respective query embeddings on the other, can be determined, especially in the embodiment of vector space models, for example, by their cosine similarity. Alternatively, other similarity measures, such as the Jaro-Winkler distance, the Levenshtein distance, or the Jaccard index, can be used to determine those language and syntax element embeddings that lie within a given similarity range to the query embeddings. The similarity range can also be determined, for example, by...that a number of syntax or language element embeddings, ranked in ascending order according to their distance from the respective query embedding, are specified. The program code data can include both functional commands in a programming language and documentation in natural language. The program code data can be retrieved from the source system.
[0011] To generate a complete functional description dataset despite incompletely documented program code data and architectural concepts extending beyond the pure program code data, it is proposed that the documentation data of the source system, at least partially available in natural language, be decomposed by the language analysis unit into individual language element embeddings, each representing a language element. These embeddings are then added to the language embedding model and stored in the language embedding model memory. This enriches the language element embeddings already present in the language embedding model memory and assignable to individual program code sections with additional information. This additional information is not derived from the program code data itself, but from other documentation data, such as specifications, project documentation, case management system data, or manuals.
[0012] To address potential gaps in the syntax and language elements, which are considered
[0013] To populate the output unit with result elements and resolve overly precise or contradictory information, the output unit can generate an inference dataset for a large language model from the result elements and pass it to an inference platform. The inference response is then output as a function description dataset. This has the advantage that a relatively small, yet highly specific inference dataset can be generated from the result elements, preventing potential hallucinations arising from the large language model. This allows the respective inference platform to be used more reliably to reduce the level of abstraction of the result elements, resolve potential contradictions using generally available information, or fill in gaps.Furthermore, the inference dataset allows the inference response to be adapted as a function description dataset to a target system that may differ in its architecture from the source system. Large language models such as generative pre-trained transformers (GPTs) can be used.
[0014] To enable the applicability of the method according to the invention to different source systems, it is proposed that the syntax tree model be programming language-independent, in particular a Generic Abstract Syntax Tree Metamodel (GASTM). This has the advantage that the syntax tree model, and thus also the syntax embedding model memory, can be constructed and reused independently of the programming language used. A syntax element can comprise one or more nodes of the syntax tree model, which preferably form functional relationships or a functional unit.
[0015] A complete mapping of functions relevant to the source system can be achieved if a generator unit selects function elements of the source system from the syntax tree model based on predefined rules and generates a query for each function element to be passed to the query unit. As a result of these measures, the individual function elements of the source system are systematically selected from the syntax tree model based on their syntax elements. The predefined rules can be based, for example, on specific flow patterns in call and stack tracing or on other syntactic relationships. The use of such rules makes it possible to analyze different source systems according to a common system with regard to their function and to generate function description data records for the individual function elements.
[0016] Although it may generally be sufficient in a preferred embodiment to provide machine-readable information in a markup language within the function description data set, the inventive method can improve simple porting between different system architectures if the function description data sets include program code data for a target system whose architecture differs from that of the source system. Due to these features, the output unit provides a function description data set in a machine-readable language, which is preferably directly executable on the target system and stored in a program code memory of the target system. For this purpose, the program code data contained in the function description data set can be transferred to the target system.
[0017] Brief description of the invention
[0018] The invention is illustrated in the drawing, for example, in a schematic block diagram.
[0019] Ways to implement the invention
[0020] A method according to the invention comprises a source system 1, from whose program code data a syntax tree model 3 is generated using a syntax tree generator 2. By decomposing the syntax tree model 3, several syntax element embeddings 5, each representing a syntax element, can be generated by a syntax analysis unit 4 and stored in a syntax embedding model in a syntax embedding model memory 6. In parallel, language element embeddings 9 can be generated in a language analysis unit 8 from both the program code data of the source system 1 and from documentation data 7 of the source system 1 that is in natural language and stored in a language embedding model in a language embedding model memory 10.
[0021] Based on a query 11, several query embeddings 13 can be generated in a query unit 12, the dimension of which in a preferred embodiment corresponds to the dimension of the language or
[0022] This corresponds to the syntax embedding model. From the syntax embedding model memory 6 and the language embedding model memory 10, those syntax element embeddings 5 and language element embeddings 9 that lie within a predefined similarity range, in particular at a predefined distance, to the query embeddings 13 are then retrieved and passed as result elements 14 to an output unit 15. In the output unit 15, a function description data record 16 is then generated from the result elements 14.
[0023] Preferably, the output unit 15 can first generate an inference data set 17 for a large language model from the received result elements 14 and transfer it to an inference platform 18. The inference response 19 can then be used in the output unit 15 to create the function description data set 16, in particular to form the function description data set 16.
[0024] In the embodiment shown, the query 11 can be created in a generator unit 20 based on the functional elements of the syntax tree model 3.
[0025] The functional description data set 16 resulting from the procedure can include program code data for a target system 21 that differs in its architecture from the source system 1.
Claims
Patent claims 1. A method for functional analysis of a source system (1), wherein a syntax tree model (3) is generated from the program code data of the source system (1), characterized in that a syntax embedding model is generated by a syntax analysis unit (4) by decomposing the syntax tree model (3) into individual syntax element embeddings (5), each representing a syntax element, and stored in a syntax embedding model memory (6), and that a language analysis unit (8) generates a language embedding model by decomposing the program code data into individual language element embeddings (9), each representing a language element, and stored in a language embedding model memory (10), after which a query unit (12) retrieves the program code data from a language embedding model.a query (11) representing a functional element of the source system (1) generates at least one query embedding (13) and retrieves from the syntax embedding model memory (6) and the language embedding model memory (10) those syntax element embeddings (5) and language element embeddings (9) that lie within a predefined area of similarity to the query embedding (13), after which the syntax elements represented by the retrieved syntax element embeddings (5) and the language elements represented by the retrieved language element embeddings (9) are passed as result elements (14) to an output unit (15), which generates and outputs a function description record (16) from them.
2. Method according to claim 1, characterized in that documentation data (7) of the source system (1), which is at least partially in natural language, is decomposed by the language analysis unit (8) into individual language element embeddings (9), each representing a language element, which are added to the language embedding model and stored in the language embedding model memory (10).
3. Method according to one of claims 1 or 2, characterized in that the output unit (15) generates an inference data set (17) for a large language model from the result elements (14) and passes it to an inference platform (18), after which the inference response (19) is output as a function description data set (16).
4. Method according to one of claims 1 to 3, characterized in that the syntax tree model is a generic abstract syntax tree metamodel.
5. Method according to one of claims 1 to 4, characterized in that a generator unit (20) selects functional elements of the source system (1) from the syntax tree model according to predefined rules and generates a query (11) for each functional element for transfer to the query unit (12).
6. Method according to one of claims 1 to 5, characterized in that the function description data set (16) comprises program code data for a target system (21) which differs in its architecture from the source system (1).
Citation Information
Patent Citations
Methods and systems for automated software natural language documentation
US20220261241A1
Systems and methods for generating natural language using language models trained on computer code
US20240020116A1