5 ms·
Catala – Law to Code
- side_up_down 10mo agoHow does this incorporate case law?
- Y_Y 10mo agoThat's not so important in Napoleonic/Civil jurisdictions like France. Judges can consider prior rulings, but the law as-written is the main thing.
- 6gvONxR4sf7o 10mo agoHow's that account for language drift over centuries?
- Y_Y 10mo agoNapoleon's only been gone for about two hundred years, whereas Common Law has some real classics. For example https://en.wikipedia.org/wiki/Statute_of_Merton https://en.wikipedia.org/wiki/Statute_of_Merton was a set of laws promulgated in 1235, some of which remained in force (at least nominally) until the 1980s. I don't know much about Canon Law, but that surely goes back even further. 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.
- mkl 10mo ago[flagged]
- embedding-shape 10mo agoNot even unrelated, Catala (the law-language) seems to be a French project, supported by institutions in France, and Catalan seems to have a intertwined history with France: https://en.wikipedia.org/wiki/Catalan_language#France https://en.wikipedia.org/wiki/Catalan_language#France
- tough 10mo agofunnily enough, the relation comes from a french jurist's last name from their repo: https://github.com/CatalaLang/catala 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.
- dghlsakjg 10mo agoCatala != Catalan
- vlql 10mo agoWell, not in Catalan… (It is "català")
- mkl 10mo agoTry clicking my "Catala" link and looking at the first sentence. The Catalan word for Catalan is català.
- dghlsakjg 10mo agoGreat. You would know that the accent can completely change the meaning of a word in that language as such an expert. So we can just say that catala != català
- mpeg 10mo agoThat’s not correct, the accent is simply there to know how to pronounce the word, and while in some specific cases (diacritic accent) it is there to avoid confusion in words that are pronounced the same with different meaning, the presence or lack of accent does not as a rule change the meaning of a word. 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.
- deleted 10mo ago[deleted]
- dghlsakjg 10mo agoYour first paragraph insists that "the presence or lack of accent does not as a rule change the meaning of a word." While your second insists that "[the same word without an accent] is simply misspelled as all words with the strong syllable being last will always have an accent mark if they end in a vowel." 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à
- kimfc 10mo agoHuh I just finished a book by Jaron Lanier that described a hypothetical system literally just like this. Always fun to get a coincidence like this
- sublinear 10mo ago> The aim is not to formalise or put into code all the law, because that would make no sense, but we are interested in the law that is already executed automatically, such as the calculation of social benefits, tax or unemployment. Can anyone explain why it's believed this "would make no sense"?
- kelvindegrees 10mo agoI assume it would fail to compile, or error out, because of myriad conflicts throughout the body of laws.
- embedding-shape 10mo agoLaw isn't written to cover 100% of real life scenarios and potential cases, it's written with deliberate parts of ambiguity, that will ultimately be up to courts to set the precedents for, in various situations and context. 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.
- d0mine 10mo agoThe same can be said about driving but self-driving cars exist.
- 6gvONxR4sf7o 10mo agoSo is the "bitter lesson" that fuzzy overlords will be practically preferable to hand coded legislation?
- nathan_compton 10mo agoI think the primary reason is that laws are about human convention, not real objects which one can clearly and deliberately define. Like at the most basic level nothing exists at all except for quantum fields or something like that. Everything else we talk about on a regular basis, people, dogs, streets, businesses, etc, is defined by convention to a greater or lesser degree. 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.
- ajax33 10mo agoPast discussions: 1. (https://news.ycombinator.com/item?id=27059899 https://news.ycombinator.com/item?id=27059899) - May 2021 (126 comments) 2. (https://news.ycombinator.com/item?id=28633122 https://news.ycombinator.com/item?id=28633122) - Sept 2021 (40 comments) 3. (https://news.ycombinator.com/item?id=37546874 https://news.ycombinator.com/item?id=37546874) - Sept 2023 (277 comments)
- abhashanand1501 10mo agoWe really need this in India. There are 53 million cases which are pending in courts, with over 180k cases open for more than 30 years (see https://en.wikipedia.org/wiki/Pendency_of_court_cases_in_India https://en.wikipedia.org/wiki/Pendency_of_court_cases_in_Ind...). It is estimated that more than 300 years will be taken to dispose of all cases. 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.
- wcp0112 10mo agoCatala is a fantastic project and a real attempt to bring computer science and law together. Which is not easy! That said, for practical projects in legaltech a modern pure Prolog system has a lot of useful properties. A project that attempts to use Scryer Prolog for this is VATmiral.
- alphazard 10mo agoObviously it would be great if this caught on, but it's not even widely understood/agreed on that read-time precision is a desirable quality in a legal system. This is something almost everyone here takes for granted; we want the interpreter or machine to give the same result for the same input. We want that property so we can know the run-time behavior during development. 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.
- btown 10mo agoIt’s also the case that the massive set of constantly evolving case law is akin to the most convoluted and buggy “libc” ever implemented, running on a system where random bit flips occur frequently. Any lawyer who says they know how to definitively encode an assumption is inherently making a probabilistic statement colored by their own experience and definitionally limited exposure to case law - it may be near perfect, but it exists in an imperfect runtime environment. 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.)
- 6gvONxR4sf7o 10mo agoI have a potentially more optimistic (and simultaneously more pessimistic!) view to offer. 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.
- akabalanza 10mo agoCan't wait for lawmakers to get a red CI before merging ;) 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.
- tinodb 10mo agoYes, this would make us programmers so happy wouldn’t it :)
- EdwardDiego 10mo agoI suspect this works better outside of common law legislation.
- TZubiri 10mo agoscope 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.
- ascold 10mo agoI wonder what people who speak the actual Catala have to say about this semantic appropriation. It would be very easy for creators just to google it first.
- alfonsovng 10mo agoYeah, I speak Catalan, and we call the language "català" in Catalan, I mean, I would say "Jo parlo català" to say "I speak Catalan". I agree that maybe do a quick Google search would avoid this strange appropiation.
- Garlef 10mo agoSerious question: 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?
- postepowanieadm 10mo agoSure - just add an AI and money will flow.
- vjay1510 10mo agoReminds me of smart contracts
- dusted 10mo agoI've thought a lot about law-as-code, but my conclusion is always that bad actors will be given an advantage by being able to brute-force the code until they find a way to get away with whatever obviously-immoral-harmful stuff they want (imagine giga-corps spending a few millions on hardware to brute-force tax law - ROI probably even better than tunneling through mountains to grab stonks first..). 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."
- TomasBM 10mo agoRight, but if laws were developed in regulatory sandboxes, you'd also have the opportunity to red-team them. Might be a design idea for future lawmakers.
- dusted 10mo agoI'm wondering if it might be impossible to write a law that both prevents the sprit of what we want it to prevent, while also not preventing the spirit of what we don't want to prevent. :)
- TomasBM 10mo agoIt probably is impossible, but you could cover a lot of cases with more deliberate design. For the rest, you can leave it up to the judges to decide. Then again, that might be exactly how (some) lawmakers think, but I'm not aware of it.