https://github.com/smucclaw/l4-ide
L4 - rules-as-code - is an open-source functional programming language for legal contracts and legislation/regulation.
https://github.com/smucclaw/l4-ide
contracts l4 legal legislation regulation rules rules-as-code
Last synced: about 2 months ago
JSON representation
L4 - rules-as-code - is an open-source functional programming language for legal contracts and legislation/regulation.
- Host: GitHub
- URL: https://github.com/smucclaw/l4-ide
- Owner: smucclaw
- License: other
- Created: 2024-11-26T07:57:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-13T08:38:06.000Z (about 2 months ago)
- Last Synced: 2025-08-13T10:24:01.671Z (about 2 months ago)
- Topics: contracts, l4, legal, legislation, regulation, rules, rules-as-code
- Language: Haskell
- Homepage: https://l4.legalese.com/reference
- Size: 29.9 MB
- Stars: 12
- Watchers: 5
- Forks: 4
- Open Issues: 82
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# L4 with IDE
An implementation of the L4 language for law, with an emphasis on IDE extensions for Visual Studio Code, and a web-only version of the L4 editor.
This repository includes language examples, a compiler toolchain, a visualizer, and integrations with VS Code.
## Gallery
Syntax Highlighting for Boolean-oriented decision logic

Decision Logic Visualization as a ladder diagram circuit

## Status (25 Feb 2025)
- ✅ Basic language features (functional core, layout parsing)
- ✅ Basic IDE features (highlighting, CHECK, EVAL)
- ✅ Decision logic visualizer (as ladder diagram)
- 🚧 resource libraries for Date, Place, Entity, Currency
- 🚧 Language support for state transition modals
- 🚧 State transition logic visualizer
- 🚧 Web App Auto-Generation for Decision Logic
- 🚧 Web App Auto-Generation for State Transition Logic, abductive reasonign, planning problems
- 🚧 Formal Verification Tooling, enhanced compiler error messages and warnings## The Web Editor
An experimental prototype offers a lightweight web-based alternative to VS Code.
https://jl4.legalese.com/
## VS Code Extension: Download, Install and Build
[Dev Build](Dev.md): for Haskell and JS developers to improve the toolchain and IDE developer experience. Requires Haskell and Typscript.
[Quickstart for a local build](Quickstart.md): for legal engineers to experiment with writing L4 code locally. Download the VS Code extension and get started.
## Language Tutorials
All this documentation is still under construction.
- Tutorial: Hello, World
- The `DECIDE` stanza
- The `ASSUME` environment
- Term Substitution
- Example: Must Sing
- Example: [The Dog Act](jl4/experiments/dogs.l4)
- Example: Vermin- Tutorial: British Nationality Act
- [Default Logic](./doc/default-logic.md) and `Optional` types with the `Maybe` monad
- References and Legal Citations
- Temporals- [Tutorial](doc/apps.md): Automatically Building User-Facing Apps
- Tutorial: Automatically Generating an AI Chatbot
- Tutorial: Contracts involving Parties, Obligations, and Deadlines
- visualizing a contract
- abductive reasoning and planning problems- Tutorial: Automatically Finding Loopholes
- underspecification, vagueness, and ambiguity## Language Reference
- Decision Logic
- State Transitions
- Functional and Logical Paradigms
- Source Citations and Versioning
- Multi-Temporal Logic
- a remark on "shall" as an unfortunate consequence of negotiation-time vs run-time interpretation
- Operationalization to Web and Mobile Apps
- Natural Language Generation: exporting to Word and PDF