Image Alt

The Singapore Law Gazette

CLAWs and Effect  

In 2011, Marc Andreessen said “software is eating the world”. And with that in mind, a computer scientist and a lawyer decided to do just that. was born, and five years later, Singapore Management University’s Centre for Computational Law. But what is Computational Law (aka CLAW)? CLAW is the ambitious idea to build infrastructure for the legal industry in a way that is compatible with our increasingly software-eaten world.     

Examining the Status Quo

The legal industry has been described as being “trapped in 1995”. I think that’s rather generous. 

Going back a little, let’s look at what a lawyer might have looked like in 1918, the year the typewriter was invented:

  • They probably charged by the hour for input (not output), so that’s incentivising them to be the most inefficient lawyer they can get away with
  • Being humans, they were error-prone, have imperfect recall, and leaned on their experience
  • They probably also relied on professional indemnities & a whole kitchen sink of assumptions 
  • And if they’re really fancy, they probably had a typewriter that was just invented!

Now what does the average lawyer look like 104 years later? Not that different – except we use Microsoft Word as their main technology (and some, like I was required to, are still trained to use typewriters for particular tasks). 

That’s not great – 104 years on, lawyers still use technology to only help with the typing (i.e. the manual labour) but not with the thinking

But We’ve Got LegalTech – Yes, for Quite Some Time Now

LegalTech seems to be the buzzword these days following hot on the heels of FinTech and blockchain technologies. LegalGeek has mapped it out, Thomson Reuters, Stanford, Law Hackers, and hey, Legalese too (including a deadpool of those who have come and gone). And, it’s not a new domain: LegalZoom was founded in 2001, Exari in 1999, HotDocs in 1993

So why isn’t LegalTech (that’s been around for so long) being widely adopted?

The lazy answer:

It is difficult to get a man to understand something, when his salary depends on his not understanding it”, said Upton Sinclair (1935). 

The slightly less lazy answer:

If we look at the categories of innovation, they’re mostly still using technology that helps with the manual labour. In Peter Thiel’s Zero to One, he talks about progress coming in two forms:

1: horizontal / extensive progress (copying things that work)

2: vertical / intensive progress (doing new things).

With horizontal progress, you look at a problem that’s currently being solved by a typewriter and innovate by throwing 10 typewriters at it. With vertical progress, you invent the word processor. And we think the time is ripe for computational law to introduce vertical progress to the legal industry.  

Enter: Computational Law

The (Natural) Language Problem in Law

Contract drafting seems to be, essentially, a small team of programmers (a fancy term for specialists with unusual skills in stylised language and abstract reasoning) writing proprietary code by hand. Contracts and programs are both, fundamentally, specifications for the distributed execution of business processes … except, lawyers have a language problem. Lawyers use different words to mean the same thing, and bewilderingly, also the same words to mean different things! That’s pseudocode. 

Foundational Technology: A Domain-specific Language for Law

To bypass the natural language problem that plagues legal today, we propose to start by creating a domain-specific language (DSL) for law. That is, a formal programming language specifically designed to capture the semantics, deontics, and pragmatics of law. Once you have a skein of a DSL as infrastructure, you can then use it to write everything that makes up law: statutes, regulations, contracts, guidelines, business process logic, rules, quasi-legal documentation, you name it (for easy reference, we’ll call this collective of things capable of being written in a DSL “Law” from now onwards). 

Syntax → semantics → pragmatics 

And this is seminal because once you have a DSL, Law now has a common denominator. And a common denominator gets you from pseudocode to real code. That’s what we suspect a contract wants to be when it grows up: a program. And the marvellous thing about programs is that Law can graduate from simply expressing syntax (i.e. words on a page, legalistic expressions) that are essentially pseudocode to semantics (i.e. what does it mean in an objective or clearly defined fashion), to pragmatics (i.e. what does it mean for me). Semantics and pragmatics are the traditional demesnes of lawyers; these are things you’d pay and ask for a lawyer’s advice on. But lawyers’ service of semantics and pragmatics may be too much like a priesthood (and too expensive) for most end users: go forth with this blessed document, but don’t break your back carving out the laundry list of assumptions, professional indemnities, and deciphering what exactly it means for you. Take faith. This just might not cut it anymore for the increasingly tech-savvy and knowledge-driven common man on the Clapham omnibus who reviews and background checks everything including their drivers, romantic dates, and restaurants.       

What Might a Computational Law Future Look Like?

With a DSL as the foundational infrastructure for “Law”, we can now apply the batteries of tools that computer scientists have at their disposal (which lawyers don’t even have names for) to “Law”. 

We argue that this, though not perfect, is better. What CLAW does, is create the opportunity for services (e.g. bringing syntax to semantics to pragmatics) to be commoditised. 

