Foundation course
A complete introduction to L4. It assumes basic familiarity with legal concepts and no programming experience.
The course takes you from zero to modelling a small legal scheme. You will learn to write legal rules that a computer can check and run, model legal entities and their relationships, express multi-step legal processes, and test them against scenarios. Take the modules in order; each builds on the ones before.
Modules
- Module 0: Introduction to L4: what L4 is for, the parts of an L4 file, and setting up.
- Module 1: Your first legal rule: an obligation with
PARTYandMUST, a condition, a deadline and consequences. - Module 2: Legal entities and relationships: records and enumerations with
DECLARE, and field access. - Module 3: Control flow:
IF,BRANCH,CONSIDER, boolean logic and lists. - Module 4: Decision logic: constitutive rules with
DECIDEandMEANS, signatures,WHERE,MAYBEand dates. - Module 5: Functions: calling functions, recursion, and higher-order functions such as
mapandfilter. - Module 6: Regulative rules: obligations, permissions and prohibitions, chained with
HENCEandLESTand tested with#TRACE. - Module 7: Putting it together: a complete model of a charity registration scheme.
After this course
Continue with the Advanced course. For a specific task, see the Tutorials; to look up a keyword, the Reference; for why L4 works as it does, Concepts. Report a problem on GitHub.