Jason Morris
  • About Jason
  • Projects
  • Rules as Code Diary

Rules as Code Diary

Research, Learn, Code, Share, Repeat.

October 2, 2020

Drooling over Rules as Code

Video of Legislative Drafting Conference Presentation I did an introduction to Rules as Code and demonstration of Blawx for the Canadian Institute for the Administration of Justice’s 2020 Legislative Drafters Conference. As promised, the video is now available on YouTube. If you hae 20 minutes, check it out at https://youtu.be/bzBouePm5Js, or watch it here: Learning Drools I’ve been spending a lot of time over the last couple of weeks trying to get my fingers dirty with Drools, which is an open source BRMS tool for Java.
September 22, 2020

Fighting the Naive Analogy

Electronic Files and the Naive Analogy When I started running a virtual law firm, I went to a lot of trouble to make sure that all of the pieces of information about one of my clients’ matters were all in the same place. Emails were converted to PDF, and stored in some single source of truth location, like an electronic version of a case file. That was a giant waste of time.
September 15, 2020

Blawx Runner Up at ATLA, and Visual Interfaces Rock

Blawx Named Runner Up at ATLA Much to my surprise, Blawx, the open source web based tool for Rules as Code that I have been working on for almost two years, was named a finalist for the Startup Category of the inaugural American Legal Technology Awards. To my even greater surprise, yesterday Blawx was named as the runner up in that category. Congratulations to the winner LegalMation. And thanks again to the judges involved.
September 9, 2020

Dirty Air

I’m a NASCAR fan. A lot of people look at NASCAR races and wonder why in the world anyone would want to watch it, except for crashes. It just looks like a lot of “go fast, turn left.” The people in front are the people with the fastest cars. What more could there be to it? Well, a few things. Air In normal experience, you drive on a road.
September 4, 2020

Encoding “For Greater Clarity” Provisions

Today has been a very interesting day in Alberta. News broke that the rules for dealing with Covid-19 had changed last Saturday, just before the start of school this week. The new order reads, in part, as follows: “… an operator of a school does not need to ensure that students, staff members, and visitors are able to maintain a minimum of 2 metres distance from every other person when a student, staff member or visitor is seated at a desk or table.
August 27, 2020

Lollies, Decision Tables, and What “Hamilton” Teaches Us About…

Search Space Episode 3 This past weekend I was listening to an episode of the Search Space, a wonderful podcast for just my particular breed of nerd, and Professor Chris Martens was talking about their language Ceptre, which is used for programming interactive worlds. I’m now excited to learn more about linear logic and the “lolly” connective A -o B which in Ceptre can be used to say “if A is true, then there can be a transition in state where A is no longer true and B becomes true.
August 21, 2020

Responding to Ma’s “Writing in Sign”

Last week a paper I wrote for the MIT Computational Law Report about using Blawx for Rules as Code was published. Please, please check it out and let me know what you think. Your feedback would be extremely valuable. I had been hoping that the piece would start a conversation, but little did I know there was another paper published in the same release that was also talking about Blawx. The conversation had started already!
August 14, 2020

The Value of Rules as Code Without Computers

I’ve been preparing a presentation for the Canadian Institute for the Administration of Justice’s Legislative Drafting Conference on Rules as Code. In the process of trying to figure out how to introduce the topic of Rules as Code to legislative drafters, I’ve been thinking about the different meanings the term “Rules as Code” has been given. Some people use “Rules as Code” to refer to the larger public service delivery methodology, which includes a method of legislative drafting, where you write the legislation in natural languages and computer languages at the same time.
August 5, 2020

Who’s to Blame?

I’m re-reading a 2011 dissertation by Tom Hvitved entitled “Contract Formalization and Modular Implementation of Domain-Specific Languages”. Hvitved proposes a set of requirements for contract formalisms. Basically, it’s a list of capabilities a “way of describing a contract to a computer” should enable. Among his proposed requirements is a record of who is to blame if something goes wrong. As he writes: In the case where a contract is breached, the monitor should not only report a breach of contract, but also who among the contract participants is responsible.
July 30, 2020

Monads, mo’ problems.

This week at work I got a wonderful lesson on Monads, which are a technique in functional programming. But what it taught me, more than what Monads are and why I should care, is how bad most people are at explaining computing science concepts. And how they could take a lesson from infomercials. Monad Nomad I’ve watched multiple videos online, and read multiple chapters of tutorials trying to explain them, and come away baffled each time.
July 17, 2020

What does GPT-3 Mean for Rules as Code?

GPT-3 is a newly announced AI model produced by OpenAI, that is showing some remarkable capabilities. I’m going to give you a quick background into what it is, what it can do, and what that might mean for Rules as Code. What is GPT-3? GPT-3, simplified, is a piece of software that can predict what the next word will be in a string of text. It can do that over and over, to the point where it can effectively write text that is almost indistinguishable from human writing.
May 26, 2020

10 Questions and Answers about Rules as Code

[Edit: A previous version of this post incorrectly identified Brainbox.Institute as the people doing the research project described below. In fact, only two of the three researchers are associated with Brainbox. Apologies.] Tom Barraclough, in a recent Medium post, put forward a test case that a team of independent researchers funded by the New Zealand Law Foundation had been working on and asked for feedback. This post is my attempt to contribute to that conversation.
March 5, 2020

Playing Along with Rules As Code: Part 6

So in the last post we got to the point where our model of the law understands what it needs to understand in order to be able to generate “Year of Employment” objects. In this post, we’re going to finish our rules, we’re going to generate an interview, and use it to debug problems in the law. Fudging It (a little) I spent some time trying to get OPM to play nice, but ran into a number of brick walls.
March 2, 2020

Playing Along with Rules as Code: Part 5

Continuing our work encoding section 183 of the Act in Oracle Policy Modelling. Oh, man. Ok, let’s get into this. This is the fifth in a series of posts following along with the Government of Canada’s Rules as Code project. Check out the earlier posts for context. The Next Part of the Problem Let’s start with a reprint of the section we’re encoding, section 183’s definition of “year of employment.”
February 28, 2020

Playing Along with Rules As Code: Part 4

So today we’re going to get started encoding section 183’s definition of “year of employment.” This is the fourth in a series of blog posts about following along with the Government of Canada’s Rules as Code discovery project. For details on the project itself, check out Scott McNaughton’s medium page. Here’s the definition from the source Act: 183 In this Division, … year of employment means continuous employment of an employee by one employer
February 27, 2020

Playing along with Rules as Code Part 3

This is the third in a series of posts were I follow along with the Government of Canada’s Rules as Code discovery project. In this post, I’m going to start modelling the legislation in Oracle Intelligent Advisor. Check out the first post for an explanation of the source material, and the second post for an explanation of why we’re starting again in OIA after having begun in Flora-2. Ontology Take 2 The ontology we are going to build here is going to be smaller than the one we started with, because we are only aiming at being able to answer questions about vacation pay.
February 24, 2020

Playing Along With Rules as Code Part 2

Scott McNaughton’s latest blog post about the Government of Canada’s Rules as Code project indicates that they have decided to change the scope of the project a little bit. The first thing is that they have decided they are worried primarily about being able to answer questions about how much vacation pay is due, and not questions about entitlement to vacation periods. The second thing he mentions is that they want to be able to take into account what is called “protected leave.
February 18, 2020

Playing Along with Rules as Code

The Government of Canada, much to my delight, is currently working on their first-ever Rules as Code discovery project. I’ve decided to play along in the hopes that it will both me and their discovery project team the opportunity to compare notes. I’m going to chronicle the journey here for people who are interested in seeing it play out in real time. This series of posts is going to include a lot of code, written in the Flora-2 (aka ErgoLite) programming language.
December 9, 2019

Is Rules as Code easier to implement in Canada than in the US?

This is an idea that has come up in a few conversations over the last few weeks. Legislative drafting in parliamentary democracies works differently than it does in the United States, for example. In a parliamentary democracy, the government, in the “executive branch” sense, remains the government because they have the “confidence” of the legislature, which is the legislative branch. “Confidence,” simplified, means that when the government puts forward something it wants to enact as a law, the legislature adopts it.
October 10, 2019

Demo of Blawx Integration with Docassemble over API for Rules as Code

Blawx is a tool for allowing people to easily encode written legal rules, and power other applications over the web with those encodings. We have now built our first proof-of-concept web integration, with docassemble, demonstrating how rules you build in Blawx can be used to give legal reasoning capabilities to any other tool on the web. The Rules: Rock Paper Scissors The first step is to encode the rules that you need.
October 9, 2019

