Manuscript Offprint
arXiv:2609.04931Solving Hard XAI Queries Based on a Compiled Dual-Rail Encoding
Abstract
The widespread adoption of artificial intelligence (AI) within real-world applications has raised a lot of concerns regarding their trustworthiness, especially in critical applications. The field of eXplainable AI (XAI) has emerged with the objective of providing explanations to the users about the decisions made by AI systems. Several explanations for boolean classifiers have been introduced in the literature, including abductive and contrastive explanations, each giving a different insight on the decision of the classifier. However, computing an explanation for a decision of a boolean classifier is a hard problem in general. One way to deal with this complexity is to rely on a compiled representation of the classifier for which each explanation can be computed efficiently. Unfortunately, we prove in this paper that several classes of abductive explanations, remain hard to compute even for Ordered Binary Decision Diagrams, one of the most tractable subsets of the knowledge compilation map. Included in such classes are shorter abductive explanations or abductive explanations that include the explainee's preferences. To recover the benefits of working with compiled representations, we show that a proper representation of the dual-rail encoding of the classifier can be used to compute efficiently these classes of explanations.
1 Introduction
The widespread adoption of artificial intelligence (AI) within real-world applications, powered by the recent advancements of machine learning, has raised a lot of concerns regarding their trustworthiness, especially in critical applications. Building trust in AI systems depends on characteristics like fairness, robustness, and explainability, each of which has been the subject of active research in the past decade. Hence, the field of eXplainable AI (XAI) has emerged with the objective of providing explanations to the users about the decisions made by AI systems. Within this field, formal explainability (Ignatiev, Narodytska, and Marques-Silva, 2019) designs explanations with provable guarantees and studies the complexity of computing these explanations based on the type of model used in the AI system. On boolean classifiers specifically, several explanations have been introduced in the literature, each giving a different insight on the decision of the classifier. For example, abductive explanations highlight a set of features in the input instance whose values are sufficient to fix the decision of the classifier (Ignatiev, Narodytska, and Marques-Silva, 2019), whereas contrastive explanations suggest a minimal set of features that can be changed in the input instance to swap the decision of the classifier (Audemard, Lagniez, and Marquis, 2024). Other types of explanations such as the Shapley value have also been adapted to boolean classifiers (Létoffé, Huang, and Marques-Silva, 2025).
Computing an explanation for a decision of a boolean classifier is a hard problem in general. In fact, one of the main focus of the literature in formal explainability has been to characterize for which types of classifiers a given explanation can be computed efficiently (typically in time polynomial in the size of the classifier).
*corresponding author: arthur.ledaguenel@gmail.com
This cartographic approach of formal explainability draws a natural parallel with knowledge compilation (Darwiche and Marquis, 2002), a field whose goal is to characterize propositional languages representing boolean functions according to their succinctness and the set of tractable queries and transformations they support. Hence, the complexity of computing explanations based on a compiled representation of the classifier has been heavily explored recently (Audemard, Koriche, and Marquis, 2020; Huang et al., 2022). It is known for instance that computing subset-minimal abductive explanations (also called sufficient reasons or prime implicant explanations) can be done efficiently for d-DNNF classifiers. Unfortunately, we prove in this paper that several classes of abductive explanations remain hard even for Ordered Binary Decision Diagrams (OBDD), one of the most tractable subsets of the knowledge compilation map. This is for instance the case of shortest (or minimal-size) explanations (Audemard et al., 2024) or optimal abductive explanations with respect to an additive utility function representing the explainee's preferences (Audemard et al., 2022). Algorithms based on SAT-like solvers have been proposed for these types of explanations, but they lack the guarantees that compiled representations can provide. The aim of this paper is precisely to fill that gap.
At the core of computing abductive explanations lies the complexity of reasoning about the implicants of a formula. The dual-rail encoding (Bryant et al., 1987) has already been used to generate or enumerate selected implicants of a formula (Manquinho et al., 1997; Palopoli, Pirri, and Pizzuti, 1999; Jabbour et al., 2014; Previti et al., 2015), but we believe that its full potential has not yet been explored. In particular, we show that a proper representation of the dual-rail encoding of a classifier can be used to efficiently compute several hard explanations, such as shortest abductive explanations, preferred abductive explanations or coverage-based explanations in the presence of domain constraints (Cooper and Amgoud, 2023). We also show that the dual-rail of a CNF can be easily represented as another CNF, which allows us to use existing knowledge compilers as-is. Finally, we measure experimentally the complexity gap between compiling the original function and its dual-rail.
Outline. We first review related works in Section 2. We define preliminary notions on boolean functions, knowledge compilation and XAI queries in Section 3. We define the dual-rail encoding in 4 and demonstrate its potential for solving hard XAI queries in Section 5. We discuss how to compile dual-rail encodings into tractable representations in Section 6 and test this approach experimentally in Section 7. Finally, we conclude our paper and discuss future research directions in Section 8.
The dual-rail encoding (Bryant et al., 1987) has already been used to generate or enumerate selected prime implicants of a formula (Palopoli, Pirri, and Pizzuti, 1999; Manquinho et al., 1997; Jabbour et al., 2014; Previti et al., 2015). However, dual-rail encodings are typically paired with SAT oracles or integer linear programming solvers rather than compiled into a tractable representation, as we explore in this paper. Moreover, we show that the range of queries they support go beyond what they have been used for so far, notably regarding XAI queries.
3 Preliminaries
For a positive integer , we denote by the set of integers . Given any set or vector indexed by and a subset of indexes, we note the set the set of elements of index in .
Terms and instances. We assume a set of boolean variables . A literal on a variable is either or . We also note the literal opposite to . A term is a set of consistent literals (it does not contain a literal and its opposite). The set of literals (resp. terms) on is noted (resp. terms()). For any two terms and , if we say that is a sub-term of or equivalently that is an extension of . Two terms are consistent if they agree on mutual variables. An instance is a term that contains one literal for each variable. We note the set of variables featured in . The set of all instances on is noted . A instance is equivalently viewed as a boolean vector or a set of literals such that (resp. ) iff contains the literal (resp. ). The size (resp. cardinality) of a term is its number of literals (resp. positive literals).
Boolean functions. A boolean function on is a function . An instance is called a model of iff . An implicant of is a term such that any extension of is a model of . The set of models (resp. implicants) of is noted (resp. ). A boolean function is said consistent if it has at least one model and is said inconsistent otherwise. We also note to indicate that a term is an implicant of . An implicant is if none of its strict sub-terms is also an implicant. Given two boolean functions and , we say that implies , noted , iff any model of is a model of (i.e., ). We follow standard definitions and notations for the negation, conjunction or disjunction of boolean functions using the symbols , and . The conditioning of on a term is noted .
Knowledge compilation. A representation language L defines a syntax for writing boolean functions as strings of symbols. We provide below rudimentary definitions for boolean circuits and binary decision diagrams.
Definition 1 (Boolean circuits). A boolean circuit in Negation Normal Form (NNF) (Darwiche and Marquis, 2002) is a labeled directed acyclic graph where each leaf node is labeled with , a variable or its negation and internal nodes are labeled with logical connectives or . For implicitity we assume w.l.o.g. that each internal node has exactly two children noted and . Its size is its number of edges. Semantics of boolean circuits follow the usual semantics of logical connectors and . A -node is decomposable if its children do not share variables. A NNF circuit is in Decomposable Negation Normal Form (DNNF) iff all of its -nodes are decomposable. A -node is deterministic if its children are inconsistent. A DNNF circuit is in deterministic Decomposable Negation Normal Form (d-DNNF) iff all of its -nodes are deterministic. A vtree over is a full, rooted, binary tree whose leaves are in one-to-one correspondence with . For any node , we node and its two children. A DNNF respects a vtree iff for any -node in there is a node such that and . The class of structured DNNF (resp. d-DNNF) is noted SDNNF (resp. d-SDNNF).
Definition 2 (Ordered Binary Decision Diagrams). A binary decision diagram (BDD) is a labeled directed acyclic graph with two leaf nodes labeled and . Each internal node is labeled with a variable in and has two outgoing edges labeled 0 and 1. A path in is an accepting path for an instance if its last node is labeled and for every internal node labeled with variable in , the outgoing edge labeled 1 (resp. 0) is in if (resp. if ). A model of is an instance with at least one accepting path. A free binary decision diagram (FBDD) is a BDD where any variable appears at most once in any path from the root to a leaf. An binary decision diagram respects an order on variables iff for any two variables and such that precedes in a path of , then . An ordered binary decision diagram (OBDD) is a BDD that respects any order. Notice that an OBDD is necessarily a FBDD.
Throughout the paper, a formula will be conflated with the boolean function it represents. Its size is noted and any notation introduced for boolean function is extended to formulas. We assume the reader is familiar with the standard subsets of Negation Normal Form (NNF) formulas listed in Table 1 and refer to (Darwiche and Marquis, 2002; Amarilli et al., 2020) or supplementary materials for more details. Knowledge compilation (Darwiche and Marquis, 2002) provides a strategy to deal with the intractability of propositional reasoning: a formula in a general representation language (e.g. CNF) is compiled into a representation in a tractable language (e.g. OBDD) for which desired queries can be answered in polynomial time. Therefore, given any concrete representation language for boolean functions, one is interested in the list of queries or transformations that can be performed on a formula in time polynomial in . Standard queries include deciding if the formula is consistent or valid (all instances are models), deciding if the formula implies a given clause or is implied by a given term, counting or enumerating the models of the formula. Standard transformations include conditioning the formula on a set of literals, computing the conjunction or disjunction of two formulas in .
XAI queries. All XAI queries considered in this paper are build around the concept of an abductive explanation.
Definition 3. Let and such that (resp. ), an abductive explanation for the decision is an implicant of (resp. ) that is consistent with . The set of abductive explanations for a model of is noted .
| Acronym | Name |
|---|---|
| CNF | Conjunctive Normal Form |
| d-DNNF | Deterministic Decomposable NNF |
| dec-DNNF | Decision Decomposable NNF |
| OBDD | Ordered Binary Decision Diagram |
Table 1: Standard representation languages.
To avoid the redundancy of abductive explanations, one can select minimal abductive explanations. The minimality criterion can either be a general minimality principle (such as size or subset minimality) or can be defined to model the preferences the explainee. A sufficient reason (or prime-implicant explanation) is a subset-minimal abductive explanation. A shortest reason is an abductive explanation that has minimal size. Notice that a shortest reason is necessarily a sufficient reason.
Preferences of the explainee can be represented both quantitatively, as an additive dis-utility function over variables, or qualitatively, as a stratification of variables from the least useful to the most useful.
Definition 4. Let be a vector of weights on variables, the dis-utility of an explanation is the sum of the weights over variables featured in the explanation, i.e., . An optimal explanation with respect to is one that minimizes its dis-utility.
Definition 5. Let form a stratified partition of , an explanation is shorter to an explanation with respect to , noted , iff its stratified size is shorter following a lexicographic order, i.e., :
A shortest explanation with respect to a stratification is one that is minimal for .
Remark 1. A subset-minimal explanation based on stratified preferences is defined in (Audemard et al., 2022).
Example 1. Let be a propositional formula in CNF. Instance is one of the 5 models of . The set of abductive explanations for is , among which two are sufficient reasons (i.e., ) and only one is a shortest reason (i.e., ). The optimal explanation with respect to dis-utility scores is while the shorter explanation with respect to stratified preferences is .
| Acronym | Description |
|---|---|
| Optimization | |
| MMM | Finds a minimum weight model |
| MPE | Finds a most probable model |
| SSM | Finds a shortest model with respect to stratified preferences |
| ST | Finds a shortest term in any predicate pred (trivial for mods) |
| Counting | |
| CT | Counts the models of |
| CTC | Counts the models of of cardinality for any |
| Enumeration | |
| Enum | Enumerate the models of |
| Transformations | |
| CD | Conditions on a given term |
| BC | Computes the conjunction of two formulas and |
Table 2: Acronym of queries and their descriptions.
Algebraic model counting. Algebraic model counting is an abstract framework introduced in Kimmig, Van den Broeck, and De Raedt (2017) that generalizes many counting and optimization queries on boolean functions based on a sum of products computation over models with suitable operators from a semiring structure.
Definition 6. A (commutative) semiring is a structure where:
-
addition is an associative and commutative binary operation over
-
multiplication is an associative binary operation over
-
distributes over
-
is the neutral element of
-
is the neutral element of
-
is an annihilator for
In a commutative semiring is also commutative. An optimization semiring is a semiring where is either max or min.
Given a formula , a commutative semiring and an attribution function , the solution to the algebraic model counting query is:
Fixing a specific semiring yields a specific query, which can be easier than general algebraic model counting. As we prove below, all counting and optimization problems described in Table 2 can be derived from algebraic model counting by choosing a specific semiring.
- Model counting (CT): counts the models of .
-
Semiring
-
Attribution function:
The associativity and commutativity of and are trivial, as for the distributivity of over .
Claim.
Proof. For any instance , we have:
Therefore:
□
- Model counting by cardinality (CTC): counts the models of of cardinality for any - Semiring with:
– Attribution function:
The associativity and commutativity of are trivial, as for the commutativity of .
Claim. is associative.
Proof. For any and :
Therefore:
Claim. distributes over .
Proof. For any and :
Therefore:
In other words: distributes over .
Claim. For any ,
where is the set of models of of cardinality k.
Proof. First, let us show that for any , we have .
For any
Notice that is equal to 1 iff m = i and k - m = j. This happens only once if k = i + j in m = i and cannot happen if . Thus .
In particular, for any instance , every positive literal in mapped to increases the by 1 and negative literals mapped to do not impact the . Hence, where is the cardinality of .
Therefore, for any :
where 1 is the indicator function that returns 1 when the input is true and 0 otherwise.
• Minimum Weight Model (MWM): finds a minimum weight model.
– Semiring where and for any
– Attribution function:
The associativity and commutativity of min and + are trivial, as for the distributivity of + over min. It comes directly from the definition of the semiring that:
• Most Probable Explanation (MPE): finds a most probable model.
– Semiring ([0,1], max, ×, 0,1)
– Attribution function:
The associativity and commutativity of max and are trivial, as for the distributivity of over max. If we note for all , it comes directly that:
• Stratified Shortest Model (SSM): finds a shortest model with respect to stratified preferences defined by an ordered partition .
– Semiring with:
– Attribution function: iff
The associativity and commutativity of and are trivial, as for the distributivity of over . It comes directly from the definition of the semiring that query outputs a preferred with respect to the the stratified preferences defined by the ordered partition .
• Shortest Term (ST): Finds a shortest term in any predicate pred (trivial for mods).
– Semiring ( , )
– Attribution function:
The associativity and commutativity of min and + are trivial, as for the distributivity of + over min. It comes directly from the definition of the semiring that:
Instead of counting or optimizing on models, one may be interested in changing the base of the sum in Equation 2. Let us assume a predicate pred that defines a subset of terms based on an input formula (and potentially additional inputs ). We define the solution to the algebraic counting query as:
Every XAI query described earlier can be modeled as an algebraic counting query by changing the base of a query in Table 2 to a specific predicate from Table 3. For any query P in Table 2, we note the problem of computing based on predicate pred for any input formula , attribution function and additional input . Additionally, we note the problem of enumerating the terms in for any and .
| Predicate | Description |
|---|---|
| Models of | |
| Implicants of | |
| Prime implicants of | |
| Abductive explanations for a model of | |
| Sufficient reasons for a model of |
Table 3: Considered predicates and their descriptions.
Example 2. The query computes a shortest implicant of an OBDD. The query counts the number of abductive explanations of a given model of an OBDD. The query enumerates the sufficient reasons for any model of an OBDD.

