docs← Back to article

Markdown for LLMs

LDC-E2114 — A closure whose domain arity differs

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

Download this articlePlain text ↗
# LDC-E2114 — A closure whose domain arity differs

## What it means

A closure that derives the explicit negative pairs a closed predicate
with a domain of the same arity: the domain tuples are the closed
scope, and a scope of pairs cannot close a predicate over singles.
When the two arities diverge, the closure would silently derive
nothing, so the compiler rejects the pairing instead.

Aligning the domain with the closed predicate — same number of places
on both sides — fixes it. Closures that derive nothing need no such
pairing and stay silent.

## Example

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

entity P;
relation lone(a: P) kind institutional;
relation pair(a: P, b: P) kind empirical;
closure ClosedLone {
  predicate lone;
  domain pair;
  snapshot "urn:law:demo:snapshot:lone";
  complete_as_of @2026-01-01T00:00:00Z;
  derive_explicit_negative true;
}
```

## Fix

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

entity P;
relation lone(a: P) kind institutional;
relation near(a: P) kind empirical;
closure ClosedLone {
  predicate lone;
  domain near;
  snapshot "urn:law:demo:snapshot:lone";
  complete_as_of @2026-01-01T00:00:00Z;
  derive_explicit_negative true;
}
```

## Engine message

The engine reports this in its own wording:

```text
example.law:10:10: error LDC-E2114: closure ClosedLone: closed predicate has arity 1, domain has 2; §70 (errata E-0087) requires a domain of the same arity as the closed predicate: its tuples are the closed scope. The closure is skipped at execution (NON_EXECUTABLE_CLOSURE), the explicit negative §231.1 is never derived, and the query answers NEITHER instead of FALSE
```

## Related

- [Negation and status](/constructs/negation-and-status/) — what the explicit negative derives.