Can we compile vocabulary into executable rules the way software developers compile code? We can translate carefully bounded language requirements into schemas, decision tables, permissions and tests. We cannot safely compile every ordinary sentence into a universally correct program without interpretation. “Customer verified” might mean an identity document was checked, a person replied to an email, or a reviewer examined evidence. Before code can act on the label, somebody with legitimate authority must choose and document the relevant meaning.
Vocabulary coding and engineering becomes concrete when a policy statement passes through stages resembling a compiler: identify concepts, remove ambiguous scope, represent the decision in typed fields, validate its structure, test positive and negative examples, and enforce permissions in the application. The goal is not to replace language with code. It is to expose where a word becomes a rule and make that transition testable. This guide explores the method from a single word through AI agents, software teams, public reporting and future superintelligence.
- Quick answer: bounded vocabulary can inform executable contracts; ordinary language needs interpretation before compilation.
- Word zoom: identify the intended concept, not merely the spelling.
- Grammar zoom: preserve exceptions, negation, obligation and time.
- Data zoom: use typed fields for money, dates, status and identity.
- Rule zoom: specify who may perform an action and what proves success.
- Testing zoom: compare valid, invalid and borderline cases.
- Institution zoom: record which authority adopted the operative definition.
- Future zoom: increasing model capability cannot by itself confer legal permission.
- Action: use the vocabulary-to-contract compiler checklist.
The problem begins before code is written
Consider the statement “Approved customers can receive a refund.” It looks clear. Yet a developer still needs to ask what counts as an approved customer, which purchases qualify, whether refund limits exist, which currency is used and who can initiate a payment. Without those choices, a machine may follow a plausible but incorrect interpretation.
A natural-language system can help enumerate the questions. The final decision should be captured in a controlled specification by people empowered to define the procedure, with necessary legal or specialist review. Calling an AI-generated interpretation “compiled” should not hide those choices.
A seven-stage vocabulary compiler
- Source intake: preserve the exact policy text, version, context and issuer.
- Concept analysis: identify objects and possible senses of each important term.
- Disambiguation: resolve unclear scope and preserve explicit unknowns.
- Intermediate representation: create typed fields for actors, actions, conditions, deadlines and exceptions.
- Validation: check required fields, allowed values and structural consistency.
- Behavioural tests: exercise decisions on positive, negative and borderline cases.
- Governed release: implement permissions, publish the change log, monitor errors and provide correction.
This is an analogy-based design proposal, not a proof that vocabulary is a formal programming language. A traditional compiler transforms a program written under defined syntax and semantics. Human language includes context and disagreement; converting it into executable decisions requires decisions about meaning first.
What a typed intermediate representation can prevent
| Natural wording | More inspectable representation | Common error avoided |
|---|---|---|
| “A small refund” | Amount, currency, ceiling, effective date | Different staff interpret “small” differently |
| “Recently active” | Activity type plus date window and time zone | Reports combine incompatible populations |
| “Human reviewed” | Reviewer role, reviewed material, timestamp, approval state | A page view is mistaken for evidence review |
| “May notify family” | Named recipient, explicit permission, message scope | A broad promise becomes unapproved disclosure |
| “Urgent” | Specified urgency category, criteria and escalation procedure | A keyword alone triggers the wrong action |
Typed fields reduce some ambiguity because they force the designer to describe what is being counted. They do not guarantee good choices. The program may still use a flawed definition of eligibility, or the data may be wrong. The structure is a place to inspect policy, not a substitute for policy.
Three useful standards—and what each does not do
The ISO 704:2022 terminology-work principles describe relationships between objects, concepts, definitions and designations. That is useful for choosing what a field actually denotes before naming it. The standard does not automatically generate working software or determine which rights a company should grant.
The JSON Schema documentation shows how required fields and allowed structures can be described for JSON data. A schema can require an amount, currency and status field, but it does not prove that a claimed amount was paid or that a transaction was authorised. The W3C SHACL Recommendation similarly defines constraint validation for RDF data graphs, not a universal test of real-world truth.
The OpenAPI Specification v3.1.1 provides a language-agnostic description of HTTP interfaces: operations, parameters, requests, responses and security declarations. An OpenAPI document may describe how a tool is invoked; implementing legitimate authorisation and checking actual effects remain separate responsibilities.
Worked example: “approve” has several incompatible meanings
A fictional online store uses “approved” for customers whose email address has been confirmed. The finance team uses it for requests reviewed by an authorised manager. The AI interface displays “approved refund” when a model predicts that a customer would likely qualify. These three operations are not interchangeable. If the same status field is reused, the system can inadvertently attempt a refund on a prediction alone.
A better intermediate representation separates identity checked, eligibility assessed, reviewer authorised, payment requested and transfer settled. Each state has an issuer, timestamp and evidence source. The interface can then tell the user what actually happened without inventing a stronger promise.
A simplified decision table
| Condition | Allowed outcome | What must not be inferred |
|---|---|---|
| User requests a refund explanation | Explain policy and gather authorised facts | Do not execute payment |
| System predicts eligibility | Mark as preliminary assessment | Do not label the request manager-approved |
| Authorised reviewer approves | Permit the specified next step within controls | Do not automatically claim money was sent |
| Payment provider confirms settlement | Report settlement with appropriate reference | Do not retroactively assume every earlier step was verified |
| Status cannot be checked | Report unknown and request follow-up | Do not claim success from a timeout |
The table is instructional rather than financial advice. Its purpose is to distinguish claim, classification, authorisation, execution and confirmation. Those stages must not be flattened into the single adjective “approved”.
All zoom levels: where a vocabulary compiler matters
| Zoom | Potential mismatch | What to specify |
|---|---|---|
| Character | A lost minus or negation | Exact data and syntax constraints |
| Word | “Approved” has several senses | Concept identifier and source definition |
| Clause | A condition is omitted | Preconditions and exceptions |
| Sentence | A recommendation is treated as a command | Permitted action type |
| Conversation | Earlier restrictions disappear | Context and authoritative request |
| Data model | Fields have overlapping meanings | Typed states and valid transitions |
| AI model | A plausible parse becomes a purported fact | Evidence and uncertainty handling |
| Tool | The AI can access a powerful API | Least privilege and actual authorization |
| Organisation | An old glossary drives new code | Versioned rollout and comparison |
| Government | Administrative criteria change | Authoritative scope and effective date |
| Global network | Currency, translation or law differs | Explicit units and jurisdiction |
| Far future | More capable systems generate more rules | Human approval and independently enforced boundaries |
Compiler errors that look like perfect answers
Type confusion: a date string is accepted without a time zone, so two systems disagree about when a deadline passed. Scope confusion: an instruction intended for one customer is applied to all customers. Authority confusion: a model’s suggestion is recorded as a manager’s approval. State confusion: an API response of “accepted” is displayed as “completed”.
All four failures can occur even when the model writes grammatically excellent explanations. A testing team should inspect the emitted structured decision and the resulting real-world action. Natural-language quality is not a sufficient product test.
Who signs off on the rules?
A program can enforce whatever rule has been written; it does not decide whether the rule deserves authority. A company data steward may approve an internal reporting category. A public body may have powers defined by law. A research community may debate a scientific operational definition. An AI model can suggest options and identify contradictions, but its output is not a substitute for legitimate institutional decisions.
A well-governed release records the original source, agreed interpretation, reviewers, version, boundary cases and known exceptions. It also provides a channel for users to challenge a mistaken classification. That is how vocabulary engineering can become accountable system engineering rather than another fashionable label.
Testing the compiled rule with deliberately difficult cases
- Test one ordinary case that should pass.
- Test one case that clearly fails.
- Test the exact numerical or time boundary.
- Test an ambiguous source with missing data.
- Test a quoted instruction inside untrusted content.
- Test whether the user can prevent an external action.
- Test partial failure, including a timeout after a tool may have executed.
- Retest older records after changing the definition.
Do not assert that validation passed merely because a JSON object fits a schema. Structural validity, correct business rules, verified facts and legitimate permissions are separate tests. Each should have a named owner and a failure response.
Why semantic debt follows a bad compilation
Suppose an organisation changes “successful case” from “response sent” to “issue remedied” but does not update historical reports, AI training labels or partner interfaces. New software uses the better term, while old data carry the previous meaning under the same status. This is semantic debt: different concepts share an unqualified name.
The related guide to AI agents sharing meaning discusses semantic contracts and ontology mappings. Can Language Be Engineered Like Computer Code? develops the wider analogy. Both make clear that a shared name is not enough when an action depends on its meaning.
What would superintelligence change?
A hypothetical system with exceptionally strong reasoning could help draft schemas, find contradictions and generate thorough test cases. That would not automatically make its selected interpretation fair, lawful or authorised. The more powerful the resulting agent, the more important it becomes to separate competence from permission and provide safe review, rollback and recourse.
A useful future protocol would expose not only the machine-executable rule but also the original human purpose, scope, unresolved alternatives and evidence of approval. More capable compilers can assist meaning transfer; they cannot make contested human values disappear.
Frequently asked questions
Can an AI compile every policy paragraph into code? It can propose structured interpretations; open-ended text may require clarification, expert judgment and approval before execution.
Does JSON Schema prove that a rule is correct? No. It can validate structure according to a chosen schema; factual and normative correctness need other checks.
What is the best first field to define? Choose a consequential status such as “approved”, “paid”, “verified” or “resolved” and document what evidence qualifies it.
What should happen when definitions clash? Preserve the competing meanings, identify the authorised rule for the task and avoid executing on an unresolved mapping.
Sources and further reading
- ISO 704:2022 — Terminology Work
- W3C SHACL — Shapes Constraint Language
- JSON Schema — Object and Required Properties
- OpenAPI v3.1.1
- W3C PROV Overview
Editorial note: “vocabulary compiler” is a proposed engineering analogy and workflow, not an adopted universal system for converting natural language into fully correct executable rules. Examples are hypothetical. Reviewed 26 November 2026.
