No, law is not code and it’s very important that it’s not code. Law is subject to interpretation, and that’s great. When bugs are discovered in law, they can be retroactively corrected.
The key part is that the court system can correct for a bug before the law itself is changed; it's a way to fix things as the code is being executed for a particular case, before the developers have even identified how/if the bug applies for other cases and figured out a general fix, much less implemented one.
In each case it may depend upon the 'application'.
For easily-understood fields undergoing well-scrutinized legal code changes it's (presumably) likely that legal drafting issues can be caught and fixed early.
Conversely, in software projects (even open source ones) where the users and authors are few and/or fail to pay attention to mistakes and errors, it could take years to report and fix issues.
All that said, in the presence of a mindful, careful and effective engineering team with responsive users, it does seem that software - or at least software processes like source control, code review and the democratized ability to contribute code changes - has an evolutionary advantage.
The premise: the judiciary is one source of authority; the legislature is another. If we treat contracts and laws as executable programs and specifications, we want to find bugs at compile time, because handling exceptions at run-time is called "going to court".
How do we find bugs at compile time? Static analysis. Formal methods. Formal verification methodologies (Lamport's TLA+, MIT's Alloy) applied to contracts and laws make it possible to SAT-solve for loopholes ("sploits") that violate LTL/CTL specifications. Once law is code you can go full white-hat/black-hat. Automate the fuzzing. https://www.theatlantic.com/technology/archive/2017/09/savin...
Maybe we don't always want "law as code" ... for, say, criminal law. Judicial discretion is important. Human judgement matters. Though if an overworked public defender can only spare two hours out of the hundred you deserve, the robolawyer starts to sound more attractive. What if we send Watson to law school? If you're hunting for a way to stay out of jail, wouldn't you want Deep Blue and AlphaGo to help you find it?
https://www.nytimes.com/interactive/2019/01/31/us/public-def...
There are plenty of black-and-white areas where the rules don't invite human interpretation: mostly things to do with finances -- like how DoNotPay.com can help apply for unemployment. Even in those domains, there are deep, deep pockets lobbying against the kinds of freedom (as in speech, and as in beer) that "law as code" promises.
https://www.propublica.org/article/inside-turbotax-20-year-f...
But, you ask, what about the knowledge acquisition bottleneck? Ah, yes, the AI Winter. Ontologies (SUMO, OWL, UFO-L), visual modeling notations (BPMN, DMN), and a new generation of tools (Flora-2, Protégé) take a new whack at that problem without going anywhere near machine learning and neural nets, which typically lack the nuance you need when every comma counts.
https://www.bbc.com/worklife/article/20180723-the-commas-tha...
Spring is coming. The vision for computable law, as laid out by Michael Genesereth at Stanford's CodeX Center, is for software that does for legal reasoning what the spreadsheet does for quantitative reasoning. (Who's Michael Genesereth? You've heard of Russell & Norvig's textbook on AI. He was Stuart Russell's Ph.D advisor.)
https://dl.acm.org/doi/10.1145/1165485.1165517
Is there any money in this? Hell, yes. In the US, DoNotPay is running a pitch-perfect Christensen disruption playbook. Outside the US, the EU has issued a half-million-euro tender for exactly the Rules As Code thing mentioned above: machine-readable-and-executable regulations. See section 1.4.2 of the PDF at https://etendering.ted.europa.eu/document/document-old-versi...
Oh, and as of last month, Singapore has just thrown $10M behind a project to turn the "law as code" vision into open source software that you can clone off Github.
I've been researching computational law since 2015, and a picture of the future legal tech stack is coming together in my head: open-source, open-standards, laws and contracts drafted in a domain-specific language from the start; libraries of clauses, linters and interpreters and unit testers and theorem provers built into the IDE, that find bugs in contracts in real time as you edit; compilers to English and other languages; model-driven architectures that flow from the specification to the app.
Once that legal stack is downloadable and accessible to the geeks of the world, then, as Joshua Browder would say, DoNotPay a law firm thousands of dollars just to copy and paste a Word doc out of their library. The law firm is not the customer -- as Atrium proved, expensively.
To help move this stack out of my head and into Github, the SG government is funding the development of open-source software targeted to real-world use cases, for drafting rules and contracts in a DSL. They've approved a grant for my small team (hi, Alexis! <3) to hire people to make it happen.
https://www.thetechnolawgist.com/2020/03/31/legalese-singapo...
If you're in a position to move to Singapore (whenever air travel reboots) ... and have skills in obscure but powerful technologies (or want to gain those skills) ... and want to help design a language that could be the basis for the next iteration of the legal industry ... we're hiring:
https://computational.law/hiring
I can see the attraction in making rules/regulation as code. But there is a downside we should be cautious of. Making law into code doesn't necessarily make it more readable/understandable or clearer for humans. In fact, making it into code will make it scalable to add lots of rules (very prescriptive, not derivable from a set of core principles) making them hard to comprehend for anyone but a rules evaluation engine. Anyone who has implemented a business rules engine and operated it in a complex workflow domain (like say e-commerce or banking) knows what I'm talking about. Then, when the machine renders judgement, we will need technical engineers to debug/explain/interpret why the machine evaluated all the rules to this particular judgement. There will also be potential for modeling the legal context of a particular case incorrectly while feeding it to the machine which can make the machine render incorrect judgment. Now, how will you appeal this decision?
You're quite right. Garbage in, garbage out. And if the cost of generating garbage goes down, we're going to get a lot more of it! There are definite risks in misinterpretation and complexity and cruft. As Genesereth quoted:
The Lord's Prayer is 66 words, the Gettysburg Address is 286 words, there are 1,322 words in the Declaration of Independence, but government regulations on the sale of cabbage total 26,911 words.
So, we will have be on our guard. The hope is that if the rules are open and machine-readable, we will be able to counter with software that sides with the user and helps to mount the sort of response that in the past was only available to corporations with very deep pockets.
One intriguing approach is to submit test cases: concrete scenarios, or traces of events, that should result in certain desired outcomes. A diverse range of people in different circumstances could be collected in a comprehensive test suite. If the contract/law passes the test suite, you're good! You can imagine two legislators from different parties with different constituents and concerns, each bringing their set of test cases; and when the negotiated compromise passes enough tests, they proceed, without ever actually reading the text of the bill, lol.
> If the contract/law passes the test suite, you're good!
Not necessarily, you risk the same sort of problems suffered by naïve statisticians who over-fit their data with ever more complicated models. This leads to erratic behaviour in real life and severe lack of predictability outside the range already covered by the data.
You need to run some kind of sensitivity analysis as well because the components used in the implementation (policemen, lawyers, auditors, traffic wardens, etc.) are not all of perfect quality. Think of an audio amplifier design, it looks wonderful on paper and works perfectly in the simulator. But fails spectacularly when built of real world components because each component is not quite exactly as specified. A sensitivity analysis can discover this by, for example, running the simulation multiple times with each component varied according to its expected quality (say +/- 10% for resistors, +/- 30 percent for transistor gain, etc.)
>government regulations on the sale of cabbage total 26,911 words
The only solution is mostly forbid government regulation except for critical things, of which "sale of cabbage" and ten of thousands others now currently regulated are not.
In order to do that within a Democracy, you have to dispel the unconscious notion (that a lot of modern voters have), that the government is a father/mother figure that has unlimited resources, can't make mistakes, and its operated by saints with the "common good" in mind 24/7.
Maybe force the lawmakers to include a text explaining the "spirit" of the law, also including indicators to the law effectiveness. For example, a law is implemented to bring down then "car accidents per million" indicator. If one year later car accidents are the same or more then the law is scrapped.
What you propose of robo-lawyers and law as code sounds as the script for a futuristic Kafka's "The Process" as an episode of Black Mirror.
This made my day! Wish you all the best and hope that this will materialize. Who needs skyscrapers and stuff (Marc is writing about) if you can have computational law?! In the meantime I will try to escape the country that will adopt such techniques the last: ol Germany
Law should be objectively decidable. Thousands upon thousands of pages of enigmatic legalistic nonsense make it impossible to predict a legal decision. When there is this much law, it becomes a paradox where the result is actually lawless - it becomes the whim of a judge's interpretation.
I’m a big fan of anything that will bring effective legal access to everyone. Technology will definitely play a role, but so will legal deregulation. Lots of jurisdictions are experimenting with opening up certain areas of legal practice to people who aren’t lawyers. And they’re rebuilding systems (alongside technology) to make them easier to access without attorneys.
The troubling part is that at some point, we need to tackle electoral reform. Even if we tackle the legal system and provide effective legal access to everyone, we’ll still be a long ways from tackling mass disillusionment. Hell, in lots of cases, disillusionment and/or disenfranchisement are logical results of history!
A piece of this is to eliminate the friction of legal text by open sourcing legal templates, in a graph, on GitHub. The key word here is "source." Legal documents currently are blobs, not source. See github.com/CommonAccord/ Lots of exampless, including the YC SAFES, Series Seed, GA4GH data sharing, etc. It's not full algorithmic, but compatible with algorithmic approaches, like Mike Genesereth's and Meng's.
It seems donotpay can get you into a legal engagement easily, but the other party can tie you up in more legal battles that donotpay doesn't yet handle and then you are screwed if you can't hire and pay expensive lawyers.