Hacker News new | comments | ask | show | jobs | submit login

I wonder if there are any systems for defining these things in a more explorable format, because I don't particularly enjoy reading legalese.

assert> forbid(anyone-in(nz), sale(illegitimately-labelled-product("Bourbon Whiskey"))

query> prohibitions-for(anyone-in(nz))

Or something. Semi-logical legal code.

Legal code is logical. Very. You might not be able to read it, but that's because you haven't learned the language yet.

And like any code, real-world applications are much harder to read than textbook examples.

That's why I figure formalization should be relatively straightforward. The PDF someone linked to about a Prolog-based formalization of UK citizenship legislation is a perfect example.

Code should be executable, queryable, checkable, and so on. Legal code translated into a logical skeleton would obviously be more amenable to visualization and other interesting things. Then everyone wouldn't have to learn the language; we could develop tools for people to query the data at different levels of sophistication.

I would love to see people trying to create these sorts of representations.

But I suspect we're decades away from actually making the shift you want in the primary documents. Computer languages are made to be executed by computers. But the execution medium for human laws is human minds. And most of the relevant human minds have law degrees. So a computer-friendly translation of laws will be always be extra work until the execution medium changes.

Machine translation is making great progress, though, so perhaps we can automate away the problem.

That's one of the features http://www.commonaccord.org/ is trying to achieve, as I understand it.

I assume the reason they don't do this is that the important and contentious parts of that assertion would be:

What do you mean by "anyone"? What does "sale" mean? How do you define "illegitimately labelled"? etc.

And before you know it you're writing your own legalese to cover every possible question.

I'm certain the powers who come up with these treaties don't care about formalization; they have lawyer armies already.

A formal definition created by some "objective" third party would make it clear which concepts are axiomatic. If "sale" is an axiom, there is no further explanation except perhaps a link to a legal dictionary (or whatever). But maybe it can be clarified with explicit relationships.

This would all amount to another kind of legalese: a formal one based on explicit logic. It won't solve the inherent messiness of law, but it might clarify some things.

Or worse, they start running the law on a computer. Instead of human interpreters, they'll just run their models and say, oh, the computer says you're guilty.

As long as we can hire our own advocate/model to provide a defensive analysis, we might be ok...

You don't make the computer output "guilty." You make it show you a likeliness of violation and a history of enforcements along with the relevance mitigating factors.

But that doesn't sound as good as a dystopian science fiction story :)

Prolog seems like a good fit for that. Any PhD student wants to publish a paper on a Prolog translation of the TPP? :-)

Here is a paper describing a "port" of the UK Nationality Act to Prolog:


That's exactly what I was fishing for. Thanks.

My wife is a commercial litigation lawyer and I've always wondered about the similarities between legislation, contracts and code.

Cool. Do you know about the paper on "composable contracts" that defines financial contracts (derivatives, etc) in terms of functional combinators? It's pretty cool. They're able to define automatic Black-Scholes valuations for complex derivatives, and stuff.


can't take credit for this idea, but i wonder why we haven't created a domain specific language for law & legislation.

language intended for verbal communication (ie. english) seems like a really poor option.

Because the law isn't a machine, it's made from humans. And "verbal" (usually "natural" in this context) languages are how humans communicate.

Humans also communicate through formal systems, which is why the history of logic has always involved formalization.

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