Language selection


Rules as Code, Part 1 (DDN2-V16)


This video (part 1 of 2) explains the notion of Rules as Code, why it matters, and how it is changing rule-making in Canada.

Duration: 00:04:48
Published: November 27, 2020
Type: Video

Now playing

Rules as Code, Part 1

Transcript | Watch on YouTube


Transcript: Rules as Code, Part 1

Rules as Code
Part 1 of 2
The concept and its benefits

The world is changing. The rapidly increasing speed, scale, and power of technology is expanding how humans and machines interact. Our daily lives are increasingly shaped by digital technologies and services. We expect governments to evolve, adapt their processes, and deliver services in a digital world.

Hi I'm Scott, and I work at the Canada School of Public Service. We have been working with public servants across government on new ideas and approaches for the digital world. One of the areas we are interested in is how to create and implement rules for a digital age.

Today, government writes rules for human use. These rules can be complex, making it difficult for individuals and businesses to understand their obligations. But if rules were also written for machines, those machines could interpret the rules for us. This could make our task of understanding our legal obligations a lot easier.

But for machines to be able to use our rules, we would need to convert them to a language that machines can understand - code.

This concept of converting rules into computer code is known as “Rules as Code”, and governments around the world are starting to explore the concept and consider its applications and possibilities.

Rules as Code has the potential to improve the quality and accessibility of rules, the consistency of their application, and the delivery of services to Canadians. Let me explain in more detail.

1) Title: Rule quality

Machines think logically - that is, in yes or no, and in true or false statements. Turning rules into code could bring clarity and transparency to a rule by converting complicated legal jargon to distinct concepts and a logical sequence. This could make our rules less ambiguous, and simpler to understand and interpret.

Drafting rules in code form could allow us to use computer simulations to test how a rule would be applied in practice. This could help to close gaps between a rule's intent and how it is implemented - ultimately, making a better rule.

2) Title: Rule accessibility

Today, rules are drafted for precision and meaning - not for readability or accessibility - so most of us will find them difficult to understand. If rules were published also for machines, we could build systems and services to make them easier to interpret and apply.

3) Title: More consistent application

Currently, many companies try to make rules easier to use - like this tax filing program. However, each tax year, the company must identify changes to the tax rules and hard code these changes into their software. Not only is there a risk of misinterpretation of the rules, but software updates are costly.

Instead, if the company's systems connected digitally with the official ruleset, they would no longer need to hard-code the rules into the software and risk errors. Rules would be applied more consistently and costs could be reduced.

4) Title: Better service delivery

Encoding rules creates new possibilities for faster, fairer and more transparent services to Canadians. For example, rules could be implemented by machines as soon as they become available. This would allow us to build automated or semi-automated applications that support service delivery and that can deliver a result, explain how the rules were applied to get to the result, and all inputs and evidence considered.

This could help Canadians understand how the rules apply to them. Once machines can process rules, there are so many possibilities for innovation!

We worked with a number of partners to put rules as code into practice and test how we could apply the process to an existing rule. I'll tell you more about what we learned in the next video.

Related links

Date modified: