by james_in_the_uk · 4y ago · 0 comments
from law_of_england_and_wales import persons, contract, boilerplate, jurisdiction
define party1 = persons(type:ltd, with_registration_no: 12345)
define party2 = persons(type:natural, with_name:"Chris", with_address: "Acacia Avenue")
define term = 1 year
try:
while date < term
{
if party1.dosomethings
then party2.pay(agreed_price) && party2.dosomethings
}
catch breach:
party_at_fault=breach.causing_party()
party_not_at_fault=(if party_at_fault == party1 ? party1 : party2)
party_at_fault.pay(if damages < limitationofliability ? damages : limitationofliability)
if party_not_at_fault.chooses(terminate())
juridiction.set_jurisdiction(exclusive_mode)
boilerplate.apply
I could go all evening at expanding this. Anyone fancy adding obligations, termination, confi etc.?Source: I am a lawyer and a coder.
There are probably hundreds of obscure unintended consequences of laws not intended to have the effects they do in practice.
Figure out contract law and parse website TOS and EULAs for violations and you could probably make some money.
The biggest benefit of such a system, though, would be for actual legislators, so they could run simulations of proposals to get a sense of consequences in practice. Simulation and summarization could be very powerful.
Question: is there a bug for the assignment of party_not_at_fault? Would you want party2 to be selected if the condition is true?
Other languages I've used have the first part be the true branch, and the other the false branch.