docs← Back to article

Markdown for LLMs

LDC-E4107 — A priority between rules that can never conflict

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

Download this articlePlain text ↗
# LDC-E4107 — A priority between rules that can never conflict

## What it means

A priority orders two rules for the case where both could fire on the same
claim. When the two rules conclude different predicates, they never compete
over one claim: no reasoning path ever consults the edge between them, so
the edge never applies.

The compiler warns and keeps the package green. Remove the edge, or point
it at two rules that conclude the same predicate.

## Example

```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;
relation s(a: A) kind institutional;
rule r1 defeasible { for a: A; when p(a); then q(a); }
rule r2 defeasible { for a: A; when p(a); then s(a); }
priority e1: r1 > r2 reason demo.diagnostics.r1;
```

## Fix

```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;
relation s(a: A) kind institutional;
rule r1 defeasible { for a: A; when p(a); then q(a); }
rule r2 defeasible { for a: A; when p(a); then s(a); }
```

## Engine message

The engine reports this in its own wording:

```text
example.law:11:10: warning LDC-E4107: priority between provably non-conflicting rules "r1" (q) and "r2" (s) — heads over different predicates (§192)
```

## Related

- [Priority](/constructs/priority/) — how competing rules are ordered.