LDC-E2110 — A recursive function with no termination proof
For LLMs5 sections
What it means
Section titled “What it means”Functions in an executable package must provably terminate: a function that calls itself with no termination argument could run forever, and the compiler rejects the cycle outright rather than risking it. The diagnostic points at the function caught in the loop.
Restructuring so the function no longer calls itself — or otherwise showing the recursion bottoms out — is the fix. A plain non-recursive definition never triggers this.
Example
Section titled “Example”language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
function Loop(x: Integer) -> Integer = Loop(x);language "law.core" version "0.2";package demo.diagnostics version "0.1.0";namespace "urn:law:demo:diagnostics";
function Next(x: Integer) -> Integer = x + 1;Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.