Hacker News new | past | comments | ask | show | jobs | submit login

I've been asked to write parser of _my_country_law_ and something that's capable of doing diffs and putting it together (diff+original=>newest version) docs without knowledge in that domain

after seeing sample doc I've estimated it on something like 1 week of work (XD)

month later I've been crying and having like 20-30% done

this shit has been so sensitive (insanely error prone) and debugging was time costly. I think I didn't spent enough time on thinking about its architecture, but on the other hand my experience was pretty small with this stuff

easy & fast to test and reliably

have solid abstraction over original documents

have solid abstraction over operation (e.g Article 5's meaning is changed)

_____________

project died because it was needed "fast" (in that time there was very specific peroid of changes in law) and we weren't getting to the viable version fast enough




I feel like legislation is a field that would benefit a great deal from the progress that software engineering has made in a number of fields.

It's already evolved somewhat into a DSL. With some nudging and technical leadership, I suspect that we could move it over entirely into a format that can be readily parsed, tested, and version control. The tax code is especially well-suited to this, because it's a lot of rules and math formulas.

In fact, I bet most tax software probably does something very similar to this.


Laws are supposed to be systematic invariants, and to specify them requires a comprehensive vocabulary containing the union of all the things people do in a life. This language is necessarily bound to your time and place, and it may not translate well in the future. (I feel like laws that live long enough to outlast the language in which they were defined hasn't actually been solved! Certainly we should have to reword the Constitution at least once every 200 years!)


BTW how do you think we would create a new Constitution today? What would it be made of, how would it be made, and how many copies would be made?


I heard about the startup Legalese [1] a while ago, which does exactly this.

[1]: https://legalese.com/


It would be more valuable to write many fewer, simpler policies, but transparently document the why when it comes to decisions by stakeholders. For example, the only difference between getting something from the government (say, a California Public Records request) and a court is (1) cost and (2) the court almost always has to write a defensible opinion for why something happened some way, but a government agency does not. At the end of the day you wind up with the same possibilities of results.


> the court almost always has to write a defensible opinion for why something happened some way, but a government agency does not.

That's not true. Agencies that do rulemaking have to provide justification for why they're enacting or repealing particular regulations, otherwise those regulations can be struck down as capricious. This is a major problem the Trump administration had: a lot of their attempts to rollback Obama's policies or enact new ones foundered on the ability to provide this justification.


> a lot of their attempts to rollback Obama's policies or enact new ones foundered on the ability to provide this justification

...in the court of law. Someone had to go and sue the administration. When they issued the policies, they simply provided no meaningful justification. You're proving my point.


It's not the court that does the justification, it's the administration that has to. It has to be litigated in the court because, well, no other branch of the government has the power to decide that someone is violating the law.


This sounds easy until you actually get to grips with how parliamentary procedure and law making actually works.

For example last year I was on a SOC (Standing orders committee) for a 3.5 day conference with 600+ delegates.

We had 120 motions submitted working out Consequentials if motion 15 passes motions 16 99 and 120 fall is non trivial.

We also had to do compositeing of 20/21 motions on one topic which where all worded slightly differently and had slightly different effects took 4 of us about 2/3 of a day just for that.

Another example is say the various legal documents for pensions a choice of a different two letter word can lead to years of legal arguments - the difference between CPI and RPI


The current buzzword for this is “rules as code” and many governments are exploring it. You’re right that it is particularly relevant to complicated financial laws like the tax code, and necessarily has been done in a limited way by tax software for many decades now. I am skeptical that this technology can meaningfully assist us in resolving contentious legal questions – it’s more about generating wizards that can help you navigate a 1,000 page tax statute by only showing you what’s relevant to your problem.


This is mostly true, however laws are are already generally written as (legal) diffs, and many agencies issue regulations as diffs as well.

Cornell Law has providing version control releases of the federal laws for some time for free, and Lexis and their competitors have been doing the same for decades for commercially.


IMHO we shouldn't define the problem in terms of reducing legislation into some computer language or schema; indeed the effort should be in describing and linking the terms into a graph with consistency validation rules and shape identities.


Do you plan on open-sourcing it, or do you have any recommendations for similar projects/research? Very excited about the computational law space.


Check out http://austlii.community/wiki/DataLex. In Australia we are fortunate enough to have AustLII publishing virtually all Australian laws and court decisions (at least from this century) for free in a somewhat consistent HTML format. DataLex is the name for the “computational law” research AustLII staff have been doing since the 1980s. It’s interesting, but the real value of AustLII’s work is in getting the courts and legislatures to allow them to collect all the raw data and publish it in a free database with full text search. Just getting to that point is a huge improvement over what’s freely available in the US and the UK.


I don't think I could legally do that


Who was the client?

I ask because my state's legislature has a staff that reviews proposed legislation and then maintains the revised official laws. If I was tasked with doing diffs, I'd first interview them, try to make their jobs easier.


Private Persona


yeah complex tax laws often have interrelated and cocontingent things to compute the final tax on.

Is this deduction before or after your AGI, whats the maximum % of AGI that it can be, does taking the deduction lower your AGI and thus the max percentage of AGI that it can be?


Ex Dee




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: