Legalese – Computational Law
legalese.com
legalese.com
Maybe a good law would be that if you can't be arsed to write the law in a formal language, or can't figure out how, then it shouldn't be a law in the first place :)
They are. It is called turbotax and it is built and maintained by Intuit, who also has powerful lobbyists.
I think what you want is a non-spaghetti open-source software program maintained by a governance structure which is both
A. Competent and communicative.
B. Accountable to the same public which is in charge of doing performance reviews for the current legislators.
You mean natural languages. Formal languages (of which programming code and math are examples) are also human languages, but more well defined and usually designed by few (opposed to emerged from usage by many).
There is of course a separation between safety and standards that is hard for laws and codes to grasp. The separation between intention and results is one of the reasons why you want these things explicitly defined as part of a formal specification for a law, it makes it possible to determine whether it is having the desired effect, and if it is not it could .e.g trigger a clause removing the code from being in effect. Rent controls would be a perfect example for this, though the whole point of my argument in my top level response is that trying to measure whether rent control is effective is the hard part (every serious study of rent controls shows that they are not).
Computational law does not nor should it mean limiting ourself to purely objective concepts and automatically-resolvable disputes. We can still introduce as abstract parameters all the fuzzy humanistic things we want. This just forces us to separate those from the "boring parts", which will make everything more productive. This is a lot like how with fancy dependent types you can pass around proofs of undecidable/non-computable things -- "undecidable" and "subjective" are equally bad at run-time.
Done right, right, this is also good for fairness because it's exactly to the extent the objective and subjective stuff is all mixed together that "the party with the most expensive lawyers wins". All the drudgery keeps everyone but the rich out.
-------
All that said, there are still immense challenges to pulling this off. Doctors and lawyers are insanely protected classes in this country --- the last, most powerful guilds --- and everything is designed against this. In "physical small repeatable goods" capitalism, well you can always try to compete end-to-end to the final consumer and slowly eck out market. But court cases and ex lawyer judges make for relatively-rare, high-risk proving ground, and foxes guarding the hen-house!
Also, I am skeptical of this beginning with contracts / private sector and not law itself / governments. The way we write programs today is like a Gustafson's law vs Amdahl's law situation in which rather than reducing complexity/mental drudgery using machines, we simply fill up our expanded capacity with more --- from hand-calculating rocket trajectories to debugging garbage bloated software stacks. If as increased corporate profits went to longer EULAs and other paperwork, this could unleash a torrent of non-sense orders of magnitude greater: please sign these 50 MiBs!
That sounds very plausible. But do you think that human lawyers might gradually become a profession of people whose job partly involves interfacing with a software implementation of (large) parts of the legal code? And do you think there is any hope for defining (large) parts of the legal code in a formal language with well-defined semantics?
I wouldn't trust a computer to be my doctor, and I wouldn't trust one to be my lawyer either. As assistants to my doctor and lawyer, sure, but to replace them? Never.
This legalese reminds me of UML. The only truly comprehensive way to capture the essence of a program is to write the program.
An interesting aspect of law-related automation concerns cases that could "be resolved with mathematical efficiency", but for whatever unfortunate reason end up slipping through the cracks in enforcement. Unequal, unpredictable and discretionary enforcement is often source of corruption and inequity, so filling those gaps would be welcome.
Because, and this is where law just messes with my brain, the field deals as much in the NORMATIVE as it does in the objective and subjective. in my limited understanding...I'm left feeling like the normative is treated as objective by those in the field, but looks subjective to those outside of it.
I think the idea that laws are strict rules that are enforced in a robot-like fashion is a common misconception, specially in engineering circles. That's not true in civil law and certainly not true in common law. There are very simple and straightforward cases that can be thought more or less like that, but almost all criminal cases and many civil cases too are very much a game of convincing other people and not satisfying a set of rules. Jury equity is a thing, technically you can acquit someone by not making any efforts into convincing the jury that your client didn't break the law.
The law does not have the last say, humans do. Loopholes are just loopholes as much as the court considers them to be valid.
The fact the process is sitting on a case for YEARS because they can't decide how to interpret the facts, or which laws apply, or what they mean, or even simply due to the procedure being enormously inefficient for everyone involved, in fact usually means that whether you are found guilty or not in the end... you lose.
And humans can always have the last say. Computers don’t take that away from anyone. Having computable law doesn't mean 100% of it is computed by dry algorithms.
It is very much a benefit that it's interpretative and slow. We want it to reflect the culture and people's common sense. We want it to be as fail proof as possible (even if it take ages to come up with all the evidence and arguments). And fail proof here is not to interpret the law in the most pedantic of ways, but in the way that is the most just. The reason for lawyers and courts are exactly the edge cases that are difficult to agree upon.
If instead we had a standard library of contract components that could be composed in verifiably compatible ways, that would be a huge achievement. I think that's what legalese is doing.
* Standford codex LSP initiative that try to standarize the format in which legal rule will be encoded https://law.stanford.edu/publications/developing-a-legal-spe... (as far as I know the initiative is still going, don't hesitate to contact oliver goodenough if you want to get involved)
* OECD recently published a full repport on current initiative in the domain https://www.oecd-ilibrary.org/governance/cracking-the-code_3...
* There was a workshop at last ICAIL where a lot of people showed their progress on the topic (link to all demo video in this gdoc : https://docs.google.com/document/u/0/d/1-7cJ0KsYzQ8IOY3L_bYX...)
* MIT started a journal on the topic ~1 year ago https://law.mit.edu/
If you want to work on this topic DM me :)
strong doubt.
laws are by definition supposed to be „soft” and not hardcoded. see the smart contract hacks.
this simply doesn’t happen in law, because the spirit plays a large role, and the spirit is something that cannot be coded
The law is (nowdays) is backed by writing, and since I think that computing is a next step in the evolution of writing (along with printing press) one day---likely in dozens of generations (hundreds of years)---the law will be backed by computing.
All these technologies change the nature of a human's consiouness; it will take hundreds of years. Look at Walter Ong's work for better made arguments along these lines https://en.wikipedia.org/wiki/Walter_J._Ong
Some exceptions to the above are: 1. Financial contracts (see ISDA derivatives). They're written with a big "human" document upfront and then there's a "notification addendum" attached to each use of that contract. 2. Master Sales Agreements (MSAs): The first MSA is a human-to-human agreement. Everything after that is order-forms. And negotiating the MSA requirements is very very human (risk, trust, effort, cost, benefit & promises). Order forms are pricing decisions that can be "automated" (especially around annual renewals if within budget without red flags).
so does law.
There are lots of drafting disputes about things where someone wrote something like
> a and b or c
leading lawyers to argue about whether this should be read as ((a and b) or c) or (a and (b or c)).
There's no reason that this kind of ambiguity should have been permitted to exist in the first place.
I think my understanding of this is related to my understanding of Lojban, which tries to avoid all syntactic ambiguities but explicitly says that it's a non-goal to avoid ambiguities related to the cultural meaning of words and concepts. Like if you say something is "medieval" or "fun" or "convenient" or "beautiful" or "fair" or "postmodern", Lojban doesn't try to make the truth-conditions for your statement objective with regard to what these concepts do or don't refer to. But to the extent that that's agreed between two people, they should then agree on what a particular sentence using these concepts means or doesn't mean.
Though I do envision that when people use better tools for avoiding parsing ambiguities in legal texts, they will still argue (and there will be many legal philosophers insisting) that they should still be permitted to argue that something was still a drafting error, because the (only permitted) interpretation under the drafting formalism is manifestly unfair or unreasonable and could not have captured their true intention.
https://digitalcommons.law.yale.edu/fss_papers/4519/
https://repository.law.umich.edu/articles/29/
https://drive.google.com/file/d/0B8axPLLxhjQFWGc0ellBYTF3RnM...
* https://catala-lang.org/ -- DSL for translating/annotating legal texts
* https://arxiv.org/pdf/2011.07966.pdf -- A Modern Compiler for the French Tax Code
* https://www.youtube.com/watch?v=EshxZVMURt4 -- Formal Methods and the Law
For folks who happen to be unreasonably interested in this stuff: there are research engineer positions open at the Centre for Computational Law at Singapore Management University where the bulk of the R&D is happening, in partnership between Legalese and the university.
TL;DR: Move to a tropical island, get paid to write open-source software, and explore the arguments being made in this thread in way more detail than you dreamed possible. DM me on Twitter, @mengwong
For more information see:
- https://finregont.com/ : Semantic compliance in finance
- https://bankontology.com/ : Semantic bank compliance
- https://www.smartlogic.com/home : I think this company uses semantic technologies and AI to do legal compliance checking
- https://tel.archives-ouvertes.fr/tel-02062174/document : Automation of legal reasoning and decision based on ontologies (PhD thesis on the topic)
- https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=sema... : search google scholar for semantic legal compliance
I know there are more companies doing it, just don't know their names right now.
The benefits of this is:
- Don't need yet another DSL, RDF works fine, and it's already being widely used.
- A lot of the world is already modelled in OWL (e.g. Organizational Ontology, Provenance Ontology, literally too many to list)
- Already have a good query language with inference support (SPARQL)
- https://data.finlex.fi/en/main - Semantic Finlex – Finnish Law and Justice as Linked Open Data
- https://lynx-project.eu/project - Legal Knowledge Graph for Multilingual Compliance Services
- https://www.mirelproject.eu/ - MINING AND REASONING WITH LEGAL TEXTS.
Need more semantic tech related stuff on here IMO, most people working in tech don't even know it exists AFAICT.
What he on the other hand thinks has been revolutionary is free access to law, advanced text search tools, and software to make filings and communication significantly easier. That's the boring part that speeds your work up so you can spend more time devising plans to get your clients to pay less in taxes, and construct stronger defences.
There are many low-hanging fruits in this process; I wish these guys the best of luck, but it seems to me that the comparisons drawn (Intuit, Adobe, etc.) are not analogues. Lawyers aren't seeking these tools for it doesn't provide them value, it only takes away billable hours away.
I can only imagine that would be a humungous task. And presumably the existence of case law makes it much harder still.
It would be quite interesting to think about what the legal equivalent of unit tests would look like. Presumably a large collections of sets of circumstances and desired legal outcomes. It seems to me that this might be an interesting output of legislatures in addition to statutes (although whether they would/should be controlled by the legisalture or judiciary is also quite an interesting question, as our existing system seems to rely quite heavily on the judiciary being able reinterpret laws in ways the original legislators most likely didn't intend)
These are called Reform Acts. They are indeed humungous tasks, rarely undertaken. Where I studied law, in the Northern Territory, a Law of Property Act was passed in 2000 and repealed Acts and overruled case law going back to the 12th century in Britain. It was indeed a massive effort.
For some areas of law the Act is also a Code (the Act explicitly says that it is the sole, whole body of the relevant law). This is mostly done for criminal law.
Codes are rare in common law jurisdictions like the US, UK, Australia, Canada, New Zealand etc. Codes are much more common in civil law countries like France, where the ideal is for all of law to be centralised and rationalised. Both systems require endless tinkering, debate and reinterpretation, which is why I am skeptical of universalist missions to convert the whole of the law into a system of formal symbols.
If I recall correctly Quebec separates by private and "public" law, so if you get divorced or break up a company it's one system, if you steal from someone, the other.
Somehow it's all hybridized and works.
Although arguably stating law in natural language might not help much with that either.
Legislation is typically drafted in a structured way, with deliberate norms and forms. There are professional drafters who do exactly that on behalf of legislators, and a body of case law on the interpretation of legislation that guides their work.
Nevertheless, such efforts cover minimal portions already very clearly defined and debated. As another commenter replied, reforms are rarely undertaken for various reasons. One great issue with tax law is also that whatever code you may write is not necessarily guaranteed to be 'better' (fairness, revenue collected, lack of loopholes and edge cases, completeness, correctness... pick your metric) simply because it's code. That's what I thought too; but no longer.
> As Merigoux explained more fully on his blog, this project became possible because the French government open-sourced the code that they use to calculate residents’ taxes, which was written in a domain-specific language called M, but they didn’t release the compiler that would have been needed to actually run any code written in that language. MLang is a compiler for M code written by Merigoux, and it has two special features: it translates the tax calculation function to Python, and it enables formal verification of features of the tax calculation using an automatic theorem prover called Z3.
All billable hours aren't created equally. If I can automate the work that I currently hire fresh grads to do - the work of actually drafting up contract agreements for review and wills - but price my services just under the prices offered by other firms then I can make a killing.
You can purchase a hand carved wooden table for your living room and some people still actively manufacture these "bespoke" items, however most folks shop at IKEA and chose between one of a dozen styles available for a dining room table. These two products are mostly functionally identical in terms of supporting food and weathering the years (if you go by depreciation the IKEA table probably loses value slower than a hand carved table - and you can replace it pretty much at will). There will likely always be contract lawyers around to sort out large M&A agreements and other high priced transactions, but wills and simple employment contracts - delivering these in a correct format (i.e. not just a download a sample contract and fill in names possibly resulting in something unenforceable) will be a game changer.
Taxes are extremely complicated - but they got that way by design. The US Tax code is the result of one of the most insane applications of regulatory capture in the world and it's there to allow Intuit to continue printing money at the expense of the tax payer - simplifying those (like for real - not the 2017 version) might not end up happening for decades as there is a ton of money entrenched - so that seems like an incredibly poor part of the market to initially target.
Contract law though, it's not simple but it's so utterly clear and actually codifying it would likely greatly aide law makers in discovering and resolving any existing loopholes and might even provide some useful insight into how the US could better handle the question of employee vs. contractor by enumerating rights and privileges in a clearer format.
And wills, pretty much everyone seeks independent legal council to write one of these at some point - it is highly advisable depending on where you live (in Canada a lack of a clear will causes assets to be tied up by the government for an extended period of time) so you could make a lot of money edging the market out there in particular.
This is probably true, but has a definite knock on effect that breaks the existing training model pretty badly.
I suspect the longer term stable solution is relatively fewer working lawyers relying more on tools - but transitioning the industry to that model will be painful.
Free access to law, and software for filings like afterpattern.com, that's the boring stuff that lawyers don't want to do and I don't want to pay for, so win/win. And that's all part of the larger vision of computational law that Legalese wants to help realize. Thanks for the good wishes and I hope to deliver on the vision, we've been at it for five years and will probably be at it for another ten before we start seeing results percolating into the real world.
https://chicagounbound.uchicago.edu/cgi/viewcontent.cgi?arti...
"The pretense is that the law is a system of known rules applied by a judge; the pretense has long been under attack. In an important sense legal rules are never clear, and, if a rule had to be clear before it could be imposed, society would be impossible. The mechanism accepts the differences of view and ambiguities of words. It provides for the participation of the community in resolving the ambiguity by providing a forum for the discussion of policy in the gap of ambiguity. On serious controversial questions, it makes it possible to take the first step in the direction of what otherwise would be forbidden ends. The mechanism is indispensable to peace in a community."
I've thought a lot about this because it directly impacts whether you could turn a contract into code. Code is for the most part very deterministic - you can expect that the logic you use will be interpreted in the same way every time given the same inputs. When that isn't the case, it's generally considered a bug.
Law and contracts appear to be deterministic, but are in fact not. Anything that is written into a law or contract is subject to interpretation later. There's no attempt at making it exhaustive because it's not possible, nor is it necessarily desirable. Sometimes contracts contain language that becomes invalid later on, and you don't want to define things too tightly or you'll have to modify the contract non-stop. Sometimes things arise which are not spelled out in the contract and as long as the parties agree, there's no problem. The rules around contracts are a lot more bendable than in code, and "it depends" is quite often the answer to many questions. So is there overlap between code and contracts/law? Certainly. But the deeper you go, the more exceptions that arise.
Unfortunately while the idea is solid, and very much viable, it's all about institutional inertia, not merely technical ability. Good luck to this startup, and I mean it.
Here's the definition: the formal and technical language of legal documents that is often hard to understand. "the typed pages were full of confusing legalese"
Business people actually think it's an asset to have an attorney that is "good" with legalese, but the practice actually represents dishonesty. And attorneys are expected to catch these unclear legal language, but most won't complain b/c it requires a few extra hours of back and forth for which they can charge money for. If software is going to eat law, I hope one of the consequences of that is better allocation of legal services and more transparency in legal contracts
What we really need is an industry-wide API-like-thing to provide a higher base to build all the other contracting solutions on top of.
Right now the default API is "English language" and law of your choice. That's too hard of a problem to solve transparently with technology and it presents a learning curve that's hard to justify with an endgame of vendor lock-in and product instability. And you can only do so much if you're the only contracting party "speaking" that API. Designing a replacement API isn't easy either, and industry adoption may be nigh impossible from the position of a startup. But these folks seem clever and they think big so something to watch.
To give only a single example, "what is admissible evidence?" Assume for a moment that we have solved the "what is admissible evidence in this context" problem. Now you have a giant list of pieces of evidence, testimony, etc. How do you prove chain of custody? The legal system is utterly blind to the world, its agents are intentionally blinded to much of the information, and practically blinded to others.
Even with modern surveillance the amount of uncertainty that is present in many legal cases is substantial, and machine learning won't help you here, because every legal case is a one off. I'm sure someone will try to create a statistical guilt detection net despite the obviousness that it will inevitably produce unjust results.
If you want laws to be written in formal languages, you need a system for defining formal semantics for the entities and relations that their abstracted axioms describe, and things like OWL and RDF are not sufficient, because they only provides the hypotheses, not the evidence. You can assert that evidence subClassOf admissible-evidence, but you need proof that the assertion is valid that can be checked by multiple parties (or anyone with the desire to do so). The one-off nature of many cases often means that you can't go out and test the hypothesis again.
These are hard measurement problems, and we don't have a good language for describing them, and how the measurements themselves are governed by the legals system.
That said, being able to bootstrap simulate court cases with juries drawn from the population would already be a massive win for interrogating laws and their implementation and enforcement. Similarly being able to simulate new legislation to reveal loopholes would be fantastic, though I doubt politicians would enjoy that.
There is quite a bit of data, but I don't think it is particularly amenable to the current fads in machine learning. Amusingly people complain that we'll never be able to write down all the axioms, yet someone wrote down all the laws. Economically unattractive due to a tragedy of the commons certainly, but at the end of the day someone is going to have to write down all the axioms, one way or another. Maybe modern machine learning techniques could be used to generate the axioms for humans to review?
And OWL has formal and provable entailment rules. So everyone can agree, given samme ontologies what the implications are. There are unsolved problems there but most of the things you list are already thought through.
Anyway, I'm interested to see what will come out of this, but I see very little awareness of past work, which might be because they want to make it look more revolutionary than it is; or because they're reinventing the wheel. Time will tell.
(Disclosure: One of the founders is a good friend, and I am wishing them success.)
I had a comment on the last time this came up where 'A computer language for law' was a bad idea unqualified, but this page actually seems to address most of the points I raised in that comment.
The thrust of the comment is 'Law is not something that will be executable and that we just automate' but more 'Law is something with an underlying structure that we can use engineering tools to write, validate and understand.' That is to say, the tools are there to help the humans with doing law stuff, not doing it for them.
This page is pretty wooly and high level, but it does seem to be going more down that avenue, which is laudable. It does mention smart contracts and Ethereum which I think might be distracting in the early days, but we'll see.
As a result, the computational legal infrastructure will slowly diverge from what the actual legal outcome would be.
That's problematic.
OTOH if they succeed at coding a large % of finance law, they 'll have created an excellent machine to find loopholes to exploit.
We can debate hours what machine-readable means, but definitely text in varying fonts and layouts IN AN IMAGE does not point in that direction.
https://twitter.com/paulg/status/1384422654195683328
> In 2008 I spent a month writing a web-based system for managing all YC's funding documents. With one click you could get an instance of the latest docs, prepopulated with all the startup's info from our database. The lawyers quietly ignored it and kept using Microsoft Word.
Others have said in the comments that doctors and lawyers are "the last, most powerful guilds" remaining. On the one hand, it's easy to call for "the end of lawyers". (The Legalese website says that sort of thing as a provocation, a way of staking a flag in the sand.) On the other, it's likely that society will always define a special role for the white-collar warrior, the champion of the courtroom; for high-stakes, once-in-a-lifetime situations, you want expert human hand-holding.
In books like https://www.amazon.com/Future-Professions-Technology-Transfo... Richard Susskind offers a more nuanced middle ground. Look at medicine: together, the Apple Watch, WebMD, DirectLabs, home glucose monitors, and home blood pressure monitors (let us never miss an opportunity to say "sphygmomanometer") allow millions of people to do for themselves what they used to need a doctor for. In turn, that lets doctors focus on more high-value work.
Suppose we distinguish quantitative and qualitative reasoning: numbers belong to the former; legal and logical problem-solving to the latter.
Quantitative reasoning went in-house when spreadsheets (the original killer app) landed on the PC: now millions of people do for themselves what a couple of generations ago used to be the domain of the accountant, the bookkeeper, the finance specialist.
What would "spreadsheets for law" look like? If tools emerge that allow laypeople at home and in business to explore for themselves simple questions like "what is the deadline for me to do X", "what things am I required to prepare ahead of that deadline", and "how do I get out of doing Y", frankly the lawyers might breathe a sigh of relief so they don't have to keep annoying people by answering "it depends". There's plenty of low-hanging fruit out there like that which makes people's lives better. Software like docassemble.org and startups like afterpattern.com are exploring these possibilities. Farther into the science-fiction future, researchers in France did a lovely demo, basically fuzzing the tax code to find a sploit that deserved to be patched. https://blog.merigoux.fr/en/2019/12/20/taxes-formal-proofs.h...
One final point: people who argue for the necessity of discretion and the desirability of vagueness and ambiguity tend to have, in the past, benefited from such discretion. But there are less privileged people out there who have been on the sharp receiving end of discretion, and they might prefer a little less discretion and a little more algorithmic, explainable, deterministic fairness!