Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

YES!

We should approach this from a two-tiered testing platform.

The first tier is rather like how you'd do it in Rails or any other TDD environment.

We write a list of tests that we know should pass as true at the end. Let's say, start with the US and State constitutions as the basis.

    def must_not_prohibit_exercise_of_religion()
    {
        People.can_exercise_religion?
    }

We then write in the test laws and see what side effects occur. When those side effects occur, we must make note of them and consider the potential exceptions.

    def freedom_of_speech()
    {
        unless(crowded_theatre && People.speak == fire)
            People.can_speak?
        end
    }
As a second layer then we must test it on smaller populations to determine the effects. This has worked wonderfully in some situations. "Gay Marriage will destroy marriage and society" is a claim I've heard prior. So test it in Massachusetts. Several years later, no marriages on record have been destroyed due to gay marriage, and the metrics of society's stability have not moved significantly in any direction that we can attribute to same-sex marriage. So it (should) pass and become law nationally because we've observed its effects. We can observe similar for the long term effects of required health insurance in Massachusetts as we debate how things should work out nationally.

Just as we have 'human-readable code' why shouldn't our laws be machine readable? Computers can remember/understand 200+ years of case law probably better than humans. Again, this is something that we could test.

One of my friends is working on a law firm run by computers (http://www.robotandhwang.com/). Of course the machines can't show up in court or legally offer advice, but they can advise the attorney. (Law.com and ABA Journal have cited him doing this, so maybe it isn't as crazy as it sounds).



I was about to respond until I realized your post was a Swift-ian parody so sophisticated as to be almost over my head. Well done.

But if we were going to try to reduce the complicated, inherently human, and uncertain concept of law to computer code, surely you'd agree that a declarative programming language would be a better choice. Something like:

prohibits_free_exercise_of_religion(X) :- unconstitutional(X). respects_establishment_of_religion(X) :- unconstitutional(X). unconstitutional(X) :- not_law(X).

Now, all you have to do is write Prolog code to test for when a law prohibits the exercise of religion or respects the establishment of religion!


You have your Prolog backwards.

  foo(X) :- bar(X).
means that foo(X) is true if bar(X) is true, not the other way around. So your code would indicate that anything that's not a law is unconstitutional, and anything unconstitutional prohibits free exercise of religion (for example).


oh! that explains why my Prolog hacking has been so unsuccessful. Thanks very much.


NO!

Your entire system breaks down because it hinges on the notion that there exist objective and generally accepted definitions for the things you intend to describe. Moreover, the metrics for things you describe also do not exist. While one could say that we could make them, I'd respond by saying that in itself is simply kicking the can down the road. Instead of arguing that, say, gay marriage destroys marriage, we'd be arguing what marriage is, how it is destroyed, and how it should be measured. Also, just because society hasn't changed in a measurable way does not mean that it is unaffected. To use this model would be to rely on the notion of some kind of perfect set of tests, which I personally find impractical, if not impossible.

Heck, TDD is something we have to do because we're working with languages that aren't powerful enough to give us a clear precise spec of what we're writing a program to do. While it can help you weed our corner cases in your code, it doesn't produce a formal description of how your program works. The same goes for society. We can use something like TDD to look for corner cases and things we don't like, but ultimately (granted it would even work, which I doubt) we'd only be looking for things that the test writers didn't like and wanted to weed out.

Automated legal interpretation makes sense if you're looking for edge cases to get out of something or you're trying to do your taxes, but for other things it does not (1st, 2nd degree murder vs manslaughter, for example). Laws are just as much about their interpretation as they are about what's on paper. These interpretations tend to evolve over time with what society finds acceptable and proper, and I'm totally cool with that. Now if you have a machine that needs updating in this regard, how he heck do you keep it updated?

I'd venture to guess that legalese may almost be easier for NLP to interpret than modern English. It seems much more structured. I think automated interpretation of laws could definitely be used in an area like tax law. To be honest, I think it's completely unreasonable that it has not been done so already. Why do millions of Americans have to pay some intermediate body to do their taxes for them because the tax law is difficult for them to understand? Why do we write administrative rules that are so difficult for everybody to understand, full well knowing that everybody must understand them for society to function? That, to me is absurd.


> Just as we have 'human-readable code' why shouldn't our laws be machine readable? Computers can remember/understand 200+ years of case law probably better than humans. Again, this is something that we could test.

Great website, however I'm going to play a straight bat on this one.

While I think expert systems have enormous potential to reduce costs and errors in legal matters, the fact remains that when the law is against your client, you must still try your level best to generate a new exception if they insist on going to court against your advice.

There is also the problem that large parts of the law rely on judicial or executive discretion, thus leading you computer to do what lawyers do: say "maybe" and bill you $600 for the time to say it.

I'm guilty of the same idea, by the way: http://clubtroppo.com.au/2007/08/25/programming-in-legal/

These days I am less confident that it would work for the hard cases; but it could expand the field of bread-and-butter legal work.


This kind of testing is already done in certain contexts. I am thinking specifically of air quality and automobile efficiency standards which are "tested" in California before being rolled out to the nation. However, this is only allowed because California has special exemptions from federal law in these contexts. It is important to note that scale and scope are critical-what may be efficient/optimal in one locale may not be so in others, or at larger scales. E.g. fuel standards and national energy profile are arguably under legitimate federal authority... other issues not so much. Also important to point out that the "optimal" and "efficient" are not mutually inclusive or absolutely defined-preferences, for better or worse, are king.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: