Hacker News new | past | comments | ask | show | jobs | submit login
Transforming the Law into Code (cornell.edu)
34 points by fogus on Aug 5, 2009 | hide | past | favorite | 25 comments



Law can be significantly improved through technological innovation but, at its heart, does not lend itself to mechanical application.

By its nature, the law seeks to regulate human affairs, which can have as many variations as there are people, thoughts, and actions. That is, law works with what is basically an infinite set of potential variations.

In trying to define what is right and what is wrong, what is just and unjust, the law adopts rules and principles to attempt to make sense of the common cases that arise. But there will always be an exceptional case waiting around the corner.

That is why judge-made law lies at the core of law. It deals with issues as they arise case by case in an individualized setting. When judges write opinions, they set precedents to help guide future decisions. The precedents in themselves embody sets of rules or principles as they applied to a particular set of facts. When new facts arise, the law can apply the same principles or can distinguish the new facts and declare a variant outcome based on such facts. It is a highly customized system that can't be systematized unless and until human conduct can be systematized - that is, it never can be made predictable except insofar as it concerns recurring types of situations, meaning that exceptions will always arise.

When legislatures try to systematize law, they do so through statutes. These are authoritative pronouncements of law that say, in effect, "for this type of issue, here is what the law will be."

Statutes are so general, though, that courts need to interpret them as they apply to individual situations that may arise under them. This leads right back to the case-by-case approach of judge-made law.

Statutes also have implementing regulations by which they are clarified and applied to detailed situations. Just try to read through the Code of Federal Regulations sometime. You will find a maze of detail so individualized that no one would possibly want to waste time trying to systematize. Again, the human factor looms large. Tax regulations might say that this or that constitutes taxable income. But some lobbyist has managed to get Congress to inject bizarre exceptions. Again, though, the real problem is how any given regulation applies to real-world facts. These come with infinite variations and lead right back to the case-by-case type of system found in courts - thus, nearly every administrative agency has a corresponding court (the Tax Court, for instance).

When David Dudley Field tried to simplify law in the 1870s in California, he got the California legislature to adopt the Field Codes. These were complete restatements of all the judge-made law then extant in California, all set forth in simply-worded statutes, drafted by the brightest people with the express intention of making the law understandable to lay people. It was a grand experiment in legal simplification. What happened? The judges began interpreting the statutes case-by-case, had to decide how the new "simple" language related to the older more complex language in evaluating the continuing worth of the older precedents, and finally had to decide whether the legislature did or did not intend to change the law from what it was before in adopting the new language in any given area. By the time the courts went through that maze, and then had to apply the simple statutes to many sets of complex facts that inevitably arose in real life, they had managed to promulgate a new body of judge-made law that was more complicated than ever. The Field Code, then, turned out to be one of the world's biggest belly flops - it began with a great flourish and ended up a humiliating embarrassment.

The same with form contracts - it all turns on customization. If you want to take an elegantly worded contract and just sign it without considering how it might apply to your deal, you are asking for trouble.

Law also has innumerable localized variations. There is municipal law (that varies with each city or town), state law (that varies with each state), federal law (that varies with each nation), and international law. Different scenarios can potentially implicate laws from one or more of these disparate levels at the same time. Who decides which law applies in a complex fact pattern where activities might have occurred in multiple states or nations? Or how the law of one region may or may not be qualitatively better than the law of another? Any coding system would need to make such determinations.

That all said, if someone can figure out how to put all this in code in any way that is meaningful, it will be one of the most stunning accomplishments ever.

The underlying article is a good read. The idea of reducing the overall body of law to code, though, is pretty fantastic, in my judgment.


IANAL, but I totally agree---algorithmic law is a frightful prospect indeed, not to mention totally untrue to our legal tradition.

