, 21 tweets, 56 min read Read on Twitter
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca no … the tests come out of our Haskell rewrite, but the code that passes the tests is the latest OpenFisca Python version, so this is as close to ams-length as two implementations can get. These tests do find some failure cases for the 2018 numbers, so I hope that's helpful…
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca the Haskell source is available in our fork. the commit at github.com/legalese/openf… shows:

1 where the tests came from

2 compilation back to the legislative english ("isomorphism")

3 and to saner natural language (thanks @mattwadd)

4 concrete goal-solving, explained in detail
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca here's the source L4 AST that underlies all of those representations. The language can, of course, be remixed to support other legislative arithmetic; in a future iteration we might just parse all the OpenFisca and translate into L4.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca For the 1000+ folks following this thread, let me explain why this is important. This is the original legislation, on the books in New Zealand. This is the literal text of the law:
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca The green-and-blue bit of computer code two tweets above is the abstract syntax tree, the rules-as-code representation of that law, in our language, called L4. That representation is Platonic. It is protean. It is primal. It can turn into English:
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca it can work through a complete real-world case, with numbers plugged in to the variables, and *explain* how it arrived at the answer; this is sufficient to back a user-facing web or mobile app serving actual citizens. This can turn into Javascript.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca It can turn into charts and, with a bit more coding, graphs, that provide a more intuitive visualization for what the legislation does across an entire population earning different amounts and paying different amounts and so on. Some call this "scenario simulation".
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca It can, of course, turn into an arithmetic expression using the old-fashioned + - * / operators, with a little bit of inline annotation meant to be helpful.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca The same software is able to produce text that looks more like that simplified, de-obfuscated version. And with a different argument on the same command line, we could produce UK English, US English, French, German, Chinese, Bahasa Indonesia, all flowers from the same trunk.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca We are still in the early days of computational law. Isomorphism between code and English is one of the Holy Grails of the vision, because that allows legal drafters to write code which compiles to English that ends up official law – but also to many other useful output formats.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca What are some of the other mountains to be climbed? Formal verification is another big one: the software can perform static analysis to detect bugs in laws or contracts: if clauses contradict each other, or if a set of specified cases is, inadvertently, incomplete.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca Here's an error message from when I went and broke the program deliberately:

aotearoa-exe: src/Lib.hs:(181,1)-(192,47): Non-exhaustive patterns in function deobfuscate

Imagine a contract or legislative IDE giving you a similar warning: you left a major scenario unaddressed!
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca So far I've blurted out a great deal of techno-enthusiasm. But what does this mean for society, for users, for customers, for citizens?

Once there exists source code for laws and contracts, there will be a proper Github for legal. Not just PDFs and .docx – those are warez.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca Once you can download the source code of legislation and run it, you can see how laws – current and proposed – affect you, your neighbours, your constituents, your society. You can write unit tests. How might a change in the law help or hurt certain segments of the population?
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca In fact, a smart contract could automatically adjust its behaviour according to the constraints imposed by relevant legislation and regulations. That's a key building block in the @mattereum vision for an Internet of Agreements, the @xalgorithms vision for an Internet of Rules.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca @mattereum @Xalgorithms There's a whole family of apps in the category of "access to justice" who offer an alternative to the legal priesthood. Imagine not having to pick up the phone to talk to your $500/hr lawyer just to ask "hey, would it be legal to do this or that? How do I achieve X or Y goal?"
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca @mattereum @Xalgorithms Today, spreadsheets allow us to "play with the numbers"; they augment our natural ability to do quantitative reasoning. Tomorrow, the legal equivalent of the spreadsheet will allow us to play with legal and business scenarios: to do automated qualitative reasoning.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca @mattereum @Xalgorithms Ask a lawyer any question; the answer is "it depends." When they give you a written opinion, it comes with page after page of assumptions. But you can't open up the document in Microsoft Word and tweak the assumptions to see how the opinion changes. Word is, crucially, not Excel.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca @mattereum @Xalgorithms Computational law promises to allow end-users like you and me – not just lawyers in law firms – to open up the source code and tweak the assumptions and see what happens to outcomes they care about. It's empowering. It'll be the One Weird Trick Lawyers Don't Want You To Know.
@BR3NDA @verbman @mattwadd @jamesondempsey @piawaugh @danielselman @craigaatkinson @RoundTableLaw @PolicyLabAU @digital_nsw @OpenFisca @mattereum @Xalgorithms It'll take years to realize the vision. The open-source, open-standard philosophy that is necessary to open law in an open society means we have to, as @timoreilly would say, create a whole lot more value than we can capture. Because the alternative is: propublica.org/article/congre…
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Meng Weng Wong
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!