AI & Law: Pitfalls Of Axiomatic Logic

Image for post
Image for post
Difficulties abound in an entirely logic-based embodiment of the law

by Dr. Lance B. Eliot

For a free podcast of this article, visit this link or find our AI & Law podcast series on Spotify, iTunes, iHeartRadio, plus on other audio services. For the latest trends about AI & Law, visit our website

Key briefing points about this article:

  • Some believe that we ought to be able to turn the law into a set of axiomatic logic


When people think wistfully or perhaps wishfully about the law, they often in an offhand manner characterize the law as though it ought to be entirely axiomatic.

In short, the notion is that since the law is seemingly written down, and since it appears to entail some semblance of logic, ergo the most obvious and natural way to try and computerize the law would be to compose it into a series of logic-based statements. The resulting axiomatic system would presumably be easy to run and maintain, thus, obviating all the messiness of today’s wrangling with the paper-based and narrative heavy-laden nature of the law.

Indeed, during my classes on Artificial Intelligence (AI) and the law, one of the questions I most often get asked involves the seemingly apparent notion that pure logic ought to be able to encapsulate the law.

In essence, rather than dealing with all of the various AI-empowered and profusely complex systems techniques and advanced computer-based technologies, just simply put the law into an everyday logic formulation. All we have to do is perhaps state that A leads to B, and B leads to C, and thus proceed to encode the law into a rudimentary series of logic-based statements and rules. No-fuss, no muss. Life would be a lot easier if this could be undertaken.

Imagine a large corpus of all the laws transformed into a set of pristine logic-based assertions. Whenever a legal case arose, you would log in to this mighty database, enter in the particulars of your case, and voila, the system would churn through possibly thousands upon thousands of logic rules and spit out your outcome.

What a wonderful life it would be.

Does Logic Cut The Bill

Well, not everyone views this as a great wonderment.

The classic concern is that these rules might be so voluminous and interconnected that the legal result generated is either an oddball result or does not lend itself to any readily understood semblance of logic. This seems counterintuitive that something based entirely on resolute logic could somehow not be logically understood by us.

Potentially, this confounding facet could arise if the logic is so intertwined and convoluted to the degree that (let’s say) a printout might run for hundreds of pages showing all the logic enacted occurrences. Presumably, this vastness of enacted rules would be beguiling for anyone to comprehensively make heads nor tails of what the underlying logic readily comports.

In a forest-for-the-trees kind of aspect, we might lose sight of a greater cohesiveness of the law by having it codified into those zillions of itsy-bitsy immaculate rules.

Another concern is that the rules themselves might be suspect. Suppose that a nefarious rule got embedded into this morass of logic-based legal theorems and stipulations (being surreptitiously implanted or having been added on the up-and-up but having unanticipated adverse consequences). Who determines which rules belong and which do not? How could we ferret out the rules that are ominous or untoward? Indeed, think of the ongoing effort required to maintain and do the upkeep on this outsized and overwhelmingly massive collection of rules about the law.

Well, be aware, a robust counterargument to those contentions is that we already do roughly the same thing, though it is primarily paper-based, crudely undertaken by hand, and presumably just as much a quagmire as if it were inside an overarching computerized database. By putting the entirety of the law into some set of sharply delineated online rules, at least we would have a better chance at using the same computer-based proclivities to scan for foul rules and otherwise manage the rules and therefore better manage the nature of our laws.

Round and round we go, whereby there are arguments to be made that it would behoove us to seek and craft this logic-based law codification vision versus those that decry such an approach as leading us down a heartless path and possibly letting machines be our ultimate ruler.

But The Feasibility You Say

Let’s take a step back from all of that thunder and lightning and ask a simpler question, namely, whether such a large-scale logic-encapsulating system is feasible, to begin with.

The base assumption underlying the aforementioned debate is that we could in fact create a crisp computer-based logic-running system to house the transmuted semantically indeterminate laws. One supposes that if we can get mankind to the moon, surely, we could devise an online system to embody and enact the laws of the land.

Sorry, it is not as easy as you might think.

There are plenty of research efforts underway to try and reach this legal-rules nirvana, though to-date the journey has been stymied in many respects.

For details about the various efforts, including sample code excerpts and salient explanations, see my textbook entitled “AI and Legal Reasoning Essentials” at this link here:

