Hacker News new | ask | show | jobs
by jamieb 4699 days ago
Yes, we should have black and white laws, and unit tests for them. So someone could write a unit test for "Will this allow the NSA to create a secret court that is outside the rule of law?" or "Does accessing a university computer that has an open access policy allow for a sentence of 130 years?"

I believe we'd see a lot simpler laws.

8 comments

Depends how you define "simpler." There would be a LOT of incredibly specific definitions, since there would be no room for interpretation by a judge.

Consider a law that says "you can't drive a vehicle without a license." Is a bicycle a vehicle? What if it has a motor and weighs a lot? A velomobile? What about a hovercar?

There might be 2,000 laws referencing "vehicle [definition #4,849, version 5]".

(Actually, I guess a sensible definition might be based on momentum: we'll call a tricycle a vehicle if you manage to get it going fast enough; the point is that you can hurt someone with it.)

.. it depends. What if the point in the given situation is to avoid traffic congestion? You normally don't want (a small) buggy drive down a high speed highway. In that case it the point would be: "should match the traffic flow requirements".

So, I agree with your argument. It's all very situation dependent. For some reason I find it oddly comforting that human society and life in general can't be crammed into a small set of fixed rules. That would be kind of boring I think.

> In that case it the point would be: "should match the traffic flow requirements".

And that's simple? What's the requirements? Might as well just say "people should be good", and say that's simple law.

There's a sub-area of AI, since about the 1970s, that does try to do that, but it's very much at the research level. Modeling even simple "common sense" things is notoriously hard for computers (commonsense reasoning seems to require a large amount of implicit background information), so it's not clear that easy to unit-test coincides well with a human notion of simplicity and predictability.

That's one reason that, in addition to being an interesting challenge domain for AI researchers, it's interesting to logicians, who aim to come up with logics and decision procedures that can capture what a decision procedure in law looks like (classical first-order logic and theorem-proving don't seem to model it well). The main short-term application is to reasoning-support systems that can suggest potentially winning arguments, point out obvious holes in draft arguments you were going to make, etc., sort of the legal analogue of medical diagnostic systems.

A classic paper from 1977: http://www.cs.rutgers.edu/~mccarty/research/hlr77.pdf

A more recent system aimed at interactive use: http://www.ai.rug.nl/~verheij/publications/pdf/ai2004.pdf

A book, albeit priced at the usual Springer price-point that assumes no non-library human will buy it: http://www.amazon.com/gp/product/3642064329/ref=as_li_ss_tl?...

Classical logic doesn't work in a legal context. You need at least to use fuzzy logic to model the domain.
> Yes, we should have black and white laws, and unit tests for them.

First problem: I don't think that can be done. I'd be a lot more convinced to consider arguments like this accompanied by completed samples in some real area of human endeavor of the "black and white laws" with accompanying "unit tests" (and, anyway, wouldn't we want automated user acceptance tests, not unit tests.)

Thinking about it, it probably can be done.. just not in a free society (which I think is all about doing what you want as long as you don't hurt others in the process). You probably can create black and white laws in a despotic rule. "The Ruler has all right, you have none. He decides." There, drafted an entire legislature with very black and white rules..
Then who decides if you have broken the law? Obviously cops have no right either. Only the ruler can decides? So ruler spent every seconds telling people whether they can talk/walk/eat?
Based on history it would be defined by corruption and the whims of who are awarded stewardship.
The problem with this is, human beings don't blindly interpret and process laws as code. Human beings can honestly differ in their interpretation of a law, and the accepted interpretation can change over time.

Some one, or some body, would have to decide what the 'proper' interpretation of these laws would be, and craft the 'unit tests' such that they correspond to the status quo. Then that someone or some body would have to ensure that anyone who disagrees with that interpretation gets put down. What you're describing seems like a particularly technocratic form of fascism to me.

Not really, as part of making the law - congress needs to go through all possible interpretations and rule out the ones not in the spirit of the law one by one. Then the law is defined by its tests.

Is it okay to collect all XYZ data?

Is it okay to collect anonymous XYZ data?

Is it okay to collect XYZ data and hold it for X days?

Is it okay to store and index but not search a collection of XYZ data?

The law would end up saying something like -

The NSA is permitted to store and index anonymous data for a period of 10 days. Attempts to make anonymous data personal are forbidden. Data may only be accessed with a court issued warrant subject to the following conditions:...

> Is it okay to collect anonymous XYZ data? Anonymity is not binary.

- What lower level of anonymity is acceptable? Is 1 in 30 acceptable?

- What about edge cases where it becomes much lower? Say only one person in a small county has an account to a web service because it is largely targeted at people elsewhere?

- What about academic improvements that keep decreasing anonymity by improving understanding of collected data? What time limit would NSA get to update its systems in case of such improvements? What happens if the speed of academic improvements is larger than the speed of updates in NSA systems? Is the system scrapped right away?

I agree that formal definitions seem lucrative. But these aren't simplified mathematical static models that we are talking about.

Right, those are exactly the questions that need to be asked, discussed before implementation, and then included in the law if it passes.

What meta-data is truly anonymous and what is not? Is the agency permitted to built a tool to de-anonymize data based on academic research, or is the data in some ways protected against these tools?

They may get to the end of this process and in this instance find that such a government tool, even based on anonymous data is uncontainable, and should not be implemented. If you just grant blanket power and rely upon a courts interpretation of your two paragraph scribble to straighten things out, the intent of the law can be completely lost.

Yes. This is my point. =) Only by actually working out all these details can we have just laws, and IMHO, we would discover that most of our laws are not just.

We want law that prevents criminals from breaking into banks and stealing your cash, but what we got was a law able to be used to persecute young people to the point of suicide for accessing an "open" system belonging to an educational establishment.

The laws we have now cannot do what they claim to do without being impossibly broad or impossible to implement. As was was discussed elsewhere today, the joke of a "Do what I mean" button, is that nobody, in fact, knows what they mean, and this goes exponentially so for a congress of 500 or so people.

But the most 'just' laws aren't always the ones least open to interpretation. Also, let's not conflate Aaron Swartz's suicide into an example of the law working as designed and intended, rather than being the result of heavy-handed interpretation intersecting with his own fragile state.

The way I look at it, making laws more and more complex and attempting to codify every possible instance is a bit like adding massive bloat to a software project for the sake of maximum backwards compatibility. Just as more lines of code introduce more bugs and increase the possible attack surface of an application, so more complex laws introduce more opportunities to manipulate and undermine those laws through legalistic means (while giving the people who have to interpret those laws on their face little leeway for context-specific interpretation.)

In Florida, to use an obvious example, the law as intended makes it legal in a certain context to kill an unarmed teenager without any ramifications, whereas firing a gun into the air can get you 40 years in prison. This is what the people of Florida wanted, and this is what their legislators gave them. America's prisons are stuffed with minor drug offenders for whom the sentencing laws were absolutely unambiguous. How complex is the tax code and how many ways are there to dance around it? Most of those holes are there on purpose.

> Right, those are exactly the questions that need to be asked, discussed before implementation, and then included in the law if it passes.

Legislation is not the only source of law.

That said, more structured analysis is no bad thing. But it's not a panacea either. There's an existing analytical mechanism for legislation: depending on where you are, it's called "Parliament" or "Congress".

To participate, you must first be elected to that body. Or work for someone who does.

IANAL but I don't think it's possible to parse laws with that degree of certainty, or to determine an upper bound for "all possible interpretations," as different people can disagree as to what the "spirit" of a law is, or should be, or could be for the forseeable future.

The US Constitution is pretty straightforward, and people are still waging petty wars over individual words to wrest their idea of "intent" from the Founding Fathers. You're suggesting a formal procedure for legislation which might have some merit, but I don't think it would remove politics or human bias from the process.

What if laws are considered whitelists? If it's a whitelist then if not directly stated it's thrown out. This may slow the legislative process, but that's not necessarily a bad thing, it was actually the founders primary goal.

Agreed that it's not a fully baked idea by any means, humans will always attempt to circumvent any system. With that in mind, you may say that rather than designing a better system, we stick to the safe that was first cracked 200 years ago.

With that in mind, you may say that rather than designing a better system, we stick to the safe that was first cracked 200 years ago.

Half the people whose valuables are in that safe find it perfectly adequate and would insist that any attempt to change the locks is just a blatant attempt to grab their money.

Do those 50% believe the system is working as intended and is not being exploited by special interests? I don't think any republican or democrat agrees with that.
congress needs to go through all possible interpretations and rule out the ones not in the spirit of the law one by one

lulz, that will happen when programmers put out code that never has any bugs in it.

I think that's impossible with the current English language, and the fact that human beings disagree about lots of things.
A nice example of the problem with natural language is Treason Act 1351[1] (this is still current law in the UK!), written in Anglo-Norman. This is problematic, as our understanding of the language is incomplete. Notably, in this case, there is no agreed upon meaning of "pvablement" — it means either "provably" or "probably": a rather major difference come a court of law!

[1]: http://www.legislation.gov.uk/aep/Edw3Stat5/25/2

you wouldn't write in English, you'd write it in Lisp.
But then you either need to get people to talk in Lisp or some other logical language, or you need a way to translate it to English. It's the English translation where ambiguities will arise. You've just moved the problem around,
Do you know of any examples of actual legal documents written in Lisp, or some other formal language?
haha, no. It was meant as a quasi-joke. I'd like to see one though.

Certain laws are very cut-and-dry (speeding for instance) and perhaps laws could be proven on a functional basis.

You could even make it axiomatic from the constitution and declaration of independence.

Of course, you'd need to define the axiomatic meaning of things like 'the right of the people to keep and bear arms shall not be infringed' - which is hard to do even with such simple language.

And then after loading the axioms, you'd spend a lifetime going through errors in the existing laws.

Certain laws are very cut-and-dry (speeding for instance)

Ha! No.

* do you want to give an exemption for speeding for, say, ambulances? So how do you define "ambulance"? Do you have to be registered to drive an ambulance? What defines the "duty of an ambulance" (or are they allowed to speed no matter what). What about a van carrying an organ to be donated?

* What if I have my sick child in the car and I'm rushing them to the hospital because it's faster than waiting for an ambulance? Is it right that I can be arrested and convicted for that? I think that would be a perversion of the spirit of any just law.

* What if I'm being chased by a maniac relative who wants to kill me? Can I speed then to drive away from them? Do I have to believe my life is in danger? How do you define that?

* Let's pretend I'm driving along and some other vehicle is about to move into my lane and crash into me because they are stupid and don't see me, and let's pretend that if I speed up a little bit (over the speed limit) and am able to get in front of them and avoid an accident. Should I be convictable for speeding even though I sped to prevent an accident?

Sure, these are all edge cases and there are loads of cases where it is clear cut, but you have to write a law that can handle the edge cases. Without accepting the vagueness of human life, you'll wind up with an unfair conviction that is horrible.

Or, alternatively, you can write the law simply and let people decide for themselves if it's worth breaking.

So, no exemptions for anyone, but then part of the cost of running an ambulance service is paying speeding fines regularly. Given the cost of ambulance services without that, the additional expense is lost in the noise, making it obviously a good choice to speed when useful (for ambulances).

Trying to figure out after the fact whether someone had a good reason to break the law (and therefore shouldn't be penalized) is one of the things that complicates legal systems enormously. Instead, we should write the law clearly and specify the penalties for breaking it directly, and let those who have the best information about the situation, the potential lawbreaker(s), choose whether it is worth breaking the law in a given instance.

That's my point.
No, you'd see more complex laws because law makers would just write around the unit tests rather than address the fundamental issue. Ergo, accessing a university computer would be fine (because that's in the test) but accessing a library computer would not .
> I believe we'd see a lot simpler laws.

Only if you model the domain with fuzzy logic. Otherwise you have a combinatorial explosion of specific definitions.

And guess what? That's already how the law works:

"Reasonable person similarly circumstanced".

"Beyond reasonable doubt".

"Balance of probabilities".

I'd love to see this for a subset of laws. You could start with the law surrounding permits, for example.