h/GENAI™—Heirloom's Gen AI solution for post-migration refactoring.
Science & Technology
h/GENAI™—Heirloom's Gen AI solution for post-migration refactoring
Heirloom utilizes a type of compiler called a transpiler to quickly and accurately process tens of millions of lines of COBOL and PL1 code, transforming them into Java source code that is guaranteed to be functionally equivalent. This capability is attributed to Heirloom's Java framework, which extends any Java application server to execute mainframe loads with absolute precision.
In a live demonstration, Heirloom's generative AI solution, known as H/GENAI™, reveals how dependencies on Heirloom's Java framework can be replaced with standard Java libraries. H/GENAI™ leverages an augmented large language model (LLM) equipped with metadata from hundreds of millions of lines of real-world mainframe application code and testware that Heirloom has already successfully transpiled to Java.
The process begins with a COBOL program that uses a VSAM file to create division calculation tests involving complex numeric edited COBOL data types. The first step is to use Heirloom to transpile the COBOL program into Java source code, which is subsequently compiled by the Java compiler to create executable classes. The program is then executed, and the results are stored in a results file (res file) for comparison against the refactored code modified by H/GENAI™.
The Java code produced by Heirloom's transpiler and the resulting execution of the COBOL program are displayed. COBOL has unique rules for calculation precision and result display. The next step is instructing the AI to refactor the Java code to eliminate dependencies on Heirloom's Java framework.
H/GENAI™ returns its first attempt at refactoring the code, which compiles cleanly. However, executing the code results in an exception. On examining the res file, the exception's cause is identified, and the result is passed back to the AI for another attempt.
On the second attempt, the code compiles and executes without exceptions but the results do not match the original COBOL program. Despite minor differences in calculations and formatting, the results are closer. Over subsequent iterations, the calculation precision and formatting improve, with each attempt getting closer to the required outcome.
The iterative approach is necessary because generative AI, by design, uses probabilistic methods to generate output, making it fundamentally non-deterministic. On the seventh iteration (spookily biblical), H/GENAI™ finally orchestrates the production of a functionally equivalent Java program without dependencies on the Heirloom Java framework.
Verification is performed by executing both the original Java program (transpiled by Heirloom) and the refactored Java program (produced by H/GENAI™) and comparing the results, which match exactly. The final examination of the refactored Java program reveals that it requires only standard Java libraries, is well-structured, easy to maintain, and faithfully replicates the functionality of the original COBOL program.
Keywords
- Heirloom
- Transpiler
- COBOL
- PL1
- Java
- Java framework
- H/GENAI™
- Large Language Model (LLM)
- Refactoring
- Probabilistic methods
- Dependency elimination
- Functionally equivalent
- Mainframe application
FAQ
Q: What is Heirloom's main function?
A: Heirloom uses a transpiler to transform COBOL and PL1 code into Java source code, ensuring functional equivalence.
Q: How does Heirloom’s Java framework aid in this transformation?
A: It extends the capability of any Java application server to execute mainframe loads with precision.
Q: What is H/GENAI™?
A: H/GENAI™ is Heirloom's generative AI solution designed to refactor Java code derived from COBOL to remove dependencies on the Heirloom Java framework.
Q: How does H/GENAI™ work?
A: It leverages a large language model (LLM) with metadata from hundreds of millions of lines of real-world mainframe application code and testware that have been accurately transpiled to Java.
Q: Why is an iterative approach necessary in the refactoring process?
A: Because generative AI uses probabilistic methods, making the output fundamentally non-deterministic. Multiple iterations help achieve closer approximation to the desired results.
Q: What was the outcome of using H/GENAI™ on the COBOL program?
A: The refactored Java program was functionally equivalent to the original and required only standard Java libraries, without any dependencies on the Heirloom Java framework.
Q: How was the accuracy of the refactored code verified?
A: By comparing the execution results of the original Java program (transpiled by Heirloom) and the refactored Java program (produced by H/GENAI™).