Skip to content

Latest commit

 

History

History

doc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Introduction to Computational Law

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.

Original Content

We maintain a small but growing set of learning exercises:

exerciselearning objective
shipping boxesintroduces DMN and interpretive ambiguity
NZ rates rebateswhat does “X reduced by Y” mean?
safe conversionhow do we compute SAFE conversion at Series A?
safe eventsdefining SAFE financing, liquidity, and dissolution events
OTC derivativesclearing obligations for OTC counterparties in Europe

A Short Introduction

Demand

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.

Insight and Vision

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.

Improving Legal Drafting

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.)

Automated Consistency Checking and Loophole Detection

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.

Rules As Code

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.

Designing a DSL

Our domain-specific language will draw on inspirations from

Some context

A Medium Survey of the Literature and Technologies

See the Legalese survey of prior art.

Specific technologies we aim to build on:

Natural Language Generation

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

Model-Driven Architectures

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.

Constraint and Logic Programming

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?”

IDE integration for the DSL

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.

Formal Methods

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

A Longer Syllabus

Rules as Code:

  1. Current projects
    1. New Zealand’s Better Rules was a major recent RaC project that made quite a splash.
    2. Canada: review Scott McNaughton’s reports (49,50,51,52,54) and Jason Morris’s contributions: (1,2,3,4,5,6)
  2. Background
    1. Demonstration of ErgoAI and Reg W
    2. GovInsider on Rules As Code
    3. Pia Andrews’s RaC deck
    4. RaC: Seven Levels of Digitisation offers a hierarchy for context
    5. British Nationality Act as a Logic Program was the OG RaC project
    6. 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/
    7. Oracle Policy Automation. introduction by Jason Morris
  3. Relevant academic work and open standards
    1. Intro to KRR generally.
    2. 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.
    3. DMN 1.1 Tutorial
    4. htttp://blog.athico.com/2017/01/dmn-runtime-example-with-drools.html
    5. LegalRuleML; RuleML; RIF
    6. XAlgorithms has been championing “Rules as Data” and an “Internet of Rules”.
    7. OpenFisca
    8. LPS
    9. Catala and OpenFisca are other points of reference
    10. Legal Ontologies
    11. Rule Extraction from Regulations, Adam Wyner
    12. Browse recent conference proceedings of mirelproject.eu; ICAIL; RuleML+RR; Jurix.
  4. Re DMN and FEEL:
    1. https://www.rand.org/pubs/research_memoranda/RM3306.html
    2. https://twitter.com/hillelogram/status/1166429051797549059
    3. https://t.co/CEP3jX5WLa?amp=1
    4. https://pdfs.semanticscholar.org/750f/ecf4349faeeab9a827a929de37be30f3df26.pdf
    5. https://twitter.com/MartinClausen8/status/1253348407105724418
  5. Recent Advances:
    1. https://journalcrcl.org/crcl/issue/current
    2. https://youtu.be/g-tun87_y2I?si=zR0XJcLz20s6x_Rn
    3. https://www.betterrules.govt.nz/
    4. https://govinsider.asia/intl-en/article/four-things-you-should-know-about-rules-as-code
    5. https://www.linkedin.com/posts/pia-andrews_oh-my-goodness-this-for-all-those-who-have-activity-7132937374170320896-TBi-/
    6. https://oecd-opsi.org/wp-content/uploads/2020/05/OECD-OPSI-draft-Innovation-Primer-Rules-as-Code.docx
    7. https://www.oecd.org/innovation/cracking-the-code-3afe6ba5-en.htm
    8. https://popl22.sigplan.org/home/prolala-2022
    9. https://aclanthology.org/2021.cnl-1.6.pdf

Contracts as Code:

A contract is a serialization of a specification for a distributed system.

A company can be modelled as the sum of its contracts.

  1. Current projects
    1. Juro.com (whitepaper)
    2. 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/
    3. Clause’s Accord Project
    4. Markus Voelter on Martin Clausen’s work: https://www.youtube.com/watch?v=kOBth0iEKFw
  2. Background
    1. Early work in 1998: Ronald Lee, Petri Nets
    2. Flood & Goodenough 2015, Contracts as Automaton
    3. 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
    4. MICA: http://www.irisa.fr/s4/tools/mica/Mica__A_Modal_Interface_Compositional_Analysis_Library/Modal_Interfaces.html
  3. Relevant academic work and open standards
    1. Lay introduction to formal methods: the Coming Software Apocalypse
    2. Contract Formalization: Hvitved’s PhD thesis; John Camilleri’s PhD thesis
    3. BPMN tutorial 1,2,3,4
    4. Model Checking Contracts.
    5. Introduction to PAT by Sun Jun?
    6. @hillelogram’s The Business Case for Formal Methods: discussion with Jason Morris
    7. CTL*, verification systems for BPMN
    8. discussion of modal logics: deontic, epistemic, temporal logics.
    9. Language Server Protocol makes life easier for developers
    10. deukti https://deducteam.github.io/
    11. https://justinh.su/files/papers/taxes.pdf Death, Taxes, and Formal Verification: tax avoidance as a problem in graph traversal and transformation.
    12. https://www.andrew.cmu.edu/user/danupam/bdmn-oakland06.pdf LTL for privacy policies
    13. Some papers by Chris Clack on Smart Legal contracts, around the era of R3 Corda / Barclays
      1. https://arxiv.org/pdf/1608.00771
      2. https://arxiv.org/pdf/1612.04496.pdf

Expert System / Document Assembly Prototypes

  1. Current projects and startups
    1. docassemble
    2. Neota Logic
    3. Worksheets.stanford.edu (try the public demos) which begat Symbium
    4. OCBC’s Will Generator
  2. Background
    1. Exari acquired by Coupa: Contract Lifecycle Management
    2. Contract Express acquired by Thomson Reuters
    3. HotDocs
    4. LegalDocumentML and
    5. Akoma Ntoso are things you might come across
    6. Natural Language Generation could harness Grammatical Framework

On Adoption Dynamics