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:

Those rules have been encoded in Ergo Lite, and the code added to the docassemble server.

Image for post
Image for post
What it looks like to edit Ergo Lite code inside Docassemble.

I then created a simple docassemble interview that asks you to set out a three-day schedule for a festival, and tells you whether or not your schedule follows those rules.

Image for post
Image for post
Results screen in the Live Demo.

I needed to add some rules to translate facts between Docassemble and Ergo Lite. After that, adding the reasoner to the docassemble interview required only a couple of lines of code.

So What?

I’m making steady progress toward a stack of technology that duplicates the features of expert system tools like Oracle Policy Automation and Neota Logic, using exclusively open source tools. That’s going to make advanced legal expert system development a more realistic alternative for organizations serving people who fall into the access to justice gap.

What’s Next?

I want to demonstrate that once you have encoded rules in Ergo Lite, you can use them to do more than one thing. I also want to demonstrate that writing code in Ergo Lite doesn’t need to be as intimidating as it looks above.

That’s why I’m also currently working on expanding the features of Blawx. Blawx is a graphical interface for declarative logic coding. I’ll be doing a brief demo of that work on May 13, 2019 at the Rules as Code Show and Tell.

The demo uses the same LSAT code from the series of posts last month, but shows how you can use Blawx to encode all 5 answers for question 6, and ask Blawx which answer is correct.

Image for post
Image for post
The Blawx Interface being used to answer Question 6 on the LSAT.

Can I Try It?

Click here to check out a live demo.

Need More Info?

I’m available on Twitter at @RoundTableLaw, and I’m always happy to chat. If you’re interested in building the next killer legal app, contact me at Lemma Legal Consulting, we’d be happy to help you build something awesome.

Written by

Lawyer, Round Table Law; 2018/2019 ABA Innovation Fellow; Sessional Instructor, University of Alberta; Computational Law (Symbolic AI) Researcher, CCLaw @ SMU

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store