Method, system and computer program product for attributing source code, and method and system for enhancing source code verification (code verification and attribution using semantic analysis)
The use of ASTs and GNNs for source code attribution and verification addresses the limitations of conventional methods, ensuring accurate and adaptive code attribution and enhancement across complex coding scenarios.
Patent Information
- Application Number
- JP2025111092
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-03
- Filing Date
- 2025-06-30
- Publication Date
- 2026-01-19
AI Technical Summary
Conventional source code attribution and verification methods struggle with nuanced coding styles, mixed human- and AI-generated code, cross-language codebases, scalability, and adaptability, failing to provide actionable feedback and automated corrective actions.
A method and system using Abstract Syntax Trees (AST) and graph neural networks (GNNs) to normalize and convert source code into vector embeddings, generate unique fingerprints, and perform robustness testing to ensure accurate attribution and provide feedback and corrective actions.
Enables accurate attribution of human-authored and AI-generated code across diverse languages, ensuring code integrity, maintainability, and security by providing actionable insights and automated improvements.
Smart Images

Figure 2026009021000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates generally to systems and methods for processing and analyzing source code, and more particularly to systems and methods for identifying and attributing source code using abstract syntax trees (ASTs), vector embeddings, and graph neural networks (GNNs) to determine coding patterns and authorship, verify code originality, provide feedback, and take automated corrective actions to enhance code quality and maintainability. [Background technology]
[0002] In the field of source code attribution and verification, traditional methods rely on syntactic analysis and direct code comparison techniques to identify and attribute source code. These methods focus on surface-level features such as text similarity, token matching, and simple syntactic patterns. Summary of the Invention [Problem to be solved by the invention]
[0003] While effective in some limited contexts, these methods face significant limitations when applied to relatively more complex scenarios, including, for example, nuanced coding styles, mixed human- and AI-generated code, and cross-language codebases. Conventional systems and methods struggle to accurately identify and attribute code that is obfuscated, heavily modified, or written in different programming languages. Additionally, such conventional systems and methods' reliance on predefined rules and static data sets poses significant challenges in scalability and adaptability, which only increase as coding practices and languages evolve and become more complex over time. Conventional systems and methods also fall short in providing actionable feedback to developers and implementing any automated corrective actions to improve code robustness and maintainability. These limitations highlight the need for advanced, dynamic, and extensible solutions that can perform deep semantic analysis and provide actionable insights across diverse and evolving codebases. [Means for solving the problem]
[0004] According to an embodiment of the present invention, there is provided a method for attributing source code, comprising: ingesting source code from multiple repositories, normalizing the ingested source code using an Abstract Syntax Tree (AST), and converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code. A unique fingerprint is generated from the vector embedding, and the fingerprint is compared against a vector database to identify potential matches and verify code attribution, and feedback and alternative code suggestions are provided based on the comparison of the fingerprints.
[0005] According to additional embodiments of the present invention, the method further includes analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions; removing comments and dead code during the normalizing the ingested source code, where the ingesting of source code includes collecting code from both public and private repositories; generating vector embeddings using a neural network model trained on a large corpus of code; generating a report summarizing the results of the attributing the source code, including a particular confidence level for the code attributions; performing robustness testing by creating and evaluating multiple code variants to ensure attribution accuracy under different code modifications; and providing feedback and alternative code suggestions, including recommending best practices for code maintainability and security.
[0006] According to another aspect of the present invention, there is provided a system for attributing source code, the system comprising: ingesting source code from multiple repositories; normalizing the ingested source code using an Abstract Syntax Tree (AST); and converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code. A unique fingerprint is generated from the vector embedding, and the fingerprint is compared against a vector database to identify potential matches and verify code attribution, and feedback and alternative code suggestions are provided based on the comparison of the fingerprints.
[0007] According to an additional embodiment of the present invention, the system includes a memory that stores instructions for performing the steps of: analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions; removing comments and dead code during the normalization of the ingested source code, wherein the ingesting of the source code includes collecting code from both public and private repositories; generating the vector embeddings using a neural network model trained on a large corpus of code; generating a report summarizing the results of the attributing the source code, including a particular confidence level for the code attributions; performing robustness tests by creating and evaluating multiple code variants to ensure accuracy of attributions under different code modifications; and recommendations for best practices in code maintainability and security in the feedback and alternative code suggestions provided by the system.
[0008] According to another aspect of the present invention, there is provided a computer program product for attributing source code, the computer program product comprising: ingesting source code from multiple repositories; normalizing the ingested source code using an Abstract Syntax Tree (AST); and converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code. A unique fingerprint is generated from the vector embedding, the fingerprint is compared against a vector database to identify potential matches and verify code attribution, and feedback and alternative code suggestions are provided based on the comparison of the fingerprints.
[0009] According to additional embodiments of the present invention, a computer program product includes program instructions for analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions; removing comments and dead code during the normalization of the ingested source code, the ingesting including collecting code from both public and private repositories; generating the vector embeddings using a neural network model trained on a large corpus of code; generating a report summarizing the results of the attributing the source code, including a specified confidence level for the code attributions; and performing robustness testing by creating and evaluating multiple code variants to ensure accuracy of attributions under different code modifications.
[0010] According to another aspect of the present invention, there is provided a method for enhancing source code verification, including ingesting source code from multiple sources; normalizing the ingested source code by employing an Abstract Syntax Tree (AST) to adjust syntactic formatting; converting the ingested source code into vector embeddings capable of representing syntactic and semantic characteristics; generating unique code identifiers from the vector embeddings; comparing the code identifiers in a vector database to identify potential source similarities and verify originality of the source code; and enhancing code integrity by generating corrective code fixes based on results of the comparing of the code identifiers.
[0011] According to additional embodiments of the present invention, the method further includes implementing an iterative normalization process during normalization of the ingested source code to gradually refine code structure, the ingested source code including both legacy and modern coding frameworks, and enhancing verification of code originality and source by analyzing the unique code identifiers using a graph neural network (GNN) to identify complex coding patterns and authorship characteristics.
[0012] According to another aspect of the present invention, there is provided a system for enhancing source code verification, including a processor device and memory storing instructions that, when executed by the processor device, cause the system to perform the following steps: ingesting source code from multiple sources; normalizing the ingested source code by employing an abstract syntax tree (AST) to adjust syntactic formatting; converting the ingested source code into vector embeddings capable of representing syntactic and semantic characteristics; generating unique code identifiers from the vector embeddings; comparing the code identifiers in a vector database to identify potential source similarities and verify the originality of the source code; and enhancing code integrity by generating corrective code fixes based on results of the comparing of the code identifiers.
[0013] According to additional embodiments of the present invention, the system stores instructions for implementing an iterative normalization process during the normalization of the ingested source code to incrementally improve code structure, the ingested source code including both legacy and modern coding frameworks.
[0014] These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which should be read in connection with the accompanying drawings. [Brief explanation of the drawings]
[0015] The following description provides details of preferred embodiments with reference to the following drawings:
[0016] [Figure 1] 1 is a block diagram illustrating an exemplary processing system to which the present invention may be applied, in accordance with an embodiment of the present invention.
[0017] [Figure 2] 1 is an exemplary diagram illustrating a method for creating a comprehensive knowledge base to perform code attribution analysis and recommendation generation in accordance with an embodiment of the present invention.
[0018] [Figure 3] 1 is an exemplary diagram illustrating a method for attributing source code, providing feedback for code improvement, and automatically taking corrective action, according to an embodiment of the present invention.
[0019] [Figure 4] 1 is an exemplary diagram illustrating a system and method for creating a comprehensive knowledge base, performing code attribution analysis and recommendation generation, and automatically taking corrective actions for a variety of real-world applications and environments, according to an embodiment of the present invention.
[0020] [Figure 5] 1 is an exemplary diagram illustrating a method for code attribution, complexity measurement, and alternative code recommendation generation in accordance with an embodiment of the present invention.
[0021] [Figure 6]1 is an exemplary diagram illustrating a system and method for identifying and attributing source code using Abstract Syntax Trees (ASTs), vector embeddings, and graph neural networks (GNNs) to determine coding patterns and authorship, verify code originality, provide feedback, and perform automated corrective actions to enhance code quality and maintainability, according to an embodiment of the present invention.
[0022] [Figure 7] 1 is an exemplary diagram illustrating a method, including exemplary pseudocode, for creating a comprehensive knowledge base to perform code attribution analysis and recommendation generation, according to an embodiment of the present invention.
[0023] [Figure 8] 1 is a diagram illustrating an exemplary processing system for improved source code verification, attribution, and execution of automated corrective actions, in accordance with an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0024] The present invention relates to the field of software development and code analysis, with a particular focus on source code verification and attribution using advanced semantic analysis and machine learning techniques.
[0025] According to an embodiment of the present invention, a system and method for source code verification and attribution using advanced semantic analysis and machine learning techniques is provided. This innovative system can efficiently identify and attribute both human-authored and AI-generated source code by analyzing the code's syntactic and semantic features. The present invention can integrate sophisticated neural network models and graph neural networks (GNNs) trained on diverse corpora of code to generate unique vector embeddings and fingerprints. These embeddings can capture deep semantic relationships within the code, enabling the system to perform complex pattern recognition and similarity detection across a variety of programming languages and coding styles.
[0026] In various embodiments, the present invention may be utilized to ensure originality and proper attribution of source code, addressing significant current challenges of distinguishing between human-authored and AI-generated code and managing cross-language codebases. The system may begin by ingesting source code from various repositories, including public and private sources. This code may then be normalized using an abstract syntax tree (AST), which may standardize syntactic structure and remove comments and dead code. The normalized code may be converted into vector embeddings that encapsulate both syntactic and semantic features to facilitate advanced pattern recognition.
[0027] The present invention can further process these embeddings to generate unique fingerprints for each code snippet. These fingerprints can be analyzed using GNNs to detect intricate coding patterns and authorship attribution. By comparing these fingerprints against a comprehensive vector database, the system can verify the originality and source of the code and identify potential matches and prior art. This comparison can be enhanced by advanced similarity search algorithms, such as cosine similarity or Euclidean distance.
[0028] The system may also perform robustness testing by iteratively creating and evaluating multiple code variants in real time (or over any selected time period) to ensure the accuracy of attribution under different modifications. In accordance with aspects of the invention, it may generate a comprehensive report summarizing findings, confidence levels, provide actionable feedback and alternative code suggestions to the developer, and / or automatically implement alternative code suggestions to improve the robustness, maintainability, and security of the code.
[0029] The present invention incorporates an adaptive learning mechanism that can continuously refine and enhance its accuracy based on feedback from the analysis and robustness testing phases. This adaptive learning ensures that the system remains effective and relevant in a rapidly evolving coding landscape. In addition, the system can use insights gained from previous steps to build a federated model, providing comprehensive educational guidance and improving the overall quality and security of the code. In accordance with aspects of the present invention, the present invention provides a robust and scalable solution for code verification, attribution, and / or implementation of automated corrective actions, thus offering significant advantages in maintaining the integrity of intellectual property, enhancing code quality, and supporting developers in adopting best coding practices.
[0030] Referring now to the drawings, in which like numerals represent the same or similar elements, and initially to FIG. 1 , an exemplary processing system 100 to which the present principles may be applied is illustratively shown in accordance with an embodiment of the present invention.
[0031] In some embodiments, processing system 100 may include at least one processor (CPU) 104 operably coupled to other components via a system bus 102. Cache 106, read only memory (ROM) 108, random access memory (RAM) 110, input / output (I / O) adapter 120, audio adapter 130, network adapter 140, user interface adapter 150, and display adapter 160 are operably coupled to system bus 102.
[0032] First storage device 122 and second storage device 124 are operably coupled to system bus 102 by I / O adapter 120. Storage devices 122 and 124 may be either disk storage devices (e.g., magnetic or optical disk storage devices), solid-state magnetic devices, etc. Storage devices 122 and 124 may be the same type of storage device or different types of storage devices.
[0033] Speakers 132 are operatively coupled to system bus 102 by audio adapter 130. Transceiver 142 is operatively coupled to system bus 102 by network adapter 140. Display device 162 is operatively coupled to system bus 102 by display adapter 160. A Vision Language (VL) model may be utilized in conjunction with a semantic search engine 164 for text and / or image processing tasks in accordance with aspects of the present invention, and may be further coupled to system bus 102 by any suitable connection system or method (e.g., Wi-Fi, wired, network adapter, etc.).
[0034] A first user input device 152 and a second user input device 154 are operably coupled to the system bus 102 by a user interface adapter 150. The user input devices 152, 154 may be one or more of any of the following: a keyboard, a mouse, a keypad, an image capture device, a motion-sensing device, a microphone, a device incorporating functionality of at least two of the preceding devices, etc. In accordance with aspects of the present invention, a system (ATTRICODE system) 156 for identifying and attributing source code using abstract syntax trees (ASTs), vector embeddings, and graph neural networks (GNNs) to determine coding patterns and authorship, verify code originality, provide feedback, and perform automated corrective actions to enhance code quality and maintainability may be included in a system having one or more storage devices, communication / network devices (e.g., WiFi, 4G, 5G, wired connectivity), hardware processors, etc. In various embodiments, other types of input devices may also be used while maintaining the spirit of the principles. The user input devices 152, 154 may be the same type of user input device or different types of user input devices. The user input devices 152, 154 are used for inputting and outputting information to and from the system 100 in accordance with aspects of the present invention. The ATTRICODE system 156 may process the received input in accordance with aspects of the present invention and may obtain data from any of several sources, including a code / vector database / repository 164 operatively connected to the system 100 for use in identifying and attributing source code using abstract syntax trees (ASTs), vector embeddings, and graph neural networks (GNNs) to determine coding patterns and authorship, verify the originality of the code, provide feedback, and perform automated corrective actions to enhance code quality and maintainability.
[0035] Of course, processing system 100 may include other elements (not shown) or omit certain elements as would be readily contemplated by one skilled in the art. For example, as would be readily understood by one skilled in the art, various other input or output devices, or combinations thereof, may be included in processing system 100, depending on its particular implementation. For example, various types of wireless and / or wired input and / or output devices may be used. Additional processors, controllers, memory, etc., in various configurations, may also be utilized, as would be readily understood by one skilled in the art. These and other variations of processing system 100 will be readily contemplated by one skilled in the art in view of the teachings of the present principles provided herein.
[0036] It should also be understood that systems 400, 600, and 800 described below with respect to Figures 4, 6, and 8 are each systems for implementing respective embodiments of the present invention. Portions or all of processing system 100 may be implemented in one or more of the elements of systems 400, 600, and 800 in accordance with aspects of the present invention. It should also be understood that processing system 100 may perform at least some of the methods described herein, including, for example, at least some of methods 200, 300, 400, 500, 600, and 700 described below with respect to Figures 2, 3, 4, 5, 6, and 7, respectively. Similarly, portions or all of systems 400, 600, and 800 may be used to perform at least some of methods 200, 300, 400, 500, 600, and 700 of Figures 2, 3, 4, 5, 6, and 7, respectively, in accordance with aspects of the present invention.
[0037] As employed herein, the terms “hardware processor subsystem,” “processor,” or “hardware processor” may refer to a processor, memory, software, or combination thereof that cooperate to perform one or more specific tasks. In useful embodiments, the hardware processor subsystem may include one or more data processing elements (e.g., logic circuits, processing circuits, instruction execution devices, etc.). The one or more data processing elements may be included in a central processing unit, a graphics processing unit, or a separate processor or computing element-based controller (e.g., logic gates, etc.), or a combination thereof. The hardware processor subsystem may include one or more on-board memories (e.g., cache, dedicated memory array, read-only memory, etc.). In some embodiments, the hardware processor subsystem may include one or more memories that may be on-board, off-board, or dedicated for use by the hardware processor subsystem (e.g., ROM, RAM, basic input / output system (BIOS), etc.).
[0038] In some embodiments, a hardware processor subsystem may include or execute one or more software elements, which may include an operating system, one or more applications, or both, and / or specific code for achieving a specified result. In other embodiments, a hardware processor subsystem may include dedicated, specialized circuitry that performs one or more electronic processing functions to achieve a specified result. Such circuitry may include one or more application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and / or programmable logic arrays (PLAs). These and other variations of hardware processor subsystems are also contemplated in accordance with embodiments of the present invention.
[0039] Referring now to FIG. 2, an exemplary method 200 for creating a comprehensive knowledge base to perform code attribution analysis and recommendation generation is shown in accordance with an embodiment of the present invention.
[0040] In various embodiments, in block 202, source code may be collected from various repositories, including GitHub, Bitbucket, GitLab, and internal private repositories maintained by an organization. This step may include acquiring the source code, which may then be standardized into a common format using an abstract syntax tree (AST). AST generation can occur even in the presence of syntax errors and may be dependency-free, allowing its runtime library to be embedded into any application. The collected code may include various programming languages and formats to ensure a comprehensive dataset. The standardization process may include normalizing code structure, removing comments and dead code, and harmonizing embeddings to ensure a consistent format for subsequent analysis. This step may further include creating a representative sample of both human-authored and AI-generated code to provide a foundation for subsequent analysis. The normalized code may then be stored in a centralized database and prepared for further processing.
[0041] In block 204, the ingested source code may undergo an initial assessment and cleanup process. This step may include identifying any corrupted files or unsupported formats that may need to be excluded from further analysis. The cleanup operation may remove non-code files, comments, and extraneous data that may skew the normalization process. This focuses on the functional aspects of the code, ensuring that the dataset is clean and suitable for further processing. In block 206, the cleaned source code may be normalized using an abstract syntax tree (AST). This process may involve analyzing the source code to create a tree representation that captures the syntactic structure of the code. An AST may be generated even in the presence of syntax errors, ensuring that all available code can be analyzed. The normalization process may also standardize code structure by unifying indentation, spacing, and brace style, and, where possible, standardizing naming conventions. Comments and dead code may be removed to focus on the functional aspects of the code.
[0042] In block 208, the normalized code (e.g., represented by the AST) may be converted into vector embeddings. These embeddings represent the syntactic and semantic features of the code in a multidimensional space. Techniques such as tokenization, indexing, and the use of neural networks may be employed to capture deep semantic relationships within the code. In various embodiments, these embeddings may capture both the syntactic and semantic features of the code, enabling sophisticated pattern recognition and similarity detection. The conversion process may utilize neural network models trained on relatively large corpora of code to convert the hierarchical structure of the AST into a numerical format that can be accurately and efficiently processed by machine learning algorithms. For example, an abstract syntax tree (AST) may be converted into a numerical vector that encodes structural and functional aspects of the code. This high-dimensional representation may be effectively utilized for advanced pattern recognition and similarity detection across different code snippets, facilitating a robust foundation for subsequent analysis.
[0043] In block 210, unique fingerprints can be derived and generated from the vector embeddings. These fingerprints encapsulate core attributes of the code, creating a distinctive identifier and / or summary that can be easily recognized and compared by computing systems, facilitating real-time comparison and analysis. Fingerprint generation can include hashing or other encoding techniques to ensure each piece of code has a unique and recognizable representation. These fingerprints can be used to track code across different repositories and versions, enabling accurate attribution. In block 212, fingerprints generated from the vector embeddings can be analyzed using a graph neural network (GNN). A GNN can leverage the fingerprints' graph-based structure to detect complex patterns and similarities for code attribution. A GNN can learn from connectivity patterns and features of the code base to identify coding styles and authorship attributes with high accuracy. A GNN can leverage the fingerprints' graph-based structure to detect complex coding patterns and authorship attributes. This analysis can reveal deep insights into the coding style, structural nuances, and potential authorship of the code. By comparing fingerprints within a graph framework, GNNs can identify relationships and similarities that traditional linear models cannot, providing an improved and robust method for code attribution. This step is particularly useful for distinguishing between human-generated and AI-generated code, providing a reliable method for code attribution.
[0044] In block 214, the fingerprint and vector embedding may be compared against a vector database containing an infinite number of code vectors. This comparison may be performed using a similarity search algorithm, such as cosine similarity or Euclidean distance, to identify potential matches. An attribution verification process may confirm the source and originality of the code by thoroughly examining the identified matches. The vector database may be populated with code from various sources to provide a comprehensive reference for attribution. The comparison process may verify the originality of the code and identify possible prior art or reused code segments to ensure accurate code attribution. This step ensures that code attribution is accurate, complies with legal and ethical standards, protects intellectual property rights, and maintains the integrity of the software development process.
[0045] In block 216, robustness testing may be performed by creating and evaluating multiple code variants. This step may include automatically creating one or more modified versions of code with specific transformations, such as renaming variables, altering code structure, or modifying syntax. The system may then determine whether these variants can still be traced back to the original source (e.g., whether attribution accuracy is maintained under these variants), effectively measuring the robustness of the attribution mechanism. Robustness testing ensures that the attribution method is resilient to common coding changes and manipulations, providing confidence and improvement in system reliability.
[0046] In various embodiments, in block 216, the testing methodology may include using data from the same bucket knowledge base. This may include original data from The Stack corpus to serve as a baseline for robustness testing. In some embodiments, variations from the original data, such as different whitespace, layout, and comments; variations in identifiers, literals, types, whitespace, layout, and comments; variations in identifiers, literals, types, whitespace, layout, and comments, as well as changes, additions, or deletions of statements; and variations in syntax, where code fragments performing the same computation are implemented using different syntax variants. Additionally, unseen data from other code corpora or from other projects may be used to test the system's ability to process previously unseen data. Test data may also be sourced from commercially available datasets and analyzed at different granularities, including entire files, complete classes, single methods or functions, and just a few lines (parts of a function). Test scenarios may include randomly sampling code snippets from the original dataset at different data granularities to see if the snippets can be correctly identified; testing code from other corpora or projects as unseen code snippets to see if they can be properly identified; and testing similar languages, where code snippets from the original dataset are rewritten in similar languages (e.g., TypeScript vs. JavaScript®) to see if they can be correctly identified. This comprehensive testing methodology ensures that the attribution mechanism of the system, in accordance with aspects of the present invention, is robust and reliable, able to handle various code transformations, and maintains accuracy across different encoding scenarios.
[0047] In block 218, a comprehensive report can be generated that summarizes the findings and provides details on the system's level of confidence in attributing each code variant. This report can include a detailed analysis of the code's origin, authorship, and structural characteristics. It can also provide confidence metrics that indicate the reliability of the attribution results. This report can be used by developers, project managers, and legal teams to make informed decisions regarding code usage and intellectual property, providing transparency and accountability in the development process. In accordance with aspects of the present invention, this report can include insights into the accuracy of the attribution, provide recommendations highlighting areas where the system can be further improved, and / or perform automated corrective actions in response to identified areas where the system can be further improved.
[0048] In block 220, the system may incorporate findings from the attribution and robustness testing phase back into the process via adaptive learning. This step may include collecting data on success rates, confidence levels, and types of code variants encountered during testing. The system may analyze this aggregated data to identify patterns or common characteristics in both successful and failed cases. Based on this analysis, the attribution algorithm may be adjusted, which may include, for example, retraining machine learning models with new data, updating heuristic rules, and improving code variant generation algorithms. This continuous feedback loop ensures that the system remains accurate and adaptable to new coding practices, providing iterative, ongoing improvement and refinement. In block 222, the developer may receive actionable feedback and alternative code suggestions from the system based on the comprehensive analysis of the system. This step includes providing the developer with actionable recommendations for improving the robustness, maintainability, and security of the code. The system may analyze the attributed code and suggest alternative implementations that may provide better performance, maintainability, or security. These suggestions can be tailored to the specific needs of the developer to support continuous learning and skill development. This feature enhances the usability of the system not only by identifying and attributing code, but also by guiding developers toward best practices and improved coding standards.
[0049] In block 224, the system may use insights gained from the previous step to build one or more Federated Models (FMs). These models may be trained using features discovered during the attribution and analysis process, such as coding patterns, authorship attributes, and similarity metrics. The Federated Models (FMs) may then provide comprehensive insights for education and / or remediation, provide explanations for recommendations, and help developers understand and adopt best practices. This step may be utilized, in accordance with aspects of the present invention, to enhance code quality and developer skills through educated insights and recommendations, ensuring the system remains relevant and effective in a rapidly evolving technological landscape. Method 200 provides a comprehensive and systematic approach to verify, differentiate, and attribute both human-authored and AI-generated source code. The process includes source code aggregation, initial evaluation and cleanup, normalization using ASTs, conversion to vector embeddings, fingerprint generation, GNN analysis, comparison against a vector database, robustness testing, comprehensive report generation, and adaptive learning to provide actionable feedback and build the Federated Models. Each step is carefully detailed to ensure accuracy, robustness, and adherence to intellectual property standards, in accordance with aspects of the present invention, providing a reliable and practical solution for code attribution and quality improvement.
[0050] Referring now to FIG. 3, a method 300 for attributing source code, providing feedback for code improvement, and automatically taking corrective action is illustratively shown in accordance with an embodiment of the present invention.
[0051] In various embodiments, in block 302, source code may be ingested from various repositories, including, but not limited to, public repositories such as GitHub, Bitbucket, and private repositories that an organization may maintain internally. This step may include directly accessing repositories via APIs or database queries to collect code samples. The ingested code may include a variety of programming languages and formats, ensuring a comprehensive dataset for subsequent analysis. The ingestion process may also process different versions of code and provide a historical perspective on code evolution. In block 304, the ingested source code may be normalized using an abstract syntax tree (AST). This normalization process may involve analyzing the source code to create a tree representation that captures the syntactic structure of the code. ASTs may be generated even in the presence of syntax errors, ensuring all available code can be analyzed. During normalization, comments and dead code may be removed to focus on the functional aspects of the code. The resulting AST may be standardized across different programming languages to provide a uniform basis for further processing.
[0052] In block 306, the normalized source code represented by the AST may be converted into vector embeddings. This conversion may be achieved using a neural network model trained on a large corpus of code. Vector embeddings may capture both syntactic and semantic features of the code, enabling sophisticated pattern recognition and similarity detection. These embeddings convert the hierarchical structure of the AST into a numerical format that can be easily processed by machine learning algorithms. In block 308, unique fingerprints may be generated from the vector embeddings. These fingerprints may encapsulate core attributes of the code and create distinctive identifiers that facilitate comparison and analysis. Fingerprint generation may include hashing or other encoding techniques to ensure each piece of code has a unique and recognizable representation. These fingerprints may be used to track code across different repositories and versions, enabling accurate attribution. In block 310, fingerprints generated from the vector embeddings may be analyzed using a graph neural network (GNN). A GNN may exploit the fingerprints' graph-based structure to detect complex coding patterns and authorship attribution. This analysis can reveal deep insights into the coding style, structural nuances, and potential authorship of the code. By comparing fingerprints within a graph framework, GNNs can identify relationships and similarities that traditional linear models may miss.
[0053] In block 312, the fingerprint may be compared against a vector database containing an infinite number of code vectors. This comparison may be performed using a similarity search algorithm, such as cosine similarity or Euclidean distance, to identify potential matches. The vector database may be populated with code from various sources to provide a comprehensive reference for attribution. The comparison process may verify the originality of the code and identify possible prior art or reused code segments. In block 314, feedback and alternative code suggestions may be provided based on the analysis. This feedback may include recommendations to improve the robustness, maintainability, and security of the code. The system may suggest alternative implementations that are better aligned with best practices or coding standards. These suggestions may be tailored to the developer's specific context and needs, providing practical guidance for enhancing the quality and integrity of their code.
[0054] In block 316, comments and dead code may be removed during the normalization process. This step ensures that the analysis focuses on the functional aspects of the code and excludes non-executable elements that may skew the results. The removal process may be automated using analysis tools that identify and exclude comments, redundant code, and non-functional elements from the AST. In block 318, code may be collected from both public and private repositories. This step ensures that the dataset is comprehensive and represents diverse coding environments. Public repositories such as GitHub and Bitbucket provide access to a wide range of open source projects, while private repositories provide insight into proprietary code bases. The inclusion of both types of repositories enhances the robustness and relevance of the analysis. In block 320, vector embeddings may be generated using a neural network model trained on a large corpus of code. This model is designed to capture the intricate syntactic and semantic features of the code and may provide rich embeddings that facilitate detailed analysis. The training corpus may include code from multiple programming languages and domains to ensure that the model is versatile and able to handle a variety of coding scenarios.
[0055] In block 322, a report may be generated summarizing the findings and confidence level in the code attribution. This report may include a detailed analysis of the code's origin, authorship, and structural characteristics. It may also provide confidence metrics indicating the reliability of the attribution results. This report may be used by developers, project managers, and legal teams to make informed decisions regarding code usage and intellectual property. In block 324, robustness testing may be performed by creating and evaluating multiple code variants. This testing may include generating modified versions of the code, such as renaming variables, altering code structure, or correcting syntax. The system may then evaluate whether the accuracy of the attribution is maintained under these variants. Robustness testing ensures that the attribution method is resilient to common coding variations and manipulations. In block 326, best practices for code maintainability and security may be recommended. These recommendations may be based on the analysis and insights generated throughout the process. Best practices may include coding standards, design patterns, and security guidelines that enhance the quality and integrity of the code. By following these recommendations, developers, in accordance with aspects of the present invention, may produce code that is not only functional, but also robust, maintainable, and secure.
[0056] Referring now to FIG. 4, a system (ATTRICODE) and method 400 for creating a comprehensive knowledge base, performing code attribution analysis and recommendation generation, and automatically taking corrective actions for a variety of real-world applications and environments is illustratively shown in accordance with an embodiment of the present invention.
[0057] In various embodiments, users 401, such as data scientists, developers, or system administrators, may utilize the ATTRICODE system and methods for various tasks. For example, users may make requests to the ATTRICODE system to analyze, attribute, and optimize code. Users may access the system remotely via a network connection, such as a LAN, WAN, or the Internet, or directly if the system is installed on their device. Interactions may include submitting code for analysis, receiving feedback and recommendations, and implementing proposed improvements.
[0058] In block 403, various exemplary functions of the overall ATTRICODE system are shown, noting that these exemplary functions are presented for ease of illustration and that various additional functions may be performed by the ATTRICODE system and method of the present invention in accordance with various aspects of the present invention. Block 403 illustrates several key processes and components for accurately attributing code and providing actionable insights based on analysis. The methodology may include collecting code, ingesting and normalizing code, embedding code into vectors, performing fingerprinting and graph neural network (GNN) analysis, verifying attribution using the vector database, performing robustness testing, applying adaptive learning, and generating implementation recommendations.
[0059] In block 402, the system can be used to protect intellectual property by verifying the originality of source code and ensuring proper attribution to the rightful creator. This application can include using the system to identify whether a piece of code has been reused without authorization, thus protecting against potential IP violations. By generating unique fingerprints for each code snippet and comparing them against a comprehensive vector database, the system can accurately attribute code and provide legal and ethical compliance in the software industry. This can protect intellectual property by accurately attributing code and preventing unauthorized reuse.
[0060] In block 404, the system may support developer skill enhancement and training by providing actionable feedback and alternative code suggestions based on the comprehensive analysis. This application may include analyzing the attributed code to recommend best practices to improve the robustness, maintainability, and security of the code. The system may also generate detailed reports highlighting areas for improvement, helping developers continuously learn and adopt better coding standards, ultimately enhancing their skills and productivity. This application may include analyzing the attributed code to recommend best practices to improve the robustness, maintainability, and security of the code. The detailed reports highlight areas for improvement, helping developers continuously learn and adopt better coding standards, ultimately enhancing their skills and productivity through guided feedback and recommendations.
[0061] In block 406, the system may be applied to code quality assurance in the software development process. This application may include integrating the system into a continuous integration / continuous deployment (CI / CD) pipeline to monitor and verify the quality and originality of code being developed. By performing robust testing and providing insights into coding patterns and authors, the system may ensure that the code base remains clean, maintainable, and free from unauthorized reuse, thus maintaining high standards of code quality (e.g., during the software development process). In block 408, the system may be used for cross-language code attribution to address the challenge of identifying code across multiple programming languages. This application may include analyzing code snippets written in different languages to accurately attribute their origin. The system's ability to normalize and analyze code using abstract syntax trees (ASTs) and vector embeddings across various languages ensures that even mixed-language code bases can be effectively attributable, providing comprehensive coverage and code attribution across diverse coding environments.
[0062] In block 410, the system can be employed to ensure ethical and legal compliance in AI-generated content. This application may include verifying the originality and attribution of code generated by an AI model to ensure generated content complies with intellectual property laws and ethical standards. By identifying the contributing source code behind AI-generated content, the system can provide transparency and accountability to help organizations navigate the complex legal landscape of AI-assisted software development and ensure compliance with intellectual property laws and ethical standards in AI-generated content. In block 412, the system can be used in educational institutions to verify the originality of student-submitted code and provide feedback for improvement. This application may include integrating the system into academic environments to monitor and evaluate student assignments to ensure submitted code is original and properly attributed. The system can also provide detailed feedback and alternative suggestions to help students learn best coding practices and improve their coding skills through guided instruction and analysis.
[0063] At block 414, the system may be utilized to enhance security in software applications by identifying and mitigating potential vulnerabilities in the code. This application may include providing recommendations for secure coding practices by analyzing the code base to detect patterns and practices that may pose security risks. By providing alternative code suggestions and highlighting security concerns, the system may help developers reduce the risk of security breaches and vulnerabilities by producing more secure and resilient software applications. At block 416, the system may be used to improve the maintainability and performance of the software code base. This application may include providing insights and recommendations for refactoring the code to enhance its maintainability and performance. The system may analyze the code structure, identify areas requiring optimization, and suggest alternative implementations that improve the code's efficiency and readability. By continuously monitoring and refining the code, the system may help maintain high standards of code quality and performance.
[0064] In block 418, the system may be applied to improve the functionality of a computer system by optimizing software code for greater performance and efficiency. This application may include analyzing and refactoring code to enhance execution speed, thereby reducing resource consumption and improving overall system stability. The system may identify inefficient code segments, suggest optimized alternatives, and ensure that the code adheres to best practices for performance optimization. By implementing these improvements, a computer system may achieve higher performance, better resource management, and increased reliability when executing software applications.
[0065] At block 420, the system may further enhance computer functionality through automated correction of inefficient code segments. This embodiment includes a system that autonomously identifies code that negatively impacts performance, such as memory leaks, redundant operations, and inefficient loops. The system may use advanced machine learning models and heuristics to detect these inefficiencies and automatically generate optimized code replacements. These replacements may be tested in a sandbox environment to ensure they do not introduce new errors and that they improve performance metrics. Once approved, the optimized code may be integrated back into the application, streamlining the process of code optimization and reducing the manual effort required by developers. This automated approach not only improves computer system functionality, but also accelerates development cycles and ensures consistent application of optimization techniques.
[0066] In block 422, output from the system may be provided to selected users or systems. This output may include results from blocks 402 through 420, such as code attribution reports, security recommendations, performance optimization suggestions, and educational feedback. The output may be communicated to various stakeholders, including developers, project managers, educational institutions, and legal teams, depending on their specific needs and use cases. The system may also be integrated with other tools and platforms to automate the application of recommendation and streamlining workflows. Network 424 represents various types of connectivity, including local area networks (LANs), wide area networks (WANs), and the Internet, which may be employed for local and / or remote communication between users, user devices, and the ATTRICODE system. This network enables remote access to the ATTRICODE system, allowing users to submit code for analysis and receive recommendations from any location. Network connectivity may facilitate seamless integration with code repositories, databases, and other external systems, ensuring the ATTRICODE system can operate efficiently and effectively in distributed environments.
[0067] The system and method 400 demonstrates various practical applications of the ATTRICODE system, demonstrating its versatility and effectiveness in a variety of real-world scenarios. By addressing intellectual property protection, developer training, code quality assurance, cross-language attribution, ethical compliance, educational support, security enforcement, and code maintainability, the system provides a comprehensive solution for ensuring accuracy, robustness, and compliance in code attribution and verification, in accordance with aspects of the present invention.
[0068] Referring now to FIG. 5, a method 500 for code attribution, complexity measurement, and alternative code recommendation generation is illustratively shown in accordance with an embodiment of the present invention.
[0069] In various embodiments, an exemplary high-level overall process for creating a knowledge base is shown in block 502. This methodology may include several detailed steps to ensure a comprehensive and robust foundation for code attribution and analysis. The process may include selecting a diverse and representative knowledge base corpus, ingesting and normalizing the code, converting the code into a flattened abstract syntax tree (AST) format, vectorizing and embedding the code, and populating a dense vector space for effective comparison and ranking.
[0070] In block 504, a knowledge base corpus may be selected from a variety of sources, including public repositories such as GitHub, proprietary code bases, and other large code datasets like The Stack. This step may include identifying a diverse set of code samples across multiple programming languages and domains to ensure the knowledge base is comprehensive. The selection process may consider factors such as code quality, relevance, and representation of different coding styles and practices. In block 506, the selected code may be ingested, curated, formatted, and normalized. This step may include analyzing the source code to remove comments, dead code, and non-functional elements. The code may then be standardized in terms of format and structure to ensure consistency across different programming languages. The normalization process may include converting the code into a common format that can be further processed in subsequent steps.
[0071] At block 508, the normalized code may be converted into a flattened abstract syntax tree (AST) format. This conversion may involve parsing the code to generate an AST that represents the code's syntactic structure. The AST may then be flattened to create a linear representation that captures hierarchical relationships within the code. This flattened format may facilitate a more efficient vectorization and embedding process. At block 510, the flattened AST may be converted into a vector embedding. This process may utilize advanced machine learning models, such as neural networks, to capture both syntactic and semantic features of the code. The embedding represents the code in a high-dimensional vector space and may enable sophisticated pattern recognition and similarity detection. This step may be important in creating a robust representation of the code that can be used for attribution and analysis.
[0072] At block 512, the vector embeddings may be populated and ranked in a dense vector space database (VectorDB). This step may include indexing the vector embeddings and performing a similarity search to identify and rank similar code snippets. The vector database may be continuously updated with new code samples to ensure it remains comprehensive and relevant. The ranking process may consider various factors, such as code uniqueness, complexity, and relevance, to ensure accurate attribution and analysis. At block 514, a process for code attribution analysis and generation of alternative code recommendations may be described. This methodology may include analyzing code to determine attribution, measuring code complexity, generating alternative code recommendations, and implementing these recommendations to improve code quality and maintainability.
[0073] At block 516, the code may be analyzed to determine its structural and functional characteristics. This step may include analyzing the code to identify key features such as variable names, function calls, and control structures. The analysis may use a variety of techniques, including static analysis, dynamic analysis, and heuristic-based methods, to gain a comprehensive understanding of the code's behavior and structure. At block 518, the system may determine the code's attribution by analyzing patterns and comparing them to a knowledge base. This step may include identifying unique coding styles, authorship attributions, and other distinguishing features. The analysis may use pattern recognition algorithms and machine learning models to match the code against the knowledge base and identify its most likely origin and author.
[0074] At block 520, the system may measure the complexity of the code. This step may include computing various complexity metrics, such as cyclomatic complexity, Halstead complexity measure, and maintainability index. These metrics may provide insight into the complexity of the code and help identify areas that may require optimization or refactoring. At block 522, the system may generate alternative code recommendations based on the complexity analysis and attribution determination. This step may include suggesting modifications to improve the quality, performance, and maintainability of the code. The recommendations may include refactoring suggestions, optimization techniques, and best practices for coding.
[0075] At block 524, the system may generate and execute alternative code approaches. This step may include implementing recommended changes and testing their impact on the code's performance and functionality. The system may use an automated testing framework and sandbox environment to approve changes and ensure they achieve the desired improvements. At block 526, a methodology for comparing code behavior across gold standards and organizational practices may be described. This process may include ingesting gold standard code, identifying and normalizing patterns, comparing current code against the gold standard, and providing coaching and learning recommendations at scale. In some embodiments, the system and method 500 may be utilized to validate and attribute content (e.g., artificial intelligence (AI)-generated, human-generated, etc.) across various domains beyond software code, including, but not limited to, lyrics, music, and written content; the systems and methods may be referred to as ATTRILYRICS, ATTRIMUSIC, and ATTRIWRITE, respectively.
[0076] At block 528, the system may ingest gold standard code samples. These samples may serve as benchmarks for code quality and best practices. The ingest process may include collecting code from well-known sources, such as industry standards, open source projects, and proprietary benchmarks. An exemplary gold standard, described herein below with reference to Python® (note that the present invention is applicable to any code language), is as follows: 1. Avoid magic numbers and strings. 2. Implement proper error handling using try-except blocks to handle exceptions without confusion and provide meaningful error messages. 3. Naming practices should follow the PEP8 standard. 4. Avoid leaving a function without logging. 5. Use type annotations to specify function parameter and return type for improved clarity and tool support. 6. Write functions that have a single role, making them easier to understand, test, and maintain. 7. To avoid namespace pollution and improve clarity, import only the functions, classes, or modules you need, rather than importing everything from a module. 8. Use a context manager (using statements) for resource management such as file I / O or database connections to ensure proper cleanup. 9. Avoid using mutable objects (e.g., lists, dictionaries) as default arguments in function definitions, as this can result in unexpected behavior. 10. Every class should be well documented.
[0077] At block 530, the system may identify patterns in the gold standard code and normalize them. This step may include analyzing the gold standard code to extract common patterns, best practices, and coding styles. The normalization process may ensure that these patterns are consistently represented and can be compared against the current code base. At block 532, the system may compare the current code against the gold standard and generate an analysis report. This comparison may highlight deviations from best practices, areas for improvement, and potential issues in the current code. The analysis report may provide detailed insights and recommendations for aligning the current code with the gold standard. At block 534, the system may provide coaching and learning recommendations at scale. This step may include communicating personalized feedback and guidance to developers based on the comparison to the gold standard. The recommendations may help developers adopt best practices, improve code quality, and strengthen their coding skills.
[0078] In block 536, the system may implement a continuous monitoring and feedback loop. This step may include tracking the evolution of code over time, providing continuous feedback, and applying automatic corrective actions as needed. The system may use machine learning models to continuously learn from new code samples and improve its recommendations and corrective actions. In block 538, the system may generate a dataset for fine-tuning in flattened AST format. This step may include selecting and identifying input-output code pairs and generating alternative code recommendations. The dataset may be used to fine-tune machine learning models, enabling them to improve their performance and accuracy in code attribution and analysis. The process may support cross-language polarization and model improvement to ensure that the system remains effective across diverse coding environments, in accordance with aspects of the present invention.
[0079] Referring now to FIG. 6, a system and method 600 for identifying and attributing source code using Abstract Syntax Trees (ASTs), vector embeddings, and graph neural networks (GNNs) to determine coding patterns and authorship, verify code originality, provide feedback, and perform automated corrective actions to enhance code quality and maintainability is illustratively shown in accordance with an embodiment of the present invention.
[0080] In various embodiments, in block 601, an overall ATTRICODE system for code attribution determination is illustratively shown in a high-level view. The system may encompass several key processes and components designed to accurately attribute code and provide actionable insights based on the analysis. The methodology may include collecting code, ingesting and normalizing the code, embedding the code into vectors, performing fingerprinting and graph neural network (GNN) analysis, verifying attribution using the vector database, performing robustness testing, applying adaptive learning, and generating implementation recommendations. A user 602 (e.g., a data scientist) may interact with the ATTRICODE system using any of several user devices. This interaction may include collecting code from various repositories, submitting it to the system for analysis, and receiving insights and recommendations. The data scientist may play a role in overseeing the code attribution process and ensuring that the results are effectively utilized. The data scientist may also use the system's feedback to improve coding practices and implement recommended changes.
[0081] At block 604, code may be collected from various sources, including public and private repositories. This step may include obtaining code samples from platforms such as GitHub, Bitbucket, and proprietary code bases. The collected code serves as raw input for subsequent analysis and processing steps. This process may include identifying relevant projects, pulling the latest versions of the code, and organizing the code into a standardized structure for ingestion. At block 606, the collected code may be ingested and normalized. This step may include analyzing the code to remove comments, dead code, and non-functional elements. The code may then be standardized in terms of format and structure to ensure consistency across different programming languages. The normalization process may prepare the code for further analysis by converting it to a common format. The ingestion process may also handle code dependencies and ensure all necessary components are included for accurate analysis.
[0082] In block 607, code repositories may be accessed to search for source code. These repositories may include platforms such as GitHub, Bitbucket, and other code storage systems. The repositories provide raw code that can be ingested and analyzed by the system. The system may be configured to automatically synchronize with these repositories to ensure that the latest code is always available for analysis. In block 608, the normalized code may be embedded into vectors. This process may utilize advanced machine learning models, such as neural networks, to capture both syntactic and semantic features of the code. Embeddings represent the code in a high-dimensional vector space, enabling sophisticated pattern recognition and similarity detection. Techniques such as tokenization, sequence embedding, and contextual embedding may be employed to create rich vector representations of the code.
[0083] At block 610, the system may generate unique fingerprints for the vector embeddings and perform GNN analysis. This step may include creating a distinct identifier for each code snippet based on its vector representation. GNN analysis may then detect coding patterns and authorship attribution by analyzing relationships between different code fragments. This process may include building a graph structure where nodes represent code components and edges represent syntactic or semantic connections, enabling the GNN to learn and identify complex patterns. At block 612, the vector embeddings may be matched against a vector database to verify code attribution. This step may include querying the vector database to identify potential matches and confirm the origin of the code. The verification process may ensure that code is correctly attributed to its legitimate author. The vector database may be populated with a wide range of code samples, allowing for comprehensive comparison and accurate attribution.
[0084] In block 613, vector databases may be used to store and manage vector embeddings of code. These databases may facilitate efficient search and matching of code vectors, enabling accurate attribution and analysis. Vector databases may be continuously updated with new code samples and fingerprints to ensure they remain current and comprehensive. The databases may also support various query techniques, such as similarity search and nearest neighbor search, to efficiently find matching code vectors. In block 614, the system may perform robustness testing and generate a report. This step may include creating and evaluating multiple code transformations to ensure that attribution remains accurate under different code modifications. The system may generate a comprehensive report summarizing its findings and confidence level in the code attribution. Robustness testing may include scenarios such as variable renaming, code restructuring, and obfuscation to evaluate the system's ability to maintain accurate attribution.
[0085] In block 616, adaptive learning and behavioral analysis may be applied to improve the system's performance. This step may include using feedback from previous analyses to improve the accuracy and robustness of the attribution algorithm. The system may continuously learn from new data and adapt to evolving coding practices and patterns. This process may include retraining machine learning models, updating heuristic rules, and incorporating new patterns observed in the code base. In block 618, the system may provide implementation recommendations and actions based on insights gained from the analysis. This step may include suggesting modifications to improve code quality, performance, and maintainability. The recommendations may be tailored to address specific issues identified during the analysis and help developers enhance their code. The system may also provide alternative code suggestions, highlight best practices, and guide developers in refactoring their code for better efficiency and readability.
[0086] In block 620, federated insights can be generated from the aggregated data. This step can include compiling insights from multiple sources and analyses to provide a comprehensive view of coding patterns and practices. Federated insights can help developers understand broader trends and make informed decisions based on collective intelligence. This can include identifying common coding challenges, recognizing effective coding techniques, and leveraging community-driven insights to improve individual and team coding practices. System and method 600 illustratively illustrates the various blocks and processes included in the ATTRICODE system, providing a comprehensive overview of the system's functionality and methodology for accurate code attribution and actionable insights. By incorporating advanced techniques such as vector embedding, GNN analysis, and adaptive learning, the ATTRICODE system provides a robust and scalable solution for code attribution, quality improvement, and developer support, in accordance with aspects of the present invention.
[0087] 7, a method 700 is illustratively shown, including an illustration of exemplary pseudocode 702, for creating a comprehensive knowledge base to perform code attribution analysis and recommendation generation, in accordance with an embodiment of the present invention. The method 700 may include tokenizing source code, generating an abstract syntax tree (AST), and creating a flattened AST for analysis, and the pseudocode 702 may be utilized to perform various processes in the ATTRICODE system for purposes of code attribution and analysis.
[0088] In this illustrative example, pseudocode 702 may be utilized for tokenization and AST tokenization. The original source code snippet is a simple Python function definition, and the first step in processing the source code may be tokenization, where the code is broken down into its constituent tokens. This step may convert the original source code into a list of tokens (e.g., ["C","def","Gfunc","(","arg","):","C","GGG","Gpass","C"]). The tokenized code may then be converted into an AST, which represents the syntactic structure of the code in a hierarchical format. In this example, the AST includes nodes for modules, function definitions, parameters, and bodies. The AST may then be flattened into a linear representation, which captures the hierarchical relationships in a sequential format. This flattened AST is more suitable for the vectorization and embedding processes used by the ATTRICODE system.
[0089] Pseudocode 702 is particularly useful for a variety of functions, including, for example: Code ingestion and normalization: The original source code is ingested and normalized by the ATTRICODE system. During this process, the system performs tokenization to break the code down into manageable units, which are then converted into an AST to represent the syntactic structure of the code. AST Flattening: The hierarchical AST is flattened into a linear format, suitable for further processing steps. This flattened representation is used to capture both syntactic and semantic features of the code, enabling sophisticated pattern recognition and analysis. Vectorization and Embedding: The flattened AST is then vectorized and embedded into a high-dimensional vector space. This step allows the ATTRICODE system to create a vector representation of the code that can be compared and analyzed using advanced machine learning models. Fingerprinting and Analysis: Vector embeddings are used to generate unique fingerprints for code snippets. These fingerprints are analyzed using graph neural networks (GNNs) to detect coding patterns and authorship attribution. The flattened AST facilitates efficient fingerprint generation and analysis by providing a structured, even linear, representation of the code. Attribution and Verification: The fingerprint generated from the flattened AST is compared against a vector database to verify code attribution. This step ensures that code is correctly attributed to its legitimate author and any unauthorized reuse is detected. Robustness Testing: The system may perform robustness testing on the code by creating multiple variations of the flattened AST and evaluating the accuracy of the attribution. This process ensures that the attribution method is resilient to common coding variations and manipulations. Recommendations and Feedback: Based on the analysis, the system can provide feedback and recommendations for code improvements. The structured nature of the flattened AST allows the system to identify specific areas of code that can be optimized or refactored.
[0090] The method 700 and pseudocode 702 may be utilized in various embodiments of the present invention to process source code and convert it from its original form into a structured, parseable format. This process enables accurate code attribution, robust analysis, actionable recommendations, and automated corrective actions for code improvement, in accordance with aspects of the present invention.
[0091] Referring now to FIG. 8, a system 800 for improved source code verification, attribution, and execution of automated corrective actions is illustratively shown in accordance with an embodiment of the present invention.
[0092] Various aspects of the present disclosure are described through text, flowcharts, block diagrams of computer systems, and / or block diagrams of machine logic included in computer program product (CPP) embodiments. For any flowchart, depending on the technology involved, operations may be performed in an order different from that shown in a given flowchart. For example, two operations shown in successive flowchart blocks may be performed in the reverse order, as a single integrated step, simultaneously, or in a manner that at least partially overlaps in time, also depending on the technology involved.
[0093] A computer program product embodiment ("CPP embodiment" or "CPP") is a term used in this disclosure to describe any set of one or more storage media (also referred to as "media") collectively included in a set of one or more storage devices that collectively contain machine-readable code corresponding to instructions and / or data for performing the computer operations specified in a given CPP claim. A "storage device" is any tangible device that can hold and store instructions for use by a computer processor. The computer-readable storage medium may be, but is not limited to, an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing.
[0094] Some known types of storage devices that include these media include diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded devices (such as punch cards or pits / lands formed on a major surface of a disk), or any suitable combination of the foregoing. Computer-readable storage media, as the term is used in this disclosure, is not to be construed as storage in the form of a transitory signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through fiber optic cables, electrical signals communicated over wires, and / or other transmission media. As will be appreciated by those skilled in the art, data typically moves at some infrequent time during the normal operation of a storage device, such as during access, defragmentation, or garbage collection, but this does not qualify the storage device as transient, as data is not transient while it is stored.
[0095] Computing environment 800 includes an example environment for execution of at least some of the computer code involved in performing the inventive methodology, such as code for improved source code verification, attribution, and execution of automated corrective action 850. In addition to block 850, computing environment 800 includes, for example, a computer 801, a wide area network (WAN) 802, an end user device (EUD) 803, a remote server 804, a public cloud 805, and a private cloud 806. In this embodiment, computer 801 includes a set of processors 810 (including processing circuitry 820 and cache 821), a communications fabric 811, volatile memory 812, persistent storage 813 (including operating system 822 and block 200, as shown above), a set of peripheral devices 814 (including a set of user interface (UI) devices 823, storage 824, and a set of Internet of Things (IoT) sensors 825), and a network module 815. Remote server 804 includes a remote database 830. The public cloud 805 includes a gateway 840, a cloud orchestration module 841, a set of host physical machines 842, a set of virtual machines 843, and a set of containers 844.
[0096] Computer 801 may take the form of a desktop computer, laptop computer, tablet computer, smartphone, smartwatch or other wearable computer, mainframe computer, quantum computer, or any other form of computer or mobile device now known or later developed that is capable of executing programs, accessing a network, or querying a database, such as remote database 830. As is well understood in the art of computer technology, and depending on the technology, execution of a computer-implemented method may be distributed among multiple computers and / or across multiple locations. However, in this presentation of computing environment 800, the detailed description focuses on a single computer, specifically computer 801, to keep the presentation as simple as possible. Although computer 801 is not shown in FIG. 8 within the cloud, it may be located within the cloud. However, computer 801 is not required for the cloud, except to any extent that may be indicated in the affirmative. Processor set 810 includes one or more computer processors of any type now known or later developed. Processing circuitry 820 may be distributed across multiple packages, e.g., multiple coordinated integrated circuit chips. The processing circuitry 820 may implement multiple processor threads and / or multiple processor cores. Cache 821 is memory located within the processor chip package and is typically used for data or code that should be available for quick access by threads or cores executing on the processor set 810. Cache memory is typically organized into multiple levels depending on relative proximity to the processing circuitry. Alternatively, some or all of the cache for a processor set may be located "off-chip."
[0097] In some computing environments, the processor set 810 may be designed to operate with qubits and perform quantum computing. Computer-readable program instructions are typically loaded into the computer 801 and cause the processor set 810 of the computer 801 to execute a series of operational steps, thereby enabling a computer-implemented methodology, such that the instructions so executed instantiate the methods specified in the computer-implemented method flowcharts and / or descriptions contained herein (collectively, the "methods of the invention"). These computer-readable program instructions are stored in various types of computer-readable storage media, such as cache 821 and other storage media described below. The program instructions and associated data are accessed by the processor set 810 to control and direct the execution of the methods of the invention. In the computing environment 800, at least some of the instructions for executing the methods of the invention may be stored in block 850 within persistent storage 813.
[0098] Communications fabric 811 is the signal-conducting pathway that allows various components of computer 801 to communicate with one another. Typically, this fabric is made up of switches and conductive pathways, such as those that make up buses, bridges, physical input / output ports, and the like. Other types of signal communication pathways may be used, such as fiber optic and / or wireless communication pathways. Volatile memory 812 is any type of volatile memory now known or later developed. Examples include dynamic-type random access memory (RAM) or static-type RAM. Typically, volatile memory 812 is characterized by random access, although this is not required unless expressly stated. In computer 801, volatile memory 812 is located in a single package and is internal to computer 801; alternatively or additionally, volatile memory may be distributed across multiple packages and / or may be external to computer 801. Persistent storage 813 is any form of non-volatile storage for computers now known or later developed. The non-volatility of this storage means that stored data is maintained regardless of whether power is supplied to computer 801 and / or directly to persistent storage 813. Persistent storage 813 can be read-only memory (ROM), but is typically at least a portion of persistent storage that allows data to be written, data to be erased, and data to be rewritten. Some well-known forms of persistent storage include magnetic disks and solid-state storage devices.
[0099] The operating system 822 may take several forms, such as various known proprietary operating systems or open-source Portable Operating System Interface-type operating systems employing a kernel. The code included in block 200 typically includes at least a portion of the computer code involved in executing the methods of the present invention. The peripheral device set 814 includes a set of peripheral devices of the computer 801. Data communication connections between the peripheral devices and other components of the computer 801 may be implemented in various ways, such as Bluetooth® connections, near-field communication (NFC) connections, connections made by cable (such as a Universal Serial Bus (USB)-type cable), insertion-type connections (e.g., Secure Digital (SD) cards), connections made by local area communication networks, and even connections made by wide area networks such as the Internet. In various embodiments, the UI device set 823 may include components such as display screens, speakers, microphones, wearable devices (such as goggles and smartwatches), keyboards, mice, printers, touchpads, game controllers, and haptic devices. Storage 824 may be external storage, such as an external hard drive, or insertable storage, such as an SD card. Storage 824 may be persistent and / or volatile. In some embodiments, storage 824 may take the form of a quantum computing storage device for storing data in the form of qubits.
[0100] In embodiments where computer 801 is required to have a large amount of storage (e.g., computer 801 stores and manages a large database locally), this storage may be provided by a peripheral storage device designed to store very large amounts of data, such as a storage area network (SAN) shared by multiple geographically distributed computers. IoT sensor set 825 consists of sensors that can be used in Internet of Things applications. For example, one sensor may be a thermometer and another sensor may be a motion detector.
[0101] Network module 815 is a collection of computer software, hardware, and firmware that enables computer 801 to interact with other computers over WAN 802. Network module 815 may include hardware such as a modem or Wi-Fi signal transceiver, software for packetizing and / or depacketizing data for communication network transmission, and / or web browser software for communicating data over the Internet. In some embodiments, the network control and network forwarding functions of network module 815 are performed on the same physical hardware device. In other embodiments (e.g., embodiments utilizing software-defined networking (SDN)), the control and forwarding functions of network module 815 are performed on physically separate devices, such that the control functions manage several different network hardware devices.
[0102] Computer readable program instructions for carrying out the methods of the present invention can typically be downloaded into computer 801 from an external computer or external storage device via a network adapter card or network interface included in network module 815 . WAN 802 is any wide area network (e.g., the Internet) capable of communicating computer data over non-local distances using any technology for communicating computer data now known or later developed. In some embodiments, WAN 802 may be replaced and / or supplemented by a local area network (LAN) designed to communicate data between devices located in a local area, such as a Wi-Fi network. WANs and / or LANs typically include copper transmission cables, optical fiber transmissions, wireless transmissions, and computer hardware such as routers, firewalls, switches, gateway computers, and edge servers.
[0103] End-user device (EUD) 803 is any computer system used and controlled by an end user (e.g., a customer of the enterprise operating computer 801) and may take any of the forms described above in connection with computer 801. EUD 803 typically receives useful and actionable data from the operation of computer 801. For example, in the hypothetical case where computer 801 is designed to provide recommendations to the end user, the recommendations would typically be communicated from computer 801's network module 815 over WAN 802 to EUD 803. In this manner, EUD 803 can display or otherwise present the recommendations to the end user. In some embodiments, EUD 803 may be a client device, such as a thin client, a heavy client, a mainframe computer, a desktop computer, and the like.
[0104] Remote server 804 is any computer system that provides at least some data and / or functionality to computer 801. Remote server 804 may be controlled and used by the same entity that operates computer 801. Remote server 804 represents a machine that collects and stores useful data for use by other computers, such as computer 801. For example, in the hypothetical case where computer 801 is designed and programmed to provide recommendations based on historical data, this historical data may then be provided to computer 801 from remote database 830 of remote server 804.
[0105] A public cloud 805 is any computer system available for use by multiple entities that provides on-demand availability of computer system resources and / or other computer capacity, particularly data storage (cloud storage) and computing capacity, without requiring direct, active management by users. Cloud computing typically leverages resource sharing to achieve coherence and economies of scale. Direct, active management of the computing resources of the public cloud 805 is performed by computer hardware and / or software in a cloud orchestration module 841. The computing resources provided by the public cloud 805 are typically implemented by virtual computing environments (VCEs) running on various computers that comprise a host physical machine set 842, which is a population of physical computers within and / or available to the public cloud 805. Virtual computing environments (VCEs) typically take the form of virtual machines from a virtual machine set 843 and / or containers from a container set 844.
[0106] It is understood that these VCEs may be stored as images and may be transferred among and between various physical machine hosts either as images or after instantiation of the VCE. Cloud orchestration module 841 manages the transfer and storage of images, deploys new instantiations of VCEs, and manages active instantiations of VCE deployments. Gateway 840 is a collection of computer software, hardware, and firmware that enables public cloud 805 to communicate over WAN 802. Here, we provide some further explanation of virtual computing environments (VCEs). A VCE can be stored as an "image." From this image, a new, active instance of the VCE can be instantiated. Two well-known types of VCEs are virtual machines and containers. A container is a VCE that uses operating system-level virtualization. This refers to a feature of an operating system where the kernel allows the existence of multiple isolated user space instances called containers. These isolated user space instances typically behave as actual computers from the perspective of the programs running within them. A computer program running on a typical operating system can utilize all of the computer's resources, such as connected devices, files and folders, network shares, CPU power, and quantifiable hardware capabilities. However, a program running inside a container can only use the contents of the container and the devices assigned to the container; this feature is known as containerization.
[0107] Private cloud 806 is similar to public cloud 805, except that the computing resources are available only for use by a single enterprise. While private cloud 806 is shown in communication with WAN 802, in other embodiments, the private cloud may be entirely disconnected from the Internet and accessible only through a local / private network. A hybrid cloud is a composite of multiple clouds of different types (e.g., private, community, or public cloud types), often each implemented by a different vendor. While each of the multiple clouds remains a separate, discrete entity, the larger hybrid cloud architecture is bound together by standardized or proprietary technologies that enable orchestration, management, and / or data / application portability between the constituent clouds. In this embodiment, public cloud 805 and private cloud 806 are both part of a larger hybrid cloud.
[0108] The present invention may be a system, method and / or computer program product integrated at any possible level of technical detail. The computer program product may include a computer-readable storage medium (or multiple computer-readable storage media) having computer-readable program instructions for causing a processor to perform aspects of the present invention.
[0109] A computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or ridge structures in grooves on which instructions are recorded, and any suitable combination of the foregoing. Computer-readable storage medium, as used herein, should not be construed as a transitory signal per se, such as an electric wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse passing through a fiber optic cable), or an electrical signal transmitted over a wire.
[0110] The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to each computing / processing device or to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing / processing device.
[0111] The computer-readable program instructions for carrying out the operations of the present invention may be either assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for an integrated circuit, or source or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk® or C++, and procedural programming languages such as the “C” programming language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be to an external computer (e.g., through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may execute computer readable program instructions to personalize the electronic circuitry by utilizing state information of the computer readable program instructions to perform aspects of the present invention.
[0112] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0113] These computer-readable program instructions may be provided to a processor of a computer or other programmable data processing apparatus to produce a machine, such that the instructions, executed by the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer-readable program instructions may also be stored on a computer-readable storage medium that can instruct a computer, programmable data processing apparatus and / or other device to function in a particular manner, such that the computer-readable storage medium having instructions stored therein has an article of manufacture including instructions that implement aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.
[0114] The computer-readable program instructions may also be loaded into a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be executed on the computer, other programmable apparatus, or other device to generate a computer-implemented process, whereby the instructions executing on the computer, other programmable apparatus, or other device implement the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.
[0115] References herein to "one embodiment" or "an embodiment" of the present invention, as well as other variations thereof, mean that a particular feature, structure, characteristic, etc. described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment," as well as any other variations thereof, appearing in various places throughout this specification are not necessarily all referring to the same embodiment.
[0116] It should be understood that the use of any of the following: " / ," "and / or," and "at least one of," is intended to encompass the selection of only the first listed alternative (A), or the selection of only the second listed alternative (B), or the selection of both alternatives (A and B), for example, in the case of "A / B," "A and / or B," and "at least one of A and B." As one further example, in the case of "A, B, and / or C" and "at least one of A, B, and C," such language is intended to encompass the selection of only the first listed alternative (A), or the selection of only the second listed alternative (B), or the selection of only the third listed alternative (C), or the selection of only the first and second listed alternatives (A and B), or the selection of only the first and third listed alternatives (A and C), or the selection of only the second and third listed alternatives (B and C), or the selection of all three alternatives (A, B, and C). This can be expanded by many enumerated items as would be readily apparent to one skilled in this and related arts.
[0117] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may actually be realized as a single step, executed concurrently, substantially concurrently, partially, or fully in a time-overlapping manner, or the blocks may possibly be executed in reverse order depending on the functionality involved. It should also be noted that each block of the block diagrams and / or flowchart diagrams, and combinations of blocks in the block diagrams and / or flowchart diagrams, may be implemented by a dedicated hardware-based system that performs the specified functions or actions or executes a combination of dedicated hardware and computer instructions.
[0118] While preferred embodiments of the system and method have been described (which are intended to be illustrative and not limiting), it should be noted that modifications and variations can be made by those skilled in the art given the above teachings. It is therefore to be understood that changes may be made within the specific embodiments disclosed which are within the scope of the invention and outlined by the appended claims. Having thus described aspects of the invention with the detail and specificity required by the patent laws, it is in the appended claims that what is claimed and desired to be protected by Letters Patent is set forth.
Claims
1. Pulling source code from multiple repositories; normalizing the captured source code using an Abstract Syntax Tree (AST); converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code; generating a unique fingerprint from the vector embedding; comparing the fingerprint against a vector database to identify potential matches and verify code attribution; and generating feedback and alternative code suggestions based on said comparing said fingerprints; 1. A method for attributing source code, comprising:
2. The method of claim 1 , further comprising analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions.
3. 10. The method of claim 1, further comprising removing comments and dead code during the normalizing the ingested source code, wherein the ingesting of source code includes collecting code from both public and private repositories.
4. The method of claim 1 , wherein the vector embeddings are generated using a neural network model trained on a large corpus of code.
5. The method of claim 1 , further comprising generating a report summarizing results of the attributing the source code, including a particular confidence level for the code attribution.
6. 10. The method of claim 1, further comprising performing robustness testing by creating and evaluating multiple code variants to ensure accuracy of attribution under different code modifications.
7. The method of claim 1 , wherein providing feedback and alternative code suggestions includes recommending best practices for code maintainability and security.
8. 1. A system for attributing source code, comprising: a processor device; and When executed by the processor device, the system: Steps to import source code from multiple repositories: normalizing the captured source code using an Abstract Syntax Tree (AST); converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code; generating a unique fingerprint from the vector embedding; comparing the fingerprint against a vector database to identify potential matches and verify code attribution; and generating feedback and alternative code suggestions based on said comparing said fingerprints; memory that stores instructions to execute A system comprising:
9. 10. The system of claim 8, wherein the memory further stores instructions for analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions.
10. 9. The system of claim 8, wherein the memory further stores instructions for removing comments and dead code during the normalization of the ingested source code, and wherein the source code ingest includes collecting code from both public and private repositories.
11. 10. The system of claim 8, wherein the memory further stores instructions for generating the vector embeddings using a neural network model trained on a large corpus of code.
12. 10. The system of claim 8, wherein the memory further stores instructions for generating a report summarizing results of the attributing the source code, including a particular confidence level for the code attribution.
13. 10. The system of claim 8, wherein the memory further stores instructions for performing robustness testing by creating and evaluating multiple code variants to ensure accuracy of attribution under different code modifications.
14. The system of claim 8 , wherein the feedback and alternative code suggestions provided by the system include recommendations for best practices in code maintainability and security.
15. 1. A computer program for attributing source code, the computer program causing a hardware processor to: Steps to import source code from multiple repositories: normalizing the captured source code using an Abstract Syntax Tree (AST); converting the normalized source code into a vector embedding representing syntactic and semantic features of the source code; generating a unique fingerprint from the vector embedding; comparing the fingerprint against a vector database to identify potential matches and verify code attribution; and generating feedback and alternative code suggestions based on said comparing said fingerprints; A computer program for executing
16. 16. The computer program product of claim 15, further causing the hardware processor to perform the steps of: analyzing the fingerprint using a graph neural network (GNN) to detect coding patterns and authorship attributions.
17. 16. The computer program product of claim 15, further causing the hardware processor to perform the steps of removing comments and dead code during the normalization of the captured source code, wherein the capturing of source code includes collecting code from both public and private repositories.
18. 16. The computer program product of claim 15, further causing the hardware processor to perform the steps of: generating the vector embeddings using a neural network model trained on a large corpus of code.
19. 16. The computer program product of claim 15, further causing the hardware processor to perform the steps of: generating a report summarizing results of the attributing the source code, including a particular confidence level for the code attribution.
20. 16. The computer program product of claim 15, further causing the hardware processor to perform a robustness test by creating and evaluating multiple code variants to ensure accuracy of attribution under different code modifications.
21. Incorporating source code from multiple sources; normalizing the captured source code by employing an Abstract Syntax Tree (AST) to adjust syntax formatting; converting the captured source code into a vector embedding capable of representing syntactic and semantic properties; generating a unique code identifier from the vector embedding; comparing the code identifiers in a vector database to identify potential source similarities and verify the originality of the source code; and Enhancing the integrity of the code by generating corrective code modifications based on the results of the comparing step. A method for enhancing source code verification, comprising:
22. 22. The method of claim 21, further comprising implementing an iterative normalization process during the normalization of the ingested source code to incrementally refine code structure, the ingested source code including both legacy and modern coding frameworks.
23. 22. The method of claim 21, further comprising enhancing verification of code originality and source by analyzing the unique code identifier with a graph neural network (GNN) to identify complex coding patterns and authorship characteristics.
24. 1. A system for enhancing source code verification, comprising: a processor device; and When executed by the processor device, the system: Steps to include source code from multiple sources; normalizing the captured source code by employing an Abstract Syntax Tree (AST) to adjust syntax formatting; converting the captured source code into a vector embedding capable of representing syntactic and semantic properties; generating a unique code identifier from the vector embedding; comparing the code identifiers in a vector database to identify potential source similarities and verify the originality of the source code; and and enhancing code integrity by generating corrective code modifications based on the results of the comparing step. memory that stores instructions to execute A system for enhancing source code verification, comprising:
25. 25. The system of claim 24, wherein the memory further stores instructions for implementing an iterative normalization process during the normalization of the ingested source code to incrementally refine code structure, the ingested source code including both legacy and modern coding frameworks.
Citation Information
Cited By
Software conversion generation system, data structure, program, and control method for the software conversion generation system.
JP7887220B1