A popular logic-encoding programming language typically used in a legal context is called ASP (Answer Set Programming). Many of the efforts toward turning law into code are oftentimes undertaken via the use of ASP. It is considered a declarative programming language, which differs from the usual procedural oriented programming languages that you might have toyed with while taking a computer programming course in college or online.

A declarative approach means that you can list the rules and do so without worrying about the order in which they are to be utilized.

Normally, when writing a program in a conventional procedural language, you need to specify the sequence of which line is to be performed one after another. Not so in a declarative language. Instead, you can pretty much toss the rules into a collection and then let the system sort through the ordering that will be needed to appropriately utilize the rules. This spares the developer from having to meticulously figure out any sequencing aspects. Besides ASP, other relatively popular declarative programming languages used for legal encoding include ASPIC+, Prolog, and others.

Non-Monotonic Reasoning

One tricky conundrum for the use of straight-ahead logic is that you almost always need to contend with what is referred to as non-monotonic logical reasoning. This might not have been covered in your math classes or it maybe has been a while since you’ve studied such matters. Let’s start by quickly defining monotonic reasoning, which is the notion that logical conclusions can be attained and are soundly concludable even if a new clause or rule is later added into the set. On the other hand, non-monotonic reasoning has provisions for having newly added rules that might invalidate prior reached conclusions.

That’s a mouthful.

The Tweety Bird example is a favorite among most explanations on this difference between monotonic and non-monotonic reasoning. Tweety Bird, the one in the Looney Tunes cartoons, provides handy fodder for easily elucidating the matter. Suppose that we agree that Tweety is a bird. Hopefully, this assertion does not raise any hackles or immediate discord, but if it does, please go along with me for the moment anyway.

Next, suppose it is asserted that birds fly. We seem to then be able to reach a quite sensible and logic-based conclusion that Tweety can fly since we know Tweety is a bird and we also now know that birds fly. Ergo, we’ll include into the legal corpus that a conclusion has been reached that Tweety can fly.

At some later point in time, there are additional rules added into the database, including that Tweety is a penguin, and then later after that insertion, there is this rule added: Penguins cannot fly. Oops, that seems to be a problem. Earlier, it was concluded that Tweety could fly, but now, based on Tweety being a penguin and the added facet that penguins cannot fly, we have to (presumably) recant the earlier arrived at conclusion. A monotonic form of logical reasoning won’t let you undo that prior conclusion, while a non-monotonic structure would allow the new conclusion to essentially override or somehow cope with the conflicting prior conclusion.

Before you get irked that this might all seem like a trivial matter, think about court cases that led to judgments and that became the understanding or meaning of the law, and then, later on, some other judgment countered or overruled the earlier ruling. It turns out that if you have a set of thousands upon thousands of logic-based rules, and you allow for a non-monotonic world, the repercussions are quite explosive in terms of having to then contend with all the rippling and cascading effects that such a later-on new ruling can have.

There are catchy names for this logic-based phenomenon, known sometimes as skeptical reasoning, credulous reasoning, zombie-arguments, and so on. Dealing with non-monotonic reasoning consideration is puzzling mathematically and can be computationally hard or intractable. Nonetheless, despite the problems it introduces, I think we can all likely concur that the real-world cannot be cast in monotonic reasoning and we must find viable means to employ non-monotonic reasoning.


All told, there is a slew of issues and problems facing the attempts to codify the law into what might be characterized as pure logic. Fortunately, there are abundant and diligently concerted efforts going on to do so. Note that others believe that it might be a kind of dead-end and thus other forms of AI-reasoning techniques and technologies will be required to shift the law into being computationally usable or reasoned.

Or, it could be that we discover a mixture of the two is the best overall approach.

Anyone that was to summarily conclude right now that one way is the right way, could subsequently find themselves facing down the cannon of the monotonic form of logic and be clamoring for a non-monotonic viewpoint when or if their acrimonious contention turned out to be untrue. That’s the way of logic.

For the latest trends about AI & Law, visit our website

Additional writings by Dr. Lance Eliot:

And to follow Dr. Lance Eliot (@LanceEliot) on Twitter use:

Copyright © 2020 Dr. Lance Eliot. All Rights Reserved.

Written by

Dr. Lance B. Eliot is a renowned global expert on AI, Stanford Fellow at Stanford University, was a professor at USC, headed an AI Lab, top exec at a major VC.

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