LDC-E1116 — Undeclared cross-file reference
For LLMs5 sections
What it means
Section titled “What it means”A package can span several files, and in the explicit authoring mode
every file declares which of the other files’ names it uses. The
declaration lives in a use self block at the top of the file. When a
rule reaches for a name declared in another file without listing it
there, the compiler stops at the first use: the reference is real, but
the declaration is missing.
The repair is to list the missing name in the file’s use self block.
The block names authoring declarations — entities, relations, rules —
one per file that uses them. Files that need nothing declare nothing.
Example
Section titled “Example”{"argv": ["check", "$ROOT"], "files": {"law.toml": "[package]\nname = \"demo.diagnostics\"\nversion = \"0.1.0\"\nlanguage = \"0.2\"\nnamespace = \"urn:law:demo:diagnostics\"\n\n[authoring]\nlocal_imports = \"explicit\"\n", "a.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:law:demo:diagnostics\";\n\nentity Person;\nrelation adult(p: Person) kind institutional;\nrelation senior(p: Person) kind institutional;\n", "b.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:law:demo:diagnostics\";\n\nuse self::{ Person, senior };\n\nrule Senior(p: Person) defeasible {\n when adult(p);\n then senior(p);\n}\n"}, "expect": "LDC-E1116"}{"argv": ["check", "$ROOT"], "files": {"law.toml": "[package]\nname = \"demo.diagnostics\"\nversion = \"0.1.0\"\nlanguage = \"0.2\"\nnamespace = \"urn:law:demo:diagnostics\"\n\n[authoring]\nlocal_imports = \"explicit\"\n", "a.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:law:demo:diagnostics\";\n\nentity Person;\nrelation adult(p: Person) kind institutional;\nrelation senior(p: Person) kind institutional;\n", "b.law": "language \"law.core\" version \"0.2\";\npackage demo.diagnostics version \"0.1.0\";\nnamespace \"urn:law:demo:diagnostics\";\n\nuse self::{ Person, senior, adult };\n\nrule Senior(p: Person) defeasible {\n when adult(p);\n then senior(p);\n}\n"}, "expect": null}Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.