Skip to content
docs
Arxo ↗

LDC-E0204 — A let without a written type

For LLMs5 sections

A let inside a rule body names an intermediate value, and the language asks for its type up front: let followed by the name, a colon, the type, and the value. Without the annotation the reader cannot tell which computation the name stands for, so the binding is refused where the value starts.

The fix is the annotation, not a different value: write the binding as its own body line with the colon and the type the value already has. Everything downstream of the binding stays untouched.

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity A;
relation p(a: A) kind institutional;
relation q(a: A) kind institutional;
rule R defeasible {
for x: A;
when p(x) and (let v = 1 in v) = 1;
then q(x);
}
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity A;
relation p(a: A) kind institutional;
relation q(n: Integer) kind institutional;
relation r(n: Integer) kind institutional;
rule R strict {
for a: A;
for n: Integer;
when p(a) and q(n);
let m: Integer = n + 1;
then r(m);
}

The engine reports this in its own wording:

Output
example.law:10:24: error LDC-E0204: let v: a type annotation is mandatory in v1 -- `let x: T = ...` (§55)

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.