Markdown for LLMs
Expressions and quantities: corpus forms
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# Expressions and quantities: corpus forms
Analysis of real fragments: package identifier, act name, the key fragment, form rating
(exemplary / debatable / wrong-form choice) and why.
Corpus-wide counts (508 packages):
| Form | Occurrences | Packages | What it usually is |
|---|---|---|---|
| comparison in a body | 5,518 | 293 | threshold, period, size — a guard on numbers and dates |
| `+ - * / mod` | 3,944 | 210 | rate, base; `mod` — check digits |
| `count(collect …)` | 745 | 83 | "no fewer than two witnesses" |
| `min(…)`, `max(…)` | 150 | 28 | "no more than four points" |
| `sum(collect all …)` | 71 | 23 | summaries of shares and sums |
| money and percents | 228 | 28 | rates and thresholds |
| `exists … in … where` | 29 | 5 | "there is at least one level" |
| `forall … satisfies` | 2 | 2 | "all permits are registered" |
| `let`, `match` | one each | one each | layers and case analysis |
## Law
### 1. England-and-Wales intestacy — parameter-witness function (exemplary, inspected)
Package `gb.statute.administration_of_estates_act_1925` — Administration of Estates Act 1925 (England and Wales):
```law
function fixed_net_sum() -> Money = FixedNetSum;
```
An A3 `FixedNetSum` parameter read through a named function: every
use executes with a witness. Exemplary: the parameter name
is wrapped in a `function` declaration, not scattered bare across rules.
Neighbouring lines — the same function in a rule head and the norm's exact fraction (`(v - c - sum) * (1 /
2)`): the share one way for the whole computation.
### 2. GloBE Pillar Two — threshold functions and entity summary (exemplary, inspected)
Package `oecd.globe_etr` — OECD GloBE Pillar Two rules (international):
```law
function minimum_rate() -> Decimal = MinimumRate;
function de_minimis_revenue_threshold() -> Money = DeMinimisRevenueThreshold;
function de_minimis_income_threshold() -> Money = DeMinimisIncomeThreshold;
```
Three act thresholds as argument-free functions. Exemplary: the rate is `Decimal`,
the thresholds are `Money` of the same kind as the compared sums (comparison
requires kind agreement). Further down the package — the
`sum all amount: Money for ce: … where …` summary over list positions:
a charge aggregate is always `collect all`, not `collect`.
### 3. US military retirement — share via `div_round` (exemplary, inspected)
Package `us.code.military_retirement` — US military retirement pay rules (United States):
```law
then retired_pay_base(m, div_round(t, 36.0, 2, "HALF_UP"));
```
A 36-month average: money divided by a `Decimal` divisor `36.0` under
an explicit policy. Exemplary: the divisor is `36.0`, not `36`
(`Money / Integer` is not in the dividend table — `LDC-E2108`), the rounding is
one — over the exact quotient. A neighbouring rule is the same form with a
variable divisor `d: Decimal` ("the same proportion", short spelling without
double rounding).
### 4. Zakat on money — one fortieth under a policy (exemplary)
Package `fiqh.zakat` — zakat rules on money (Islamic jurisprudence):
```law
then zakat_money_due(o, div_round(w, 40.0, 2, "HALF_UP"));
```
The same form in religious law: `div_round(w, 40.0, …)` instead of a decimal
share approximation (`w * 0.025` is a mistake, not a form: the approximation
diverges from the norm on large sums). Exemplary for the same reason as item 3.
## Standard and economics
### 5. Gas project economics — `round` on a trade sum (exemplary, inspected)
Package `gas.project_economics` — gas project economics (sector model):
```law
then item_cost(w, cv, round(price * qty, 2, "HALF_EVEN"));
```
Price times quantity rounded with `round(…, 2, "HALF_EVEN")` —
banker's rounding of a trade sum. Exemplary: the policy named
explicitly, `precision` and `mode` mandatory (`LDC-E2116` without them). A later rule
in the same file — `div_round(f * 1.0, 1.0 + rate, 4, "HALF_EVEN")`:
lifting an `Integer` multiplier into `Decimal` by multiplying by `1.0`.
### 6. Fund allocation — round-down and remainder (exemplary, inspected)
Package `calc.allocation` — fund allocation primitives (calculation pack):
```law
then share_floor(a, r, div_round(pool * w, sumw, p, "DOWN"));
```
A fund share `pool * w / sumw` truncated `"DOWN"` to the queue precision, the
remainder picked up by a separate rule (`ShareScaledRemainder`).
Exemplary: the rounding is one — over the exact quotient; no double rounding
(separate `round` over the share). The short aggregate spelling nearby —
`count all f: Money for r: Recipient, w: Decimal where …`.
### 7. SI unit pack — unit and dimension declarations (exemplary)
Package `units.si` — SI unit dictionary (units pack):
```law
pub unit kg dimension Mass scale 1 / 1;
```
Benchmark unit declarations with dimension and scale — the dictionary all
magnitude arithmetic rests on. Exemplary: each unit
declared once, not attached by tag in every package
(`x / 3.6` as a unit conversion is a trap — see `pitfalls.md`, item 11).
## Science and medicine
### 8. Medication ordering — benchmark constant for the step to a number (exemplary, inspected)
Package `med.medication_order` — medication-order guidance (medical corpus):
```law
const MillilitreEdinitsa: Quantity = 1 ml {
label ru official "эталон одного миллилитра для явного перехода от объёма к безразмерному числу при расчёте дозы по концентрации";
}
```
A named benchmark makes the "volume → dimensionless number" transition explicit:
dividing a volume by `MillilitreEdinitsa` gives a millilitre count, not
a silent tag strip. Exemplary: `const` names the magnitude, the rule
below multiplies a dose by a counter
`n * q` — `Integer * Quantity`, the second operand's kind.
### 9. VIN check — Euclidean remainder (exemplary)
Package `us.cfr.vin` — US VIN check-digit rule (United States):
```law
then vin_check_remainder(vin, total mod 11);
```
A check digit via `Integer mod Integer` — Euclidean remainder:
`0 <= r < |b|` for any signs. Exemplary: the remainder is taken of
a whole total, not of an inexact magnitude (`Decimal` has no remainder —
`TYPE_ERROR`; policy first).
## Summary accounting
### 10. OFAC 50% rule — share summary (exemplary)
Package `us.ofac.fifty_percent` — OFAC fifty-percent ownership rule (United States): an ownership-share summary
`sum(collect all …)` in the form of items 2 and 6: charges summed over
list positions, the "no less than 50%" threshold a guard comparison in the body.
Exemplary: the same "threshold-constant + `collect all`" pair as in
`research.expressions.counted_threshold`.