Markdown for LLMs
LDC-E8302 — Decision table does not cover the universe
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-E8302 — Decision table does not cover the universe
## What it means
A decision table marked total promises that every input finds a row: no
input may fall through the table undecided. The compiler proves the
promise by partitioning the value universe of the inputs and checking
each cell against the rows. When a cell matches nothing, the promise is
broken — some input has no row — so the compiler stops and names a
witness input from the uncovered cell.
Add the missing rows until the universe is covered, or drop the total
mark if the table is meant to stay partial.
## Example
```run
{"argv": ["check", "$ROOT"], "files": {"law.toml": "[package]\nname = \"demo.diagnostics\"\nversion = \"0.1.0\"\nlanguage = \"0.2\"\nnamespace = \"urn:demo:diagnostics\"\n", "main.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:demo:diagnostics\";\n\nentity Person;\n", "rate.lawtable.json": "{\"schemaVersion\": \"law.decision/0.1\", \"kind\": \"decision-table\", \"id\": \"urn:demo:diagnostics#rate\", \"mode\": \"function\", \"hitPolicy\": \"first\", \"total\": true, \"inputs\": [{\"id\": \"x\", \"name\": \"days late\", \"type\": {\"name\": \"urn:law:std#Natural\"}}], \"outputs\": [{\"id\": \"r\", \"name\": \"rate\", \"type\": {\"name\": \"urn:law:std#Decimal\"}}], \"rows\": [{\"id\": \"only_small\", \"when\": [{\"input\": \"x\", \"condition\": {\"kind\": \"comparison\", \"op\": \"lt\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Natural\"}, \"value\": 10}}}], \"then\": [{\"output\": \"r\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Decimal\"}, \"value\": \"0.5\"}}], \"anchors\": [\"urn:demo:diagnostics#table\"]}]}", "law.lock": "{\"lockVersion\": \"0.2\", \"resources\": [{\"capability\": \"compile_time\", \"contentHash\": \"sha256:bbd2d73facc86a613287d903e58dc8ad7824592bbb7c946cfa379fe562923766\", \"id\": \"urn:demo:diagnostics#rate\", \"kind\": \"decision-table\", \"path\": \"rate.lawtable.json\"}]}"}, "expect": "LDC-E8302"}
```
## Fix
```run
{"argv": ["check", "$ROOT"], "files": {"law.toml": "[package]\nname = \"demo.diagnostics\"\nversion = \"0.1.0\"\nlanguage = \"0.2\"\nnamespace = \"urn:demo:diagnostics\"\n", "main.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:demo:diagnostics\";\n\nentity Person;\n", "rate.lawtable.json": "{\"schemaVersion\": \"law.decision/0.1\", \"kind\": \"decision-table\", \"id\": \"urn:demo:diagnostics#rate\", \"mode\": \"function\", \"hitPolicy\": \"first\", \"total\": true, \"inputs\": [{\"id\": \"x\", \"name\": \"days late\", \"type\": {\"name\": \"urn:law:std#Natural\"}}], \"outputs\": [{\"id\": \"r\", \"name\": \"rate\", \"type\": {\"name\": \"urn:law:std#Decimal\"}}], \"rows\": [{\"id\": \"small\", \"when\": [{\"input\": \"x\", \"condition\": {\"kind\": \"comparison\", \"op\": \"lt\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Natural\"}, \"value\": 10}}}], \"then\": [{\"output\": \"r\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Decimal\"}, \"value\": \"0.5\"}}], \"anchors\": [\"urn:demo:diagnostics#table\"]}, {\"id\": \"big\", \"when\": [{\"input\": \"x\", \"condition\": {\"kind\": \"comparison\", \"op\": \"gte\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Natural\"}, \"value\": 10}}}], \"then\": [{\"output\": \"r\", \"value\": {\"kind\": \"value\", \"type\": {\"name\": \"urn:law:std#Decimal\"}, \"value\": \"0.5\"}}], \"anchors\": [\"urn:demo:diagnostics#table\"]}]}", "law.lock": "{\"lockVersion\": \"0.2\", \"resources\": [{\"capability\": \"compile_time\", \"contentHash\": \"sha256:f71405f806ae828f56c08d6dc7018561bf0058f838a3ed6b96cf3b985431ce2f\", \"id\": \"urn:demo:diagnostics#rate\", \"kind\": \"decision-table\", \"path\": \"rate.lawtable.json\"}]}"}, "expect": null}
```
## Engine message
The table checker reports this in its own wording:
```text
LDC-E8302: total decision table does not cover the universe
```
## Related
- [LDC-E8301](/diagnostics/LDC-E8301/) — hit policies and row guards.