Turning rules and laws into computer code


Stuart Corner
Contributor

“If I can book an aeroplane flight online, why can’t I find out online whether I’m liable for something?”

That rhetorical question came from Adrian Kelly, cofounder of SmartLegal in a Rules as code: writing laws computers understand webinar organised by the Australian Society for Computers & Law and the Allens Hub for Technology Law.

“You have to recognise that people consume their world digitally,” Mr Kelly said. “Anyone who has a cell phone has an appetite for being able to find out whether they’re liable for something or not.”

We’re still a long way from being able to go online and determine our liability under law. But while many challenges still exist, enormous progress has been made in translating rules and regulations into computer code.

You can watch the entire webinar on YouTube.

CSIRO Data 61’s Software Systems Group leader Dr Guido Governatori said Data61, in a joint venture with PwC, had developed a system that encoded the rules for paying workers.

“We built a system where they can check payroll for compliance. It started as technology transfer, but now it’s a fully commercial system and has had very good success,” Dr Governatori said.

“They are able to track compliance in a fraction of the time, and it improves compliance. We estimated that there are savings of the order of 30 percent of compliance costs.”

Data61 is now working on a system that would codify the requirements on when and where people need to disclose information about previous criminal convictions.

“Over five million of these requests are processed manually per year. Over 90 per cent could be analysed by computer in a very effective way, and in a fraction of time,” Dr Governatori said.

However, so long as the definitive version of any law or regulation is the printed word there will be a huge challenge to ensure that any encoded version not only reflects the definitive version but can be seen to do so.

Former Australian Government digital luminary Pia Andrews – who is now digital and client data workstream lead with Employment and Social Development Canada – says the problems is not new.

“There’s nothing new in the concept of rules being codified, because we’ve always had to do it. What’s new here is what’s possible when you a take a digital first approach to legislation, to regulation and effectively reimagine what rules look like in the 21st century,” Ms Andrews said.

“[A problem] we have is that how rules are encoded in business systems and computers, is very rarely visible, or traceable back to law, or, held to account in terms of its accuracy.”

Ideally human and machine rules should be developed simultaneously, Ms Andrews said. “Right now, those things are mashed up and it’s almost impossible to figure out what is true in business systems.”

Simultaneous development and assurance of conformance of code to rules is difficult to achieve when these are written in different languages.

“You have computer programmers using OpenFisca [a tool for writing rules as code] and C+ to obfuscate and bamboozle the everyday governance person, who is not an IT person” Adrian Kelly said.

“You need to have confidence that there is what we call isomorphism between the source material and the computer output. One way to do that is with an intermediate language that you can transparently trace back to the source code and forward to the source code.”

Mr Kelly claims to have developed just such a platform. “We call it Log Law. And we base it on international standards. We’re hoping one day that Log Law will become some kind of international standard in its own right.

“It’s a structured language that captures, in a computer language-agnostic way, the logic and meaning of a statue, We’ve had university graduates with no computer experience whatsoever learn it in two hours.”

With any translation there is always the chance something will be lost in translation. Dr Governatori envisages a different solution: a language for writing rules and legislation that can be understood by both humans and machines.

“What we propose is to have some language that allows us to represent legislation in a language which is neutral, that’s closer to the language in which legislation are written, and essentially at the same time, understandable by humans, and processable by machine – and to have that as much as possible to standard.”

He says some standards have been developed for representation of legal knowledge: Akoma Ntoso, which is about the representation of the structure of a legal document, and LegalRuleML, both standards proposed by OASIS.

“They are a good starting point. They are not perfect, there are some problems, but we have to have standards so we can have interoperability,” Dr Governatori said.

“And it’s very important that once you have our presentation and encoding of the legislation, it should be possible to use different systems. If we don’t adopt a common standard, data interoperability will be very, very, very hard.”

Do you know more? Contact James Riley via Email.

2 Comments
  1. Marina 8 months ago
    Reply

    InnovationAus is doing a fantastic job in spotlighting critical issues in this space, including potentially disruptive effect of technology on the drafting, interpretation, enforcement, practice (and more) of law. I agree that RaC has the potential to significantly change our understanding of what law is and how it will operate in the future. The Australian Society for Computers and Law AUSCL and the Allens Hub were fortunate to have such a fantastic panel to explore what is Rules as Code and the challenges to its adoption. If you would like to join the Community of Practice you may do so via: https://community.codeforaustralia.org/ and to receive invitations to our future Rules as Code events (including Masterclasses) subscribe here: https://ausclsubscribe.eventbrite.com.au

  2. TJ Harrop 8 months ago
    Reply

    It’s great to see Rules as Code being explored more publicly.

    I couldn’t agree more than isomorphism, and making rulesets usable, is absolutely what will make RaC work within policy-making teams. It’s for exactly that reason the rules absolutely shouldn’t be obfuscated from regular people. That’s a matter of comprehension, opening the rules further than those who understand legal prose of programming languages, and also a matter of accessibility. Without open sourcing rules, Rules as Code becomes little more than a business system – we already have that.

    In openfisca’s defence, the programming knowledge required is not a prohibitive barrier to entry. There have been UXers and Policy makers coding in openfisca for years now, but it does require somebody to be comfortable looking at code syntax without getting spooked, and that’s not always common.

    One thing often missing from RaC publicity is the citizen, or end-user, benefit. From working on Rules as Code with 3 jurisdictions I’ve seen that focussing on the end-result, the citizen impact, really helps make the purpose more understandable. For as long as we talk about Rules as Code as an IT systems thing, or even an IT systems and drafting process thing, we’re not realising the core value – joining these things up and focusing them on a citizen need.

Leave a Comment

Your email address will not be published.

Related stories