XAI-LAW: A Logic Programming Tool for Modeling, Explaining, and Learning Legal Decisions
Agostino Dovier, Talissa Dreossi, Andrea Formisano, Benedetta Strizzolo
TL;DR
The paper addresses transparent, explainable legal reasoning for the Italian Criminal Code by encoding ICC articles in Answer Set Programming and enabling semi-automatic rule learning from judicial decisions with ILASP. It introduces XAI-LAW, integrating $P_{law}$ with ILASP and explainability tools such as xclingo2 and xASP to generate both textual and graphical explanations and to explore plausible decision scenarios. The approach handles vagueness via non-deterministic choice and manages contradictions through maxims like Lex specialis, while dynamic refinement via ILASP updates the knowledge base with new judgments. Empirical results show trade-offs between learning expressiveness and computational cost, and the authors provide open-source tooling to support judges and legal experts in explainable, decision-support workflows.
Abstract
We propose an approach to model articles of the Italian Criminal Code (ICC), using Answer Set Programming (ASP), and to semi-automatically learn legal rules from examples based on prior judicial decisions. The developed tool is intended to support legal experts during the criminal trial phase by providing reasoning and possible legal outcomes. The methodology involves analyzing and encoding articles of the ICC in ASP, including "crimes against the person" and property offenses. The resulting model is validated on a set of previous verdicts and refined as necessary. During the encoding process, contradictions may arise; these are properly handled by the system, which also generates possible decisions for new cases and provides explanations through a tool that leverages the "supportedness" of stable models. The automatic explainability offered by the tool can also be used to clarify the logic behind judicial decisions, making the decision-making process more interpretable. Furthermore, the tool integrates an inductive logic programming system for ASP, which is employed to generalize legal rules from case examples.
