Skip to main content

Appendix C — Using this textbook in a class

This appendix shows how to teach Chapters 4–9 as a five-session class (or a three-session one). Students who have read Chapters 1–3 and done the setup of Section 2.4 can start with Session 1.

C.1 Course at a glance​

SessionChapterTitleThemeDeliverable
14CADL ModellingStructure of an SoSmy_delivery_v1.cadl (structure only)
25DSL DesignNorms: lifecycle and monitorsmy_delivery_v2.cadl (with lifecycle + monitors)
36VisualisationReading and comparing specs visuallyA/B comparison report with screenshots
47 (and 8)SimulationExecuting the spec, reading tracesBaseline trace + parameter sweep
59ImprovementUsing observations to refine the specmy_delivery_v3.cadl + before/after report

Chapter 8 (Unity) is optional in a class: its only exercise, 8.1 (★★★), belongs to Session 4.

Each session is ~90 minutes in class plus ~3 hours of homework. The final deliverable across all five sessions is a 3-page report (initial model / simulation comparison / reflection).

Repository availability

Sessions 1–3 need only cadl and cadl-explorer (except the ★★★ Exercise 6.3, which takes a log from the simulator repository). Sessions 4–5 run the Python reference runtime that lives in cadl-raspimouse-simulator (see Section 2.4 for how to get it).

Compact 3-session version​

If you only have three sessions (e.g., a short module, an intensive weekend), use this mapping:

3-sessionCombines
Session ASessions 1 + 2 (Modelling + DSL design)
Session BSessions 3 + 4 (Visualisation + Simulation)
Session CSession 5 (Improvement)

The exercises stay the same; you simply move the optional / "stretch" exercises to homework.

Per-session format​

Every session has the same shape, and each part is found in the same place of its chapter:

  1. Learning objectives — what you should be able to do by the end (Section N.1, "What you'll learn").
  2. Prerequisites — deliverables from the previous session, plus reading ("Before the session" at the end of the chapter).
  3. Concept introduction (~30 min) — the small amount of theory you need (the subsection of "Background").
  4. Exercises (~50 min) — graded ★ (basic) → ★★ (intermediate) → ★★★ (stretch) (the "Exercises" section).
  5. Wrap-up + homework (~10 min) — what to bring to next session ("Wrap-up and homework" at the end of the chapter).

The procedure of each chapter (the former Course A steps, about 15 minutes each) can be done before the session as preparation or at its start.

Rubric (suggested)​

The instructor can use this for grading; the student can self-check.

CriterionWeight
All ★ and ★★ exercises completed for every session40%
cadl check passes on every submitted CADL file20%
Final 3-page report demonstrates understanding (not just steps)30%
At least one ★★★ stretch exercise attempted10%

C.2 Final deliverable summary​

By the end of Session 5, every student should have:

ArtefactFrom sessionExercise
my_delivery_v1.cadl (structure only)14.1
my_delivery_v2.cadl (with lifecycle + monitors)25.1–5.2
session3_comparison.md + 2 screenshots36.2
session4_baseline.ndjson + parameter-sweep table47.1–7.3
my_delivery_v3.cadl (improved) + 3-page final report59.2, 9.4
(Optional) test_rewards.py + reward execution code59.3
(Optional) violation_trace_view.py Streamlit page36.3

All five (or seven, with optionals) live in a single course-deliverables repository.