docs← Back to article

Markdown for LLMs

LDC-E2102 — A predicate with no declaration

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-E2102 — A predicate with no declaration

## What it means

A rule body may only call predicates the file declares as relations.
A name the file never declares is most often a typo, a predicate that
was renamed in the declarations but not in the rule, or a helper the
author meant to add and forgot. The compiler stops at the call instead
of treating the unknown name as a fresh predicate.

Declaring the relation with its parameters, or correcting the name at
the call site, clears the diagnostic.

## Example

```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";

entity P;
relation known(a: P, b: P) kind institutional;
rule R strict { for x: P; when nowhere(x); then known(x, x); }
```

## Fix

```law
language "law.core" version "0.2";
package demo.diagnostics version "0.1.0";
namespace "urn:law:demo:diagnostics";

entity P;
relation known(a: P, b: P) kind institutional;
relation noted(a: P, b: P) kind institutional;
rule R strict { for x: P; for y: P; when known(x, y); then noted(x, y); }
```

## Engine message

The engine reports this in its own wording:

```text
example.law:7:32: error LDC-E2102: predicate "nowhere" is not declared as a relation in this file
```

## Related

- [Vocabulary](/constructs/vocabulary/) — which names a rule body may use.
- [Strict rules](/constructs/rule-strict/) — how rule bodies are built.