This post describes a method that I have implemented in v1.3.15-alpha of Blawx for using abductive reasoning features of the s(CASP) programming langauge to power relevance decisions in expert systems. I’ll try to give you a brief introduction to what problem we’re trying to solve, how it has been solved before, how I have solved it in Blawx, and how those solutions differ. The Problem…
Long time no blog! There have been lots of big, exciting changes to Blawx over the last while. I’m now working on getting the documentation caught up. When that’s done, I promise I’ll come back and do a big post about Blawx. Today, I just want to talk about an idea I’ve been developing over the last few days. What’s Phase 2? When we talk about Rules as Code, we tend…
It’s been a while since I did a blog about the changes to Blawx, so let’s get you caught up! Spans For reasons that will be clear shortly, we needed a way to delineate and name parts of a paragraph of text. So I made some changes to CLEAN so that you can use the following format to be able to treat spans of legal text as though they were a sub-part of the law.
Rather than me repeating it here, you can check out my live tweet of the final session. My Thoughts I’m not sure if I’m surprised, or not, but there was almost no consensus on anything, except that we should experiment concretely, not debate abstractly, the tools should be explainable, and the products of the work should be publicly accessible and usable, not behind proprietary…
TL;DR There is a new version of Blawx, live online, that allows you to edit legislation in a markdown-like language called Clean. I will be participating in a conference on Monday on Rules as Code 2.0, looking at how we generate the skilled workforce that rules as code requires. Registration is free and highly recommended. Videos from the SMU Computational Legal Studies conference are available…
The Problem I made a number of changes to Blawx that makes it possible to organize your code according to the pieces of the legislation. This is the first of a number of improvements that are all designed to let you use Blawx to do a structurally-isomorphic encoding of the legislation. The problem was that the initial version did not provide any good way to edit the Akoma Ntoso source code for the…
There was a conversation on Twitter this week that helped to clarify my thinking about something, and I wanted to share. There is a sort of tension between “code” and “no-code” (sometimes “low-code”) solutions. People who consider themselves software developers see people trying to use no-code solutions to do things that the no-code solutions are not good at,…
Progress on Blawx Just a quick note to let you know what I’ve been doing with Blawx over the last few weeks. Blawx was originally a single web page that could contain a single workspace of code, much like an IDE that could only have one file open at a time. Version 1 changed that by creating “workspaces” that are saved server-side, and giving you the ability to create multiple…
Using OpenFisca to Power Expert Systems in the Canadian Public Service: Lessons Learned This is a draft of a paper being prepared for the Singapore Management University Centre for Computational Law’s Computational Legal Studies Conference 2022. Abstract The paper demonstrates an approach to encoding legislation in OpenFisca, and an approach to using the OpenFisca API, which in combination…
Background A couple of blog posts ago I talked about how I was working on a way of getting information about statutes into Blawx, so that they could be used for generating explanations, cross-references, and links to source material. Playing around with it that way gave me what I needed to know in terms of the data structure that I needed to fill, but it also taught me that the block-based…
Announcing Blawx v1.0.0-alpha I’m very happy to announce the release of Blawx v1.0.0-alpha. What is Blawx? Blawx is an open source, web-based, user-friendly tool for Rules as Code. It allows you to take what you know about laws, regulations, or contracts, and describe them to the computer in a simple but powerful block-based visual language. In September of 2020 it was awarded second place…
I’ve been spending some time recently working on adding a way to describe legal documents to the development version of Blawx.com. Objectives Big picture, I want to have a data structure inside Blawx that is going to allow people to cite the authority for rules using a specific reference, as pictured here: Importing The structure should allow the user to add to and modify information…
Chris Bailey’s ProLaLa 2022 Presentation As I mentioned in the last blog post, Chris Bailey’s presentation at ProLaLa 2022 sort of requires its own blog post in response. I didn’t take any screenshots of Chris’ presentation, because he just shared his VS Code window. The sourcecode is available online. It might help to read this first, though. Chris is a law student at the…
I had the opportunity to participate in Programming Languages and the Law (ProLaLa 2022), a workshop held as part of the Principles of Programming Languages 2022 conference (POPL 2022). All of the day’s events are available to watch on YouTube. It’s sort of hard to imagine an academic conference with a topic closer to my interests, and it did not disappoint. Here’s an extremely…
The Clause Order Hassle Learning to use s(CASP) to encode legislation over the course of the last year or so has been at times frustrating. The reason for that is that I would often find myself with code that did not work as expected, and I could not understand why. Then, I would make changes, usually by changing the order of the lines of code, or by changing the number of predicates I was using,…
I’ve been playing around with an s(CASP) library for doing date math over the last little while, and finally found some time today to test it with s(CASP)’s ability to do constraints over reals. I was interested to see if there was a way that we could convert the dates into timestamps and then have s(CASP) treat them as a constraint. The Problem Here’s my imaginary scenario. I am…
Here we go again! In what risks becoming an annual tradition, around here, I’ve decided to move the Rules as Code Diary away from Medium into a self-hosted blog built with hugo. This is mainly motivated by the fact that a lot of what I’m writing these days is actually code, and Medium is pretty limited in terms of what it can do to display code typed into the editor. Hugo, on the other…
talk.RulesAsCode.com is a discourse site that I set up with the help of Jameson Dempsey of Legal Hackers. It is a web forum, knowledge base, and mailing list for people working on digitized legislation, regulation, and contract, particularly people doing it in the public sphere. When I learn about cool tools, I add to the knowledge base there.
Blawx is my tool for demonstrating that it is possible to take declarative logic programming, which I believe to be the best way to encode legislation, regulation, and contract, and turn it into a user interface that is approachable for non-programmers. It is a graphical development environment for the Flora-2 programming language, built in Google’s Blockly tool for graphical development…
I am a Canadian husband, dad, former lawyer, and computational law expert specializing in “Rules as Code.” I ran my own law firm “Round Table Law” for nearly a decade until 2020. In 2020 I obtained a Masters degree in Computational Law from the University of Alberta, and since mid-2020 have been working full time in the area of applying symbolic, rules-based artificial…
It’s traditional at the end of the year to look back and see where you started, and how far you have come. I’m going to extend the look back to 2020, because I started Computational Law Diary half way through 2020. A Little Personal Background I started my full-time career in computational law about the same time that I started the Computational Law Diary in July of 2020. I spent one year with the…
Following up on the plan I wrote about a few days ago… By exposing all of the intermediate conclusions, and by adding separate variables that represent whether the primary variables are “known,” I’ve managed to create an encoding in OpenFisca that is capable of doing some cool stuff over the Web API. You can see the source code in this GitHub repository, and the demos/explanations.py file…
At Service Canada we are working on a new tool to help Canadians to plan for retirement. And we are experimenting with implementing that system using a Rules as Code approach. Specifically, we are looking at implementing the rules in OpenFisca. OpenFisca is a leading Rules as Code solution, but it is primarily aimed at microsimulation. Microsimulation is where you create a data model that…
Last December, Denis Merigoux and Liane Huttner presented a paper at the Algorithmic Law Symposium hosted at HEC Paris, on “Catala: Moving Towards the Future of Legal Expert Systems”. I’ve been meaning to take a look for some time, and finally managed it today. [Edit: Denis Merigoux notes in the replies that the version of the paper I viewed was a pre-print before the authors had received the…
Just had a great conversation with a colleague that helped me understand a challenges involved in implementing Rules as Code that hadn’t occured to me before. The objective in Rules as Code is to write an encoding of the legislation that is as re-usable as possible. That means avoiding the temptation to put things into the encoding of the rules that only make sense to include in the context of a…
I blogged recently about the opportunity to use s(CASP) inside SWISH, the web-based development environment for SWI-Prolog. Today it is another web-based development environment for Rules as Code, OpenFisca inside Google Colab. What is OpenFisca? OpenFisca is probably the world’s most popular open source tool for Rules as Code. It is used extensively in France, and is spreading around the world.…
Rules as Code is a movement in public administration that suggests that the digitization of legislation, regulation, and other rules should happen as early in their life cycle as possible, so as to improve policy design, improve legislative drafting, and massively simplify service automation and building software systems compliant with those rules. It is an international movement, and it is an…
In yesterday’s post, I talked a little about how it would be nice if there was a way to use legislative scope to refer to sections of law, particularly to implement, in a structurally-isomorphic way, defeasibility statements like “subject to this act and the regulations.” Today I’m going to share a small experiment I did in Flora-2 to see if I can demonstrate a working approach. I’d be interested…
I’m currently working within Service Canada’s Benefits Delivery Modernization Program, and I’m working with a team that is looking to automate calculations under the Old Age Security Act. I have been looking at various approaches for encoding the relevant sections of the Act, and over the last couple of days I’ve been struck by what a good example section 3(1) of the OAS Act is of the kinds of…
It was back in December of 2020 that I first learned about a tool called s(CASP). Since then I have written about using s(CASP) to encode Covid-19 rules using basic event calculus, I wrote about how it is my new favourite tool for Rules as Code, I’ve written about what it is, and why that matters for Rules as Code, about how you can use it to make laws better, and I introduced a new tool for…
Perhaps the most interesting part of the first day of ICAIL 2021 proper is a presentation by Dr. Alice Witt, entitled Converting Copyright Legislation into Machine-Executable Code: Interpretation, Coding Validation and Legal Alignment. The presentation is available on YouTube here. Let me first say that this is the first time that I have seen a paper on Rules as Code at ICAIL, and it is nice to…
ICAIL is the International Conference on Artificial Intelligence and Law. It is held bi-annually, and it is currently being “hosted” virtually in Sao Paulo, Brazil. You can “attend” it virtually by going to the Associação Lawgorithm youtube channel and following along with the live presentations today, tomorrow, and Thursday. On the Monday and Friday of the conference there are typically a number…
The International Conference on Artificial Intelligence and Law is a renowned international academic conference on law and artificial intelligence. It is held every two years. In 2019, I had the pleasure of attending in order to present a demonstration of work that was part of my LLM in Computational Law at the University of Alberta. I’m happy to share that I will be “attending” again this year.…
Today at SMU CCLaw we had a seminar from Dr. Joaquín Arias Herrero of the Universidad Rey Juan Carlos in Spain. Dr. Arias is one of the researchers responsible for s(CASP), which is my new favourite programming language for Rules as Code. I was delighted to learn about the existence of s(CASP) late last year. I have been spending a lot of time working in it in the first half of 2021, and that…
I want to give you an intuition for why Rules as Code in logical tools like s(CASP) makes laws better. Let’s imagine that you are the legal knowledge engineer assigned to the Rules as Code process for drafting the Rock Paper Scissors Act of 2021. The purpose of the Rock Paper Scissors Act is to set out the official rules of who is the winner of a game of Rock Paper Scissors.
The International Law Lab Showcase is an online meetup of innovation and technology labs at law schools around the world. It is an opportunity for the members of these labs to meet one another, and for people interested in how these innovative institutions operate to come ask questions. If you are interested in attending a law school with an innovation and technology lab, or if you are a law…
At SMU’s Centre for Computational Law we are working on an open source domain specific language for law, called L4. The idea is that you should be able to write legal rules, like laws or contracts, in L4, and other applications should be able to translate that encoding into other forms to do useful things. One of the useful things that we want people to be able to do with L4 is to build expert…
I was working on an s(CASP) encoding last week, and learned something that gave me a better intuition for how to encode things well. I needed to encode what counted as a business, and there were two things. I needed to encode what counted as a business entity, and there were 7 things, each of which required a business, which meant there were 14 possibilities total. Then I needed to encode what…
I’ve been spending a lot of time recently thinking about the problem of choosing how to model things when doing automated legal reasoning. What is a Model? Just so we’re on the same page, when I talk about a model, there is a real thing, of some sort, and there is a representation of that thing in a language which is useful for some reason. The representation is the model, and the language is the…
Yesterday I posted about what justified stable model query-driven constraint answer set programming is. Now let me tell you a little bit about why I think all of that matters. Defeasibility The higher-order logic features of s(CASP) make it very easy to implement forms of defeasibility the way it is implemented in legal writing, which is that the relationship is noted only in the default, or in…
I spent some time today trying to understand where s(CASP) fits into the world of programming languages more generally, and here’s what I think is going on. Remember, I’m not an expert. This is my amateur understanding after playing with it for a few days. What is the “Usual” type of programming language? The usual paradigm for programming languages is called imperative programming, in which you…
OK, I think I’m going to call it. Flora-2 is no longer my favourite tool for doing Rules as Code. My new favourite is s(CASP). I’m working on a paper for the International Conference on Artificial Intelligence and Law at work, and I’m doing an experiment, the results of which are blowing me away. I took a piece of legislation recommended by a potential industry partner, and encoded it in s(CASP).
Flora-2 is a logic programming language that implements defeasible reasoning using a method called “defaults and argumentation theories.” Here’s how it works. Choose An Argumentation Theory The first thing you have to do is choose the argumentation theory that you want, but Flora-2 has a very intuitive default. :- use_argumentation_theory. Tag Your Rules Flora-2 gives you the option of specifying…
I was pointed by a colleague to a paper on SSRN by two law professors proposing a method for making smart contracts “legal.” What they mean, I take it, is that they want to make sure that smart contracts are enforceable in court the way “normal” contracts are. And the method they propose is a combination of natural language and code. This is similar to the way clause.io uses blocks of natural…
I took the opportunity over the last couple of days to spend some time working on long-planned upgrades to Blawx. It has been partly successful, and partly an exercise in frustration. The frustration comes from the fact that I’m working with limited processing power here in my hotel room in Singapore, having only brought a Surface Go tablet with me for writing code. To get any further, I think I’m…
January 14, 2021 was “World Logic Day”, and in celebration of it the Department of Computing Science at the University of Texas Dallas invited Robert Kowalski to give a speech on Logical English. If you don’t know who Dr. Robert Kowalski is, he more or less invented logic programming in the 1970s. In the logic programming community, he is a “big deal.” He is also the first person I’m aware of to…
I thought that given it is a new year, it was time to refresh the way the Diary looks. So the Diary has become a publication on Medium, which you can follow without needing to follow me personally, and to which I can add other members of the SMU Centre for Computational Law team. I would love it if you would share the link to the diary with your friends networks interested in Rules as Code, Smart…
If you’ve been following along for the last few weeks, you know that I’ve been playing with different methods of representing event calculus, and aiming at being able to explain the outcomes. This week I’d like to show you an experiment I did with a tool called Carneades. Carneades is named for the ancient Greek philosopher who was famous for having travelled to Rome and given two lectures in two…
Alright, fellow legal nerds, let’s get deep in the weeds, here. What is Event Calculus? A “calculus” is a way of reasoning about something. Event Calculus is a way of reasoning about events, and their consequences. I use consequences here to mean “what happens after those events have occured, and because those events have occurred.” So it is a calculus of causes, and a calculus of time. What is…