Let’s contrast what an average software stack looks like compared to its legal stack equivalent:

Software Stack     Legal Stack
app stores, self-updating packages  
StackExchange, IRC, code reviews, agile pairs  
build dependency management  
FOSS Libraries, apps, tutorials  
git+github: versions, issues, pull requests track changes
static analysis, formal methods, fuzzing, linting  
unit testing, code coverage  
m4 macros, MVC template filling  
IDEs: Eclipse, Sublime, Atom, Emacs, Vim Microsoft Word
C, C++, Java, Javascript, Lisp, Prolog, Haskell English (& Latin?)
Lambda Calculus  

Sure it doesn’t look great now, because law predates software and has been playing catch-up for a very long time. But this also means that in every area that law currently pales in comparison with software, there is an opportunity that CLAW can innovate on. 

Some Examples of CLAW Functionalities

When the laws change, that’s like a software update. One can even make it a self-updating package with automatic notifications. 

Documents depend on each other and you have to track all your obligations and dependencies to make sure they don’t conflict or create ambiguity? Meet dependency management! One can layer the development architecture modularly the way software development does today. Add to that, acceptance testing, which allows you to evaluate compliance with your specified rules. 

How about static analysis? We could test, calculate, and model (mathematically, visually, textually, you name it!) the effects of a change to a system, without first implementing the change. Software code gets testing all the time prior to execution. Finding bugs at run time? That’s called litigation. 

Unit and integration testing are also cool. We could unit test individual pieces of the codified Law or even modules of them together (e.g. a certain business process, guidelines) with controlled data, usage and operating procedures to determine if they are fit for purpose. 

Not Everyone Needs to Learn the DSL

Please don’t learn to code, unless you want to. Yes, as with law, the alarmist “shortage” issue often gets recklessly thrown about, but what they really mean is that there’s a shortage of senior or full-stack developers (this applies to lawyers as well) – and that’s usually not something a bootcamp or any 101 course can easily or quickly help transform you into.

The good news is that you don’t need to learn the DSL to be part of the CLAW future. We have known about low-code platforms for awhile now. In fact, most of us are already using what are essentially, low-code platforms:  spreadsheets and their formulas, Word documents with macros, photo editing apps and software. The DSL and CLAW act as foundational technologies on which applications, software, low-code platforms, can be built atop. Foundational technologies are often invisible to the end-user (you don’t need to know Postscript to use Adobe) and that’s a good thing. 

Instagrammification of Law

I call this the Instagrammification of Law. We no longer need to learn about aperture, focal lengths, exposure, or colour theory to take good pictures with our phones anymore – we know and can see that we’ve got what we want by applying a filter, moving a slider, tapping on a screen. That’s the CLAW future I’m signing up for. With a DSL as the foundational technology for apps and software, functionalities can allow one to (this is non-exhaustive):

  • see what the outcome looks like and tweak it to one’s liking prior to signing
  • automatically generate the same document in different natural languages with the assurance that the base logic and outcomes remain the same
  • import different applicable laws or regulations as libraries with a click of a button without having to manually update each provision
  • run consistency checks with other documents one’s entered into
  • integrate notification obligations with calendars and project tasks 

That’s Way Too Out There … is it Though?

Let’s go back to the idea that today we are still paying lawyers by the hour for manual labour (typing) and priesthood analysis. Now let’s look at what other professional domains have.

Accounting: Think of the last time you paid for someone to do your mental sums and set up manual accounting ledgers. Did you really do that or did you pay for someone to use accounting software and spreadsheets instead? 

Photography. Think of the last time you paid someone to take photos with an analog camera. Or did you pay someone who used a digital camera with post-production editing skills, or did you simply use your phone?

Architecture. Think of the last time you paid an architect to hand-draw blueprints and set out measurements. Or did you pay for an architect skilled in AutoCad software that inherently recognises object and structural relationships?

Graphic Design. Think of the last time you paid a designer to hand-draw on pen and paper. Or did you pay for a designer skilled in editing and creative software?

Law. Now, think of the last time you paid a lawyer to do all their thinking in their head and set it all down in Microsoft Word. The analysis is opaque, and because it’s not unified by software or technology, what you get might just depend on their workload for the day, whether they’re rushing off somewhere, or even simply, whether they are on their first cup of coffee or sixth. 

The idea that vertical innovation (recall Zero to One from earlier) happens in a professional domain via the invention of a domain specific language or format is a well-honed software tradition. I will save you the florid grandstanding with this:

Domain Language / Format Category Leader
Printed page Postscript Adobe
Databases SQL Oracle
3D Drawings dwg Autodesk
Accounting LP2 Intuit
Chips Verilog Cadence
Legal ? ?

Who’s Going to Lead the Charge on Computational Law? 

It’s probably not lawyers!

