Introducing L4-Docassemble

SMU CClaw brings logic-based legal encodings, defaults and exceptions, reusable rules and data structures, explanations, rapid prototyping, and deeper legal reasoning to open source legal expert systems.

Open Source Legal Expert System Tools: What are they missing?

Logical Representations of Laws and Contracts

Prototype User Interfaces

Explanations for Answers

Legal Expert System Tools: What are they missing?


Modular Rules and Data Structures

Multiple Justifications

Hypothetical Reasoning

What is L4-Docassemble?

  • Logical Representation of Rules *
  • Rapid Prototyping *
  • Natural Language Explanations *
  • Defeasibility +
  • Modular Data Structures and Rules +
  • Multiple Justifications +

How do you Use L4-Docassemble?

  1. Install it.
  2. Upload your s(CASP) and LExSIS files to the static folder in the docassemble playground.
  3. Run the interview generation tool, which creates an interview and installs it onto your docassemble server for you.
  4. Modify the interview however you like.

What Does Using L4-Docassemble Look Like?

% RULE 34(5)
% (5) Despite paragraph (1)(b), but subject to paragraph (1)(a) and (c) to (f),
% a locum solicitor may accept an executive appointment in a business entity which
% does not provide any legal services or law-related services, if all of the
% conditions set out in the Second Schedule are satisfied.
according_to(r34_5,may(LP,accept,EA)) :-
not provides_legal_or_law_related_services(BE),
provides_legal_or_law_related_services(BE) :-
provides_legal_or_law_related_services(BE) :-
query: legally_holds(Rule,must_not(Lawyer,accept,Position))
- name: legal_practice
type: String
any: Are there any legal practices?
another: Is there another legal practice?
ask: What is the name of the legal practice?
tell: the legal practice {X}
minimum: 0
- law_practice(X)
- name: joint_law_venture
ask: Is {Y} a joint law venture?
type: Boolean
- joint_law_venture(Y)
- name: formal_law_alliance
type: Boolean
ask: Is {Y} a formal law alliance?
- formal_law_alliance(Y)
- name: foreign_law_practice
type: Boolean
ask: Is {Y} a foreign law practice?
- foreign_law_practice(Y)
- name: jurisdiction
type: Enum
ask: What is the jurisdiction of {Y}?
singapore: Singapore
other: Somewhere Else
- jurisdiction(Y,X)
- name: legal_practitioner
type: Object
source: person
minimum: 0
any: Are there any legal practitioners in {Y}?
another: Is there another legal practitioner in {Y}?
ask: Who is a legal practitioner in {Y}?
tell: the legal practitioner {X} in {Y}
- legal_practitioner(X)
- in(X,Y)
- name: locum_solicitor
ask: Is {Y} a locum solicitor?
type: Boolean
- locum_solicitor(Y)
- name: primary_occupation
type: Enum
ask: What is the primary occupation of {Y}?
- primary_occupation_of(Y,X)
practicing_as_a_lawyer: Practicing as a lawyer
something_else: Something Else
A question screen in an L4-Docassemble interview.
An example of an answer from an L4-Docassemble interview

Legal Expert Systems in One Line of Code

  1. Change the query entry in your LExSIS file.
  2. Rerun the interview generator.
  3. There is no step 3.

Using L4-Docassemble, building a new legal expert system to answer a different question about the same rules requires a single line of code.


  1. There are open source reasoning tools like Blawx and closed source tools like Regulation as a Platform that feature logical representations and defeasibility, but that do not have features for the development of user interfaces. Such tools are excluded from the analysis.
  2. I’ll write more about LExSIS in a later blog post.



A sporadic diary by Jason Morris of Lexpedite Legal Technology Ltd.

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
Jason Morris

Rules as Code Director at Service Canada, CEO Previous: Lawyer; ABA Innovation Fellow; Sessional Instructor; Computational Law Researcher