The second point the article makes is a good one, though. Lexis-Nexis and Westlaw are useful tools, but they are neither free nor particularly easy to navigate. A hypertext version of the law, organized hierarchically and cross-linked with explanations for lay people as well as expert opinions, would be invaluable. A "Legapedia", if you will---or "Nomopedia", if you're not the sort to mix Latin and Greek. :)


As long as it is not called a Thesaurus Legum, I am fine with it.

This would be an excellent resource, is technically achievable, and would further the worthwhile (in my judgment) goal of undoing the guild-like control over legal knowledge once held by the lawyers.


I'm happy to see you agree, but---to play devil's advocate against my own belief/desire---consider the following Mad Lib:

An online reference crosslinking lay and expert knowledge would be an excellent resource, is technically achievable, and would further the worthwhile (in my judgment) goal of undoing the guild-like control over [PROFESSION (adj.)] knowledge once held by the [SAME PROFESSION (pl. n.)].

Are there professions about which this doesn't fit? For example, is WebMD satisfactory for medicine? More to the point, this doesn't really exist for computer science, the first field you'd expect to have it. What do you (and others) think the barriers are? Unwilling/absent expert users? Lack of incentives?


I think the practical barriers are very high, as there would be no commercial incentive for someone to devote the enormous amounts of time it would take to do this for any field.

In law, there is also the huge problem of licensing barriers that prevent lawyers from practicing outside of specific jurisdictions in which they are authorized. This heavily tends to balkanize the field and also puts up high barriers to entry and to the sharing of knowledge and expertise.

Specific services like Lexis and Westlaw are given commercial incentives to organize legal data (case law, statutory law, etc.) and put out high-priced, proprietary search services that give subscribers access to many key legal authorities. Since they do this based on very lucrative contracts, I doubt that we will see any opening up of this information for free or easy access.

As a practical matter, the barriers will be around for a long time to come.

Unlicensed fields, in contrast, face only the practical barriers, but these are huge. Over a lengthy period of time, though, these will gradually lessen, as more and more significant information is brought into public accessibility via the web - at some point, it might become practical to start and sustain a project - maybe through volunteer efforts ala wikis or open source - that begins to realize such a vision. But it is a long way off.


