docs← Back to article

Markdown for LLMs

LDC-E1303 — Defeater without head

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

Download this articlePlain text ↗
# LDC-E1303 — Defeater without head

## What it means

A defeater with neither a `defeat` clause nor a `then` part attacks
nothing and derives nothing, so the compiler skips the node and warns.
In practice the parser reports the same headless rule first as
LDC-E0201, at the same position, so this warning is never the first
diagnostic on a plain check: the error is listed before the warning.

The repair is to give the defeater its attack: add a `defeat` clause
over the attacked atom, alongside a defeasible rule that produces a
candidate for the attack to meet.

## Example

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

relation p(x: Text) kind institutional;
relation q(x: Text) kind institutional;
rule R defeater {
    for v0: Text;
    when p(v0);
}
```

## Fix

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

relation p(x: Text) kind institutional;
relation q(x: Text) kind institutional;
rule Base defeasible {
    for v0: Text;
    when p(v0);
    then q(v0);
}
rule R defeater {
    for v0: Text;
    when p(v0);
    defeat q(v0);
}
```

## Engine message

The engine reports this in its own wording:

```text
example.law:7:6: warning LDC-E1303: defeater "R": without a `defeat` clause and a then-part; node is skipped
```

## Related

- [Defeasible rules and unless](/constructs/rule-defeasible-unless/) — defeaters and the attacks they spell.
- [LDC-E1308](/diagnostics/LDC-E1308/) — a defeater that keeps a `then` part.