Skip to main content

Hands-on Index

This section gathers all CADL / SoS-DSL hands-on materials. The materials fall into two tracks. Pick the one that matches your role.

Your roleWhat you doWhere to start
🧑‍🎓 LearnerWrite CADL with your own hands and watch it runWhy SoS-DSL? → Code Walkthrough (recommended before Course A) → Course A → B → C
🧑‍🔬 ResearcherAlready comfortable with the field; reuse the courses for your own SoSSkim Why SoS-DSL? then jump to Course C
Repository availability

cadl-spec (this specification and hands-on site), cadl (compiler / CLI), cadl-explorer (visualisation) and cadl-raspimouse-simulator (simulator) are public, so every step of Course A can be followed with public repositories. mobility-sos-exercise, used by Course B, is not publicly available at present.

🗺️ First time here? A three-stage path​

If this is your first contact with the toolchain, follow three stages: understand → practise with templates → build from scratch. You are never asked to write code cold.

StageWhat you doMaterialsRough time
① UnderstandGrasp the overall structure (four repositories; the spec → IR → codegen flow) and what each key program doesWhy SoS-DSL? (skimming is fine), then the Architecture & Code Walkthrough (recommended before Course A)0.5–1 day
② Practise with templatesCopy the provided skeletons and fill them in while going once around the loop: write a contract → check → visualise → run the simulationCourse A (main textbook) Steps 0–6, then the ★ / ★★ exercises of the exercises booklet Part 11–2 weeks
③ Build from scratchAdd features with no template: new monitors and states (★★★), model a new domain (Part 2), or the LLM contract-generation loop (advanced exercise)★★★ / advanced exercise / Part 2 of the exercises bookletas your interest dictates

🧑‍🎓 For learners — three courses​

All courses share the same CADL/SoS-DSL syntax; only the domain and target runtime change. Take them in order: A → B → C.

Before you start: Why SoS-DSL?​

A short, plain-language intro to what an SoS is, why ordinary programming languages don't capture it well, and what CADL adds on top. Read this once before Course A — it gives you the vocabulary the courses will rely on.

→ Why SoS-DSL?

Course A — Robot Delivery (foundations)​

ItemDetails
DomainWarehouse robot package delivery
Target runtimeUnity C#
TimeAbout 95 min (5 min setup + 15 min × 6 steps)
PrerequisiteNone — open to CADL beginners
You will learnCADL syntax / actors / contract / lifecycle / monitors / cadl-explorer / Unity integration

→ Course A — Robot Delivery

After finishing, practice with the extra exercises: → Course A — Exercises — 5 sessions, 19 exercises graded ★ to ★★★ (Part 1 of the exercises booklet)

Course B — Urban Mobility (applied)​

ItemDetails
DomainTaxi-fleet System of Systems
Target runtimeSUMO (traffic simulator)
Time60–90 min (with 5 visualization checkpoints)
PrerequisiteCourse A
You will learnCode generation for a different runtime / checking simulation results against the contract's guarantee clauses (deadlines and monitors are listed but not evaluated in SUMO) / sensitivity analysis (edit CADL, re-evaluate)

→ Course B — Urban Mobility

Contrast with Course A: see what happens when you swap the domain and the codegen target while keeping the CADL syntax untouched.

Course C — Model your own SoS (advanced)​

ItemDetails
DomainAnything you choose (food delivery, emergency response, power grid…)
Target runtimeYour choice. The suggested default is a lightweight Python discrete-event harness such as SimPy; Unity is not required
TimeA few hours to a few weeks (a self-directed mini-project)
PrerequisiteCourse A + B
You will learnDesigning actors / contracts / lifecycle / monitors on your own for a new domain, then choosing your own runtime

Course C is deliberately open-ended: the brief is an outline, not a step-by-step tutorial. It is Part 2 of the exercises booklet: → Exercises booklet — Part 2 (Course C)


🚀 60-second smoke test (optional)​

Just want to see something work first?

cd ~/program/cadl_repo
./scripts/sos_dsl_handson_e2e.sh

This assumes the setup in Step 0 of Course A is done (the cadl repository cloned as ~/program/cadl_repo). The script runs the end-to-end pipeline (parse → IR → codegen) on the bundled examples/sos_dsl_robot_delivery.cadl and prints what to do next. Its last stage copies the generated C# into the Unity project of cadl-raspimouse-simulator (expected next to cadl_repo); if you have not cloned it yet, run ./scripts/sos_dsl_handson_e2e.sh --unity "" instead, which stops after code generation.

After that, start with Why SoS-DSL? and then Course A.


Quick reference​

RoleDocument
Background read (learner's first)Why SoS-DSL?
Course A — main textbookRobot Delivery
Course A — extra problemsExercises
Course B — mobility tutorialUrban Mobility
Course C — your own SoSExercises Part 2