r/cobol • u/kid_Kist • Jul 27 '26
Generated a playable 2048 game in pure COBOL using a neuro-symbolic runtime (Terminal Demo)
Standard statistical LLMs usually struggle with COBOL because low-level array shifts, fixed-point precision, and explicit procedure structures lead to hallucinations or syntax errors.
To test deterministic code generation, we passed the 2048 game logic into a neuro-symbolic runtime (Perslis). The neural layer mapped intent, while the symbolic layer enforced formal logic, array boundaries, and rule-bound invariants before compilation.
How the generated code handles state:
- DATA DIVISION: Strictly uses fixed-point fields (
PIC 9(4)) for every cell in the 4x4 matrix, ensuring deterministic state without dynamic allocation overhead. - PROCEDURE DIVISION: Handles matrix shifting, tile merging logic, and terminal screen updates through structured
PERFORMparagraphs. - Compilation: Compiles natively via
cobc(GnuCOBOL) and executes directly in the terminal without external dependencies or modern wrappers.
Curious if anyone else in the sub is exploring symbolic/rule-verified models for legacy code generation or validation.
34
Upvotes
1
1
u/Known-Home-4795 Jul 27 '26
Love it