docs← Back to article

Markdown for LLMs

Defeasible rules: pitfalls

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

Download this articlePlain text ↗
# Defeasible rules: pitfalls

> Updated 3 October 2026: `concept`, `except_when`, `claim`, `definition … sufficient`, and `default` strength have been removed, together with their special deprecation diagnostic. References below to the former behavior and corpus sources are historical. New source uses `relation`, `unless`, `duty`, a strict rule, and `defeasible`.

Wrong forms, silent outcomes, `LDC-E` diagnostics, typical mistakes of
formalizers and AI agents, and how to detect them.

## 1. `unless` on a strict rule; defeater against a strict head

`unless` in `rule … strict` — rejection `LDC-E4110` (exception nodes are
not generated); a `defeater` whose target is produced only by strict rules
or by nobody — rejection `LDC-E4112`.
A strict rule has no exceptions by definition. Detection:
`law engine check` fails. Fix: make the rule `defeasible` or move the
applicability condition into the strict body.

## 1a. Repeated `defeat` in one block

Two `defeat` clauses in one defeater are a rejection `LDC-E1329`:
one defeat target per block, like `scope` and `effective`.
Detection: `law engine check` names the repeated clause.

## 2. The proviso does not bind all head variables

`unless stall_reserved(s)` on head `may_use_stall(v, s)` — rejection
`LDC-E4101` on the name `<Rule>/unless/N`: the body
of the generated node is the condition `C` itself, the general rule’s `when`
is not carried into it, and range restriction applies to the node separately. Detection:
`law engine check` names the generated name. Fix: repeat the binding
conjunct as the first premise of the clause
(`unless stall_requested(v, s) and stall_reserved(s);`).

## 3. Expected Refuted, got Not established, not refuted

A bare `unless` and a separate defeater remove support without asserting the
opposite. Refusal is written in the contrary form
`unless C then not A` or as a rule with a `not A` head and priority.
The difference is measured on the ILO No. 138 package
(`intl.labour.c138`): the bare variant would have given
“undetermined” where the law says “no”.

## 4. A defeater cancelled a valued literal and carried away another’s inference

`defeat srednedneva(w, s, <computed-value>)` on matching values removes EVERY
candidate of the named literal, including other inferences: the result is
empty, `check` and the evaluation document are clean, not a single issue
anywhere. Detection: only by reading the
answer — warning `LDC-E2144` sounds when there are two or more defeasible
producers of the predicate. Fix: cancel a valueless applicability relation,
not a literal carrying a number.

## 5. Priority between same-polarity heads

Two inferences of one relation are not opposite under any arguments —
the edge expresses nothing: warning `LDC-E2142`. The
corpus still holds 46 such dead edges in 13 packages. Exception: an edge between links of an
`unless` chain — it is kept alive by the
closure, and `LDC-E2142` no longer sounds on it.

## 6. Answer Contradiction although “it is clear which norm is special”

The core does not count speciality by number of conditions or date:
declare `priority` with a `reason`. Priority over a strict
rule is impossible here (`LDC-E4105`): source rank is `defeasible` +
`priority … reason lex_superior` or `priority policy`, not `strict`.

## 7. Traps for AI agents

- A `then { a; b; }` block is accepted by the grammar but not lowered by the
  compiler: warning `LDC-E1302`, zero rules in the compiled output. Write separate `then`
  clauses — each becomes a separate head rule.
- Rule strength is explicit: use `defeasible` for a rule that may be
  defeated, `strict` otherwise.
- A head variable bound only by comparison or negation — `LDC-E4101`: add a
  positive literal that binds it.
- A keyword name (`event`, `case`, `calendar`, `action`) as a binder —
  `LDC-E0203`; quoted identifiers removed.
- Silent outcome: Not established, not refuted on an unfired rule is not refusal; Contradiction
  on two incomparable candidates is a preserved conflict, part of the answer.