Comment by eternalban
5 years ago
This motivated a visit to wiki to look up Code of Ur-Nammu. Some gems (yes, /s) in there:
If a man accused the wife of a man of adultery, and the river ordeal proved her innocent, then the man who had accused her must pay one-third of a mina of silver.
So, here is justice at work. If she drowns, she was guilty. If she survives, someone gets 1/3 of a Mina. Ur-Nammu is vague here as to who gets the money. Likely the husband.
How would we code this in Catala? I'll start it, someone else can finish it /g
declaration structure Person:
data id content integer
declaration structure Period:
data start content date
data end content date
declaration structure MarriedCouple:
data marriage_date content date
data husband content Person
data wife content Person
declaration structure AccusationOfAdultery:
data couple1 content MarriedCouple
data accuser content Person
data adultery_date content Period
declaration structure River
data id content integer
declaration structure OrdealByWater:
data subject content Person
data river1 content River
data ordeal_date content Period
declaration scope UrNammuLaw14:
context requirements_met condition
context married_met condition
context accused_while_married_met condition
context tested_by_water_ordeal_met condition
...
https://en.wikipedia.org/wiki/Code_of_Ur-Nammu#Surviving_law...
Some issues I think I can see:
1. The above law makes it clear that it is only a man who can accuse the wife of another man of adultery. Your code seems to permit other genders as accusers.
2. Similarly it seems only the wife needed to face the river ordeal. (i.e. every person subject to the river ordeal needs to have a husband) Your code seems to allow the husband to subjected to the river ordeal.
Sorry for nitpicking... it was not to attack your attempt at the code, but the entire idea of formalizing the law in this manner might be very tedious, and less precise in practice than natural language.
np, it's good on all points. So we need gender defined. And yes, it's tedious. Which is why IANAL :)
[but p.s.] reviewing the laws in wiki, the only instance of a 'female voice' is when a slave girl puts down her mistress (and gets the Sumerian equivalent of soap in mouth). So, putting my Sumerian lawyer hat on, 'context' here implicitly affords 'legal voice' only to men. Women were mute as far as the law was concerned. So a Sumerian AI judge using Catala would have no problem with my code :)
Okay, but isn't that a good thing?
Because in the normal case, everything will already be there and only the last part must be written. And then, if someone changes the definition of a "River" then you will immediately see all the laws that are impacted and how they are impacted. Sounds good to me.
And that's why we should also write tests, to make sure the intention of the law works at all times.
I don't think it is either or. Tests are certainly helpful, but they are not perfect and they do not replace a good language/compiler.