Skip to content
docs
Arxo ↗

LDC-E1322 — Free variable in a definition body

For LLMs5 sections

A definition body may use exactly two kinds of names: its own parameters, and symbols the package declares. A definition introduces no binder of its own, so an auxiliary name has nowhere to be introduced — a term that needs one belongs in a rule with a binder. A body name that is neither a parameter nor a declared symbol is free, and the compiler stops at it instead of substituting a constant that would never derive.

The repair is to spell a parameter, or to declare the missing symbol. A body where every name resolves lowers exactly as written.

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Tenant;
relation tall(t: Tenant) kind institutional;
definition Adult(x: Tenant) exact {
when tall(y);
}
Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Tenant;
relation tall(t: Tenant) kind institutional;
definition Adult(x: Tenant) exact {
when tall(x);
}

The engine reports this in its own wording:

Output
example.law:8:15: error LDC-E1322: name "y" in a §151 `definition` body is neither its parameter nor a declared package symbol — it is a free variable (§188 unresolved name). A definition has NO binder (§529 grammar), so there is nowhere to introduce an auxiliary name: a term needing an intermediate link is expressed with a `for` rule. Silent constant substitution would yield a predicate that never derives

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

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