Much Ado About Verada

A cheerful guide to programs that keep their promises.

Much Ado About Verada

A cheerful guide to programs that keep their promises.

Puck the rook outside a tiny theatre. Three entrances, marked Vada, Varc and Vibe, lead to the same stage.

Welcome to a very small theatre with a remarkably strict box office.

We will write programs, ask what they ought to do, and learn how Verada checks that they keep their promises. Along the way there will be tickets, troublesome arithmetic, and a rook who sold nine tickets for eight seats. His spreadsheet was very persuasive.

You need a little programming experience: the idea of a variable, a condition, and a function. You do not need Ada, Shakespeare, or a previous acquaintance with mathematical proof. If programming itself is new, take the prediction questions slowly and run each experiment.

Find your seat

Start reading: Curtain Up.

First Puck learns to keep a sales count and make a promise about each sale (chapters 1–4). Then he gives each seat a number and learns to read, count and search a seating chart (5–9). He turns those answers into receipts, updates the chart, and learns to read a proof report (10–13). On opening night he puts the pieces together and meets a rule his original contract never had to express (14–15).

Chapter The question it answers
1 · Curtain Up How do I run a program, and what does proving it mean?
2 · A Name and a Number What changes, what stays put, and which numbers fit?
3 · To Branch, or Not to Branch How does a decision make the next operation safe?
4 · Measure for Measure How do caller and function share a precise promise?
5 · A Seat by Any Other Name How can the same number do two different jobs?
6 · Once More Unto the Loop How do I print exactly the ticket labels I want?
7 · All the World's an Array How do I find a particular seat on the chart?
8 · A Midsummer Night's Proof How do I keep a tally within bounds as I walk the row?
9 · Is There Room in the House? When can a search safely answer yes or no?
10 · The Cast of Characters How do I keep a request and its decision together?
11 · The Play Within the Package How can the usher trust a receipt from the other side of the counter?
12 · To Have and to Hold How do I change one seat and preserve the rest of the chart?
13 · Exit, Pursued by a Counterexample What evidence tells me where a proof needs repair?
14 · The Box Office Opens How do the receipt, the tally, and the booking rules work together?
15 · A Play Is Only as Good as Its Script What does the proof let me promise a customer?

One play, three costumes

Verada has three syntaxes. Vada uses Ada's spelling, Varc uses a C-family syntax, and Vibe uses typed Python. They express a shared language. We'll point out differences as they come up in the lessons.

Badge Syntax Colour Files
Quill badge Vada · Ada Ada words and punctuation Lavender .vads, .vadb
Braces badge Varc · C-family Braces, fn, let, var Peach .va
Steps badge Vibe · Python Indentation and typed definitions Mint .vb

Read the shared explanation, choose one version of each example, then rejoin the prose. Vada appears first and starts open. Expand Varc or Vibe to take that route instead. You can skip the other code panels completely: they contain no secret plot developments.

In the HTML reading edition, Read examples in selects a route and remembers it across chapters when your browser allows local storage. Compare all three opens the versions in Vada–Varc–Vibe order. Each example has a stable link, so you can return to a particular spelling. A language-neutral Syntax note beside an example explains any meaningful difference. Printed pages show all three with their names and badges.

The colours are useful landmarks, but the labels and shapes carry the same information.

Read, predict, try

Every chapter gives you a small problem before its solution. At the end, Your cue offers short experiments. Prompter's notes contains hints and answers; leave it closed until you have tried. You can always get back to the contents from the chapter navigation.

Complete example projects accompany every full program, in each syntax. An excerpt labelled fragment is not a complete source file. Copy the folder for your syntax and work in the copy; the exercises deliberately break it.

Where next