The Better Way To #RulesAsCode, in Two Drawings

Here’s how we generally build tools that automate legal reasoning now: So we have some rules, and we have a question we would like to answer. A programmer comes up with a procedure for answering that question given the rules, and encodes that procedure in an algorithm. The algorithm and the data (collected from the user somehow) are given to the computer, and the computer follows the steps in the algorithm and spits out an answer.
June 21, 2019

Another Rules as Code example from ICAIL 2019

A short while ago I wrote a post about how you can use AustLII’s DataLex to take legislation and turn it into code. This week I’m attending the International Conference on Artificial Intelligence and Law (ICAIL 2019) at the University of Montreal Cyberjustice Lab. As I type, I’m in a tutorial session discussing a new open-source tool for Rules as Code, called NAI. Encoding The Law I decided to re-implement the same code from the previous post in order to see the differences.
June 5, 2019

“Rules as Code” Can and Should Be Done Without Programmers

I’ve been having conversations with people on twitter recently about my aspirational view that encoding laws will not always require programmers to be involved. I am both a lawyer and a programmer, so it’s easy for me to be wrong about that sort of thing. So I’d like to share an example of why I think it’s possible, and you can decide for yourself. The basic idea of Rules as Code is we take rules, we encode them, and that allows us and others to build more and better helpful applications.
May 10, 2019

Live Demo: Integrating Docassemble and Ergo Lite for Logic Coding

I posted just over a month ago about having figured out how to get Docassemble and Ergo Lite to play nice with one another, so that it was possible to use logic coding inside a Docassemble interview. Then, a couple of weeks ago I posted a series about using Ergo Lite to encode LSAT puzzle questions. So today I’d like to show of a combination of the two. Encoding LSAT Puzzles for Fun and Profit The preamble of the LSAT puzzle questions that I encoded last week reads like this:
April 25, 2019

A Computer Takes the LSAT: Conclusion

This is the conclusion to a series of posts about encoding LSAT Puzzles in the Ergo Lite programming language. To start from the beginning, go to the introductory post. If you’ve followed along this far, thanks for coming along for the ride. I hope it was interesting. As I said at the beginning, the point is not that now you should now know how to write code in Ergo Lite. Far from it.
April 25, 2019

A Computer Takes the LSAT: Resources

This is the resources post in a series of posts about encoding LSAT Puzzles in the Ergo Lite programming language. To start from the beginning, go to the introductory post. If you are interested in learning more about the Ergo Lite programming language, or if you would like to play along with the coding as a learning exercise, here are some useful resources. The Official LSAT PrepTest from June of 2007 from which the example questions are taken is available online.
April 25, 2019

A Computer Takes the LSAT: Generating Fact Scenarios

This is the third in a series of posts that show how to encode LSAT Puzzles in the Ergo Lite programming language. To start from the beginning, go to the introductory post. In this post, I will show you how you can use Ergo Lite to automatically generate all possible schedules. In some of the questions we are going to encode, the question will be whether something is always true or never true about a schedule that adheres to the rules.
April 25, 2019

A Computer Takes the LSAT: Question 6

This is the 4th in a series of posts about encoding LSAT questions in the Ergo Lite programming language. To start from the beginning, go to the introductory post. In this post, we will encode the first of 5 questions using the code we generated earlier. Question 6 reads as follows: 6. Which one of the following could be a complete and accurate description of the order in which the films are shown at the festival?
April 25, 2019

A Computer Takes the LSAT: Question 7

This is the 5th in a series of posts describing how to encode LSAT Puzzles in the Ergo Lite programming language. To start from the beginning, go to the introductory post. In this post, we will encode Question 7, which reads: 7. Which one of the following CANNOT be true? (A) Harvest is the last film shown on each day of the festival. (B) Limelight is shown on each day of the festival.
April 25, 2019

A Computer Takes the LSAT: Question 8

This is the 6th in a series of posts about encoding LSAT Puzzles in the Ergo Lite programming language. To start from the beginning, go to the introductory post. In this post, we will encode Question 8. It reads: 8. If Limelight is never shown again during the festival once Greed is shown, then which one of the following is the maximum number of film showings that could occur during the festival?
  • ««
  • «
  • 1
  • 2
  • 3
  • 4
  • »
  • »»
© Jason Morris 2023