Introduction
Answer Set Programming (ASP) is a powerful declarative programming paradigm used for complex AI tasks such as robotics, planning, and medical diagnosis. While modern ASP solvers are highly efficient at finding solutions (answer sets), they often operate as "black boxes." A user may receive a plan or a diagnosis without understanding the underlying reasoning or why alternative options were rejected.
The Challenge of Explainable AI in ASP
Existing AI systems frequently lack the interactive "dialogue" component necessary for true Explainable AI (XAI). Specifically, they struggle to address user queries like "Why is this true?" or "Why wasn't that included?" This research introduces exp(ASP), a system designed to generate structured, automated justifications for truth values in ASP programs.
The exp(ASP) Methodology
The exp(ASP) system, implemented in Python, utilizes a three-stage pipeline to transform raw logic into human-readable explanations:
- Preprocessing: Using the
clingosolver, the system grounds logic rules. To prevent the solver from optimizing away essential facts—a process that usually speeds up computation but obscures reasoning—the system redefines facts as#externalstatements. This preserves the full logical structure. - Minimal Assumption Sets: Logic programs often contain cycles (e.g., "A is true if B is false; B is true if A is false"). The system identifies "minimal assumption sets"—the smallest number of atoms that must be assumed false to break these cycles and provide a grounded justification.
- Explanation Graph Generation: The system builds a directed graph where positive atoms are linked to supporting rules, and negative atoms are linked to the reasons why every potential supporting rule failed. Assumptions are explicitly labeled to show where the AI made a "choice" based on the program's structure.
Evaluation and Benchmarks
The researchers evaluated exp(ASP) using several benchmark logic problems and real-world scenarios rather than traditional machine learning datasets. These include:
- The 3-Coloring Problem: A standard graph theory benchmark.
- Scheduling Problems: Such as "Bob’s Weekly Plan," involving conflicting choices.
- Medical Diagnosis: A complex model for ophthalmologist surgery recommendations.
- Historical Analysis: A diagnosis model of the Three Mile Island nuclear accident.
Key Results and Visual Clarity
The primary output of the system is the automated generation of visual explanation graphs. These graphs allow users to trace the "chain of causality" through facts and logical dependencies.
In practical applications, such as the ophthalmologist diagnostic system, the tool demonstrates high qualitative clarity. For instance, it can show that a specific lens is recommended because a competing surgery was ruled out due to the patient's financial constraints. This visual "chain of negation" is significantly more accessible than raw ASP code. Furthermore, by leveraging the ASP Intermediate Format (aspif), the system remains compatible with modern solvers without requiring modifications to their underlying engines.
Future Work
Currently, exp(ASP) provides one-way explanations. The authors aim to evolve this into a full interactive loop where users can challenge the AI’s assumptions and provide new information, seeing the explanation graph update in real-time. Future research will also explore applying these techniques to "explainable planning" tasks where temporal constraints are critical.
Summary updated