# XAI-LAW: A Logic Programming Tool for Modeling, Explaining, and Learning Legal Decisions

arXiv: https://arxiv.org/abs/2601.03844 · HTML: https://mlsanity.com/paper/2601.03844/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 6 of its 37 references that are in the map.
- First posted on arXiv 7 Jan 2026.

## Builds on (most cited first, 6 of 6)

- [The ILASP system for Inductive Learning of Answer Set Programs](https://mlsanity.com/paper/2005.00904/) (2020)
- [LLASP: Fine-tuning Large Language Models for Answer Set Programming](https://mlsanity.com/paper/2407.18723/) (2024)
- [Towards Automatic Composition of ASP Programs from Natural Language Specifications](https://mlsanity.com/paper/2403.04541/) (2024)
- [GPU-based parallelism for ASP-solving](https://mlsanity.com/paper/1909.01786/) (2019)
- [Parallel Logic Programming: A Sequel](https://mlsanity.com/paper/2111.11218/) (2021)
- [Automated legal reasoning with discretion to act using s(LAW)](https://mlsanity.com/paper/2401.14511/) (2024)

## Abstract (arXiv)

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.
