Learning Ampersand
There is a particular satisfaction in watching something you described come to life and run. You can have that very kick here: sketch a small world — who may enrol in which course, say — click through a working application within the hour, and then deepen your understanding one idea at a time. What follows is a short, ordered path — tutorial first, then the ideas beneath it, then practice. So, you can see the whole route before you take a single step and judge whether it suits the way you like to learn.
You do not need any prior knowledge of Ampersand. A little familiarity with information systems helps, but the tutorial explains the ideas as you go, one step at a time.
Your learning path
Step 1 — Do the tutorial (about 1–2 hours)
Start with the tutorial. You will look at a small information system called Enrollment, build and run it yourself in the web-based tool RAP4, and meet the first keywords of the language. By the end you will have a working prototype and a feel for what Ampersand does. This is the best place to begin — everything else builds on it.
Step 2 — Keep the syntax reference at hand (ongoing)
While you work through the tutorial and start writing your own code, keep the Syntax of Ampersand open in a second tab. It is a reference, not a course: use it to look up the exact form of a statement the moment you need it, rather than reading it front to back. The companion pages on terms and interfaces go one level deeper when you are ready.
Step 3 — Understand the idea behind the rules
Ampersand rests on a small but powerful idea: a business rule is a statement in relation algebra. You do not need to master the mathematics to be productive, but a little goes a long way. Read the conceptual model section of the tutorial, and follow the link to relation algebra when you want to understand why a rule constrains your data the way it does.
Step 4 — Practice on your own
Learning sticks when you build something. Study the examples of real Ampersand specifications to see idioms in context, then take on the exercises to sharpen your skills. Try to specify a small system of your own — even a to-do list or a library — and run it in RAP4.
Questions & answers
Welcome! Whether you're starting the tutorial, wrestling with your first rule, or running your model for real, this chapter answers the questions learners ask most. No prior Ampersand knowledge is assumed — just bring your curiosity.
Getting started
What is Ampersand and what can it do for me? Ampersand turns your business rules into a working information system, so you go from ideas to a running prototype without hand-coding a database or UI. Think of it as a low-code, rule-based environment for modelling, prototyping, and generating software. Learn more →
Do I need prior knowledge to start learning Ampersand? No — you can start from scratch. A little familiarity with information systems helps, but the tutorial explains every idea step by step, so you'll never be left guessing. Learn more →
What learning path should I follow as a student new to Ampersand? Start with the RAP4 tutorial, keep the syntax reference at hand, get the relation-algebra idea behind rules, then cement it all by practising with examples and exercises. This route takes you from zero to confident modeller in a sensible order. Learn more →
Where should I start reading the Ampersand documentation based on my role or interest? The introduction points you to exactly the right starting page — whether you're curious, a student, a professional, a scientist, or a software engineer — so you don't waste time wandering. Learn more →
What are good reasons to build an Ampersand model? Modelling pays off when you want to study a domain, design an application, spot architecture flaws, write a functional specification, or cleanse data. Knowing your "why" helps you get the most out of every model you build. Learn more →
Following the tutorial
How do I get started building an information system with Ampersand using RAP4? RAP4 is a web-based tool where you write, compile, and run scripts right in your browser — nothing to install. The tutorial walks you end to end through the Enrollment example, so you learn by building something real. Learn more →
What are the basic ingredients of an Ampersand conceptual model? Every model is built from CONCEPTs, RELATIONs, and RULEs, then enriched with interfaces, populations, and meanings. Once you recognise these few building blocks, the whole language clicks into place. Learn more →
How can I extend the Enrollment example, for instance to register teachers? Add a CONCEPT Teacher, a RELATION providedBy, and an interface line, then recompile, regenerate the prototype, and reinstall the database. It's a satisfying way to see your own changes go live. Learn more →
Are there videos that walk me through setting up the Ampersand environment? Yes — the Quick Start Guide videos cover setup and build, folder structure, and local configuration, so you can watch and follow along. You'll just need Git and Docker ready first. Learn more →
Is there a video series explaining the Enrollment example? Yes — the Enrollment tutorial videos walk through the code, show you how to use and modify the model, and cover questions and CRUD. Perfect if you prefer learning by watching. Learn more →
Learning the language
Where do I find the complete reference description of the Ampersand language? The reference-material section is your dictionary for the whole language — keep it open as you write scripts. It's a reference, not an intro course, so reach for it when you need precise answers. Learn more →
What do the core Ampersand terms like atom, concept, relation, rule, and pattern mean? The dictionary defines every Ampersand notion with a meaning, an example, and a purpose, and links to where each is fully explained. It's the fastest way to look up a word you just met. Learn more →
How do I write comments and name concepts and relations in an Ampersand script?
Single-line comments start with -- and multiline comments use {- -}; concept names start with a capital letter and relation names with a lowercase letter. Getting these conventions right keeps the compiler happy from the start. Learn more →
What do the ?, +, and * symbols mean in Ampersand syntax descriptions?
In the grammar notation they mean zero-or-one, one-or-more, and zero-or-more occurrences. Once you can read this, the whole syntax reference opens up to you. Learn more →
What is an atom in Ampersand? An atom is one individual object inside a context — and because it identifies exactly one real-world thing, every statement you make about it is unambiguous. This precision is what makes your model trustworthy. Learn more →
What is a context in Ampersand and why does it matter? A context is a set of true statements in one language, within which nothing may contradict anything else. Every fact you write lives inside a context, which is what keeps your model consistent. Learn more →
What does it mean for a statement to be true in Ampersand? A pair in a relation represents a fact — a true statement — and truth always holds only within a given context. Grasping this makes rules and violations feel natural rather than mysterious. Learn more →
How do I state that one concept is a specialization of another?
Write CLASSIFY Specific ISA Generic, which says every atom of the specific concept is also an atom of the generic one. It's a tidy way to capture "is a kind of" relationships in your model. Learn more →
The ideas beneath the rules
What is a term in Ampersand and what is its meaning? A term combines relations with operators to denote a set of pairs — in effect, a brand-new relation you've built yourself. Mastering terms is what lets you express rich rules from simple parts. Learn more →
What does composition (r;s) mean in relation algebra?
r;s relates a to c whenever there's a b with a r b and b s c, producing a relation of type [A*C]. It's the operator you'll reach for to chain relationships together. Learn more →
What is the difference between a declarative and a procedural specification? A declarative spec defines a thing by its constraints; a procedural one prescribes the ordered steps to produce it. Ampersand is declarative, so you describe what must be true and let the tool work out the how. Learn more →
What does it mean that Ampersand follows the reactive programming paradigm? It treats your information system as data that changes over time plus rules that must stay satisfied, reacting whenever an event breaks one. This is the mindset shift that makes rule-based design powerful. Learn more →
How does a rule like "every parcel must have an owner" behave when data is inserted? The moment an ownerless parcel appears, the system signals a violation; as soon as you supply an owner, the rule is satisfied again. Seeing rules police your data live is one of the most rewarding "aha" moments. Learn more →
How does the theory define a dataset, and why is it based on triples? A dataset is a set of well-typed triples plus an instance relation. Building the theory on triples keeps it independent of any particular database technology, so the ideas you learn transfer everywhere. Learn more →
Is there a book or course on rule-based design with Ampersand? Yes — the Open Universiteit publishes the open book "Rule Based Design," used in its course of the same name. It's a great companion if you want to go deeper than the tutorial. Learn more →
Modelling your own domain
What does a conceptual (domain) model in Ampersand consist of? It consists of concepts, relations, the language structure that links them, and the constraints that govern the domain. Learning to see your domain in these terms is the heart of conceptual modelling. Learn more →
How can I validate that my conceptual model can represent the facts of my domain? Invent two or three facts per relation and write them as a POPULATION, then check the relations can actually hold them. It's a quick, concrete sanity check that catches modelling mistakes early. Learn more →
How do I extract relations from a spreadsheet table to build a data model? Treat each row as an instance of the source concept and each column as a relation, naming each relation after its column. This simple recipe turns familiar spreadsheets into proper models. Learn more →
Why should I write a MEANING for every relation in a data model? The meaning tells you how to talk about what the relation holds, and writing it out prompts stakeholders to reveal where their interpretations differ. It's a small habit that prevents big misunderstandings. Learn more →
What is the difference between requirements and specifications in Ampersand? Requirements say in prose what users want; Ampersand specifications define unambiguously what to build. Knowing the difference helps you translate fuzzy wishes into precise, buildable rules. Learn more →
Building interfaces
How do I define a user interface in Ampersand and how is it displayed? Define an INTERFACE with an interface term and a BOX of labelled field terms; each field shows the data its term selects for the current atom. With a few lines you get a real, clickable screen. Learn more →
What does a worked client interface look like and how is it structured? It has a header — name, FOR-roles, and interface term — followed by a BOX of labelled box items, each with a term that selects the data to display. Studying one worked example teaches you the whole pattern. Learn more →
How can I create a nested, hierarchical interface in Ampersand? Follow a field term with a BOX containing subinterfaces; each atom in that field's codomain gets its own box, mirroring the page hierarchy. This is how you build drill-down screens that feel natural. Learn more →
How do I change the layout of an Ampersand interface, e.g. tabs or tables?
Refine BOX with templates like <FORM>, <TABLE>, or <TABS> to control layout, plus widget templates such as <PROPBUTTON> or dropdowns. A few keywords let you make screens that look the way you want. Learn more →
How can I make interface subboxes appear only under certain conditions, like login versus logout? Use box terms that are non-empty only under the desired condition, combined with a hiding template so empty subboxes stay hidden. This is how you build context-aware screens without extra code. Learn more →
What does each letter in a CRUD annotation like cRud mean?
C is create, R is read, U is update, D is delete — uppercase allows the operation and lowercase denies it. This compact notation gives you fine control over what users can do. Learn more →
Installing & running your model
How do I install Ampersand on my own computer? You have three easy routes: run it through Docker on any platform, grab a prebuilt executable on Windows or Linux, or build it from source with Stack. Pick whichever fits your setup. Learn more →
Is there editor support for writing Ampersand scripts? Yes — install the "Ampersand language support" VS Code extension and pick the Ampersand coloring theme. Syntax highlighting makes your scripts far easier to read and write. Learn more →
How can I run the Ampersand compiler without installing it on my machine?
Pull the ampersandtarski/ampersand Docker image and run it with docker run, mounting your project directory. You get the compiler with zero local installation. Learn more →
How do I deploy and run my Ampersand prototype using Docker?
Put a Dockerfile, a docker-compose.yml, and your .adl file in a working directory, run docker-compose up -d, then browse to localhost. In a few commands your prototype is live. Learn more →
How do I install and run the RAP environment with Docker on Windows?
Install Docker Desktop, download the RAP repo as a ZIP, run docker-compose up -d (creating the proxy network if needed), and open localhost in your browser. That gets the full modelling environment running on Windows. Learn more →
My deployed application looks empty or shows a database error — what did I miss? Press the red install button in the application to create and populate the database. It's the one step that's easy to forget, and it fixes the "empty app" surprise instantly. Learn more →
How do I split an Ampersand specification across multiple files?
Use an INCLUDE statement to pull all the definitions of another .adl file into your context. This keeps large models tidy and easy to navigate. Learn more →
Practice: examples & exercises
Is there a complete Delivery script with clients, vendors, products and orders I can compile and run? Yes — the exercises page has a full Delivery context complete with populations, rules, and interfaces that you can run on a RAP server. It's a ready-made playground for experimenting. Learn more →
How do I practise adding PURPOSE and MEANING to a rule in Ampersand? The Delivery exercise has you work out a rule's meaning by experimenting, then add a PURPOSE and MEANING that compile and run. It's hands-on practice with the annotations that make models readable. Learn more →
Where can I find larger Ampersand exercises suitable for classroom projects? The exercises chapter offers bigger assignments like the Delivery script and the Dutch VOG legal-procedure case. They're ideal when you're ready for something more ambitious than the basics. Learn more →
Getting help & troubleshooting
Where can I get help when I am stuck learning Ampersand? Reach for the syntax reference and FAQ, open a GitHub issue for bugs, or ask your tutor if you're taking the Open University Rule-Based Design course. You're never on your own. Learn more →
What should I do when I run into a problem the documentation does not cover? Check the common problems, search the existing issues, then file a new issue against the documentation or against Ampersand itself. Reporting it also helps the next learner who hits the same snag. Learn more →
Where to get help
- Stuck on the language? Look it up in the Syntax of Ampersand or the frequently asked questions.
- Found a bug or something unclear? Open an issue on GitHub with your own account.
- Following the Open University course IM0403, Rule-Based Design? Your tutor can help you directly, and Learning Unit 3 of the coursebook covers the required theory.
Ready? Begin with the tutorial.