docs← Back to article

Markdown for LLMs

Split a term’s meaning by the act’s purpose

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

Download this articlePlain text ↗
# Split a term’s meaning by the act’s purpose

## Intent

I want to apply a definition only in an explicitly named domain.

A domain is not transferred by a matching word.

## Wrong form and why it stays silent

```law title="Incorrect form"
definition eligible(p: Person) exact { when young(p); for_purposes_of Tax; }
```

The for_purposes_of shorthand is rejected with E0201. The executable domain in the example is an ordinary scope formula; it constrains both halves of exact.

## Correct form

```law
language "law.core" version "0.2";
package recipes.g.r06 version "0.1.0";
namespace "urn:recipe:g-concepts:06";

entity Person;
relation young(p: Person) kind empirical;
enum Purpose { Tax; Civil; }
relation purpose(p: Person, purpose: Purpose);
definition eligible(p: Person) exact {
    when young(p);
    scope purpose(p, Tax);
}
```

## Frozen execution scene

| Facts on 13.09.2026 | Question | Answer |
|---|---|---|
| tax purpose | `truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")))` | `truth_status == TRUE_ONLY;` / `COMPUTED` |
| civil purpose | `truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")))` | `truth_status == NEITHER;` / `COMPUTED` |
| purpose not named | `truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")))` | `truth_status == NEITHER;` / `COMPUTED` |
| scope removed | `truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")))` | `truth_status == TRUE_ONLY;` / `COMPUTED` |

```law
test "tax purpose qualifies" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert young(entity_ref("urn:recipe:g-concepts:06:p")); assert purpose(entity_ref("urn:recipe:g-concepts:06:p"), Tax);
    }
    evaluate truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

```law
test "civil purpose stays unknown" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert young(entity_ref("urn:recipe:g-concepts:06:p")); assert purpose(entity_ref("urn:recipe:g-concepts:06:p"), Civil);
    }
    evaluate truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;
}
```

```law
test "unnamed purpose stays unknown" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert young(entity_ref("urn:recipe:g-concepts:06:p"));
    }
    evaluate truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")));
    expect truth_status == NEITHER;
    expect evaluation_status == COMPUTED;
}
```

```law
test "removed scope restores unqualified reading" {
    given {
        context {
            legal_time @2026-09-13;
            decision_time @2026-09-13T09:00:00+05:00;
            knowledge_time @2026-09-13T09:00:00+05:00;
            timezone "Asia/Almaty";
        }
        assert young(entity_ref("urn:recipe:g-concepts:06:p")); assert purpose(entity_ref("urn:recipe:g-concepts:06:p"), Civil);
    }
    evaluate truth(eligible(entity_ref("urn:recipe:g-concepts:06:p")));
    expect truth_status == TRUE_ONLY;
    expect evaluation_status == COMPUTED;
}
```

## Counterfactual

Mutation `scope purpose(p, Tax);` → `for_purposes_of Tax;`: LDC-E0201.

## Boundary

Purpose is a synthetic case input, not a built-in choice of legal order. Two independent acts must have their own symbols and domains. Imported enum members require qualification — see [Distinguish an enum member from a data variant](/recipes/g-concepts/enum-and-variant/).