Figure 1: Reductions between algebraic counting queries: an arrow indicates that can be reduced to .
Moreover, these queries can be organized in a lattice of reductions displayed on Figure 1.
Claim. All reductions displayed on Figure 1 are true for any predicate pred and representation language L.
Proof. We prove a reduction by showing that any attribution function on the semiring of can be translated in polynomial time into an attribution function on the semiring of such that
for any predicate pred.
Since this reduction does not depend on L, it remains true for any choice of representation language used for .
-
The reducibility of queries CTC and MWM to AMC comes directly from the selection of a specific semiring and set of attribution functions.
-
CT CTC: simply sum the counts over all cardinal to get the total count .
-
MPE MWM: given an attribution function for MPE, we note for . Then, set the attribution function to:
with .
We have:
- SSM MWM: given a partition , we fix the attribution function:
For any terms , we have:
-
ST SSM: fix the partition .
-
ST MPE: fix the attribution function , we have:
4 Dual-rail encoding
In this section, we formally define the dual-rail encoding and detail its key properties. We assume that is a boolean function on boolean variables . We define the set of literal variables as . Terms and instances on are noted and respectively. A term or an instance on is said pure iff it satisfies . For any pure term on , we note the term on that contains the literal (resp. ) iff contains the literal (resp. ). Reciprocally, for any term on , we note the pure term on that contains the literal (resp. ) iff contains the literal (resp. ). Additionally, for any term on , we note the instance on where every unassigned variable in has been assigned to 0. We can easily see that the function mapping each pure instance on to the term on is bijective. Its inverse maps every term on to the pure instance on .
Example 3. Consider the term on . Transposing to the literal domain yields . Extending to form a pure instance yields .
We can now define the dual-rail encoding of a boolean function.
Definition 7. The dual-rail encoding of , noted , is the boolean function on such that:
It is well and uniquely defined since Equation 12 constrains models of to be pure and Equation 13 imposes a correspondence between the models of and the implicants of .
Example 4 (Example 1 cont'ed). Let be the dual-rail encoding of . The model of corresponding to the implicant is as defined in Example 3.
Given a model of , we would like to filter implicants of to only select those that are consistent with , i.e., abductive explanations for .
Definition 8. Given a model of , we note the boolean function based on selector variables such that:
where is the term composed of literals such that .
Lemma 1. The function is monotone.
Proof. Let us assume two instances on such that , we have:
Therefore, is monotone.
Theorem 2. Prime implicants of correspond to sufficient reasons for the decision .
Proof. By monotonicity, a prime implicant of is a set of positive literals. We note the term on composed of the literals from selected from . Then, is an abductive explanation for by definition of and is subset minimal because is: if a proper sub-term of is still an abductive explanation for , then the corresponding proper sub-term of is an implicant of , which is a contradiction. Therefore, prime implicants of are in bijection with sufficient reasons for the decision .
Example 5 (Example 1 cont'ed). Let be the same model as in Example 1. Then, has 3 models (resp. 2 prime implicants) corresponding to the 3 abductive explanations (resp. 2 sufficient reasons) for the decision . For example, corresponds to and corresponds to .
Theorem 3. Given a representation of in a language L that offers polynomial support for conditioning and a model , a representation of in L can be obtained in polynomial time in the size of .
Proof. First, we note the pure term on that contains the literal (resp. ) iff (resp. ). For any pure instance on , is a model of iff is consistent with . Therefore, conditioning on effectively restricts the set of considered implicants to the abductive explanations for . Finally, remaining variables are renamed to yield : any occurrence of a variable or in is replaced with the variable . Notice that for any both and cannot belong together in , therefore no two distinct variables are rename with the same variable in .
5 Solving hard queries using
Reasoning on implicants. Reasoning on the implicants of a boolean function is a hard computational task in general. Deciding if a term is an implicant of a propositional formula or a boolean circuit is coNP-complete. Furthermore, knowing if a 3-DNF has an implicant included in a given subset of its variables, a problem usually referred as QSAT, is -complete and a canonical problem of the second level of the polynomial hierarchy (Umans, 2001). Things become much simpler for d-DNNF and its subsets, where both finding a model and deciding if a term is an implicant can be done in polynomial time. Since a solution can be checked in polynomial time, many decision and optimization problems on implicants fall from to NP.
Amongst the XAI queries one might be interested to perform on the implicants of a formula, finding a shorter or optimal implicant based on explainee's preferences can be very useful. First, it provides a lower bound on the size of explanations for any model of the boolean function, which can be used as a measure of its explainability under the explainee's preferences. Secondly, optimal implicants under additive dis-utility functions can be used to emulate most probable abductive explanations of a decision taken by marginal inference on probabilistic inputs, for instance in neurosymbolic systems (Manhaeve et al., 2021).
We show in this section that most optimization queries on implicants remain NP-hard even when the input formula is represented as an OBDD, one of the most tractable subset of d-DNNF. This is for instance the case of the variant of QSAT based on OBDD, which we call QSAT[OBDD], as shown in (Colnet and Marquis, 2022).
Lemma 4 (Colnet and Marquis (2022)). Deciding if an OBDD has an implicant included in a subset of its variables is NP-hard.
We prove the hardness of finding a minimum size implicant of an OBDD by a reduction from QSAT[OBDD] to ST[OBDD], adapted from the reduction of QSAT to ST[BC] found in Umans (2001).
Theorem 5. Computing a shortest implicant of an OBDD (ST[OBDD]) is NP-hard.
Proof. Given a subset of variables , we assume w.l.o.g. that with . We create additional variables and define the formula:
If is provided as an OBDD, then an OBDD representation of can be computed in polynomial time.
On the one hand, notice that an implicant of must include all variables in to ensure that each constraint for is satisfied. Besides, an implicant of can be extracted by deleting the literals in . On the other hand, an implicant on can be completed to form an implicant of . Therefore, has an implicant included in iff has an implicant of size at most , which can be decided by a single ST[OBDD] query.
Therefore, QSAT[OBDD] can be reduced in polynomial time to ST[OBDD]. Since QSAT[OBDD] is NP-hard, this also proves that ST[OBDD] is NP-hard.
The combination of Theorem 5 with the reductions displayed on Figure 1 shows that any optimization query found in Table 2 made on implicants is NP-hard when is given as an OBDD.
Contrastingly, assuming a representation of that offers polynomial support for algebraic model counting, the correspondence between the models of and the implicants of allows us to answer any algebraic counting query on implicants.
Theorem 6. Answering any algebraic counting query on the implicants of a boolean function given a d-DNNF representation of can be done in polynomial time in .
Consequently, counting implicants or selecting a preferred implicant can be done in polynomial time.
Proof. The proof relies on the correspondence between the implicants of and the models of to create a reduction from to . Let us remind that given a semiring and an attribution function , the solution to the algebraic counting query (ims, ) is:
Let us note such that:
Notice that for any pure instance on :
Since the models of are pure by definition and correspond exactly to the implicants of , we have:
Therefore, if a d-DNNF representation of is provided, can be computed in polynomial time.
Preferred abductive explanations. Instead of reasoning on all implicants of a function, computing specific abductive explanations only requires to reason about implicants that are consistent with a given input instance. The set of considered implicants being restricted, one might expect queries to be easier. Unfortunately, as for computing a shorter implicant, computing a shorter reason for a decision remains hard, even for an OBDD representation of .
Lemma 7. Given an undirected graph where , we can construct in polynomial time an OBDD of size such that:
-
is a model of
-
a subset of variables is a vertex cover of iff is a weak abductive explanation for
Proof. The proof of this Lemma is adapted from the reduction of enumerating minimal hypergraph transversals to enumerating sufficient reasons of an OBDD (Colnet and Marquis, 2022).
Assume an undirected graph where and . For each edge , we note the instance on boolean variables such that if and 0 otherwise. We define the function on variables such that and we note for . Notice that is a model of iff or . Therefore we have:
In other words, the set of negative implicates of (i.e., which only contains negative literals) correspond to vertex covers of . It is known by duality that the implicants of are exactly the negations of the implicates of . Since the negation of a negative clause is a positive term, we have:
Besides, notice that is a model of (the set to which it corresponds is clearly a vertex cover of ). Therefore, positive implicants of correspond exactly to weak abductive explanations of . Hence, a subset of variables is a vertex cover of iff is a weak abductive explanation of .
Finally, since has at most a quadratic number of models, it can be compiled in polynomial time into an OBDD, which then can be negated in polynomial time to yield an OBDD representing .
Reasoning about the vertex covers of a graph is notoriously hard. In particular, finding a minimum size vertex cover belongs to the list of canonical NP-hard optimization problems mentioned in (Karp, 1972). Therefore, the correspondence proven in Lemma 7 directly provides a proof of NP-hardness for finding a minimum size sufficient reason.
Corollary 8. Computing a shortest abductive explanation for any model of an OBDD (ST_{axp}[OBDD]) is NP-hard.
Proof. The proof works by reduction from the minimum size vertex cover (MVC) problem. For any undirected graph where and , build an OBDD as defined in Lemma 7. The set of vertex covers of corresponds exactly to the set of abductive explanations of . Moreover, the size of a vertex cover is exactly that of its corresponding sufficient reason. Therefore, finding a minimum size vertex cover can be reduced to finding a minimum size sufficient reason for . Since MVC is NP-hard, then ST_{srs}[OBDD] is also NP-hard.
Similarly to reasoning on implicants, any query that can be reduced to ST_{axp}[OBDD] in Figure 1 is therefore NP-hard as well on abductive explanations when the input formula is given as an OBDD.
Again, assuming a representation of that offers polynomial support for algebraic model counting and conditioning, the transformation from to proven in Theorem 3 and the correspondence between the models of and the abductive explanations for allows us to answer any algebraic counting query on implicants.
Theorem 9. Answering any algebraic counting query on the abductive explanations of a model of a boolean function given a d-DNNF representation of can be done in polynomial time in .
Proof. We first use Theorem 3 to compute a d-DNNF representation of from . The rest of the proof is identical to that of Theorem 6 by replacing with and with .
Enumeration. Similarly to optimization queries, enumeration queries do not become easier when the set to enumerate shrinks from all prime implicants to prime implicants explanations of a specific model. Indeed, Colnet and Marquis (2022) showed that enumerating prime implicants of a dec-DNNF (Enum_{pips}[dec-DNNF]) can be done with incremental polynomial delay. In contrast, it showed that enumerating the prime implicant explanations of an arbitrary model of an OBDD (Enum_{srs}[OBDD]) is at least as hard as enumerating the minimal transversals of a hypergraph, an enumeration problem whose membership to OutputP is a longstanding open question in complexity theory.
We prove below that the enumeration of sufficient reasons can be done with incremental polynomial delay provided an adequate representation of the dual-rail encoding.
Theorem 10. Enumerating the sufficient reasons for any model of a boolean function given a dec-DNNF representation of can be done with incremental polynomial delay in .
Proof. The result comes directly from Theorems 2 and 3 combined with the enumeration algorithm for the prime implicants of a dec-DNNF with incremental polynomial delay proved in Colnet and Marquis (2022).
Shapley values. Shapley values are a staple in the XAI literature (Létoffé, Huang, and Marques-Silva, 2025), although some of their limits have been pointed out (Huang and Marques-Silva, 2023; Marques-Silva and Huang, 2024). Recently (Willot, 2025) introduced a new Shapley value where the contribution of a coalition is based on abductive explanations: the score of the coalition is 1 if selected literals form an abductive explanation for the decision, and 0 otherwise.
Definition 9. Given a boolean function and one of its model , the abductive Shapley value of a variable in the decision is:
A decomposition of the abductive Shapley value, similar to the one used on the standard Shapley value in (Arenas et al., 2021), shows that it can be computed if one has access to the number of abductive explanations of size that include (resp. do not include) variable . As such counts can be computed in polynomial time given a d-DNNF representation of , so can the abductive Shapley value.
Theorem 11. Given a d-DNNF representing and a model of , one can compute the Shapley value of a variable in the decision for any in polynomial time.
Proof. Let us note the number of abductive explanations of size and the number of abductive explanations of size that include variable . Notice that the number of abductive explanations of size that do not include variable is given by . We then have the following decomposition:
Hence, we can compute the abductive Shapley value if we have access to the counts and .
Notice that the cardinality of a model of is equal to the size of its corresponding abductive explanation . Therefore, computing the counts (resp. ) for strictly corresponds to solving CTC on (resp. ). Since a d-DNNF representation of can be derived from in polynomial time (see Theorem 3), then counting and can be done in polynomial time.
Finally, we can compute the abductive Shapley value in polynomial time in the size of .
Although we do not know of a formal proof of #P-hardness on this specific Shapley value, the following observation regarding the complexity of counting abductive explanations ensures that the method used in the proof of Theorem 11 is out of reach even for an OBDD representation of .
Theorem 12. Given an OBDD and one of its model , counting abductive explanations of ( is #P-hard.
Proof. Similarly to the proof of Corollary 8, this proof works by reduction from the problem #VC of counting the vertex covers of a graph, a canonical #P-hard problem (Valiant, 1979). For a given graph , we build as earlier an OBDD such that the abductive explanations of the model are in one-to-one correspondence with the set of vertex covers of . Therefore, counting the vertex cover of a graph can be reduced to counting the abductive explanations for a model of an OBDD. Therefore, we have proven that counting the abductive explanations for a model of an OBDD is #P-hard.
Coverage-based explanations. Most explanation queries are designed under the hypothesis of variable independence. However, it is not uncommon for input variables to be tied to each other through a set of constraints that discards a subset of instances. Ignoring these input constraints can lead to superfluous and redundant explanations (Gorji and Rubin, 2022; Cooper and Amgoud, 2023). Therefore, new definitions of abductive explanations under constraints were introduced to cope with that phenomenon. In this section, we show how dual-rail encodings can help computing coverage-based explanations introduced in Cooper and Amgoud (2023).
For two boolean function and , the coverage-based explanations of a model of under the input constraints is defined as follows.
Definition 10. A weak abductive explanation for a model of under constraints (wAXpc) is a sufficient reason for .
The coverage of a wAXpc with respect to is:
The neighborhood of with respect to is the set of literals that are a direct consequence of under :
A coverage-based PI-explanation for a model of under constraints (CPI-Xp) is a wAXpc such that no other wAXpc has a strictly larger coverage with respect to .
It was shown in Cooper and Amgoud (2023) that computing a CPI-Xp for the decision under constraints can be done with a polynomial number of calls to an oracle that decides given a wAXpc if it is a CPI-Xp or not. We prove below that this test can be decided in polynomial time if we have access to representations of and that share a common structure.
Definition 11. A subset of variables from is balanced if it contains exactly one variable between and for every . Let and be two vtrees on variables sets and respectively. We say that is the base of if for any balanced subset of variables , where any variable or in is viewed as in .
By definition, if is a structured d-DNNF on respecting a vtree of base , then for any instance , as defined in the proof of Theorem 3 is a structured d-DNNF respecting (where any variable or is viewed as in ).
We start with several observations before proving our main result.
Lemma 13. Given two wAXpc t and h of under g:
Proof. ( ) Let us assume that and contains a literal . Let us note the negation of the literal . Since is a wAXpc for under : . Thus we also have: . We now reason on the size of .
- if , then . Hence, we have:
Which is in contradiction with .
- if , let us note . We have and since and . Which is in contradiction with .
Therefore we have:
() Let us assume that . Then, for any we have:
Hence, in particular, .
Therefore we have:
Corollary 14. A wAXpc t is a CPI-Xp iff for any wAXpc :
□
Proof. We prove the contrapositive: a wAXpc is not a CPI-Xp iff there is a wAXpc such that .
First, if is not a CPI-Xp, then there is another wAXpc such that . By Lemma 13 we have that .
Now, if there is a wAXpc such that . By Lemma 13 we have that , therefore is not a CPI-Xp.
Corollary 15. A wAXpc is a CPI-Xp iff:
Proof. First, by union over all wAXpc in , Corollary 14 becomes: is a CPI-Xp iff:
Since and is a wAXpc, the condition can be relaxed to:
Based on the definition of the coverage and switching from reasoning on models to reason about boolean formulas, the condition becomes:
Since appears on both sides, the condition can be simplified to yield:
Therefore, if we can build a representation of that supports conditioning and consistency checks in polynomial time, then each literal in can be tested and we can decide in polynomial time if is a CPI-Xp. We show below that this can be done if we have access to structured representations of and that share a common base.
Theorem 16. Given a structured d-DNNF representation of respecting a vtree of base , a structured d-DNNF representation of respecting , a model , and a wAXpc for under , one can decide in polynomial time in if is a CPI-Xp or not.
Proof. The decision process has the following steps:
-
Check if is consistent, if not then has no coverage and is not a CPI-Xp.
-
Greedily compute the set using : for each literal , iff is inconsistent.
-
Restrict the abductive explanations represented by by conditioning on all literals not in (as in Theorem 3 for the literals in a model):
-
If we replace in occurrences of the remaining variable or in with the variable , we retrieve a formula equivalent to which represents wAXpc included in .
-
However, if we replace in occurrences of (resp. ) by (resp. ) if (resp. ), then an instance is a model of the re-written iff it is consistent with a wAXPc in .
-
We can then compute which can be done in polynomial time since both and respect the vtree
-
Model of exactly correspond to extensions of a wAXPc included in that are consistent with , i.e.,
- Finally test if : if it does, then is a CPI-Xp, if not it is not.
6 Compiling
Every tractability theorem proved in Section 5 relies on the availability of a compiled representation of in a suitable language such as d-DNNF, dec-DNNF or sd-DNNF. Most knowledge compilers work on input formulas written as CNF. Since the dual-rail encoding of a CNF can be easily represented as a CNF formula itself (Previti et al., 2015), existing knowledge compilers can be used as they stand.
Lemma 17. Given an input CNF, a CNF representation of its dual-rail encoding can be computed in linear time.
Proof. Given a CNF , we note:
First, is trivially in CNF. It has a size linear in that of since every clause keeps the same size and the added constraint has a size linear in . It can be computed in linear time by renaming variables in the input CNF and adding a linear constraint .
All models of are pure since is straightforward.
Finally, let us assume a model and prove that is an implicant of . For any clause , we have: which means that and have at least a literal in common. Hence, and have at least the literal in common, which means that . Since this is true for all , we have:
Therefore, is a linear size CNF representation of and can be computed in linear time.
More importantly, the CNF representation of the dual-rail encoding preserves most of the structure of the original CNF.
Theorem 18. Let be a CNF on and be its dual-rail encoding in CNF. Let be a width measure between incidence/primal tree-width/path-width, we have:
Proof. Any tree-decomposition of the primal (res. incidence) hypergraph of can be turned into a tree-decomposition of the primal (res. incidence) hypergraph of by replacing every variable by the pair of variables , which only doubles the size of the decomposition.

(a) Number of solved instances, timeouts, and memory-outs.

(b) Compilation time (s), per instance.

(c) Size of the d-DNNF (number of edges).
Figure 2: Comparison of d4 (compiling the CNF) and d4 (compiling its dual-rail encoding). In the scatter plots (b) and (c), each dot is an instance, the x-axis reports d4 and the y-axis d4; instances solved only by d4 are pinpointed on the plots.
Based on this observation, every theorem in Section 5 that offers polynomial support for XAI queries based on a compiled representation of can be turned into a fixed-parameter tractable algorithm for CNF based on a standard width parameter.
7 Experiments
In order to evaluate the impact of the dual-rail encoding on the compilation time and the size of a representation that allows explainability queries to be answered in polynomial time, we rely on benchmarks suited for knowledge compilation. More precisely, our evaluation uses the benchmarks from Lagniez and Lonca (2025). All experiments were conducted on a cluster equipped with Intel® Xeon® E5-2643 v4 CPUs (3.30 GHz) running Rocky Linux 9.5 (kernel 5.14). For each compilation, we set a time limit of 3600 seconds and a memory limit of 32 GB per instance. We implement the dual-rail mechanism on top of the d4 compiler Lagniez and Marquis (2017). We compare two approaches: the baseline, denoted d4, which compiles the input CNF formula directly, and our method, dual-rail d4 (denoted d4), which first transforms the CNF using the dual-rail encoding and then compiles the resulting formula with d4. To ease reproducibility, the supplementary material provides the statically compiled binary used to run the experiments, together with the raw benchmark logs and the scripts that regenerate the figures reported below.
Figure 2 summarizes our results. Figure 2a reports, for each approach, the number of solved instances, timeouts, and memory-outs. d4 solves 1355 instances, with 31 timeouts and 59 memory-outs, whereas d4 solves 1237 instances, with 37 timeouts and 171 memory-outs. As expected, d4 solves fewer instances than d4: it produces a richer representation that supports queries which cannot be answered from the plain CNF compilation. The main bottleneck is memory consumption, as witnessed by the substantially larger number of memory-outs.
Figure 2b is a scatter plot comparing the compilation time of the two approaches, each dot being an instance, with d4 on the x-axis and d4 on the y-axis; instances solved only by d4 are pinpointed. Although d4 is slower, handling the additional queries typically increases the compilation time by about one order of magnitude. This overhead is paid offline, once, and is largely compensated by the fact that the resulting representation answers in polynomial time queries that are NP-hard without the dual-rail encoding.
Figure 2c uses the same axis convention to compare the size of the d-DNNF produced by the two approaches, measured as the number of edges. The dual-rail encoding generally increases the size of the d-DNNF, but the growth remains manageable: queries are then answered in polynomial time on this structure, whereas they cannot be handled in general on the compilation of the plain CNF.
https://zenodo.org/records/15837216
8 Conclusion
The contributions of the paper are two-folds. First, we prove the hardness of a several XAI queries even for an OBDD representation of the classifier , one of the most tractable language in the knowledge compilation map. Then, we demonstrate the potential of the dual-rail encoding for answering these queries: we proved for instance that a d-DNNF representation of the dual-rail can answer any algebraic counting query on implicants or abductive explanations for positive decisions. Included as special cases are finding a preferred abductive explanation with respect to quantified or stratified preferences or counting abductive explanations to compute a new Shapley value based on abduction. Moreover, we showed that a dec-DNNF representation of the dual-rail provides an enumeration algorithm for the sufficient reasons of positive decisions with incremental polynomial delay. Finally, sharing structure between the representations of the dual-rail and domain constraints allows us to compute coverage-based explanations.
Future research directions included a thorough experimental analysis of the runtimes of computing explanations based on a compiled dual-rail representation and a comparison with solver or oracle based solutions. In particular, the impact of compilation on enumeration delays is a promising use-case. Exploring compilation of the dual-rail for non-clausal formulas is also an interesting avenue of research.
References
Amarilli, A.; Capelli, F.; Monet, M.; and Senellart, P. 2020. Connecting Knowledge Compilation Classes Width Parameters. Theory of Computing Systems, 64(5): 861–914.
Arenas, M.; Barceló, P.; Bertossi, L.; and Monet, M. 2021. The Tractability of SHAP-Score-Based Explanations for Classification over Deterministic and Decomposable Boolean Circuits. Proceedings of the AAAI Conference on Artificial Intelligence, 35(8): 6670–6678.
Audemard, G.; Bellart, S.; Bounia, L.; Koriche, F.; Lagniez, J.-M.; and Marquis, P. 2021. On the Computational Intelligibility of Boolean Classifiers. Proceedings of the International Conference on Principles of Knowledge Representation and Reasoning, 18(1): 74–86. Conference Name: Proceedings of the 18th International Conference on Principles of Knowledge Representation and Reasoning.
Audemard, G.; Bellart, S.; Bounia, L.; Koriche, F.; Lagniez, J.-M.; and Marquis, P. 2022. On Preferred Abductive Explanations for Decision Trees and Random Forests. In Electronic proceedings of IJCAI 2022, volume 1, 643–650.
Audemard, G.; Koriche, F.; and Marquis, P. 2020. On Tractable XAI Queries based on Compiled Representations. Proceedings of the International Conference on Principles of Knowledge Representation and Reasoning, 17(1): 838–849. Conference Name: Proceedings of the 17th International Conference on Principles of Knowledge Representation and Reasoning.
Audemard, G.; Lagniez, J.-M.; and Marquis, P. 2024. On the Computation of Contrastive Explanations for Boosted Regression Trees. In The 27th European Conference on Artificial Intelligence. Santiago de Compostela, Spain.
Audemard, G.; Lagniez, J.-M.; Marquis, P.; and Szczepanski, N. 2024. Deriving Provably Correct Explanations for Decision Trees: The Impact of Domain Theories. volume 5, 3688–3696.
Bounia, L.; Goliot, M.; and Chafik, A. 2023. Impact of Weight Functions on Preferred Abductive Explanations for Decision Trees. In ICCBR Workshops, 158–171.
Bounia, L.; and Setitra, I. 2025. Enhancing the intelligibility of decision trees with concise and reliable probabilistic explanations. Data & Knowledge Engineering, 156: 102394.
Bryant, R. E.; Beatty, D.; Brace, K.; Cho, K.; and Sheffler, T. 1987. COSMOS: a compiled simulator for MOS circuits. In Proceedings of the 24th ACM/IEEE Design Automation Conference, DAC '87, 9–16. New York, NY, USA: Association for Computing Machinery. ISBN 978-0-8186-0781-3.
Colnet, A. d.; and Marquis, P. 2022. On the Complexity of Enumerating Prime Implicants from Decision-DNNF Circuits. In Electronic proceedings of IJCAI 2022, volume 3, 2583–2590.
Cooper, M.; and Amgoud, L. 2023. Abductive Explanations of Classifiers under Constraints: Complexity and Properties. In ECAI 2023, 469–476. IOS Press.
Cooper, M. C.; and Marques-Silva, J. 2021. On the Tractability of Explaining Decisions of Classifiers. In Michel, L. D., ed., 27th International Conference on Principles and Practice of Constraint Programming (CP 2021), volume 210 of Leibniz International Proceedings in Informatics (LIPIcs), 21:1–21:18. Dagstuhl, Germany: Schloss Dagstuhl – Leibniz-Zentrum für Informatik. ISBN 978-3-95977-211-2.
Darwiche, A.; and Marquis, P. 2002. A knowledge compilation map. Journal of Artificial Intelligence Research, 17(1): 229–264.
Gorji, N.; and Rubin, S. 2022. Sufficient Reasons for Classifier Decisions in the Presence of Domain Constraints. Proceedings of the AAAI Conference on Artificial Intelligence, 36(5): 5660–5667.
Huang, X.; Izza, Y.; Ignatiev, A.; Cooper, M.; Asher, N.; and Marques-Silva, J. 2022. Tractable Explanations for d-DNNF Classifiers. Proceedings of the AAAI Conference on Artificial Intelligence, 36(5): 5719–5728.
Huang, X.; and Marques-Silva, J. 2023. The Inadequacy of Shapley Values for Explainability. ArXiv:2302.08160 [cs.LG].
Ignatiev, A.; Narodytska, N.; and Marques-Silva, J. 2019. Abduction-based explanations for Machine Learning models. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence and Thirty-First Innovative Applications of Artificial Intelligence Conference and Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, volume 33 of AAAI'19/IAAI'19/EAAI'19, 1511–1519. AAAI Press. ISBN 978-1-57735-809-1.
Jabbour, S.; Marques-Silva, J.; Sais, L.; and Salhi, Y. 2014. Enumerating Prime Implicants of Propositional Formulae in Conjunctive Normal Form. In Fermé, E.; and Leite, J., eds., Logics in Artificial Intelligence, 152–165. Cham: Springer International Publishing. ISBN 978-3-319-11558-0.
Karp, R. M. 1972. Reducibility among Combinatorial Problems. In Miller, R. E.; Thatcher, J. W.; and Bohlinger, J. D., eds., Complexity of Computer Computations: Proceedings of a symposium on the Complexity of Computer Computations, held March 20–22, 1972, at the IBM Thomas J. Watson Research Center, Yorktown Heights, New York, and sponsored by the Office of Naval Research, Mathematics Program, IBM World Trade Corporation, and the IBM Research Mathematical Sciences Department, The IBM Research Symposia Series, 85–103. Springer US. ISBN 978-1-4684-2001-2.
Kimmig, A.; Van den Broeck, G.; and De Raedt, L. 2017. Algebraic model counting. J. of Applied Logic, 22: 46–62.
Lagniez, J.; and Lonca, E. 2025. Enhancing Query Efficiency for D-DNNF Representations Through Preprocessing. In Casini, G.; Dundua, B.; and Kutsia, T., eds., Logics in Artificial Intelligence - 19th European Conference, JELIA 2025, Kutaisi, Georgia, September 1-4, 2025, Proceedings, Part II, volume 16094 of Lecture Notes in Computer Science, 125–140. Springer.
Lagniez, J.; and Marquis, P. 2017. An Improved Decision-DNNF Compiler. In Sierra, C., ed., Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, 667–673. ijcai.org.
Létoffé, O.; Huang, X.; and Marques-Silva, J. 2025. Towards Trustable SHAP Scores. Proceedings of the AAAI Conference on Artificial Intelligence, 39(17): 18198–18208.
Manhaeve, R.; Dumančić, S.; Kimmig, A.; Demeester, T.; and De Raedt, L. 2021. Neural probabilistic logic programming in DeepProbLog. Artificial Intelligence, 298: 103504.
Manquinho, V.; Flores, P.; Silva, J.; and Oliveira, A. 1997. Prime implicant computation using satisfiability algorithms. In Proceedings Ninth IEEE International Conference on Tools with Artificial Intelligence, 232–239. ISSN: 1082-3409.
Marques-Silva, J.; and Huang, X. 2024. Explainability Is Not a Game. Communications of the ACM, 67(7): 66–75.
Palopoli, L.; Pirri, F.; and Pizzuti, C. 1999. Algorithms for selective enumeration of prime implicants. Artificial Intelligence, 111(1): 41–72.
Previti, A.; Ignatiev, A.; Morgado, A.; and Marques-Silva, J. 2015. Prime compilation of non-clausal formulae. In Proceedings of the 24th International Conference on Artificial Intelligence, IJCAI'15, 1980–1987. AAAI Press. ISBN 9781577357384.
Shih, A.; Choi, A.; and Darwiche, A. 2018. A symbolic approach to explaining Bayesian network classifiers. In Proceedings of the 27th International Joint Conference on Artificial Intelligence, IJCAI'18, 5103–5111. Stockholm, Sweden: AAAI Press. ISBN 978-0-9992411-2-7.
Umans, C. 2001. The Minimum Equivalent DNF Problem and Shortest Implicants. Journal of Computer and System Sciences, 63(4): 597–611.
Valiant, L. G. 1979. The Complexity of Enumeration and Reliability Problems. SIAM Journal on Computing, 8(3): 410–421.
Willot, H. 2025. Lier la Valeur de Shapley, les Explications par Impliquants Premiers et Contrefactuelles: Analyse Théorique.