Tutorials

Step-by-step guides for getting a task done with L4: from installing it and writing a first rule, to testing and publishing rules, to using them from AI agents and applications. Each guide stands on its own; for the exact meaning of a keyword, follow its links into the reference.

Start here

Write and check rules

  • Test your rules: check outcomes with #EVAL and #ASSERT, and simulate obligations with #TRACE.
  • Fix errors: read a diagnostic, and fix the errors that come up most.
  • Encode legislation: turn a statutory provision into a tested rule, alone or with an AI assistant.
  • Make rules read like law: infix and mixfix names, and rules that render as readable documents.
  • Common patterns: recipes for records, decisions, calculations, lists, dates and obligations.

Publish rules

  • Deploy your rules: mark rules with @export, deploy them to Legalese Cloud and call them.

Use deployed rules

Advanced