Most professional domains have been disrupted (it’s not a dirty word, really) by software. Kodak invented the first digital camera, but they didn’t come up with Instagram or Photoshop. They should have but as Christensen’s (the guy who coined “disruption innovation”) disruption theory goes, they probably couldn’t. Lego didn’t invent Minecraft, they should have but didn’t. 

It may seem quite mental to think about vertical innovation coming from without the legal industry, but that is exactly what Andreessen talks about in Software is Eating the World. And that is exactly what we have already seen happen. He goes into greater detail, but here are some examples: the largest bookseller is Amazon, a software company; the largest video service by number of subscribers is Netflix, a software company; the most dominant music companies, Apple and Spotify, are software companies; the largest private accommodation group is Airbnb, a software company.

To quote Andreessen, “Oops”. 

The Parable of the Brilliant Cartographer Who is Not Arrogant

Imagine a brilliant cartographer, the best of their kind and trade, and what they would say if asked to innovate within their space. (We assume, of course, that they are not at all arrogant about how good they are, how their work couldn’t be made better because they’re the secret sauce, and that they are actually interested in exploring innovation and progress) They might look at something like your iPhone and say, it would be quite something for all the maps I draw or draw reference from to be accessible and contained within one little device! If it stores thousands of photos, then it can store thousands of maps! That’s pretty ground breaking innovation, they would think. But what they might not be able to imagine is what Apple Maps, Google Maps, Waze, do for us today – driving directions, transit times, real-time traffic updates, alternative routes filtered by transportation, tolls, and even telling you when you need to leave to make it in time!

Even if Sinclair were wrong (about how it is difficult to get a man to understand something when his salary depends on his not understanding it), sometimes, a man might not understand something simply because they weren’t trained in it.

All CLAW is Legaltech, but Some Legaltech are More CLAW Than Others

When we talk about CLAW, we are not talking about entrenching what doesn’t quite work (whether for consumers/clients or lawyers) in the current system in a future system; we are also not talking about law firms with a different user interface. After all, I think we all agree that giving a restaurant a website doesn’t count as innovation or “computational food”. So whilst we rejoice in the interest in LegalTech (I, too, was excited when first seeing PHP on a page), we are focused on the computational law vision. 

Computational Law at SMU 

At the SMU Centre for Computational Law (CCLAW), we are working together to make CLAW a reality. My co-founder, Wong Meng Weng, is the principal investigator leading the CCLAW’s research programme in Computational Law, alongside the law and computer science unicorn experts:  Lim How Khang (Assistant Professor of Law & Computer Science (Practice)) and Jerrold Soh (Assistant Professor of Law). Supported by the National Research Foundation of Singapore, and tapping on the twin expertise of the SMU Yong Pung How School of Law and the SMU School of Computing & Information Systems, CLAW is in some really good hands.

At CCLAW, we very much believe in translational research. Following Pasteur’s quadrant, we work with use-cases from day one which hopefully ensures high theory advancement, as well as high practicality. After all, codifying the entire Companies Act may sound impressive, it may be of little practical value since most use cases require other sources of rules, documents, and regulations; however, if one took even the simplest of use cases like the incorporation of a company in Singapore, then the exhaustive and identifiable “Laws” within such a use case will quickly allow the industry (whether it is the end-user consumer, law firm, or the regulator) to build an integrated and automated application which can be implemented. This slowly but surely gets us closer to the born digital, Rules As Code future that the OECD identified as an emerging trend.

Next Steps

Let’s chat if you’re interested in industry collaborations for use-inspired research under the Programme (you provide the use-case, and if we choose it, we codify it for you).

I’ll be there in the next foreseeable future. I hope to see you there.

AcknowledgementThis research / project is supported by the National Research Foundation, Singapore under its Industry Alignment Fund – Pre-positioning (IAF-PP) Funding Initiative. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore.

Alexis is a recovering lawyer and self-taught programmer. As cofounder of, Alexis spends her day exorcising legal demons and unlearning her bad habits. Legalese is a LegalTech startup that is developing a domain-specific language for computational law. By applying computer science to contract drafting, generation, and management, Legalese aims to eventually replace contract-drafting lawyers with contract-drafting software. 

Since 2020, she has also been dual-hatting as Industry Director at the Computational Law Centre (CCLAW) at Singapore Management University under the Computational Law Research Programme (the Programme). 

In her previous life, she was a dispute resolution, technology, and IP lawyer in one of the largest transnational law firms in Asia. Alexis is an advocate and solicitor of the Supreme Court of Singapore. She has a Bachelor of Laws (Second Upper with Honours) from Queen Mary, University of London (2011). She loves Belle & Sebastian, computer games, and carbs-on-carbs. She is heavily influenced by science fiction and when she grows up, she’d like to be Tina Fey.