docs← Back to article

Markdown for LLMs

Show a defeated position

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

Download this articlePlain text ↗
# Show a defeated position

## Intention

I want to see an excluded duty without letting it generate consequences.

## Incorrect form and why it stays silent

```text title="Incorrect form"
// DEFEATED скрывают из positions или публикуют instance_of как у активной нормы.
```

The position is visible with payload and createdBy, but its status literals and links are not published. Without a producer there is no position at all; when excluded it exists as DEFEATED.

## Correct form

```law
language "law.core" version "0.2";
package recipes.zh.r08 version "0.1.0";
namespace "urn:recipe:zh-violation:08";

entity Person;
relation enrolled(p: Person);
relation done(p: Person);
relation excluded(p: Person);
relation followup(p: Person);
rule Primary defeasible { for p: Person; when enrolled(p);
    then duty Main { bearer p; achieve done(p) during [@2026-09-01, @2026-09-10]; };
    unless excluded(p);
}
rule Follow strict { for pos: PositionInstance; for p: Person;
    when instance_of(pos, Main) and bearer_of(pos, p); then followup(p);
}
```

## Frozen execution scene

| Facts and snapshot | Question | Answer |
|---|---|---|
| no ground; 2026-09-13 | `positions()` | `not positions_present();` |
| ground excluded; 2026-09-13 | `positions()` | `position(Main, DEFEATED);` |
| the link is not published; 2026-09-13 | `truth(followup(entity_ref("urn:recipe:zh-violation:08:p")))` | `truth_status == NEITHER;` |
| surviving ground; 2026-09-13 | `truth(followup(entity_ref("urn:recipe:zh-violation:08:p")))` | `truth_status == TRUE_ONLY;` |
| proviso removed; 2026-09-13 | `truth(followup(entity_ref("urn:recipe:zh-violation:08:p")))` | `truth_status == TRUE_ONLY;` |

```law
test "no ground creates nothing" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-30T09:00:00+05:00;
            timezone "Asia/Almaty";
        }

    }
    evaluate positions();
    expect not positions_present();
    expect evaluation_status == COMPUTED;
}
```

```law
test "excluded ground defeats visibly" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-30T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert enrolled(entity_ref("urn:recipe:zh-violation:08:p")); assert excluded(entity_ref("urn:recipe:zh-violation:08:p"));
    }
    evaluate positions();
    expect position(Main, DEFEATED);
    expect evaluation_status == COMPUTED;
}
```

```law
test "unpublished linkage stays unknown" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-30T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert enrolled(entity_ref("urn:recipe:zh-violation:08:p")); assert excluded(entity_ref("urn:recipe:zh-violation:08:p"));
    }
    evaluate truth(followup(entity_ref("urn:recipe:zh-violation:08:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;
}
```

```law
test "surviving ground supports followup" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-30T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert enrolled(entity_ref("urn:recipe:zh-violation:08:p"));
    }
    evaluate truth(followup(entity_ref("urn:recipe:zh-violation:08:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

```law
test "removed clause restores followup" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-30T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert enrolled(entity_ref("urn:recipe:zh-violation:08:p")); assert excluded(entity_ref("urn:recipe:zh-violation:08:p"));
    }
    evaluate truth(followup(entity_ref("urn:recipe:zh-violation:08:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

```python
>>> import runpy
>>> check = runpy.run_path("docs/recipes/zh-violation/resources/check.py")
>>> check["check_proof"](https://github.com/arxohq/law/blob/master/docs/recipes/zh-violation/8)
'Ж8: структура доказательства проверена; lawc = lawref'
```

## Counterfactual

Diagnostic mutation `rule Primary defeasible` → `rule Primary strict`: LDC-E4110. Semantic differences are pinned as separate scenes.

## Boundary

DEFEATED applies to the losing ground, not to a lifecycle transition. It is not added to statusHistory; the defeat node must name the losing application.