Skip to content
docs
Arxo ↗

LDC-Q2005 — The expression names a variable the query never bound

For LLMs5 sections

Inside a filter or a return list, every name must come from somewhere: a source introduced at the head of the query. A name with no source is not an empty value and not a typo the engine will guess past — the expression cannot be evaluated for any row, so the query stops at the first row that reaches it.

Bind the name in a source, or replace it with the source variable the expression was meant to read.

Both queries below run against this package:

Arxo Law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";
entity Applicant;
relation resident(a: Applicant) kind institutional;
relation permit_eligible(a: Applicant) kind institutional;
rule PermitEligibility strict {
for a: Applicant;
when resident(a);
then permit_eligible(a);
}

The filter reads a name no source introduces:

LawQL
from r in rules where zzz == 1 select r
LawQL
from r in rules select r

The engine reports this in its own wording:

Output
LDC-Q2005: variable 'zzz' is not bound.

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

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