Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Argon is a programming language for declarative ontology modeling with first-class reasoning. Its purpose is to let you describe a domain — its concepts, the relations between them, the rules that hold over them — in a single, typed, packageable language and then run things against that description: queries, mutations, simulations, regulatory checks, diagrams.

This chapter answers four questions: what Argon is, who it is for, what is distinctive about it, and how it relates to the tools you already know.

What Argon is

A working Argon program contains four kinds of items.

Concepts are the things in your domain. A Person, a Lease, a Property, a Mortgage. A concept declaration introduces a type and the fields that go with it. Concepts form hierarchies: a ResidentialLease is a Lease, a Tenant is a Person.

Relations connect concepts. They can be binary (HasResidence(person, residence)) or carry their own structure (a Lease mediates a Tenant, a Landlord, and a property — and has its own dates and rent).

Rules derive new facts from existing ones. derive ActiveLease(l) :- l.start_date <= today(), l.end_date > today() reads as “a Lease is ActiveLease when these conditions hold.” The reasoner picks an evaluator per rule type — structural saturation for the cheap fragment, Datalog for the recursive one, an event-driven engine for reactive rules — and the same evaluators run at compile time and at runtime. Every derivation carries provenance.

Operations do work over the model. compute items are pure functions. query items return bindings. mutation items change the world and emit typed events into a bitemporal log. Each kind picks the body shape that fits its job: = expr, :- body, or { stmts }.

A package collects these items, ships them through a registry, and lets other packages import them. The toolchain — oxup for installing, ox for building/testing/running, ox-lsp for editor integration — is shaped like Cargo’s, intentionally.

Why Argon

A few things that working ontology engineers have asked of their tools, and that Argon tries to answer.

Compose like software. Foundational ontologies (UFO, BFO, DOLCE) and domain ontologies live in different repositories, evolve at different rates, and need to compose. Argon packages do that. There is no monolithic schema; there are libraries, and a manifest, and a lockfile.

Reason at compile time when you can. Most rules are decidable. A few are not. Argon’s tier ladder makes the line explicit: rules at tiers 0–3 execute; rules at tiers 4–6 parse and elaborate but do not run, so the compiler tells you up front when you have written something the engine cannot evaluate. @[theorem] marks a derive as a theorem claim and preserves the marker through to the kernel for a future mechanical-verification pipeline (the pass itself is not yet active). Refinement types are a decidable fragment with a polynomial-time decision procedure.

Carry time with you. Every fact has a valid time (when it is true in the world) and a transaction time (when the system learned it). Mutations publish typed events into an append-only log. Queries can dial in a standpoint, a fork, or a historical timestamp. You do not bolt this on; it is built in.

Show your work. Every result carries why-provenance. Every diagram is generated from the same source the rest of the language reads. Tests live next to the model.

Who Argon is for

The book imagines two readers.

The first is a foundational-ontology researcher or a domain modeller who has been building in OntoUML, OWL, or hand-rolled DL formalisms. You know what a relator is, what a sortal is, why disjointness and completeness matter, why decidability is not a curiosity. What you have wanted is a language whose ergonomics, packaging, and tooling let you ship a model the way a Rust crate ships a library.

The second is a working programmer — Rust, TypeScript, Haskell, OCaml — who has been hand-rolling typed domains and finally wants to declare them once. You may not yet know the term relator; you have certainly written one many times by hand and watched the runtime checks pile up.

Either way, the book starts at the toolchain and walks you through to a compiled, tested, queryable, visualizable lease ontology. Read straight through and it should take a long afternoon.

What is distinctive

Several pieces of Argon, taken individually, exist elsewhere. The synthesis is what is unusual.

  • Vocabulary-neutral by construction. Argon’s language core ships zero foundational metatypes. kind, subkind, role, phase, relator, category — these are not keywords. They come from a vocabulary package (UFO, BFO, your own). The reserved-keyword set is small; almost everything composes from packages.
  • Three computational modes, one type system. compute for pure functions, derive/query for declarative reasoning, mutation for state-changing operations. Refinement types and the metatype calculus apply uniformly to all three.
  • Decidability tier ladder. Seven named tiers from tier:structural (polynomial, the cheapest) through tier:fol (full first-order logic) up to tier:mlt (multi-level theory). The compiler classifies every rule. Tier-cap enforcement at the module level keeps a package’s effective fragment honest.
  • Bitemporal + event-sourced + standpoint-aware. The runtime is built around an append-only axiom-event log with valid-time and transaction-time axes; standpoints discriminate views; forks branch the world.
  • Mechanically verified core. Refinement-fragment decidability (PTIME), occurrence-typing soundness, and meta-property-fixpoint termination + uniqueness are stated and proven in Part 5.

How Argon compares

A short, comparative sketch — useful if you have spent time with any of these.