grellas, keep 'em good posts coming. It's good to have a lawyer amongst us and you have been dropping gems around here (I've been forwarding a few of your posts as well.)


What makes these poor naive souls think that the law wants to be transformed into code?

Millions of bureaucrats, both large and petty, derive their power from the complexity, ambiguity, and room for arbitrary, capricious enforcement of the existing legal code. Dislodging them would probably require mass bloodshed on the scale of the French Revolution.

And treating the presently existing legal system as a logical program can lead to disaster. See "What Color are your Bits?" (http://ansuz.sooke.bc.ca/lawpoli/colour/2004061001.php)


Or you know, you could just change the law to eliminate their positions.

No blood, no mess, no silly truther-type calls for revolution.


The very nature of law, law-making, and law-enforcement attracts such people and repels others. Therefore even traditional revolution would ultimately fail. One would need to do something new.


Making law "compile" could be useful in democratizing a process that's entirely dominated by lawyers.

Once a law is in "code form", links, ambiguities, contradictions and loopholes becomes (more) obvious, and extending it with e.g. precedent and opinions is simple. It would also help the legislative process - you propose you change, and everyone can run their test-suite on it, and see if and how they'll be affected.

My first though was the software that the European Union has been developing (I don't know the state of it) that, on the fly, translates what the writer is typing into a intermediate language and back into the writers language - that way ambiguities and idioms are caught immediately. It's not exactly useful for poetry, but should help in creating concise and unambiguous texts, even in just a single language.


Most of the problems with the law are in the ambiguous edge/border scenarios that were not foreseen at the time the law went into effect, for example, b/c the law has been extended by practice or case law.

Also, most law is applied more like fuzzy logic than like discrete logic -- a judge has a set of factors, each of which he may weigh separately, in reaching a decision.


I wish I could upvote this more than once. I have been ruminating on these ideas for several years; even given the ambiguities uncomputabilities inherent in a natural-language legal system, every time I go look at a piece of legislation the first thought that runs through my mind is 'why is this code so hideously untidy?'

While we will never be able (and probably shouldn't attempt) to reduce the law to something resembling C, I'm strongly of the opinion that the law badly needs wikification if only for the sake of its own long-term acceptability. The more abtruse and inaccessible a rule system, the greater the liklihood of its displacement, as every tinpot dictator is aware.


I must disagree with the OP's justification: "this recent push for transparency has ignored government’s central function, to pass and enforce laws."

It is not the government's central function to pass and enforce laws, nor is that the goal that legislators set for themselves.

From a philosophical perspective, the function is to government is to govern. There is no reason that this must necessarily entail laws. In many cases simple speechifying and arbitration might suffice. Very often, it would be more appropriate to repeal a law than to pass a new one. Internal consistency is not required (or is a moot point) if there is no code of laws. And while that seems a huge leap from today's situation, it is in principle a possibility.

From a more practical perspective, the role that our government has taken is to be seen to do something. For example, the CAN-SPAM law certainly involved passing a law. But that law had no basis in reality; it's utterly impractical and unenforceable. Assuming that our legislators aren't stupid, there was never any requirement that this law be used to prosecute spammers. Rather, the intent was to demonstrate to the public that the government was "doing something about the problem". Thus, there was no need to ensure that it was consistent with anything, or even that it had any actual meaning.

Thus, it's perfectly feasible for a functional government to have inconsistency in its legal code.


Law cannot be inconsistent. If one law is inconsistent with another, one or both gets struck down.


    if (plaintiff.type == LARGE_CORP) { punitiveDamagesRatio = INT_MAX; }


The problem with translating legalese into a programming language is that the targets are police officers and juries, not Von Neumann machines or lambda calculus.


I wonder how the Gödel's Incompleteness Theorems apply here.


The author says (and I agree) that the process of judging cannot be easily performed completely by a computer, and goes on arguing for better retrieval systems for legal texts -- so Gödel would probably just shrug.

Actually, I think laws (at least in the Civil Law sense; I'm not too familiar with Case Law) could be adequately represented in some formal logic language if the value judgements are made explicit so that the semantics of the law language specifies the meaning of most operators explicitly but leaves the judging-operator up to human judgment.

Then, laws could be model-checked for loop-holes.


Case law is very rarely discrete; the point of case law is that the law is not and should not be mechanically applied.

Case law arises from the chancery courts of England, where the primary goal of the court was to do what was "fair", rather than simply what the law said.


I look forward to how one can mechanically handle "disorderly conduct".

Note that many of the things that are typically considered DO are legal in circumstances that do not have an explicit "DO doesn't apply here". Even worse, in many of those circumstances, the identity of the actor determines whether the act is DO and the "exemption" is usually for only some DO acts.


Is the author the same Stuart Sierra from the Clojure lists? (Just curious.)


Yes. In the bio at the bottom of the article it says that he works on AltLaw, which is an open source clojure app.

http://github.com/stuartsierra/altlaw-backend/tree/master


The hacker news title is extremely misleading. I almost typed some off hand comment about Lessig's Code book and how I couldn't finish it because of such ideas. This article was good though.


Care to explain about "Lessig's Code book and how I couldn't finish it because of such ideas"?


Such ideas like coding the law. I admit it's been a while and I never finished reading it. After having read his Free Culture book, I mean, I was so for his ideas in Free Culture, and then it was the complete opposite with Code v2. I couldn't stomach it, so I passed.

I remember ideas that would essentially be turning the internet into a fascist regime where you would have to show your credentials at every stop or be refused access to the web.

anyway, care to take a shot? http://codev2.cc/download+remix/

I got as far as chapter 10, but could never finish the intellectual property chapter, or so my bookmark tells me.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: