# 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](/l4/courses/foundation/module-0-introduction.md): what L4 is for, the parts of an L4 file, and setting up.
- [Module 1: Your first legal rule](/l4/courses/foundation/module-1-first-rule.md): an obligation with `PARTY` and `MUST`, a condition, a deadline and consequences.
- [Module 2: Legal entities and relationships](/l4/courses/foundation/module-2-entities.md): records and enumerations with `DECLARE`, and field access.
- [Module 3: Control flow](/l4/courses/foundation/module-3-control-flow.md): `IF`, `BRANCH`, `CONSIDER`, boolean logic and lists.
- [Module 4: Decision logic](/l4/courses/foundation/module-4-decision-logic.md): constitutive rules with `DECIDE` and `MEANS`, signatures, `WHERE`, `MAYBE` and dates.
- [Module 5: Functions](/l4/courses/foundation/module-5-functions.md): calling functions, recursion, and higher-order functions such as `map` and `filter`.
- [Module 6: Regulative rules](/l4/courses/foundation/module-6-regulative.md): obligations, permissions and prohibitions, chained with `HENCE` and `LEST` and tested with `#TRACE`.
- [Module 7: Putting it together](/l4/courses/foundation/module-7-capstone.md): a complete model of a charity registration scheme.

## After this course

Continue with the [Advanced course](/l4/courses/advanced.md). For a specific task, see the [Tutorials](/l4/tutorials.md); to look up a keyword, the [Reference](/l4/reference.md); for why L4 works as it does, [Concepts](/l4/concepts.md). Report a problem on [GitHub](https://github.com/legalese/l4-ide/issues).
