Catala – Law to Code
Posted by Grognak 5 days ago
Comments
Comment by alphazard 5 days ago
There are judges and politicians in the US that advocate for various "interpretations" of laws including parts of the constitution, which are different from what the law literally says. In fact they refer to the literal meaning as the "literal interpretation", implying it is one of many valid interpretations, and casting doubt on the idea of language having a precise meaning. The crowd here knows that it is totally possible and often invaluable to work in languages with precise meaning. Anyways, in practice this means: all the steps happened for the law to get passed by the legislature including arguing about the exact text, and instead of enforcing it as written, the judiciary enforces some slightly different but similar law.
A technology like this necessarily concentrates power in the legislature, and takes it away from the judicial system. It concentrates legal power at write time and removes it from run/read time.
Comment by csb6 5 days ago
I agree government/justice by algorithm would be very dangerous, but Catala does not seem to be that.
Comment by btown 5 days ago
This doesn’t mean that this isn’t a useful tool as an aid for interpretability. And perhaps we can reach a point where ambiguity in case law can “propagate” through a graph of nodes to give a range of answers to any question about a regulation - perhaps with the aid of LLMs. But until we have such a system, it can be dangerous to draw conclusions from systems like this one.
(Not a lawyer, this is not legal advice.)
Comment by undershirt 5 days ago
We have to remember that the letter and spirit of the law can grow apart over time, and loopholes are often gamed before that naturally happens anyway. So obviously we still need judges to keep the "spiritual" aspect of intent alive, so that evil isn't laundered through technicality.
"Literal" should really be a concrete thing, but it does feel strangely connected to a problem that has existed since Sola Scriptura, up to Gödel's theorem. I think about this everytime software and law collide. That article on "what color are your bits"[1] also comes to mind.
Comment by TZubiri 5 days ago
Comment by maratc 3 days ago
Comment by alphazard 3 days ago
The famous example you give illustrates why a system without precise meaning cannot work. It can seem like it works when lots of people act in good faith, but it quickly breaks down with even a few actors play the actual game instead of some "spirit of the game". In 1973, judges ruled one way, playing the actual game to accomplish a goal, and then everyone acted surprised in 2022, when the same tactics (playing the actual game not the spirit) reverted the decision.
I'm going to take a guess, and assume that you were in favor of the 1973 understanding and not the 2022 understanding. It would have been nice for that to have been captured precisely in some kind of specification, instead of enacted with a volatile read-time mechanism.
Comment by maratc 3 days ago
With that, I still want to point out that even if we both agree that "changing the text is the correct way to handle," it's not a possibility that is even remotely practical or achievable; any meaningful progress that the US have had in the last 100 years or so was achieved solely by the means of "reinventing" the meaning of already written (and unchangeable) words. That seems to be the exact thing you seem to be in opposition of.
Comment by knollimar 3 days ago
Comment by jaco6 5 days ago
Comment by 6gvONxR4sf7o 5 days ago
Some differing interpretations of the law distinguish between the lawmakers' intention vs the literal meaning (and keep in mind that language itself changes a lot in just a few centuries. The hard problem is that, in PL terms, the law is written in syntax without agreed upon semantics. So a decent step could be just using some agreed upon semantics, like we do in code! Then at least "interpreting" it would be unambiguous.
Maybe a decent analogy would be gcc vs clang might produce different programs for certain undefined behavior, and different combinations of pieces might lead to different behavior too (like race conditions), and somebody (the plaintiff/user) is asking you (the judge/compiler) to decide what's going to happen in this next loop/program/whatever.
Or maybe a decent analogy would be getting a ticket that the API is erroring in some rare user's case and having to look into the code and stacktrace to realize it's some weird unanticipated interaction between two different pieces of legacy code (150 year old law) that now interact due to a recent merge (a new law from last year), and now it's crashing, so we have to figure out how to interpret/compile/resolve this user's case.
If law was usable like code, we'd never have any of those issues, just like we never have those issues with actual literal programs. And when we do, it's just because we're using the wrong language/aren't encoding enough things in the types and semantics/shouldn't have used this niche compiler so now let's get a new interpretation from another Supreme Compiler/etc. Life would be easier \s
So it's maybe more optimistic than you, in that the run/read time power (judicial) doesn't get diminished, but more pessimistic in that I believe it because I believe that changing the language from english law jargon to some formal language doesn't actually eliminate the issues it might be intended to eliminate.
Comment by abhashanand1501 5 days ago
If law code is a repository: 1. Each trial should be encoded into a law. 2. If the trial is already covered sufficiently in the codebase, and both parties agree to it result. Then case is solved. 3. If not, the new judgement leads to a "pull request" into the codebase.
Comment by akabalanza 5 days ago
Jokes aside, I'm trying to imagine what a pull request workflow would be for law making.
For example, there might be a test that checks that a law has adequate budget before applying it; or to get an error if it conflicts with another law.
Also (Italian here), I would be very happy to do "git blame" and discover who actually introduced a modification.
Comment by tinodb 3 days ago
Comment by wcp0112 5 days ago
Comment by dusted 3 days ago
In the end it reminds me of a quote by Edmund Burke: "Bad men obey the law only out of fear of punishment; good men obey it out of conscience - and thus good men are often restrained by it, while bad men find ways around it."
Comment by TomasBM 2 days ago
Might be a design idea for future lawmakers.
Comment by dusted 2 days ago
Comment by TomasBM 1 day ago
Then again, that might be exactly how (some) lawmakers think, but I'm not aware of it.
Comment by sublinear 5 days ago
Can anyone explain why it's believed this "would make no sense"?
Comment by solidsnack9000 5 days ago
"Murder is the unlawful killing of a human being with malice aforethought."
You might say, well, "unlawful" and "malice" are fuzzy concepts; but we can take them to be facts that we input into the model. I guess we could write something like this in Catala:
scope Murder :
definition in_the_1st_degree
under condition is_malice_aforethought and is_unlawful consequence
equals
true
In the calculation of social benefits and taxes, the facts input to the model are generally things like prices, depreciations, costs, areas of offices, percentages and so on, input numerically and sworn to be true. These numbers are then used to calculate an amount due (or in arrears). Performing the calculation in a way that is verified to conform to the law is a big part of the work.However, in other areas of law, determining the facts is actually where the real work is -- was there malice aforethought? A formalized legal machine could process these facts but it's not a big help. The models would just be a huge list of assumptions that have to be input and a minimal calculation that produces `true` or one of the alternatives of an enum.
Comment by embedding-shape 5 days ago
I think the idea is that you can't really cover 100% of real-life cases in "code", either legal or software, so the areas you'll leave this out of would be those "not-entirely-strict" parts.
Comment by d0mine 5 days ago
Comment by 6gvONxR4sf7o 5 days ago
Comment by recursivecaveat 5 days ago
> If it is found that the defendant did the killing or wounding, but that it was not intentional or negligent, the court shall dismiss the proceeding. Otherwise, if it is found that the defendant did the killing or wounding intentionally, by an act of gross negligence, or while under the influence of alcohol, the court shall issue an order permanently prohibiting the defendant from taking any bird or mammal.
Comment by ttoinou 5 days ago
Comment by dghlsakjg 5 days ago
Write a function for that, keeping in mind that “this situation” needs to be modeled with potentially infinite variables. Then try to define a “reasonable person”.
Hell, the reason most trials happen is because there is huge grey area, and the written laws are not obvious as to what the outcome should be.
Comment by pnathan 5 days ago
Criminal law is often fundamentally subjective, incorporating questions of intent and remorse.
Comment by kelvindegrees 5 days ago
Comment by nathan_compton 5 days ago
It is therefore quite hard to create a formal system to refer to objects in the world in a way which induces no contradictions with intuition. This is why we have courts, among other functions of government.
Comment by samrus 5 days ago
Comment by bigbadfeline 5 days ago
Philosophy is not knowledge, it's pure speculation.
> law is philosophy, so cant be modeled by math
Law is not philosophy unless it was written based on sloppy speculations. In other words, what law is, depends on how it was written, it can certainly be modeled by logic and math methods can be developed for it too.
It's nothing new, lawyers have to master logic as part of their training.
Comment by shakna 5 days ago
Comment by bigbadfeline 5 days ago
Besides, only a lesser part of law is about intent, the major part is about punishing and avoiding harm, finding the true facts and applying the written law to them.
Down-voting can't change the truth, we've been led by the nose for far too long.
Comment by shakna 5 days ago
To punish, you must establish intent.
Intent has been the core underiding feature of the law since the Magna Carta. To ignore or trivialise it is nothing short of advocating for the return of kings.
Comment by bigbadfeline 5 days ago
I've already explained that intent is another word for interest - material or political, it may not be as trivial as potato chips but it's far simpler than rocket science.
> To ignore or trivialise it is nothing short of advocating for the return of kings.
Another purely speculative assertion with zero meaning or practical value.
There's no logical path from trivializing your occultist and unknowable notion if intent to the return of kings. First, you've got to start with a proof that at present there aren't any kings... but philosophy's got no proofs.
Speaking of kinks (sic), wasn't Epstein one of them? Or at least under their protection... until he wasn't, as usual.
Comment by shakna 5 days ago
Material interest and intent only accidentally collide. Intent cannot be defined in that manner.
Almost every person beneath a capitalist system has a material interest in wealth. That does not translate to intent to seize it.
If intent does not matter, only interest, then there is no war crime in bombing boats. There is no arguing with the government's interpretations of law, as they will have a vested interest as to how it plays out.
The "test of intent" is not a part of law to be so offhandly thrown aside.
Comment by bigbadfeline 4 days ago
That's a different topic, legislative intent is different from criminal intent, the latter does not change the fact of wrongdoing, only the severity of it. Bombing sailors in a wreckage situation is either a war crime or gross military incompetence which may lead to court-martial. This together with interest-as-motive are decided based on facts and logic, not philosophy - these arguments support my view, not yours.
Comment by shakna 4 days ago
Philosophy is the science of understanding logic. Founded on Aristotles, Plato, and others. Rational process is derived directly from philosophy.
An appeal to facts and logic, is and always has been, an appeal to philosophy.
Comment by ajax33 5 days ago
1. (https://news.ycombinator.com/item?id=27059899) - May 2021 (126 comments) 2. (https://news.ycombinator.com/item?id=28633122) - Sept 2021 (40 comments) 3. (https://news.ycombinator.com/item?id=37546874) - Sept 2023 (277 comments)
Comment by TZubiri 5 days ago
scope QualifiedEmployeeDiscount :
definition qualified_employee_discount
under condition is_property consequence
equals
if employee_discount >=
customer_price \* gross_profit_percentage
then customer_price \* gross_profit_percentage
else employee_discount
It feels like the best of both worlds, a syntax that is new and strange to use while basically being the same old abc If Else programming language.Not sure I'm seeing any law-specific features either. Maybe if there were some tokens like 'jurisdiction' or 'jurisprudence', but it seems like yet another programming language.
Comment by EdwardDiego 5 days ago
Comment by kimfc 5 days ago
Comment by Garlef 5 days ago
Is there any money to be made with this yet? (Jobs, Contracting, Projects, etc)
If not: What's the plan to get this to be used?
Comment by postepowanieadm 4 days ago
Comment by ascold 5 days ago
Comment by alfonsovng 4 days ago
I agree that maybe do a quick Google search would avoid this strange appropiation.
Comment by side_up_down 5 days ago
Comment by Y_Y 5 days ago
Comment by 6gvONxR4sf7o 5 days ago
Comment by Y_Y 5 days ago
All that to say, you can just do your best to understand the law in the the context in which it was written, and replace the text every now and again.
Comment by vjay1510 5 days ago
Comment by mkl 5 days ago
Comment by embedding-shape 5 days ago
Comment by tough 5 days ago
from their repo: https://github.com/CatalaLang/catala
> The language is named after Pierre Catala, a professor of law who pionneered the French legaltech by creating a computer database of law cases, Juris-Data.
Comment by kiliancs 4 days ago
Comment by darkwater 5 days ago
Comment by dghlsakjg 5 days ago
Comment by mkl 5 days ago
Comment by dghlsakjg 4 days ago
So we can just say that catala != català
Comment by mpeg 4 days ago
In this case, catala and català mean the same thing, one is simply misspelled as all words with the strong syllable being last will always have an accent mark if they end in a vowel.
Comment by dghlsakjg 3 days ago
But your accent rule also isn't followed by the language you claim uses it as a hard and fast rule: in the case of the single syllable Catalan word ma (my, femenine) and mà (hand). Please square that with your declaration that " all words with the strong syllable being last will always have an accent mark if they end in a vowel." Seemingly ma is breaking your rules, as well as your assertion that missing the accent is only a spelling error. In this, and many other cases, the accent completely changes the meaning of the word which also contradicts your assertion I highlighted in paragraph 1. Maybe "as a rule" isn't the correct phrase given the multitude of words that can change meaning with an accent mark.
The broader thing you missed is that Catala is the last name of a person working on the project, and is not missing an accent. That is how the person's name is spelled. Even in Catalan. Català is a Catalan word refering to a different thing. In this case the accent is incredibly important since it helps us differentiate between a man's name and a language.
In both the figurative and spelling sense we must therefore conclude that, in reality:
Catala != Català
Comment by mpeg 2 days ago
mà / ma does not break the general rule because the word does have an accent mark, it just also falls under the diacritic special rule.
On your point about the author’s last name, it’s fair, but also you’re ignoring that the last name comes from the same word and is thus a spelling variation from French/Occitan, further proving your assertion of Catala != Català as wrong.
Comment by dghlsakjg 15 hours ago
Please refrain from making negative assumptions about my language skills and motives. I am not a native speaker of the language, but I do read and understand it fine. This is not the place for passive or backhanded personal attacks.
> I have already explained why your comment is incorrect, have nothing else to say to you on that subject...
Since you made it personal, and then went on to say quite a bit on that subject I will provide my comments:
Thank you for acknowledging the validity of my points. I hear your argument, but it doesn't invalidate mine. Either an accent mark has no bearing on the meaning of a word or it does. I have demonstrated that it is absolutely and undeniably the case that an accent mark can change the meaning of a word in Catalan.
My original assertion is, verbatim: "...the accent can completely change the meaning of a word". You aren't arguing that ma and mà are the same word, despite your assertion that "the presence or lack of accent does not as a rule change the meaning of a word".
I don't address formal grammatical rules, and I am not arguing against your interpretation, it is correct AFAICT. I understand that there are rules for placing accent marks, which is why I asked you to explain the full rule when I was able to easily contradict the grammar rule. That doesn't contradict my argument.
The argument is simply that the placement of an accent changes the meaning of some words in Catalan. There was a side argument that if the last syllable is stressed it must have an accent on the vowel, which you asserted was true "as a rule". That was not true, as evidenced by you having to explain when it doesn't work "as a rule". It can be the case that accent marks have rules for when they are written, and also be the case that different words can have the same letters and differ only in the accent. Both of our arguments are correct.
In this exact case that is what is happening. Catala is a niche programming language named after a french man. Català is a language. The presence of the accent is distinguishing meanings between Catala and Català. I can write the following: "Parlo català, però no se res sobre el llenguage Catala", and the presence or absence of accents will mean the difference between that sentence being gibberish and that sentence meaning something. Likewise, Ma, si, dona, que, etc. can all have an accent added to them to give them a completely different meaning in Catalan. It is unequivocally true, and I don't know why you would assert otherwise.
Thanks for a great discussion.
Comment by vlql 5 days ago