ToolWhat it does wellWhere Argon differs
OWL / Description LogicsMechanically reasonable; standardised (Motik et al. 2012); well-studiedProgramming-language ergonomics; first-class packaging; bitemporal + event log; refinement types; per-rule decidability classification rather than fixed profiles
Datalog with stratified negationClean declarative semantics; PTIME data complexity; well-foundational (Abiteboul, Hull & Vianu 1995)Richer types (refinement, primitives, generics); mutations + events; modal + Allen operators; standpoints; bitemporal axes
PrologMaximally expressive; SLD resolutionDecidable subsets via the tier ladder; @[theorem] markers (mechanical-verification pipeline planned); package system; static types; non-defeasibility default
OntoUML / UFOSemantic richness; foundational-ontology grounding (Guizzardi 2005)Executable; ox diagram round-trips OntoUML; mutations + tests next to the model; UFO is a package, not a built-in; refinement types over the metatype calculus
Defeasible Logic ProgrammingArgument-based defeasibility (García & Simari 2004; Governatori et al.)Native @[default] / @[override] decorators; integrated with type system; project-level lex orderings ([defeat] order = [...])
TypeScript / Rust typesMainstream; tooled; refinement support via librariesReasoning, not just type-checking; ontology-shaped, not class-shaped; constraints in the type system, not in runtime checks; first-class temporal axes
RDF* / Property graphsQuad/edge-attribute representation; vendor-supportedStatic typing; mechanically-verified refinement-fragment decidability; first-class metatype calculus; tier-classified rules

A finer-grained feature matrix:

FeatureOWL 2 RLDatalog±NaFOntoUMLArgon
Subsumption reasoning✓ (encoded)✓ (via UFO axioms)✓ (Tier 0)
Default reasoning / defeasibility✓ (@[default] / @[override])
Refinement types✓ (PTIME-decidable fragment)
Bitemporal valid + tx
Standpoint discrimination✓ (project-level lattice)
Event-sourced mutations✓ (mutation items + append-only log)
Compile-time mechanical verificationplanned (@[theorem] markers preserved today; verification pass forthcoming)
Vocabulary-neutrality (no built-in metatypes)n/a✗ (UFO baked-in)✓ (UFO is a package)
Per-rule decidability classification✓ (seven-tier ladder)
First-class diagrams✓ (via tooling)✓ (diagram items in source)

You do not have to pick a side. An Argon project can import an OntoUML-flavored UFO package, emit OntoUML JSON for visual tools, target OWL where downstream consumers need it, and still keep a typed compile-and-test loop the rest of the time.

What this book covers

The book covers Parts 1 through 5: getting started, foundations (concepts, relations, rules, computations and mutations, the type system), composition (patterns, state machines, tests, diagrams), packages and tooling, and the advanced material — the metatype calculus, defeasibility, the tier ladder in detail, standpoints and bitemporal. Where the language is still moving, the chapters flag it inline; the full migration trajectory lives in Appendix D.

The shortest path to a working ontology is to read Chapter 1 end-to-end, then Chapter 2, then Chapter 3.4. That gets you to “concepts, relations, rules, and a diagram of what you have built.”

What’s in argon/examples/

The repository ships with a library of runnable example packages alongside this book. Each is a complete Argon workspace — ox.toml, src/prelude.ar, sometimes a README.md — that you can cd into and exercise with ox check. The book draws on them throughout; this is the canonical index.

Tutorial:

  • lease-story/ — the residential-lease ontology built up through Chapters 2–3. The book’s running example.

Foundational ontology ports (each is a minimal smoke test, useful when you want to see a vocabulary stand on its own):

  • bfo-smoke/ — Basic Formal Ontology. Declares temporal_status and dependence axes, four BFO metatypes, six BFO concepts, two BFO structural rules.
  • dolce-lite/ — DOLCE-Lite. A second independent foundational vocabulary, used in the book to demonstrate disjoint-non-interference composition with BFO.

Domain ontologies (each is a port of a published ontology, faithful to the source):

  • pizza/ — the Manchester pizza ontology. The canonical OWL classroom example, ported to Argon. Exercises five relation characteristics (@[transitive], @[symmetric], @[asymmetric], @[functional], @[inverse-functional]) across a class lattice with multiple inheritance.
  • time/ — OWL-Time. All 13 Allen relations as first-class pub rel declarations, ~25 datatype properties, DayOfWeek and MonthOfYear enums.
  • foaf/ — Friend Of A Friend. The social-graph ontology.
  • skos/ — Simple Knowledge Organisation System.
  • wine/ — the wine ontology (Hendler / McGuinness OWL teaching example).

Composition demos:

  • ontology-tour/ — a registry consumer that pulls pizza, foaf, and wine into a single project and declares a tour_role metaxis for type. Useful as a worked example of cross-package composition.

Beyond these, argon/examples/_catalog/ holds ~530 minimal mini-workspaces — one per (feature, variant) pair — that exercise each atomic feature of the language in isolation. The catalog is the reference companion to the book; see argon/examples/_catalog/README.md for the index.

Open a terminal. The next chapter installs the toolchain.