This introduction to computational law is presented by the Singapore Management University’s Centre for Computational Law.
It was started in late May 2020 and is a work in progress.
We maintain a small but growing set of learning exercises:
exercise | learning objective |
---|---|
shipping boxes | introduces DMN and interpretive ambiguity |
NZ rates rebates | what does “X reduced by Y” mean? |
safe conversion | how do we compute SAFE conversion at Series A? |
safe events | defining SAFE financing, liquidity, and dissolution events |
OTC derivatives | clearing obligations for OTC counterparties in Europe |
In 2020, the European Union announced a tender for machine-readable and -executable regulations for regulatory reporting.
The US Government shared their thinking about how computational law could accelerate implementation of policy as code.
Juro, a LegalTech startup, offered a vision for machine-readable contracts.
Software is eating the world. What if we could write and run contracts (and statutes) the way we do programs?
Michael Genesereth, at Stanford’s CodeX, laid out a vision for computational law in ICAIL 2005 and The Cop in the Back Seat.
Harry Surden (2014) explains computable contracts on his blog (part 1, part 2) and in a longer article published in the UC Davis Law Review (2014).
Richard Susskind believes that these kinds of innovations will change the future of the legal profession.
In 1978, Layman Allen complained that legal drafting sucks and can learn from logic.
32 years later, in 2010, Howard Darmstadter complained that legal drafting sucks and can learn from software.
Another 32 years later, in 2042, will thinkers still be complaining about the state of legal drafting? Not if we can help it.
Hypothesis: natural language generation, using tools like GF, can automate the production of legal English. (Much legal English already has the look and feel of a compiled object. We just need to work out what it compiles from.)
Hypothesis: the CS field of Formal Verification can improve legal construction using the same tools that improve software development.
In Sep 2017 the Atlantic Magazine discussed how FV could save the world from The Coming Software Apocalypse.
See pages 6 to 9 of Dramatically Reducing Software Vulnerabilities (2016) for a concise summary of different formal methods.
Pamela Zave compares Alloy and SPIN.
Ron Dolin, Harvard Law School professor, looks at the legal system through an engineer’s eyes.
See Meng’s 2020 book chapter Designing for Correctness on formal methods in law: https://drive.google.com/drive/folders/18MYebMK447vpvqkLQVnuI0ea36WLfyNc
See Meng’s HOPE2020 conference talk: https://www.youtube.com/watch?v=4FJGb_dDOw0&list=PLmP-Y3XW_cf5sNiuhWJWYb-3TgSYz1gUL&index=3&t=0s
After learning Alloy, move on to Electrum.
See GovInsider on Rules As Code, Seven Levels of Digitisation, New Zealand’s Better Rules report, and the longer OECD/OPSI Primer.
See also JetBrains MPS Case Study of the Dutch Tax Office.
Our domain-specific language will draw on inspirations from
- specification languages like TLA+ and Alloy,
- ontology software like Protégé for OWL,
- functional languages like Haskell and Ocaml, and also, uh, Lisp
- logic programming languages like Prolog, Flora-2, and LPS, and
- model-driven architecture standards like BPMN and DMN (for which Camunda is building tools in Javascript).
- interactive development environments like Excel, the most common programming language in the world that nobody thinks of as a programming language.
- Why Contracts Are Written In Legalese, by Claire Hill
- Computational Law, Symbolic Discourse and the AI Constitution by Stephen Wolfram, Oct 12 2016
- A Manual of Style for Contract Drafting by Ken Adams, now in its fourth edition, offers uncanny parallels to style guides in programming.
- In legislation space, as opposed to contract space, see https://www.calc.ngo/sites/default/files/loophole/jan-2014.pdf for an account of how drafting happens.
- AI isn’t just machine learning: https://www.nytimes.com/2018/06/20/technology/deep-learning-artificial-intelligence.html
- https://www.youtube.com/watch?v=YGG3e_1JX7Q Reasoning With Regulations - Vijay Saraswat
- https://www.youtube.com/watch?v=0XL-LM0fpN4 ReMeP keynote by Kowalski
- http://www.calc.ngo/sites/default/files/loophole/Loophole%20-%202020-01%20%282020-02-09%29.pdf could be read at the start and end of a course in computational law, as a springboard for assessing where its concepts find resonances in prior art and current work.
See the Legalese survey of prior art.
Specific technologies we aim to build on:
with Grammatical Framework; read http://www.cse.chalmers.se/~aarne/articles/cade2011.pdf
Isomorphism and Argumentation: https://intranet.csc.liv.ac.uk/~tbc/publications/ICAILTom.pdf
while the first wave of MDA came and went leaving little but UML behind, a new generation of DMN and BPMN modeling tools bear promise. In particular, DMN is amenable to static analysis, such as exhaustiveness checking, conflict detection.
At the intersection of:
- functional programming
- logic programming
- constraint programming
- SMT integration
See G2Q or perhaps more realistically SBV.
See Curry (tutorial, Wikipedia, website, KiCS2).
As a learning exercise: represent the rules regarding an AGM as a system of constraints, and treat as a planning problem the question of “what paperwork in what order needs to be issued by what actors?”
What would an IDE for law look like? Let’s ask Michael Jeffery: https://law.mit.edu/pub/whatwouldanintegrateddevelopmentenvironmentforlawlooklike/release/2
While interactive theorem provers are the extreme example of “AI Augmentation” in “CASE” tooling, editors like VS Code offer code completion, linting and other mechanisms. It would be really interesting to see how those mechanisms could translate to interactive legal drafting in a DSL.
We might call the VS Code / LSP approach “backend-oriented”.
A “frontend-oriented” approach would be Jupyter Notebooks.
See this thread https://twitter.com/avibryant/status/1289680996841828354?s=21 and the source text from the book A Small Matter of Programming.
Broadly defined, including symbolic execution, model checking, type systems (basic, dependent, and more advanced), and syntactic (e.g. decision tables). Consider ontology inference as a problem domain related to type inference. See the Rates Rebates case study for an example.
https://www.cs.cmu.edu/~rwh/papers/unreasonable/basl.pdf
- Current projects
- Background
- Demonstration of ErgoAI and Reg W
- GovInsider on Rules As Code
- Pia Andrews’s RaC deck
- RaC: Seven Levels of Digitisation offers a hierarchy for context
- British Nationality Act as a Logic Program was the OG RaC project
- Covid Contact Tracing in a Rule Engine demos LPS and the Event Calculus. For motivation, see tjharrop’s tweet and post. Subsequently, wombatwombat.github.io and https://18f.gsa.gov/2020/05/12/rapid-implementation-of-policy-as-code/
- Oracle Policy Automation. introduction by Jason Morris
- Relevant academic work and open standards
- Intro to KRR generally.
- The notion of model-driven engineering underlies DMN. Remember UML? Many legal texts specify rules of the form “A is a B if C is a D”. DMN represents these rules well.
- DMN 1.1 Tutorial
- htttp://blog.athico.com/2017/01/dmn-runtime-example-with-drools.html
- LegalRuleML; RuleML; RIF
- XAlgorithms has been championing “Rules as Data” and an “Internet of Rules”.
- OpenFisca
- LPS
- Catala and OpenFisca are other points of reference
- Legal Ontologies
- Rule Extraction from Regulations, Adam Wyner
- Browse recent conference proceedings of mirelproject.eu; ICAIL; RuleML+RR; Jurix.
- Re DMN and FEEL:
- Recent Advances:
- https://journalcrcl.org/crcl/issue/current
- https://youtu.be/g-tun87_y2I?si=zR0XJcLz20s6x_Rn
- https://www.betterrules.govt.nz/
- https://govinsider.asia/intl-en/article/four-things-you-should-know-about-rules-as-code
- https://www.linkedin.com/posts/pia-andrews_oh-my-goodness-this-for-all-those-who-have-activity-7132937374170320896-TBi-/
- https://oecd-opsi.org/wp-content/uploads/2020/05/OECD-OPSI-draft-Innovation-Primer-Rules-as-Code.docx
- https://www.oecd.org/innovation/cracking-the-code-3afe6ba5-en.htm
- https://popl22.sigplan.org/home/prolala-2022
- https://aclanthology.org/2021.cnl-1.6.pdf
A contract is a serialization of a specification for a distributed system.
A company can be modelled as the sum of its contracts.
- Current projects
- Juro.com (whitepaper)
- Consider the possibility of embedding machine readable contract parameters (data) and terms (logic) in a contract PDF, in XMP. See also https://github.com/smucclaw/complaw/blob/master/doc/ex-xmp-20200808/
- Clause’s Accord Project
- Markus Voelter on Martin Clausen’s work: https://www.youtube.com/watch?v=kOBth0iEKFw
- Background
- Early work in 1998: Ronald Lee, Petri Nets
- Flood & Goodenough 2015, Contracts as Automaton
- FpML just so you know it’s out there; MLFi by lexifi.com (functional pearl), is perhaps the best-known example of a financial DSL
- MICA: http://www.irisa.fr/s4/tools/mica/Mica__A_Modal_Interface_Compositional_Analysis_Library/Modal_Interfaces.html
- Relevant academic work and open standards
- Lay introduction to formal methods: the Coming Software Apocalypse
- Contract Formalization: Hvitved’s PhD thesis; John Camilleri’s PhD thesis
- BPMN tutorial 1,2,3,4
- Model Checking Contracts.
- Introduction to PAT by Sun Jun?
- @hillelogram’s The Business Case for Formal Methods: discussion with Jason Morris
- CTL*, verification systems for BPMN
- discussion of modal logics: deontic, epistemic, temporal logics.
- Language Server Protocol makes life easier for developers
- deukti https://deducteam.github.io/
- https://justinh.su/files/papers/taxes.pdf Death, Taxes, and Formal Verification: tax avoidance as a problem in graph traversal and transformation.
- https://www.andrew.cmu.edu/user/danupam/bdmn-oakland06.pdf LTL for privacy policies
- Some papers by Chris Clack on Smart Legal contracts, around the era of R3 Corda / Barclays
- Current projects and startups
- docassemble
- Neota Logic
- Worksheets.stanford.edu (try the public demos) which begat Symbium
- OCBC’s Will Generator
- Background
- Exari acquired by Coupa: Contract Lifecycle Management
- Contract Express acquired by Thomson Reuters
- HotDocs
- LegalDocumentML and
- Akoma Ntoso are things you might come across
- Natural Language Generation could harness Grammatical Framework