July 07, 2026
The XAI community has studied a wide range of queries and scores for explaining predictions of ML models. From a data management perspective, this proliferation of explanation notions calls for declarative query languages in which such notions can be specified, combined, and analyzed uniformly. In this paper, we develop such a framework for Boolean models. We first revisit \(\mathrm{\small FOIL}\), an interpretability query language for black-box models, and show that it has two fundamental limitations: it cannot express central optimality-based explanation queries, and its evaluation problem over decision trees is hard for every level of the polynomial hierarchy. We then introduce \(\mathrm{\small ExplAIner}\), a query language based on \(\mathrm{\small FOIL}\) with an extended vocabulary and a layered structure. We show that \(\mathrm{\small ExplAIner}\) can express a broad family of explanation notions, including abductive, contrastive, feature-based, and distance-based queries. We also prove that the evaluation problem for each query in \(\mathrm{\small ExplAIner}\) belongs to the Boolean hierarchy over every class of Boolean models for which some basic predicates can be evaluated in polynomial time. In particular, that property holds for deterministic and decomposable Boolean circuits. Finally, we introduce \(\mathrm{\small Opt-FOIL}\), an optimization-oriented fragment of \(\mathrm{\small ExplAIner}\) for computing explanations that are minimal with respect to strict partial orders, and prove that its evaluation problem is in \(\mathrm{FP}^{\mathrm{NP}}\) under the same tractability assumptions. These complexity results have a direct algorithmic consequence: a fixed ExplAIner query can be evaluated with a fixed number of calls to a SAT solver, while a notion of explanation specified in \(\mathrm{\small Opt-FOIL}\) can be computed with a polynomial number of such calls. This is particularly relevant in formal XAI, where SAT solvers have been successfully used to compute explanations for several classes of ML models.
The increasing use of machine learning (ML) models in decision-making systems has created a pressing need for principled methods to understand the predictions produced by such models. This need has led to a large body of work in explainable AI (XAI) [1]–[4], and in particular to a variety of queries, scores, and explanation notions aimed at identifying why a model classifies a given input in a particular way [5]–[7]. Examples include abductive explanations, contrastive explanations, counterfactual-style queries, and feature-necessity or feature-relevance notions [8]–[11].
From a data management perspective, this proliferation of explanation notions suggests a natural question: rather than designing a separate algorithm or formalism for each explanation task, can we develop a declarative language in which users specify what explanation they are looking for? This is in line with a long tradition in databases: complex computational tasks are exposed through query languages with well-defined syntax and semantics, while the study of their expressive power and evaluation complexity provides a principled understanding of what can be asked and how hard it is to answer [12]–[15]. In this view, a model becomes an object over which one poses queries, and explanation notions become fixed queries evaluated over that object [16], [17].
This perspective has several advantages. First, it provides a uniform framework for comparing and combining explanation notions. This is important because there is no single explanation concept that is best suited for all users, models, or applications; in many cases, the most informative explanation is obtained by combining several criteria [18], [19]. Second, it makes it possible to study explainability through standard database-theoretic lenses, such as expressiveness and evaluation complexity [12], [14], [20]. Third, it opens the door to the development of general optimization techniques for the operators of a query language for explainability. Such techniques can reduce the evaluation time of several explainability queries simultaneously, rather than treating each query in isolation.
A central issue in such a framework is how to measure the complexity of query evaluation. Since an explanation notion is intended to be specified by a fixed formula of the language, the appropriate measure is data complexity: the query is fixed, while the input consists of the model representation and the instance to be explained [14]. From this perspective, polynomial-time data complexity is desirable, but it is not the only meaningful tractability target. Many explanation tasks are inherently computationally demanding [21], [22], and therefore a useful explainability language should also allow controlled forms of non-polynomial complexity. In particular, data complexity in \(\mathrm{P}^{\mathrm{NP}}\) remains a reasonable and useful target: it corresponds to computation with a polynomial number of calls to an NP oracle, and it is compatible with the use of SAT solvers as evaluation engines. This complexity level is especially appropriate in our setting because the inputs are model representations, not database instances in the traditional sense. In contrast with large relational databases, the tree-based models commonly considered in formal explainability are often of moderate size, and SAT-based methods have been successfully used to compute explanations for such models [23]–[25]. Thus, in this paper we regard polynomial time and \(\mathrm{P}^{\mathrm{NP}}\) as desirable data-complexity bounds for an explainability query language.
A first step in this direction was taken by Arenas et al. [16], who introduced FOIL, a first-order interpretability logic for querying ML models. FOIL is model-agnostic: it treats a model as a black box and provides access to its positive instances together with the natural subsumption relation over partial instances. This simple design makes FOIL an appealing foundational language, and it is expressive enough to capture several basic explanation notions.
However, model-agnosticism also has limitations. If the language is too weak, it cannot express explanation concepts that are central in practice. If it is too unconstrained, its evaluation problem may become too complex to support query evaluation in the sense expected from a database-oriented framework. Thus, the challenge is to design a language that balances two requirements. On the one hand, it should be expressive enough to capture a broad family of explanation queries, including optimality-based notions such as minimum or maximum explanations. On the other hand, it should have well-behaved evaluation and computation problems over relevant classes of Boolean models.
In this paper, we address this challenge by developing a declarative framework for explaining Boolean models. Our setting is not tied to decision trees. Instead, we consider models abstractly as Boolean functions, while also studying concrete representation classes such as deterministic and decomposable Boolean circuits and decision trees. This allows us to separate the logical specification of explanation queries from the representation-dependent complexity of evaluating them. Such a separation is particularly natural from a database perspective, where query specification and query evaluation over different representation classes are treated as distinct but connected problems.
We begin by revisiting FOIL from the perspective of query-language design. We show that, despite its foundational role, FOIL does not satisfy the requirements above. First, FOIL lacks the expressive power needed to capture some natural optimality-based explanation notions. In particular, we prove that minimum abductive explanations cannot be expressed in FOIL, even when the underlying model is restricted to be a decision tree. This shows that the limitation is not caused by the use of complex model classes, but by the expressive resources of the language itself. Second, FOIL has high evaluation complexity. We prove that, for every level of the polynomial hierarchy, there is a fixed FOIL formula whose evaluation problem over decision trees is hard for that level. Thus, even on a class of models traditionally regarded as interpretable, unrestricted FOIL does not provide the kind of controlled data complexity that one would expect from a practical declarative language for explanations. This complements earlier complexity-theoretic approaches to model interpretability, which study the difficulty of answering explanation queries over different model classes [21], [22].
Motivated by these limitations, we introduce ExplAIner, a first-order logic designed to express explanation queries over Boolean models while retaining controlled evaluation complexity. The language extends the basic FOIL vocabulary with a relation that compares partial instances according to the number of defined features. This addition is essential for expressing optimality conditions based on cardinality, such as minimum abductive explanations [9], [21] and maximum contrastive explanations [8], [11].
ExplAIneris organized in layers. Its atomic layer captures structural properties of partial instances; its quantified layer allows formulas to refer to the behavior of the model by combining formulas from the atomic layer with the predicates \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\), which express whether all completions of a partial instance are classified positively or negatively; and its topmost layer permits Boolean combinations of explanation properties. This organization is designed to provide enough expressive power for explanation tasks while keeping evaluation under control.
We show that ExplAInercan express the explanation notions studied in this paper, including weak abductive explanations, abductive explanations, and minimum abductive explanations [8], [9], [21], [26]; weak contrastive explanations, contrastive explanations, and maximum contrastive explanations [7], [8], [21]; minimum change required and maximum change allowed [21]; and necessary features and relevant features [11], [27]. At the same time, we prove that the evaluation problem for ExplAInerbelongs to the Boolean hierarchy over every class of models for which the basic \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) checks are tractable. This includes decision trees and also richer representation classes with suitable tractability properties, such as deterministic and decomposable Boolean circuits [28], [29].
Evaluation is only one part of the problem. A language for explainability should also support the computation of explanations. For this reason, we introduce Opt-FOIL, an optimization-oriented fragment built from the quantified layer of ExplAInertogether with a minimization operator over definable strict partial orders.
Opt-FOILcaptures explanation tasks in which one seeks an object satisfying a logical specification and minimal with respect to a user-defined preference order. This includes standard subset-minimal explanations, cardinality-minimum explanations, and distance-based notions such as minimum change required. By changing the order, the same formalism can also express maximality-based notions, such as maximum contrastive explanations and maximum change allowed.
Our main computational result for Opt-FOILis that its computation problem belongs to \(\mathrm{FP}^{\mathrm{NP}}\) over every class of models for which \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be evaluated in polynomial time, where \(\mathrm{FP}\) is the class of functions that can be computed in polynomial time. In the terminology above, this means that computing explanations specified in Opt-FOILhas controlled data complexity: the formula is fixed, and the cost is measured as a function of the model representation and the input instance. This places Opt-FOILwithin the complexity regime identified above as suitable for declarative explainability languages, while allowing the language to capture optimization-based explanation tasks that are unlikely to admit polynomial-time algorithms in full generality.
The following are the technical contributions of the paper.
We prove two limitations of FOIL over decision trees. On the expressiveness side, we show that no FOIL formula can define the minimum abductive explanation query. On the complexity side, we prove that for every level \(\Sigma_k^P\) of the polynomial hierarchy, there is a fixed FOIL formula whose evaluation problem is \(\Sigma_k^P\)-hard.
We introduce ExplAIner, a logic based on FOILwith an extended vocabulary and a layered structure: the atomic layer, the quantified layer, and the full ExplAInerlayer. The vocabulary of ExplAInerconsists of the predicates \(\subseteq\), \(\preceq\), \(\mathsf{AllPos}\), and \(\mathsf{AllNeg}\), where \(\subseteq\) is the subsumption relation on partial instances and \(\preceq\) compares partial instances by their number of defined features. We show that both \(\subseteq\) and \(\preceq\) are necessary by proving that neither relation is first-order definable from the other over decision trees.
We show that ExplAIneris expressive enough to encode the explanation queries considered in the paper, including weak abductive explanations, subset-minimal abductive explanations, cardinality-minimum abductive explanations, weak and maximal contrastive explanations, minimum change required, maximum change allowed, necessary features, and relevant features. Each of these notions is expressed by a fixed query in ExplAIner.
We establish complexity bounds for the three layers of ExplAIner. First, we show that the evaluation problem for queries in the atomic layer can be solved in polynomial time over every class of Boolean models. Second, for every class of Boolean models over which the predicates \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be decided in polynomial time, we show that the evaluation problem for queries in the quantified layer is in \({\rm NP}\). Moreover, we show that there exists a query in the quantified layer whose evaluation problem is \({\rm NP}\)-complete over the class of decision trees. Third, for every class of Boolean models over which \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be decided in polynomial time, we show that the evaluation problem for ExplAInerqueries is in the Boolean hierarchy; equivalently, such queries can be evaluated with a fixed number of calls to an \({\rm NP}\) oracle. Furthermore, we show that for every level \({\rm BH}_k\) of the Boolean hierarchy, there exists an ExplAInerquery whose evaluation problem is \({\rm BH}_k\)-hard over the class of decision trees.
Importantly, the assumption that the predicates \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be decided in polynomial time is not specific to decision trees. This condition also holds for more general classes of Boolean models, including deterministic and decomposable Boolean circuits. Thus, the upper bounds above apply beyond tree-based representations and cover circuit classes that are central in knowledge compilation [28].
We define Opt-FOILas an optimization-oriented fragment of ExplAIner, based on the quantified layer together with a minimization operator over strict partial orders. For every class of Boolean models over which the predicates \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be decided in polynomial time, we show that the computation problem for Opt-FOILqueries is in \(\mathrm{FP}^{\mathrm{NP}}\). Hence, explanations specified in Opt-FOILcan be computed with a polynomial number of calls to an \({\rm NP}\) oracle.
As a result of independent interest, we use Presburger arithmetic to show that the problem of verifying whether a sentence over the atomic layer of ExplAIneris valid is decidable. This result is needed to provide an effective syntax for Opt-FOIL, since Opt-FOILrequires verifying that a sentence in the atomic layer defines a strict partial order.
Finally, we show that, under standard complexity-theoretic assumptions, Opt-FOILis strictly contained in ExplAIner, and ExplAIner is strictly contained in FOILover the extended vocabulary consisting of the predicates \(\subseteq\), \(\preceq\), \(\mathsf{AllPos}\), and \(\mathsf{AllNeg}\).
The remainder of the paper is organized as follows. Section 2 introduces the basic notions used throughout the paper, including Boolean models, partial instances, model representations, and the explanation queries studied in our framework. Section 3 revisits \(\mathrm{\small FOIL}\) and establishes its limitations in terms of expressiveness and evaluation complexity. Section 4 introduces ExplAInerand proves its main expressiveness and evaluation results. Section 5 presents Opt-FOIL, our optimization-oriented language for computing explanations, together with its computational guarantees. Section 6 presents concluding remarks and directions for future work. Finally, the appendix contains supplementary material, including technical proofs that are deferred for readability.
We begin by introducing the main components of our framework, followed by a review of various explainability queries that will be addressed in the subsequent sections.
We use an abstract notion of a model of dimension \(n\), and define it as a Boolean function \(\mathcal{M}: \{0,1\}^n \to \{0, 1\}\).1 We write \({\textit dim}(\mathcal{M})\) for the dimension of a model \(\mathcal{M}\). A partial instance of dimension \(n\) is a tuple \(\mathbf{e}\in \{0,1,\bot\}^n\), where \(\bot\) is used to represent undefined features. We define \(\mathbf{e}_\bot = \{i \in \{1,\dots,n\} \mid \mathbf{e}[i] = \bot\}\). An instance of dimension \(n\) is a tuple \(\mathbf{e}\in \{0,1\}^n\), that is, a partial instance without undefined features. For every instance \(\mathbf{e}\) of dimension \({\textit dim}(\mathcal{M})\), we write \(\mathcal{M}(\mathbf{e})\) for the value assigned by \(\mathcal{M}\) to \(\mathbf{e}\).
Given two partial instances \(\mathbf{e}\), \(\mathbf{e}'\) of dimension \(n\), we write \(\mathbf{e}\subseteq \mathbf{e}'\) and say that \(\mathbf{e}\) is subsumed by \(\mathbf{e}'\) if and only if, for every \(i \in \{1, \ldots, n\}\), whenever \(\mathbf{e}[i] \neq \bot\), we have \(\mathbf{e}[i] = \mathbf{e}'[i]\). In other words, \(\mathbf{e}'\) can be obtained from \(\mathbf{e}\) by replacing some occurrences of \(\bot\) by Boolean values. For example, \((1,\bot)\) is subsumed by \((1,0)\), but it is not subsumed by \((0,0)\). A partial instance \(\mathbf{e}\) can be seen as a compact representation of the set of instances \(\mathbf{e}'\) such that \(\mathbf{e}\) is subsumed by \(\mathbf{e}'\). Such instances \(\mathbf{e}'\) are called the completions of \(\mathbf{e}\) and the set of all of them is denoted by \(\textit{comp}(\mathbf{e})\).
For each \(n\), partial instances of dimension \(n\) are partitioned into \(n+1\) levels: for each \(i \in \{0, \ldots, n\}\), level \(i\) consists of all partial instances with exactly \(i\) defined features. Given partial instances \(\mathbf{e}\), \(\mathbf{e}'\), we write \(\mathbf{e}\preceq\mathbf{e}'\) and say that \(\mathbf{e}\) is on a less or equal level than \(\mathbf{e}'\) if and only if \(|\mathbf{e}_\bot| \geq |\mathbf{e}'_\bot|\). In other words, \(\mathbf{e}'\) has at least as many defined features as \(\mathbf{e}\).
We will also use the symbols \(\subset\) and \(\prec\) for the corresponding strict relations.
In several proofs, we write \(\mathbf{e}\cdot \mathbf{e}'\) for the concatenation of both instances. Moreover, for a value \(s \in \{0,1,\bot\}\), we denote by \(\{s\}^{n}\) the partial instance of dimension \(n\) whose entries are all equal to \(s\).
We next introduce several classes of Boolean functions that will be used throughout the paper.
A Boolean circuit of dimension \(n\) is a directed acyclic graph over a set of variables \(\{x_1, ..., x_n\}\) such that:
Every node without incoming edges is either a variable gate or a constant gate. A variable gate is labeled with a variable, and a constant gate is labeled with either \(0\) or \(1\);
Every node with incoming edges is a logic gate, and is labeled with a symbol \(\land\), \(\lor\) or \(\lnot\). If it is labeled with the symbol \(\lnot\), then it has exactly one incoming edge;
Exactly one node does not have any outgoing edges, and this node is called the output gate.
Given a Boolean circuit \(C\) and an instance \(\mathbf{e}\) of dimension \(n\), the value \(C(\mathbf{e})\) is defined as the value of the output gate of \(C\) when we evaluate \(C\) on input \(\mathbf{e}\). Note that we are identifying inputs of the circuit as instances of the Boolean model.
Several restrictions of Boolean circuits with good computational properties have been studied.
A negation normal form (\(\mathsf{NNF}\)) circuit of dimension \(n\) is a Boolean circuit of dimension \(n\) such that the incoming edge of every negation gate comes from a variable gate.
Let \(X\) be a set of variables, let \(C\) be a circuit over \(X\), and let \(g\) be a gate of \(C\). We define \(C_g\) to be the Boolean circuit over \(X\) induced by the set of gates \(g'\) of \(C\) for which there exists a directed path from \(g'\) to \(g\) in \(C\). Note that \(g\) is the output gate of \(C_g\). An \(\lor\)-gate \(g\) of \(C\) is said to be deterministic if, for every pair \(g_1\), \(g_2\) of distinct input gates of \(g\), there is no instance \(\mathbf{e}\) such that \(C_{g_1}(\mathbf{e}) = C_{g_2}(\mathbf{e}) = 1\). The circuit \(C\) is called deterministic if every \(\lor\)-gate of \(C\) is deterministic. For every gate \(g\) of \(C\), define \(\mathsf{var}(g)\) as the set of variables \(x \in X\) such that there exists a variable gate labeled by \(x\) in \(C_g\). An \(\land\)-gate \(g\) of \(C\) is said to be decomposable if for every pair \(g_1\), \(g_2\) of distinct input gates of \(g\), we have \(\mathsf{var}(g_1) \cap \mathsf{var}(g_2) = \emptyset\). The circuit \(C\) is called decomposable if every \(\land\)-gate of \(C\) is decomposable.
A deterministic decomposable negation normal form (\(\mathsf{d}\text{-}\mathsf{DNNF}\)) circuit of dimension \(n\) is an \(\mathsf{NNF}\) circuit of dimension \(n\) that is both deterministic and decomposable. An example is shown in [fig:ddnnf].
A binary decision diagram (\(\mathsf{BDD}\)) of dimension \(n\) is a directed acyclic graph with a unique root, and whose nodes and edges are labeled as follows: (i) every leaf is labeled by \(\mathbf{true}\) or \(\mathbf{false}\) and (ii) every non-leaf node is labeled by a feature in \(\{1, ..., n\}\) and has exactly two outgoing edges, one labeled by \(0\) and the other by \(1\).
Let \(B\) be a binary decision diagram and let \(\mathbf{e}\) be an instance of dimension \(n\). The value \(B(\mathbf{e})\) is defined as the Boolean value of the leaf obtained by starting at the root and following the path such that, at each non-leaf node labeled by \(i\), the outgoing edge labeled by \(\mathbf{e}[i]\) is chosen.
A decision tree (\(\mathsf{DTree}\)) over instances of dimension \(n\) is a binary decision diagram of dimension \(n\) such that (i) its underlying graph is a tree and (ii) no feature appears more than once on any root-to-leaf path. An example is shown in [fig:dtree].
We now define the explainability queries studied in this work.
Given an instance \(\mathbf{e}\) and a model \(\mathcal{M}\), a partial instance \(\mathbf{e}_1\) is a weak abductive explanation (\(\mathsf{wAXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if \(\mathbf{e}_1 \subseteq \mathbf{e}\) and, for every \(\mathbf{e}_2 \in \textit{comp}(\mathbf{e}_1)\), the condition \(\mathcal{M}(\mathbf{e})=\mathcal{M}(\mathbf{e}_2)\) holds [11]. This notion is also known as sufficient reason in the literature [32]. For example, in [fig:ddnnf], \((1,1,1,\bot)\) is a weak abductive explanation for the instance \((1,1,1,1)\).
Given a pair \((\mathbf{e},\mathcal{M})\), a partial instance \(\mathbf{e}_1\) is an abductive explanation (\(\mathsf{AXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if it is a weak abductive explanation for \(\mathbf{e}\) on \(\mathcal{M}\) and there is no weak abductive explanation \(\mathbf{e}_2\) such that \(\mathbf{e}_2 \subset \mathbf{e}_1\) [8]. This notion of explanation has been extensively studied and it can be found in the literature under names such as sufficient reason [9], [33], prime implicant [34], and minimal sufficient reason [32]. Modeling abduction using propositional logic or first-order logic, and the complexity of computing such an explanation has been studied for many decades [35]. In [fig:ddnnf], \((1,1,1,\bot)\) is a weak abductive explanation for \((1,1,1,1)\), but not an abductive explanation. By contrast, one can check that \((1,1,\bot,\bot)\) is indeed an abductive explanation.
Given a pair \((\mathbf{e},\mathcal{M})\), a partial instance \(\mathbf{e}_1\) is a minimum abductive explanation (\(\mathsf{mAXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if it is a weak abductive explanation for \(\mathbf{e}\) on \(\mathcal{M}\) and there is no weak abductive explanation \(\mathbf{e}_2\) such that \(\mathbf{e}_2 \prec\mathbf{e}_1\). Our definition is based on the minimum sufficient reason explainability query by [21] and [32]. In [fig:ddnnf], \((1,1,\bot,\bot)\) is also a minimum abductive explanation for \((1,1,1,1)\).
Given a pair \((\mathbf{e},\mathcal{M})\), the partial instance \(\mathbf{e}_1\) is a weak contrastive explanation (\(\mathsf{wCXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if \(\mathbf{e}_1 \subseteq \mathbf{e}\) and there is an instance \(\mathbf{e}_2 \in \textit{comp}(\mathbf{e}_1)\) such that the condition \(\mathcal{M}(\mathbf{e})\not =\mathcal{M}(\mathbf{e}_2)\) holds [6].
Given a pair \((\mathbf{e},\mathcal{M})\), the partial instance \(\mathbf{e}_1\) is a contrastive explanation (\(\mathsf{CXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if it is a weak contrastive explanation for \(\mathbf{e}\) on \(\mathcal{M}\) such that there is no weak contrastive explanation \(\mathbf{e}_2\) satisfying \(\mathbf{e}_1 \subset \mathbf{e}_2\). It can be shown that this definition is equivalent to the one by [6].
Given a pair \((\mathbf{e},\mathcal{M})\), the partial instance \(\mathbf{e}_1\) is a maximum contrastive explanation (\(\mathsf{mCXp}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if it is a weak contrastive explanation for \(\mathbf{e}\) on \(\mathcal{M}\) such that there is no weak contrastive explanation \(\mathbf{e}_2\) satisfying \(\mathbf{e}_1 \prec\mathbf{e}_2\). In [fig:ddnnf], the partial instance \((\bot,1,1,1)\) is a maximum contrastive explanation for \((1,1,1,1)\), thus also a \(\mathsf{CXp}\) and a \(\mathsf{wCXp}\).
Given a pair \((\mathbf{e},\mathcal{M})\), an instance \(\mathbf{e}_1\) is a solution to the minimum change required query (\(\mathsf{MCR}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if \(\mathcal{M}(\mathbf{e}) \not = \mathcal{M}(\mathbf{e}_1)\) and \(\mathcal{M}(\mathbf{e}) = \mathcal{M}(\mathbf{e}_2)\), for every instance \(\mathbf{e}_2\) at smaller Hamming distance (meaning the number of flipped features between two instances) from \(\mathbf{e}\) than \(\mathbf{e}_1\). The instance \(\mathbf{e}_1\) represents the minimum distance required to change the value on the model. This notion is based on the query introduced by [21]. Considering the instance \((1,1,1,1)\) in [fig:ddnnf], one possible explanation for the query is \((0,1,1,1)\).
Given a pair \((\mathbf{e},\mathcal{M})\), an instance \(\mathbf{e}_1\) is a solution to the maximum change allowed query (\(\mathsf{MCA}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if \(\mathcal{M}(\mathbf{e}) = \mathcal{M}(\mathbf{e}_1)\) and \(\mathcal{M}(\mathbf{e}) \not = \mathcal{M}(\mathbf{e}_2)\), for every instance \(\mathbf{e}_2\) at greater Hamming distance from \(\mathbf{e}\) than \(\mathbf{e}_1\). This notion is based on the query introduced by [36]. As the authors argue, only studying counterfactual queries like minimum change required may not capture the whole picture for explaining certain situations. That is why we include their semifactual version of the problem. In [fig:ddnnf], the maximum change allowed for the negative input \((0,1,1,1)\) is the instance \((0,0,0,0)\).
The original versions of \(\mathsf{MCR}\) and \(\mathsf{MCA}\) [21], [36] are defined similarly with respect to each other, but have very different interpretations. Given a distance \(k\) for \(\mathsf{MCR}\) it is not trivially easier to decide any distance \(k'\) for \(\mathsf{MCA}\); and vice versa. We only know that the inequality \(k \leq k' + 1\) holds. Thus, presenting both queries has additional value and lets us present another useful case of maximization.
Given a pair \((\mathbf{e},\mathcal{M})\), a partial instance \(\mathbf{e}_1\) with exactly one defined feature is a necessary feature (\(\mathsf{NF}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if, for every weak abductive explanation \(\mathbf{e}_2\) for \(\mathbf{e}\) on \(\mathcal{M}\), \(\mathbf{e}_1 \subseteq \mathbf{e}_2\) holds. An equivalent formulation appears in [11], where the authors define the property feature necessity on their own framework using abductive explanations instead of weak abductive explanations. It is easy to see that both definitions are equivalent. Considering \((1,1,1,1)\) in [fig:ddnnf], the instance has two abductive explanations: \((1,1,\bot,\bot)\) and \((1,\bot,1,1)\). Therefore, the feature \(x_1=1\), represented by the partial instance \((1,\bot,\bot,\bot)\), is a necessary feature.
Given a pair \((\mathbf{e},\mathcal{M})\), a partial instance \(\mathbf{e}_1\) with exactly one defined feature is a relevant feature (\(\mathsf{RF}\)) for \(\mathbf{e}\) on \(\mathcal{M}\) if there exists an abductive explanation \(\mathbf{e}_2\) for \(\mathbf{e}\) on \(\mathcal{M}\) such that \(\mathbf{e}_1 \subseteq \mathbf{e}_2\). This notion appears in the literature as the AXp membership problem [37] and as feature relevancy [11]. Considering \((1,1,1,1)\) and its abductive explanations \((1,1,\bot,\bot)\) and \((1,\bot,1,1)\) in [fig:ddnnf], \(x_2=1\) is one of the relevant features, and can be represented by the partial instance \((\bot,1,\bot,\bot)\).
In this section, we introduce an initial interpretability logic designed for expressing queries. We demonstrate that it faces limitations in expressive power and exhibits high computational complexity for its evaluation problem.
Our work is inspired by the first-order interpretability logic (\(\mathrm{\small FOIL}\)) [16], which is a simple explainability language rooted in first-order logic. \(\mathrm{\small FOIL}\) is simply first-order logic over two relations on the set of partial instances of a given dimension: a unary relation \(\mathsf{Pos}\) whose interpretation is the set of instances that are positively classified by the model, and a binary relation \(\subseteq\) that represents the subsumption relation among partial instances.
Given a vocabulary \(\sigma\) consisting of relations \(R_1\), \(\ldots\), \(R_\ell\), recall that a structure \(\mathfrak{A}\) over \(\sigma\) consists of a domain over which quantifiers range, and an interpretation for each relation \(R_i\). Moreover, given a first-order formula \(\varphi\) defined over the vocabulary \(\sigma\), we write \(\varphi(x_1, \ldots, x_k)\) to indicate that the free variables of \(\varphi\) are among \(\{x_1,\ldots,x_k\}\). Finally, given a structure \(\mathfrak{A}\) over the vocabulary \(\sigma\) and elements \(a_1\), \(\ldots\), \(a_k\) in the domain of \(\mathfrak{A}\), we use \(\mathfrak{A}\models \varphi(a_1, \ldots, a_k)\) to indicate that the formula \(\varphi\) is satisfied by \(\mathfrak{A}\) when each variable \(x_i\) is replaced by element \(a_i\) (\(1 \leq i \leq k\)).
Consider a model \(\mathcal{M}\) with \({\textit dim}(\mathcal{M}) = n\). The structure \(\mathfrak{A}_\mathcal{M}\) representing \(\mathcal{M}\) over the vocabulary formed by \(\mathsf{Pos}\) and \(\subseteq\) is defined as follows. The domain of \(\mathfrak{A}_\mathcal{M}\) is the set \(\{0,1, \bot\}^n\) of all partial instances of dimension \(n\). A partial instance \(\mathbf{e}\in \{0,1, \bot\}^n\) belongs to the interpretation of \(\mathsf{Pos}\) in \(\mathfrak{A}_\mathcal{M}\) if and only if \(\mathbf{e}\in \{0,1\}^n\) and \(\mathcal{M}(\mathbf{e}) = 1\). Moreover, a pair \((\mathbf{e}_1,\mathbf{e}_2)\) is in the interpretation of relation \(\subseteq\) in \(\mathfrak{A}_\mathcal{M}\) if and only if \(\mathbf{e}_1\) is subsumed by \(\mathbf{e}_2\). Finally, given a formula \(\varphi(x_1, \ldots, x_k)\) in \(\mathrm{\small FOIL}\) and partial instances \(\mathbf{e}_1\), \(\ldots\), \(\mathbf{e}_k\) of dimension \(n\), the model \(\mathcal{M}\) is said to satisfy \(\varphi(\mathbf{e}_1, \ldots, \mathbf{e}_k)\), denoted by \(\mathcal{M}\models \varphi(\mathbf{e}_1, \ldots, \mathbf{e}_k)\), if \(\mathfrak{A}_\mathcal{M}\models \varphi(\mathbf{e}_1, \ldots, \mathbf{e}_k)\).
Notice that for a succinctly-represented model \(\mathcal{M}\), the structure \(\mathfrak{A}_\mathcal{M}\) can be exponentially larger than the representation of \(\mathcal{M}\). Hence, \(\mathfrak{A}_\mathcal{M}\) is a theoretical construction needed to formally define the semantics of \(\mathrm{\small FOIL}\), but it should not be constructed explicitly when checking in practice if a formula \(\varphi\) is satisfied by \(\mathcal{M}\).
It will be instructive for the rest of our presentation to see a few examples of how \(\mathrm{\small FOIL}\) can be used to express some natural explainability queries on models. In these examples, we make use of the following \(\mathrm{\small FOIL}\) formula: \[\mathsf{Full}(x) \;:= \;\forall y \, (x \subseteq y \, \rightarrow \, y \subseteq x).\]Notice that if \(\mathcal{M}\) is a model and \(\mathbf{e}\) is a partial instance, then \(\mathcal{M}\models \mathsf{Full}(\mathbf{e})\) if and only if \(\mathbf{e}\) is also an instance (i.e., it has no undefined features). We also use the formula \[\mathsf{AllPos}(x) \;:= \;\forall y \, \big((x \subseteq y \wedge \mathsf{Full}(y)) \, \rightarrow \, \mathsf{Pos}(y)\big),\] such that \(\mathcal{M}\models \mathsf{AllPos}(\mathbf{e})\) if and only if every instance in \(\textit{comp}(\mathbf{e})\) is classified as positive by \(\mathcal{M}\). Analogously, we define a formula \(\mathsf{AllNeg}(x)\). The definitions of both predicates are inspired by important knowledge compilation queries such as a conditioning transformation of the input and a consistency or validity check on the conditioned model [28]. \(\mathsf{AllPos}(x)\) and \(\mathsf{AllNeg}(x)\) will be important components of a new logic for explainability defined in 4 since they enable the expression of a wide range of explainability queries. For example, we can now define weak abductive explanations (refer to 2.2) in \(\mathrm{\small FOIL}\) as follows: \[\mathsf{wAXp}(x,y) := \mathsf{Full}(x) \wedge y \subseteq x \;\wedge \\ (\mathsf{Pos}(x) \to \mathsf{AllPos}(y)) \wedge (\neg \mathsf{Pos}(x) \to \mathsf{AllNeg}(y)).\]
In fact, it is easy to see that \(\mathcal{M}\models \mathsf{wAXp}(\mathbf{e},\mathbf{e}')\) if and only if \(\mathbf{e}'\) is a weak abductive explanation for \(\mathbf{e}\) over \(\mathcal{M}\). Notice that \(\mathbf{e}\) is always a weak abductive explanation for itself. However, we are typically interested in explanations that satisfy some optimality criterion. A common such criterion is that of being minimal [21], [34], [38]. Let us write \(x \subset y\) for \(x \subseteq y \wedge \neg (y \subseteq x)\). Then, for \[\mathsf{AXp}(x,y) := \mathsf{wAXp}(x,y) \land \forall z \,(z \subset y \, \rightarrow \neg \mathsf{wAXp}(x,z)),\]we have that \(\mathcal{M}\models \mathsf{AXp}(\mathbf{e},\mathbf{e}')\) if and only if \(\mathbf{e}'\) is an abductive explanation for \(\mathbf{e}\) over \(\mathcal{M}\). We could similarly express local explainability queries like contrastive explanations through the same approach using \(\mathrm{\small FOIL}\).
As we show below, \(\mathrm{\small FOIL}\) fails to meet either of the two criteria we are looking for in a practical language that provides explanations. The first issue is its limited expressiveness: there are important notions of explanations that cannot be expressed in this language, even when restricted to decision trees, which are traditionally deemed to be easily interpretable. The second issue is its high computational complexity: there are queries in \(\mathrm{\small FOIL}\) that cannot be evaluated with a polynomial number of calls to an NP oracle. Both facts firmly establish the inadequacy of \(\mathrm{\small FOIL}\) as a practical language.
In some scenarios we want to express a stronger condition for abductive and contrastive explanations: not only that they are minimal, but also that they are minimum (see 2.2). In the case of abductive explanations, they can be minimal without being minimum. The following theorem shows that \(\mathrm{\small FOIL}\) cannot express the query that asks whether a partial instance \(\mathbf{e}'\) is a minimum abductive explanation for a given instance \(\mathbf{e}\) over decision trees.
Theorem 1. There is no formula \(\mathsf{mAXp}(x,y)\) in FOIL such that, for every decision tree \(\mathcal{T}\), instance \(\mathbf{e}\) and partial instance \(\mathbf{e}'\), we have that \(\mathcal{T}\models \mathsf{mAXp}(\mathbf{e},\mathbf{e}') \Leftrightarrow \mathbf{e}'\) is a minimum abductive explanation for \(\mathbf{e}\) over \(\mathcal{T}\).
Proof. The proof extends techniques from [20] such as the games for FOdistinguishability. We now present notions that will be used in this and the following arguments throughout this paper.
The quantifier rank of an \({\rm FO}\) formula \(\varphi\), denoted by \({\rm qr}(\varphi)\), is the maximum depth of quantifier nesting in it. For a structure \(\mathfrak{A}\), we write \({\rm dom}(\mathfrak{A})\) to denote its domain. An Ehrenfeucht-Fraı̈ssé (EF) game is played in two structures, \(\mathfrak{A}_1\) and \(\mathfrak{A}_2\), of the same schema, by two players, the spoiler and the duplicator. In round \(i\) the spoiler selects a structure, say \(\mathfrak{A}_1\), and an element \(c_i\) in \({\rm dom}(\mathfrak{A}_1)\); the duplicator responds by selecting an element \(e_i\) in \({\rm dom}(\mathfrak{A}_2)\). The duplicator wins in \(k\) rounds, for \(k \geq 0\), if \(\{(c_i,e_i) \mid i \leq k\}\) defines a partial isomorphism between \(\mathfrak{A}_1\) and \(\mathfrak{A}_2\). If the duplicator wins no matter how the spoiler plays, we write \(\mathfrak{A}_1 \equiv_k \mathfrak{A}_2\). A classical result states that \(\mathfrak{A}_1 \equiv_k \mathfrak{A}_2\) iff \(\mathfrak{A}_1\) and \(\mathfrak{A}_2\) agree on all \({\rm FO}\) sentences of quantifier rank \(\leq k\) (cf. [20]).
Also, if \(\bar a\) is an \(m\)-tuple in \({\rm dom}(\mathfrak{A}_1)\) and \(\bar b\) is an \(m\)-tuple in \({\rm dom}(\mathfrak{A}_2)\), where \(m \geq 0\), we write \((\mathfrak{A}_1,\bar a) \equiv_k (\mathfrak{A}_2,\bar b)\) whenever the duplicator wins in \(k\) rounds no matter how the spoiler plays, but starting from position \((\bar a,\bar b)\). In the same way, \((\mathfrak{A}_1,\bar a) \equiv_k (\mathfrak{A}_2,\bar b)\) iff for every \({\rm FO}\) formula \(\varphi(\bar x)\) of quantifier rank \(\leq k\), it holds that \(\mathfrak{A}_1 \models \varphi(\bar a) \Leftrightarrow \mathfrak{A}_2 \models \varphi(\bar b)\).
It is well-known (cf. [20]) that there are only finitely many \({\rm FO}\) formulae of quantifier rank \(k\), up to logical equivalence. The rank-\(k\) type of an \(m\)-tuple \(\bar a\) in a structure \(\mathfrak{A}\) is the set of all formulae \(\varphi(\bar x)\) of quantifier rank \(\leq k\) such that \(\mathfrak{A}\models \varphi(\bar a)\). Given the above, there are only finitely many rank-\(k\) types, and each one of them is definable by an \({\rm FO}\) formula \(\tau_k^{(\mathfrak{A},\bar a)}(\bar x)\) of quantifier rank \(k\).
We now introduce some terminology necessary for the proof.
Let \(\mathcal{M}\), \(\mathcal{M}'\) be models of dimension \(n\) and \(p\), respectively, and consider the structures \(\mathfrak{A}_\mathcal{M}= \langle \{0,1,\bot\}^n,\subseteq^{\mathfrak{A}_\mathcal{M}},\mathsf{Pos}^{\mathfrak{A}_\mathcal{M}} \rangle\) and \(\mathfrak{A}_{\mathcal{M}'} = \langle \{0,1,\bot\}^p,\subseteq^{\mathfrak{A}_{\mathcal{M}'}},\mathsf{Pos}^{\mathfrak{A}_{\mathcal{M}'}} \rangle\). We write \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}'}\) for the structure over the same vocabulary that satisfies the following:
The domain of \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}'}\) is \(\{0,1,\bot\}^{n+p}\).
The interpretation of \(\subseteq\) on \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}'}\) is the usual subsumption relation on \(\{0,1,\bot\}^{n+p}\).
The interpretation of \(\mathsf{Pos}\) on \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}'}\) is the set of instances \(\mathbf{e}\in \{0,1\}^{n+p}\) such that \((\mathbf{e}[1],\cdots,\mathbf{e}[n]) \in \mathsf{Pos}^{\mathfrak{A}_\mathcal{M}}\) or \((\mathbf{e}[n+1],\cdots,\mathbf{e}[n+p]) \in \mathsf{Pos}^{\mathfrak{A}_{\mathcal{M}'}}\).
We will also consider structures of the form \(\mathfrak{A}_n = \langle \{0,1,\bot\}^n,\subseteq^\mathfrak{A}\rangle\), where \(\subseteq\) is interpreted as the subsumption relation over \(\{0,1,\bot\}^n\). For any such structure, we write \(\mathfrak{A}_n^+\) for the structure over the vocabulary \(\{\subseteq,\mathsf{Pos}\}\) that extends \(\mathfrak{A}\) by adding only the tuple \(\{1\}^n\) to the interpretation of \(\mathsf{Pos}\).
We now state two crucial lemmas, whose proofs can be found in the appendix of this work (refer to Sections 8.1 and 8.2).
Lemma 1. If \(n,p \geq 3^k\), then \((\mathfrak{A}_n,\{1\}^n) \;\equiv_k \; (\mathfrak{A}_p,\{1\}^p)\). In particular, \(\mathfrak{A}_n^+ \equiv_k \mathfrak{A}_p^+\).
Lemma 2. Consider models \(\mathcal{M}\), \(\mathcal{M}_1\), and \(\mathcal{M}_2\) of dimension \(n\), \(p\), and \(q\), respectively, and assume that \((\mathfrak{A}_{\mathcal{M}_1},\{1\}^p) \equiv_k (\mathfrak{A}_{\mathcal{M}_2},\{1\}^q)\). Then it is the case that \[\begin{align} \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1},\{1\}^{n+p},\{\bot\}^n \cdot \{1\}^p\big) \;\equiv_k \; \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2},\{1\}^{n+q},\{\bot\}^n \cdot \{1\}^q\big). \end{align}\]
We now proceed with the proof of Theorem 1. Assume, for the sake of contradiction, that there is in fact a formula \(\mathsf{mAXp}(x,y)\) in \(\mathrm{\small FOIL}\) such that, for every decision tree \(\mathcal{M}\), instance \(\mathbf{e}\), and partial instance \(\mathbf{e}'\), we have that \(\mathfrak{A}_\mathcal{M}\models \mathsf{mAXp}(\mathbf{e},\mathbf{e}')\) iff \(\mathbf{e}'\) is a minimum abductive explanation for \(\mathbf{e}\) over \(\mathcal{M}\). Let \(k \geq 0\) be the quantifier rank of this formula. We show that there exist decision trees \(\mathcal{M}_1\) and \(\mathcal{M}_2\), instances \(\mathbf{e}_1\) and \(\mathbf{e}_2\) over \(\mathcal{M}_1\) and \(\mathcal{M}_2\), respectively, and partial instances \(\mathbf{e}'_1\) and \(\mathbf{e}'_2\) over \(\mathcal{M}_1\) and \(\mathcal{M}_2\), respectively, for which the following holds:
\((\mathcal{M}_1,\mathbf{e}_1,\mathbf{e}'_1) \equiv_k (\mathcal{M}_2,\mathbf{e}_2,\mathbf{e}'_2)\), and hence \[\begin{align} \mathcal{M}_1 \models \mathsf{mAXp}(\mathbf{e}_1,\mathbf{e}'_1) \;\Leftrightarrow \; \mathcal{M}_2 \models \mathsf{mAXp}(\mathbf{e}_2,\mathbf{e}'_2). \end{align}\]
It is the case that \(\mathbf{e}'_1\) is a minimum abductive explanation for \(\mathbf{e}_1\) under \(\mathcal{M}_1\), but \(\mathbf{e}'_2\) is not a minimum abductive explanation for \(\mathbf{e}_2\) under \(\mathcal{M}_2\).
This is our desired contradiction.
Let \(\mathcal{M}_{n,p}\) be a decision tree of dimension \(n+p\) such that, for every instance \(\mathbf{e}\in \{0,1\}^{n+p}\), we have that \(\mathcal{M}_{n,p}(\mathbf{e}) = 1\) iff \(\mathbf{e}\) is of the form \(\{1\}^n \cdot \{0,1\}^p\), i.e., the first \(n\) features of \(\mathbf{e}\) are set to 1, or \(\mathbf{e}\) is of the form \(\{0,1\}^n \cdot \{1\}^p\), i.e., the last \(p\) features of \(\mathbf{e}\) are set to 1. Take the instance \(\mathbf{e}= \{1\}^{n+p}\). It is easy to see that \(\mathbf{e}\) only has two abductive explanations in \(\mathcal{M}_{n,p}\); namely, \(\mathbf{e}_1 = \{1\}^n \cdot \{\bot\}^p\) and \(\mathbf{e}_2 = \{\bot\}^n \cdot \{1\}^p\).
We define the following:
\(\mathcal{M}_1 := \mathcal{M}_{2^{k},2^{k}}\) and \(\mathcal{M}_2 := \mathcal{M}_{2^k,2^k+1}\).
\(\mathbf{e}_1 := \{1\}^{2^k + 2^k}\) and \(\mathbf{e}_2 := \{1\}^{2^k+2^k+1}\).
\(\mathbf{e}'_1 := \{\bot\}^{2^k} \cdot \{1\}^{2^k}\) and \(\mathbf{e}'_2 := \{\bot\}^{2^k} \cdot \{1\}^{2^k+1}\).
From our previous observation, \(\mathbf{e}'_1\) is an abductive explanation for \(\mathbf{e}_1\) over \(\mathcal{M}_1\) and \(\mathbf{e}'_2\) is an abductive explanation for \(\mathbf{e}_2\) over \(\mathcal{M}_2\).
We show first that \((\mathfrak{A}_{\mathcal{M}_1},\mathbf{e}_1,\mathbf{e}'_1) \equiv_k (\mathfrak{A}_{\mathcal{M}_2},\mathbf{e}_2,\mathbf{e}'_2)\). It can be observed that \(\mathfrak{A}_{\mathcal{M}_1}\) is of the form \(\mathfrak{A}_{N} \oplus \mathfrak{A}_{N_1}\), where \(N\) is a model of dimension \(2^k\) that only accepts the tuple \(\{1\}^{2^k}\) and the same holds for \(N_1\). Analogously, \(\mathfrak{A}_{\mathcal{M}_2}\) is of the form \(\mathfrak{A}_{N} \oplus \mathfrak{A}_{N_2}\), where \(N_2\) is a model of dimension \(2^k + 1\) that only accepts the tuple \(\{1\}^{2^k + 1}\). From Lemma 1, we have that \[(\mathfrak{A}_{N_1},\{1\}^{2^k}) \;\equiv_k \; (\mathfrak{A}_{N_2},\{1\}^{2^k+1}).\] Notice that indeed any winning strategy for the Duplicator on this game must map the tuples \(\{1\}^{2^k}\) in \(\mathfrak{A}_{N_1}\) and \(\{1\}^{2^k+1}\) into each other.
Now, from Lemma 2, we obtain that \[\begin{align} \big(\mathfrak{A}_N \oplus \mathfrak{A}_{N_1},\{1\}^{2^k+2^k},\{\bot\}^{2^k} \cdot \{1\}^{2^k}\big) \;\equiv_k \; \big(\mathfrak{A}_N \oplus \mathfrak{A}_{N_2},\{1\}^{2^k+2^k+1},\{\bot\}^{2^k} \cdot \{1\}^{2^k+1}\big). \end{align}\] We can then conclude that \((\mathfrak{A}_{\mathcal{M}_1},\mathbf{e}_1,\mathbf{e}'_1) \equiv_k (\mathfrak{A}_{\mathcal{M}_2},\mathbf{e}_2,\mathbf{e}'_2)\), as desired.
Notice now that \(\mathbf{e}'_1\) is a minimum abductive explanation for \(\mathbf{e}_1\) over \(\mathcal{M}_1\). In fact, by our previous observations, the only other abductive explanation for \(\mathbf{e}_1\) over \(\mathcal{M}_1\) is \(\mathbf{e}''_1 = \{1\}^{2^k} \cdot \{\bot\}^{2^k}\), which has the same number of undefined features as \(\mathbf{e}'_1\). In turn, \(\mathbf{e}'_2\) is not a minimum abductive explanation for \(\mathbf{e}_2\) over \(\mathcal{M}_2\). This is because \(\mathbf{e}''_2 = \{1\}^{2^k} \cdot \{\bot\}^{2^k+1}\) is also an abductive explanation for \(\mathbf{e}_2\) over \(\mathcal{M}_2\), and \(\mathbf{e}''_2\) has more undefined features than \(\mathbf{e}'_2\). ◻
For each query \(\varphi(x_1, \ldots, x_k)\) in \(\mathrm{\small FOIL}\) and \(\mathcal{C}\) a class of models, we define its associated problem Eval\((\varphi, \mathcal{C})\) as follows (we assume models and instances have the same dimension):
It is known that there exists a formula \(\varphi(x)\) in \(\mathrm{\small FOIL}\) for which its evaluation problem over the class of decision trees is \({\rm NP}\)-hard [16]. We want to determine whether the language \(\mathrm{\small FOIL}\) is appropriate for implementation using SAT encodings. Thus, it is natural to ask whether the evaluation problem for formulas in this logic can always be decided in polynomial time by using a \({\rm NP}\) oracle. However, we prove that this is not always the case. Although the evaluation of \(\mathrm{\small FOIL}\) formulas is always in the polynomial hierarchy (PH), there exist formulas in \(\mathrm{\small FOIL}\) for which their corresponding evaluation problems are hard for every level of PH. Based on widely held complexity assumptions, we can conclude that \(\mathrm{\small FOIL}\) contains formulas whose evaluations cannot be decided in polynomial time by using a \({\rm NP}\) oracle even on decision trees (\(\mathsf{DTree}\)).
Theorem 2. The following statements hold:
Let \(\varphi\) be a FOIL formula. Then, there exists \(k \geq 0\) such that Eval\((\varphi, \mathsf{NNF})\) is in the \(\Sigma_k^{\rm{P}}\) complexity class.
For every \(k \geq 0\), there is an FOIL-formula \(\varphi_k\) such that Eval\((\varphi_k, \mathsf{DTree})\) is \(\Sigma_k^{\rm{P}}\)-hard.
Proof. For the first item, consider a fixed \(\mathrm{\small FOIL}\) formula \(\varphi(x_1,\dots,x_m)\). We assume without loss of generality that \(\varphi\) is in prenex normal form, i.e., it is of the form \[\exists \bar y_1 \forall \bar y_2 \cdots Q_k \bar y_k \, \psi(x_1,\dots,x_m,\bar y_1,\dots,\bar y_k), \quad \quad (k \geq 0)\] where \(Q_k = \exists\) if \(k\) is odd and \(Q_k = \forall\) otherwise, and \(\psi\) is a quantifier-free formula. A FOIL formula of this form is called a \(\Sigma_k\)-\(\mathrm{\small FOIL}\) formula. Consider that \(\mathcal{M}\) is a negation normal form of dimension \(n\), and assume that we want to check whether \(\mathcal{M}\models \varphi(\mathbf{e}_1,\dots,\mathbf{e}_m)\), for \(\mathbf{e}_1,\dots,\mathbf{e}_m\) given partial instances of dimension \(n\). We know that the predicates \(\mathsf{Pos}\) and \(\subseteq\) can be decided in polynomial time on \(\mathcal{M}\). Additionally, the formula \(\varphi\) is fixed, and thus the length of each tuple \(\bar y_i\), for \(i \leq k\), is constant. Therefore, we can decide this problem in polynomial time by using a \(\Sigma_k\)-alternating Turing machine (as the fixed size quantifier-free formula \(\psi\) can be evaluated in polynomial time over \(\mathcal{M}\)).
We now deal with the second item. We start by studying the complexity of the well-known quantified Boolean formula (QBF) problem for the case when the underlying formula (or, more precisely, the underlying Boolean function) is defined by a decision tree. More precisely, suppose that \(\mathcal{M}\) is a decision tree over instances of dimension \(n\). A \(\Sigma_k\)-QBF over \(\mathcal{M}\), for \(k > 1\), is an expression \[\exists P_1 \forall P_2 \cdots Q_k P_k \, \mathcal{M},\] where \(Q_k = \exists\) if \(k\) is odd and \(Q_k = \forall\) otherwise, and \(P_1,\dots,P_k\) is a partition of \(\{1,\dots,n\}\) into \(k\) equivalence classes. As an example, if \(\mathcal{M}\) is of dimension 3 then \(\exists \{2,1\} \forall \{3\} \, \mathcal{M}\) is a \(\Sigma_2\)-QBF over \(\mathcal{M}\). The semantics of these expressions is standard. For instance, \(\exists \{1,2\} \forall \{3\} \, \mathcal{M}\) holds if there exists a partial instance \((b_1,b_2,\bot) \in \{0,1\} \times \{0,1\} \times \{\bot\}\) such that both \(\mathcal{M}(b_1,b_2,0) = 1\) and \(\mathcal{M}(b_1,b_2,1) = 1\).
For a fixed \(k > 1\), we introduce then the problem \(\Sigma_k\)-QBF\((\mathsf{DTree})\). It takes as input a \(\Sigma_k\)-QBF \(\alpha\) over \(\mathcal{M}\), for \(\mathcal{M}\) a decision tree, and asks whether \(\alpha\) holds. We establish the following result, which we believe of independent interest, as (to the best of our knowledge) the complexity of the QBF problem over decision trees has not been studied in the literature (refer to Section 8.3 for the proof).
Lemma 3. For every odd \(k \geq 1\), the problem \(\Sigma_{k+1}\)-QBF\((\mathsf{DTree})\) is \(\Sigma_{k}^{\text{P}}\)-complete.
For the second item, we can now finish the proof of the theorem with the help of Lemma 3 and a reduction from \(\Sigma_{k+1}\)-QBF\((\mathsf{DTree})\). We can assume that \(k\) is odd because for proving that there are FOIL-formulas \(\varphi_{k'}\) such that Eval\((\varphi_{k'}, \mathsf{DTree})\) is \(\Sigma_{k'}^{\rm{P}}\)-hard it is enough to show that there are FOIL-formulas \(\varphi_{k}\) such that Eval\((\varphi_{k}, \mathsf{DTree})\) is \(\Sigma_{k'}^{\rm{P}}\)-hard for some \(k \geq k'\). The input to \(\Sigma_{k+1}\)-QBF\((\mathsf{DTree})\) is given by an expression \(\alpha\) of the form \[\exists P_1 \forall P_2 \cdots \exists P_k \forall P_{k+1} \, \mathcal{M},\] for \(\mathcal{M}\) a decision tree of dimension \(n\) and \(P_1,\dots,P_{k+1}\) a partition of \(\{1,\dots,n\}\). We explain next how the formula \(\varphi_k(x_1,\dots,x_{k+1})\) is defined.
We start by defining some auxiliary terminology. We use \(x[i]\) to denote the \(i\)-th feature of the partial instance that is assigned to variable \(x\). We define the following formulas.
\({\sf Undef}(x) := \neg \exists y (y \subset x)\). That is, \({\sf Undef}\) defines the set that only consists of the partial instance \(\{\bot\}^{n}\) in which all components are undefined.
\({\sf Single}(x) := \exists y (y \subset x) \wedge \forall y (y \subset x \, \rightarrow \, {\sf Undef}(y))\). That is, \({\sf Single}\) defines the set that consists precisely of those partial instances in \(\{0,1,\bot\}^{n}\) which have exactly one defined component.
\((x \sqcup y = z) := (x \subseteq z) \wedge (y \subseteq z) \wedge \neg \exists w \big((x \subseteq w) \wedge (y \subseteq w) \wedge (w \subset z)\big)\). That is, \(z\), if it exists, is the join of \(x\) and \(y\). In other words, \(z\) is defined if every feature that is defined over \(x\) and \(y\) takes the same value in both partial instances, and, in such case, for each \(1 \leq i \leq n\) we have that \(z[i] = x[i] \sqcup y[i]\), where \(\sqcup\) is the commutative and idempotent binary operation that satisfies \(\bot \sqcup 0 = 0\) and \(\bot \sqcup 1 = 1\).
As an example, \((1,0,\bot,\bot) \sqcup (1,\bot,\bot,1) = (1,0,\bot,1)\), while \((1,\bot) \sqcup (0,0)\) is undefined.
\((x \sqcap y = z) := (z \subseteq x) \wedge (z \subseteq y) \wedge \neg \exists w \big((w \subseteq x) \wedge (w \subseteq y) \wedge (z \subset w)\big)\). That is, \(z\) is the meet of \(x\) and \(y\) (which always exists). In other words, for each \(1 \leq i \leq n\) we have that \(z[i] = x[i] \sqcap y[i]\), where \(\sqcap\) is the commutative and idempotent binary operation that satisfies \(\bot \sqcap 0 = \bot \sqcap 1 = 0 \sqcap 1 = \bot\).
As an example, \((1,0,\bot,\bot) \sqcap (1,\bot,\bot,1) = (1,\bot,\bot,\bot)\), while \((1,\bot) \sqcap (0,0) = (\bot,\bot)\).
\({\sf Comp}(x,y) := \exists w \exists z ({\sf Undef}(z) \, \wedge \, x \sqcup y = w \, \wedge \, x \sqcap y = z)\). That is, \({\sf Comp}\) defines the pairs \((\mathbf{e}_1,\mathbf{e}_2)\) of partial instances in \(\{0,1,\bot\}^n \times \{0,1,\bot\}^n\) such that no feature that is defined in \(\mathbf{e}_1\) is also defined in \(\mathbf{e}_2\), and vice versa. In fact, assume for the sake of contradiction that this is not the case. By symmetry, we only have to consider the following two cases.
There is an \(i \leq n\) with \(\mathbf{e}_1[i] = 1\) and \(\mathbf{e}_2[i] = 0\). Then the join of \(\mathbf{e}_1\) and \(\mathbf{e}_2\) does not exist.
There is an \(i \leq n\) with \(\mathbf{e}_1[i] = \mathbf{e}_2[i] = 1\). Then the \(i\)-th component of the meet of \(\mathbf{e}_1\) and \(\mathbf{e}_2\) takes value 1, and hence \(\mathbf{e}_1 \sqcap \mathbf{e}_2 \neq \{\bot\}^n\).
\({\sf MaxComp}(x,y) := {\sf Comp}(x,y) \, \wedge \, \neg \exists z \big((y \subset z) \wedge {\sf Comp}(x,z)\big)\). That is, \({\sf MaxComp}\) defines the pairs \((\mathbf{e}_1,\mathbf{e}_2)\) such that the components that are defined in \(\mathbf{e}_1\) are precisely the ones that are undefined in \(\mathbf{e}_2\), and vice versa.
\({\sf Rel}(x,y) := \neg \exists z \big((z \subseteq y) \, \wedge \, {\sf Single}(z) \, \wedge\, {\sf Comp}(x,z)\big)\). That is, \({\sf Rel}\) defines the pairs \((\mathbf{e}_1,\mathbf{e}_2)\) of partial instances in \(\{0,1,\bot\}^n \times \{0,1,\bot\}^n\) such that every feature that is defined in \(\mathbf{e}_1\) is also defined in \(\mathbf{e}_2\).
\({\sf MaxRel}(x,y) := {\sf Rel}(x,y) \, \wedge \, \neg \exists z \big((z \subset y) \wedge {\sf Rel}(x,z)\big)\). That is, \({\sf MaxRel}\) defines the pairs \((\mathbf{e}_1,\mathbf{e}_2)\) such that the features defined in \(\mathbf{e}_1\) and in \(\mathbf{e}_2\) are the same.
For defining the formula \(\varphi_k(x_1,\dots,x_{k+1})\) we will use guarded quantifiers. For each \(i\) with \(1 \leq i \leq k+1\) consider \[\begin{align} \exists^{\mathcal{G}(x_i)} y_i \, \psi \;&= \;\exists y_i \, \big({\sf MaxRel}(x_i,y_i) \;\wedge \;\psi \big) \\ \forall^{\mathcal{G}(x_i)} y_i \, \psi \;&= \;\forall y_i \, \big({\sf MaxRel}(x_i,y_i) \;\rightarrow \;\psi \big) \end{align}\]
We now define the formula \(\varphi_k(x_1,\dots,x_{k+1})\) as \[\begin{align} \exists^{\mathcal{G}(x_1)} y_1 \forall^{\mathcal{G}(x_2)} y_2 \cdots \exists^{\mathcal{G}(x_k)} y_k \forall^{\mathcal{G}(x_{k+1})} y_{k+1} \;\forall z \big(z = y_1 \sqcup y_2 \sqcup \cdots \sqcup y_{k+1} \, \rightarrow \, \mathsf{Pos}(z)\big) \end{align}\]
For each \(i\) with \(1 \leq i \leq k+1\), let \(\mathbf{e}_i\) be the partial instance of dimension \(n\) such that \[\mathbf{e}_i[j] \;= \;\begin{cases} 1 \quad \quad & \text{if j \in P_i,} \\ \bot & \text{otherwise.} \end{cases}\] That is, \(\mathbf{e}_i\) takes value 1 over the features in \(P_i\) and it is undefined over all other features. We claim that \(\alpha\) holds if, and only if, \(\mathcal{M}\models \varphi_k(\mathbf{e}_1,\dots,\mathbf{e}_{k+1})\). The result then follows since \(\mathcal{M}\) is a decision tree.
For the sake of presentation we only prove the aforementioned equivalence for the case when \(k = 1\), since the extension to \(k > 1\) is standard (but cumbersome). That is, we consider the case when \(\alpha = \exists P_1 \forall P_2 \mathcal{M}\) and, therefore, \[\begin{align} \varphi_2(x_1,x_2) = \exists^{\mathcal{G}(x_1)} y_1 \forall^{\mathcal{G}(x_2)} y_2 \;\forall z \big(z = y_1 \sqcup y_2 \, \rightarrow \, \mathsf{Pos}(z)\big). \end{align}\]
Assume first that \(\mathcal{M}\models \varphi_2(\mathbf{e}_1,\mathbf{e}_2)\). Hence, there exists a partial instance \(\mathbf{e}'_1\) such that \[\label{eq95case95one} \mathcal{M}\, \models \, \big({\sf MaxRel}(\mathbf{e}_1,\mathbf{e}'_1) \;\wedge \;\forall^{\mathcal{G}(\mathbf{e}_2)} y_2 \;\forall z \big(z = \mathbf{e}'_1 \sqcup y_2 \, \rightarrow \, \mathsf{Pos}(z)\big) \big).\tag{1}\] This means that the features defined in \(\mathbf{e}_1\) and \(\mathbf{e}'_1\) are exactly the same, and hence \(\mathbf{e}'_1\) is a partial instance that is defined precisely over the features in \(P_1\). We claim that every instance \(\mathbf{e}\) that is a completion of \(\mathbf{e}'_1\) satisfies \(\mathcal{M}(\mathbf{e}) = 1\), thus showing that \(\alpha\) holds. In fact, take \(\mathbf{e}\) to be an arbitrary completion. By definition, \(\mathbf{e}\) can be written as \(\mathbf{e}'_1 \sqcup \mathbf{e}'_2\), where \(\mathbf{e}'_2\) is a partial instance that is defined precisely over those features not in \(P_1\), i.e., over the features in \(P_2\). Thus in the formula 1 we can assign the partial instance \(\mathbf{e}'_2\) to the variable \(y_2\) and the instance \(\mathbf{e}\) to the variable \(z\), which allows us to conclude that \(\mathcal{M}\models \mathsf{Pos}(\mathbf{e})\). This tells us that \(\mathcal{M}(\mathbf{e}) = 1\).
Assume in turn that \(\alpha\) holds, and hence that there is a partial instance \(\mathbf{e}'_1\) that is defined precisely over the features in \(P_1\) such that every instance \(\mathbf{e}\) that is a completion of \(\mathbf{e}'_1\) satisfies \(\mathcal{M}(\mathbf{e}) = 1\). We claim that \[\begin{align} \mathcal{M}\, \models \, \big({\sf MaxRel}(\mathbf{e}_1,\mathbf{e}'_1) \;\wedge \;\forall^{\mathcal{G}(\mathbf{e}_2)} y_2 \;\forall z \big(z = \mathbf{e}'_1 \sqcup y_2 \, \rightarrow \, \mathsf{Pos}(z)\big) \big), \end{align}\] which implies that \(\mathcal{M}\models \varphi_2(\mathbf{e}_1,\mathbf{e}_2)\). In fact, let \(\mathbf{e}'_2\) be an arbitrary instance such that \({\sf MaxRel}(\mathbf{e}_2,\mathbf{e}'_2)\) holds. By definition, \(\mathbf{e}'_2\) is defined precisely over the features in \(P_2\). Let \(\mathbf{e}= \mathbf{e}'_1 \sqcup \mathbf{e}'_2\). Notice that \(\mathbf{e}\) is well-defined since the sets of features defined in \(\mathbf{e}'_1\) and \(\mathbf{e}'_2\), respectively, are disjoint. Moreover, \(\mathbf{e}\) is a completion of \(\mathbf{e}'_1\) as \(P_1 \cup P_2 = \{1,\dots,n\}\). We then have that \(\mathcal{M}(\mathbf{e}) = 1\) as \(\alpha\) holds. This allows us to conclude that \(\mathcal{M}\models \mathsf{Pos}(\mathbf{e})\), and hence that \(\mathcal{M}\models \varphi_2(\mathbf{e}_1,\mathbf{e}_2)\).
This concludes the proof of the theorem. ◻
In the previous section we identified two limitations of \(\mathrm{\small FOIL}\) that must be addressed in order to build a practical logic for explanations. On one hand, we must extend \(\mathrm{\small FOIL}\) to increase its expressive power, and on the other hand, we must constrain the resulting logic to ensure that its evaluation complexity is appropriate. In this section we define ExplAIner, a logic that takes both criteria into account and in which explainability notions can be expressed naturally.
\(\mathrm{\small FOIL}\) cannot express properties such as minimum abductive explanations that involve comparing cardinalities of sets of features. As a first step, we solve this issue by extending the vocabulary of \(\mathrm{\small FOIL}\) with a simple binary relation \(\preceq\) defined as: \[\mathcal{M}\models \mathbf{e}\preceq\mathbf{e}' \;\;\Longleftrightarrow \;\; |\mathbf{e}_\bot| \geq |\mathbf{e}'_\bot|.\] As we will show later, the use of this predicate indeed allows us to express many notions of explanations. Note that we could not simply keep only one of \(\subseteq\) and \(\preceq\) when defining the new logic, as we show that they cannot be defined in terms of each other. First, we show that predicate \(\preceq\) cannot be defined in terms of predicate \(\subseteq\).
Proposition 3. There is no formula \(\varphi(x,y)\) in FOIL defined over the vocabulary \(\{\subseteq\}\) such that, for every decision tree \(\mathcal{T}\) and pair of partial instances \(\mathbf{e}\), \(\mathbf{e}'\), we have that \[\mathcal{T}\models \varphi(\mathbf{e},\mathbf{e}') \;\Longleftrightarrow \;|\mathbf{e}_\bot| \geq |\mathbf{e}'_\bot|.\]
Proof. For the sake of contradiction, assume that \(\varphi(x,y)\) is definable in \(\mathrm{\small FOIL}\) over the vocabulary \(\{\subseteq\}\). Then the following are formulas in \(\mathrm{\small FOIL}\): \[\begin{align} \mathsf{wAXp}(x,y) &:=& \mathsf{Full}(x) \wedge \, y \subseteq x \wedge \forall z \, \big(y \subseteq z \wedge \mathsf{Full}(z) \, \rightarrow \, (\mathsf{Pos}(z) \leftrightarrow \mathsf{Pos}(\;x))\big),\\ \mathsf{mAXp}(x,y) &:=& \mathsf{wAXp}(x,y) \wedge \forall z \, \big(\mathsf{wAXp}(x,z) \to (\varphi(z,y) \to \varphi(y,z))\big). \end{align}\] But the second formula verifies if a partial instance \(y\) is a minimum abductive explanation for a given instance \(x\), which contradicts the inexpressibility result of Theorem 1, and hence concludes the proof of the proposition. ◻
Second, we show that predicate \(\subseteq\) cannot be defined in terms of predicate \(\preceq\).
Proposition 4. There is no formula \(\psi(x,y)\) in FOIL defined over the vocabulary \(\{\preceq\}\) such that, for every decision tree \(\mathcal{T}\)2 and pair of partial instances \(\mathbf{e}\), \(\mathbf{e}'\), we have that \[\mathcal{T}\models \psi(\mathbf{e},\mathbf{e}') \;\Longleftrightarrow \;\mathbf{e}\text{ is subsumed by } \mathbf{e}'.\]
Proof. Intuitively, \(\preceq\) is invariant under any bijection of partial instances that preserves the number of \(\bot\)’s, whereas subsumption is not. We formalize this as follows.
For the sake of contradiction, assume that \(\psi(x,y)\) is definable in \(\mathrm{\small FOIL}\) over the vocabulary \(\{\preceq\}\), and let \(n \geq 3\). Moreover, for every \(k \in \{0, \ldots, n\}\), define \(L_k\) as the following set of partial instances: \[\begin{align} L_k &=& \{ \mathbf{e}\in \{0,1,\bot\}^n \mid |\mathbf{e}_\bot| = k\}, \end{align}\] and let \(f_k : L_k \to L_k\) be an arbitrary bijection from \(L_k\) to itself. Finally, let \(f : \{0, 1, \bot\}^n \to \{0, 1, \bot\}^n\) be defined as \(f(\mathbf{e}) = f_i(\mathbf{e})\) if \(\mathbf{e}\in L_i\). Clearly, \(f\) is a bijection from \(\{0, 1, \bot\}^n\) to \(\{0, 1, \bot\}^n\).
For a decision tree \(\mathcal{T}\) of dimension \(n\), define \(\mathfrak{A}'_\mathcal{T}\) as the restriction of \(\mathfrak{A}_\mathcal{T}\) to the vocabulary \(\{\preceq\}\). Then function \(f\) is an automorphism of \(\mathfrak{A}'_\mathcal{T}\) since \(f\) is a bijection from \(\{0, 1, \bot\}^n\) to \(\{0, 1, \bot\}^n\), and for every pair of partial instances \(\mathbf{e}_1, \mathbf{e}_2\): \[\begin{align} \mathfrak{A}'_\mathcal{T}\models \mathbf{e}_1 \preceq\mathbf{e}_2 \quad \text{ if and only if } \quad \mathfrak{A}'_\mathcal{T}\models f(\mathbf{e}_1) \preceq f(\mathbf{e}_2). \end{align}\] Then given that \(\psi(x,y)\) is definable in first-order logic over the vocabulary \(\{\preceq\}\), we have that for every pair of partial instances \(\mathbf{e}_1, \mathbf{e}_2\): \[\begin{align} \label{eq-subsumed-aut} \mathfrak{A}'_\mathcal{T}\models \psi(\mathbf{e}_1, \mathbf{e}_2) \quad \text{ if and only if } \quad \mathfrak{A}'_\mathcal{T}\models \psi(f(\mathbf{e}_1), f(\mathbf{e}_2)). \end{align}\tag{2}\] But now assume that \(g_k : L_k \to L_k\) is defined as the identity function for every \(k \in \{0, \ldots, n\} \setminus \{1\}\), and assume that \(g_1\) is defined as follows for every partial instance \(\mathbf{e}\): \[\begin{align} g_1(\mathbf{e}) &=& \begin{cases} (\bot, 0, \ldots, 0) & \text{if } \mathbf{e}= (0, \ldots, 0, \bot)\\ (0, \ldots, 0, \bot) & \text{if } \mathbf{e}= (\bot, 0, \ldots, 0)\\ \mathbf{e}& \text{otherwise} \end{cases} \end{align}\] Clearly, each function \(g_i\) is a bijection. Moreover, let \(g : \{0, 1, \bot\}^n \to \{0, 1, \bot\}^n\) be defined as \(g(\mathbf{e}) = g_i(\mathbf{e})\) if \(\mathbf{e}\in L_i\). Then we have by 2 that for every pair of partial instances \(\mathbf{e}_1\), \(\mathbf{e}_2\): \[\begin{align} \mathfrak{A}'_\mathcal{T}\models \psi(\mathbf{e}_1, \mathbf{e}_2) \quad \text{ if and only if } \quad \mathfrak{A}'_\mathcal{T}\models \psi(g(\mathbf{e}_1), g(\mathbf{e}_2)). \end{align}\] Hence, taking \(\mathbf{e}_1 = (\bot, \bot, 0, \ldots, 0)\) and \(\mathbf{e}_2 = (\bot, 0, \ldots, 0)\), given that \(g(\mathbf{e}_1) = (\bot, \bot, 0, \ldots, 0)\) and \({g(\mathbf{e}_2) = (0, \ldots, 0, \bot)}\), we conclude that: \[ \begin{gather} \mathfrak{A}'_\mathcal{T}\models \psi((\bot, \bot, 0, \ldots, 0),\, (\bot, 0, \ldots, 0)) \\ \text{ if and only if }\\ \mathfrak{A}'_\mathcal{T}\models \psi((\bot, \bot, 0, \ldots, 0),\, (0, \ldots, 0, \bot)). \end{gather}\] But this leads to a contradiction, since \((\bot, \bot, 0, \ldots, 0)\) is subsumed by \((\bot, 0, \ldots, 0)\), but \((\bot, \bot, 0, \ldots, 0)\) is not subsumed by \((0, \ldots, 0, \bot)\). This concludes the proof of the proposition. ◻
However, adding \(\preceq\) to \(\mathrm{\small FOIL}\) can only add extra complexity. Therefore, our second step is to define the logic \(\mathrm{\small ExplAIner}\) expressive enough to capture important notions, but keeping the evaluation tractable using \(\mathrm{\small SAT}\) solvers. Our logic \(\mathrm{\small ExplAIner}\) consists of three hierarchical layers, where the first layer does not depend on the structure of the model.
Predicates \(\subseteq\) and \(\preceq\), as well as predicate \(\mathsf{Full}\) used in Section 3.1, can be regarded as syntactic in the sense that they refer to the values of the features of partial instances, and they do not make reference to classification models. It turns out that all the syntactic predicates needed in our logical formalism can be expressed as first-order formulas over the predicates \(\subseteq\) and \(\preceq\). The atomic formulas of \(\mathrm{\small ExplAIner}\) are defined as first-order formulas over the vocabulary \(\{\subseteq, \preceq\}\). We now prove that such formulas can be evaluated in polynomial time. We also prove that in the case of sentences, that is, formulas without free variables, it is decidable whether a sentence is true in every structure \(\mathfrak{B}_n\).
Given \(n \geq 0\) and a model \(\mathcal{M}\) of dimension \(n\), define \(\mathfrak{B}_\mathcal{M}\) as a structure over the vocabulary \(\{\subseteq, \preceq\}\) generated from \(\mathfrak{A}_\mathcal{M}\) by removing the interpretation of predicate \(\mathsf{Pos}\), and adding the interpretation of predicate \(\preceq\). Notice that, given two models \(\mathcal{M}_1\) and \(\mathcal{M}_2\) of dimension \(n\), we have that \(\mathfrak{B}_{\mathcal{M}_1} = \mathfrak{B}_{\mathcal{M}_2}\), so we define simply \(\mathfrak{B}_n\) as \(\mathfrak{B}_\mathcal{M}\) for an arbitrary model of dimension \(n\). Therefore, when measuring the complexity of evaluating formulas in the atomic layer, we take \(n\) in unary as part of the input, since \(n\) is the size of the partial instances. Hence, for each formula \(\varphi(x_1, \ldots, x_k)\) in the atomic layer of \(\mathrm{\small ExplAIner}\), we define its associated problem Eval\((\varphi)\) as follows:
Recall also that the width of a first-order formula \(\varphi\), denoted \(\rm{wd}(\varphi)\), is defined as the maximum number of free variables among all subformulas of \(\varphi\) (see [39] for a reference).
Theorem 5. The following statements hold:
Let \(\varphi\) be a first-order formula defined over the vocabulary \(\{\subseteq, \preceq\}\). Then Eval\((\varphi) \in {\rm P}\).
It is decidable whether a given first-order sentence \(\varphi\) defined over the vocabulary \(\{\subseteq, \preceq\}\) is true in every structure \(\mathfrak{B}_n\). In particular, it can be solved in \(2^{2^{\rm{poly}\big(|\varphi| \cdot 3^{\rm{wd}(\varphi)} \big)}}\) space, and, hence, in \(2^{2^{2^{\rm{poly}\big(|\varphi| \cdot 3^{\rm{wd}(\varphi)} \big)}}}\) time.
Proof. We will prove both claims by a reduction to Presburger arithmetic. One standard presentation of Presburger arithmetic consists of two constants, \(0\) and \(1\), a binary relation \(<\) and a binary function \(+\). We consider the model \(\mathbb{N}\) of the non-negative integers with the usual interpretations. We will use the following two well-known facts about Presburger arithmetic:
Presburger arithmetic admits quantifier elimination, that is, for every Presburger formula \(\varphi(y_1, \dots, y_m)\) there exists a quantifier-free formula \(\psi(y_1, \dots, y_m)\) such that \(\varphi\) and \(\psi\) are logically equivalent [40].
The problem of determining the truth of sentences in Presburger Arithmetic with respect to the model \(\mathbb{N}\) can be solved in double exponential space with respect to the size of the sentence [41].
First, we introduce some terminology. Let \(n \in \mathbb{N}\) be the dimension. Then, for a tuple \(\Gamma=(x_1,\dots,x_k)\) of (distinct) variables, an assignment \(s \colon \Gamma \to \{0,1,\bot\}^n\), and a coordinate \(i \in \{1,\dots,n\}\), we define the “pattern” \({\operatorname{pat}}^{\Gamma, s}_i\) as the tuple \(\bigl(s(x_1)_i,\,\dots,\,s(x_k)_i\bigr)\in \{0,1,\bot\}^k.\) Given a pattern \(\rho \in \{0,1,\bot\}^k\), we define its pattern count in \((\Gamma,s)\) by \[c^{\Gamma,s}_\rho := \bigl|\{\, i\in \{1,\dots,n\} \, : \, {\operatorname{pat}}^{\Gamma,s}_i=\rho \,\}\bigr|.\] Clearly, \(\displaystyle\sum_{\rho\in \{0,1,\bot \}^{k}} c^{\Gamma,s}_\rho = n.\) For example, let \(\Gamma=(x_1,x_2)\) and let \(n=4\). Suppose that \(s(x_1)=(1,\bot,0,0)\) and \(s(x_2)=(1,1,\bot,\bot)\). Then the four coordinates have patterns \[\operatorname{pat}^{\Gamma,s}_1=(1,1),\qquad \operatorname{pat}^{\Gamma,s}_2=(\bot,1),\qquad \operatorname{pat}^{\Gamma,s}_3=(0,\bot),\qquad \operatorname{pat}^{\Gamma,s}_4=(0,\bot).\] Hence \[c^{\Gamma,s}_{(1,1)}= c^{\Gamma,s}_{(\bot,1)}=1,\qquad c^{\Gamma,s}_{(0,\bot)}=2,\] and every other pattern in \(\{0,1,\bot \}^2\) has count \(0\).
We are now ready to state the reduction lemma (refer to Section 8.4 for the proof):
Lemma 4. Let \(\varphi(x_1, \dots, x_\ell)\) be a first-order formula defined over the vocabulary \(\{\subseteq,\preceq\}\), and let \(\Gamma \coloneq (x_1, \dots, x_k)\) be a tuple of distinct variables that contains all free variables of \(\varphi\). Then there exists a Presburger formula \[\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\] such that for every \(n\in\mathbb{N}\) and every assignment \(s:\Gamma\to \{0,1,\bot \}^n\), \[\mathfrak{B}_n\models \varphi(s(x_1), \dots, s(x_\ell)) \quad\Longleftrightarrow\quad \mathbb{N} \models \operatorname{T}_\Gamma(\varphi)\bigl((c^{\Gamma,s}_\rho)_\rho\bigr).\] Moreover, if \(k = \ell\) (that is, if \(\Gamma\) contains exactly the free variables of \(\varphi\)), then we have that \[\bigg|\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\bigg| = O\bigg(|\varphi| \cdot 3^{\rm{wd}(\varphi)} \cdot \mathrm{poly}(\rm{wd}(\varphi))\bigg),\] and the reduction can be computed using the same space.
We now show how Lemma 4 implies both statements of the theorem.
For the first part, let \(\varphi(x_1, \dots, x_k)\) be a first-order formula defined over the vocabulary \(\{\subseteq, \preceq\}\), and let \(\Gamma = (x_1, \dots, x_k)\). Because Presburger arithmetic admits quantifier elimination, we know that there exists a quantifier-free Presburger formula \(\psi\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\) that is logically equivalent to \(\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\). From Lemma 4 we know that, for every \(n\in\mathbb{N}\) and every assignment \(s:\Gamma\to \{0,1,\bot\}^{n}\), \[\mathfrak{B}_n \models \varphi(s(x_1), \dots, s(x_\ell)) \quad\Longleftrightarrow\quad \mathbb{N} \models \psi\bigl((c^{\Gamma,s}_\rho)_\rho\bigr).\] Now suppose we are given an integer \(n \in \mathbb{N}\) in unary and partial instances \(\mathbf{e}_1, \ldots, \mathbf{e}_k\). Let \(s:\Gamma\to \{0,1,\bot\}^{n}\) be the assignment such that \(s(x_i) = \mathbf{e}_i\) for every \(i \in \{1, \dots, k\}\). Notice that we can compute in linear time all the values \(\{c^{\Gamma,s}_\rho\}_{\rho\in\{0,1,\bot\}^{k}}\), as \(3^k\) is constant with respect to the input size of Eval\((\varphi)\). Notice that each variable \(c^{\Gamma,s}_\rho\) has a value less than or equal to \(n\). Because \(\psi\) is a fixed, quantifier-free formula, we can evaluate it onto the values \(\{c^{\Gamma,s}_\rho\}_{\rho\in\{0,1,\bot\}^{k}}\) in polynomial time. This shows that Eval\((\varphi) \in {\rm P}\).
For the second part, let \(\varphi\) be a first-order sentence defined over the vocabulary \(\{\subseteq, \preceq\}\). Because we can take \(\Gamma\) as an empty context, there is only one possible pattern. Therefore, the formula \(\operatorname{T}_\Gamma(\varphi)\bigl((z)\bigr)\) has exactly one free variable. Recall that, in general, given an assignment for \(\Gamma\) in \(\mathfrak{B}_n\), the sum over all pattern counts must equal \(n\). Hence, in this case, \(\varphi\) is true in every structure \(\mathfrak{B}_n\) if and only if \(\forall m \operatorname{T}_\Gamma(\varphi)\bigl((m)\bigr)\) is a true Presburger sentence. We know from Lemma 4 that the sentence \(\forall m \operatorname{T}_\Gamma(\varphi)\bigl((m)\bigr)\) has size \(O\bigg(|\varphi| \cdot 3^{\rm{wd}(\varphi)} \cdot \mathrm{poly}(\rm{wd}(\varphi))\bigg)\) and it can be constructed in at most the same space. Because the problem of determining the truth value of a Presburger sentence can be solved in double exponential space, we conclude that we can determine if \(\varphi\) is true in every structure \(\mathfrak{B}_n\) in \(2^{2^{\rm{poly}\big(|\varphi| \cdot 3^{\rm{wd}(\varphi)} \big)}}\) space. This concludes the proof of the theorem. ◻
In this layer we introduce predicates whose interpretation does depend on the model. The vocabulary of this layer is \(\{\subseteq, \preceq, \mathsf{AllPos}, \mathsf{AllNeg}\}\), where \(\mathcal{M}\models \mathsf{AllPos}(\mathbf{e})\) if and only if all instances in \(\textit{comp}(\mathbf{e})\) are classified positively by \(\mathcal{M}\), and \(\mathsf{AllNeg}\) is defined analogously. As we will show, at this point we will already be able to express properties over polynomial-size sets of instances and minimality/minimum conditions.
We will need two auxiliary formulas from the atomic layer that we already defined during the proof of Theorem 2. The first is \[{\sf Undef}(x) := \neg \exists y (y \subset x),\] which defines the set that only contains the partial instance \(\{\bot\}^{n}\). The second is \[{\sf Single}(x) := \exists y (y \subset x) \wedge \forall y (y \subset x \, \rightarrow \, {\sf Undef}(y)),\] which defines the set of partial instances with exactly one defined feature.
The quantified layer is recursively defined as follows:
Boolean combinations of formulas from the atomic layer, together with \(\mathsf{AllPos}(x)\) and \(\mathsf{AllNeg}(x)\), are formulas from the quantified layer.
If \(\varphi\) is a formula from the quantified layer, then \(\exists x\;\varphi\) is a formula from the quantified layer.
If \(\varphi\) is a formula from the quantified layer, then \(\forall x\;\left( {\sf Single}(x) \to \varphi\right)\) is a formula from the quantified layer.
Using only the first rule we can already express some basic explainability properties. For example, we can express the query for weak abductive explanations as follows: \[\mathsf{wAXp}(x, y) := \mathsf{Full}(x) \wedge y \subseteq x \wedge (\mathsf{AllPos}(x) \to \mathsf{AllPos}(y)) \wedge (\mathsf{AllNeg}(x) \to \mathsf{AllNeg}(y)).\]
The third rule involves the concept of guarded quantification. In that case we only quantify over partial instances with exactly one defined feature, which naturally correspond to assignments of a value to a single feature. On any class of models \(\mathcal{C}\), the number of partial instances with one defined feature is at most twice the dimension of the model, so we cannot express universal properties over superpolynomial-size sets of partial instances. Notice that our rules do not allow us to define unguarded universal quantifiers because the first rule only allows us to take Boolean combinations of unquantified formulas. In particular, in this layer we are not allowed to negate formulas that were produced using the second (or third) rule.
Theorem 6. The following statements hold:
Let \(\mathcal{C}\) be a class of models such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\). Then Eval\((\varphi, \mathcal{C}) \in {\rm NP}\) for every formula \(\varphi\) from the quantified layer of ExplAIner.
There exists a formula \(\varphi\) from the quantified layer of ExplAIner such that Eval\((\varphi, \mathsf{DTree})\) is \({\rm NP}\)-hard.
Proof. For the first item, let \(\mathcal{C}\) be a class of models such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\), and let \(\varphi\) be a fixed formula from the quantified layer of ExplAIner. The algorithm is the following. For each existential quantifier we nondeterministically guess a partial instance as a polynomial-size witness. Each guarded universal quantifier ranges only over the set of partial instances with exactly one defined feature, whose size is linear in the dimension \(n\). Since the formula is fixed, unfolding all guarded universal quantifiers yields only polynomially many cases (to be more precise, at most \(n^c\) cases, where \(c\) is the quantifier rank of \(\varphi\)). At every computation path of this process, we are left with a Boolean combination of formulas from the atomic layer, together with \(\mathsf{AllPos}(x)\) and \(\mathsf{AllNeg}(x)\). Thanks to Theorem 5 and to the hypothesis that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\), and considering that the formula \(\varphi\) is fixed, we can do that evaluation in polynomial time.
For the second item, we consider the following formula from the quantified layer of ExplAIner: \[\mathsf{nmAXp}(x, y) \;:= \;\exists z\;\big( \neg \mathsf{wAXp}(x, y) \vee [z \prec y \wedge \mathsf{wAXp}(x, z)] \big).\] \(\mathsf{nmAXp}\) defines the pairs \((\mathbf{e}_1,\mathbf{e}_2)\) such that the partial instance \(\mathbf{e}_2\) is not a minimum abductive explanation for the instance \(\mathbf{e}_1\), that is, it is logically equivalent to \(\neg \mathsf{mAXp}(x, y)\). We conclude the proof using the following intermediate result, whose proof can be found in the appendix of this work (refer to Section 8.5).
Lemma 5. Eval\((\mathsf{mAXp}(x,y), \mathsf{DTree})\) is \({\rm coNP}\)-hard.
◻
We define \(\mathrm{\small ExplAIner}\) as the logic obtained by taking Boolean combinations of formulas from the quantified layer. In particular, since we can negate quantified formulas, in this third layer we are allowed to use unguarded universal quantifiers. Nevertheless, notice that a necessary condition for a formula to have a valid syntax according to the \(\mathrm{\small ExplAIner}\) logic is that alternations between unguarded quantifiers cannot occur.
We now provide a precise characterization of the complexity of the evaluation problem for \(\mathrm{\small ExplAIner}\). More specifically, we establish that this problem can always be solved in the Boolean Hierarchy over \({\rm NP}\) [42], [43], i.e., in the class consisting of Boolean combinations of \({\rm NP}\) languages. In fact, we will show that the \(\mathrm{\small ExplAIner}\) logic captures the entire Boolean Hierarchy.
For the following theorem, we denote the levels of the Boolean Hierarchy by \({\rm BH}_k\), and we denote by \({\rm BH}\) the Boolean Hierarchy consisting of all these levels.
Theorem 7. The following statements hold:
Let \(\varphi\) be an ExplAIner formula. Then there exists a \(k \geq 1\) such that, for every class of models \(\mathcal{C}\) such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\), it holds that Eval\((\varphi, \mathcal{C}) \in {\rm BH}_k\).
For every \(k \geq 1\), there exists an ExplAIner formula \(\varphi\) such that Eval\((\varphi, \mathsf{DTree})\) is \({\rm BH}_k\)-hard.
This result tells us that \(\mathrm{\small ExplAIner}\) meets one of the fundamental criteria for an interpretability logic, namely that we can evaluate an \(\mathrm{\small ExplAIner}\) formula over a tuple of partial instances in polynomial time with a polynomial number of calls to an \({\rm NP}\) oracle. In fact, by definition of the Boolean hierarchy, the evaluation of a fixed \(\mathrm{\small ExplAIner}\) formula can be done with a constant number of calls to an \({\rm NP}\) oracle. Thus, we argue that the technology of \(\mathrm{\small SAT}\) solvers will allow us to tractably evaluate \(\mathrm{\small ExplAIner}\) over classes that support consistency and validity checks in polynomial time. More precisely, Theorem 7 requires the class of models \(\mathcal{C}\) to satisfy that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\) in order for \(\mathrm{\small ExplAIner}\) to be able to tractably solve its evaluation problem over that class. This includes decision trees, but also richer representation classes like \(\mathsf{d}\text{-}\mathsf{DNNF}\) circuits. Moreover, this includes fragments of the class of circuits corresponding to propositional formulas in conjunctive normal form (\(\mathsf{CNF}\)) whose satisfiability can be decided in polynomial time, such as the class of circuits corresponding to CNF formulas in which each clause contains at most two literals (\(2\mathsf{CNF}\)), and the class of circuits corresponding to Horn CNF formulas (\(\mathsf{HORN}\)). We formally state these results in the following corollary.
Corollary 1. Let \(\varphi\) be an ExplAIner formula. Then Eval\((\varphi, \mathsf{d}\text{-}\mathsf{DNNF}) \in {\rm BH}\), Eval\((\varphi, 2\mathsf{CNF}) \in {\rm BH}\), and Eval\((\varphi, \mathsf{HORN}) \in {\rm BH}\).
In what follows, we provide a proof of Theorem 7.
Proof of Theorem 7. We consider languages over a finite alphabet \(\Sigma\). First, we introduce Boolean operations between complexity classes as follows [42]:
\(A \vee B = \{L_A \cup L_B \;| \;L_A \in A \text{ and } L_B \in B \}\);
\(A \wedge B = \{L_A \cap L_B \;| \;L_A \in A \text{ and } L_B \in B \}\);
\(\rm{co}A = \{\overline{L} \;| \;L \in A\}\).
Then, the Boolean Hierarchy \({\rm BH}\) is defined as the union \(\cup_{k \geq 1} {\rm BH}_{k}\) [43], where:
\({\rm BH}_{1} = {\rm NP}\);
\({\rm BH}_{2i} = {\rm BH}_{2i-1} \wedge {\rm coNP}\);
\({\rm BH}_{2i + 1} = {\rm BH}_{2i} \vee {\rm NP}\).
Note that \({\rm coNP}\subseteq {\rm BH}_{2}\). In fact, let \(L \in {\rm coNP}\) and note that \(L = \Sigma^\ast \cap L\), where \(\Sigma^\ast \in {\rm BH}_{1}\).
With this definition, every Boolean combination of \({\rm NP}\) and \({\rm coNP}\) languages is contained in \({\rm BH}_{k}\) for some positive integer \(k\).
For the first item of the theorem, let \(\varphi\) be an ExplAIner formula. We know that \(\varphi\) is a fixed Boolean combination of formulas from the quantified layer of ExplAIner. Now let \(\mathcal{C}\) be a class of models such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\). Thanks to the first part of Theorem 6 we know that Eval\((\psi, \mathcal{C}) \in {\rm NP}\) for every formula \(\psi\) from the quantified layer of ExplAIner that appears as a subformula of \(\varphi\). This means that the evaluation problem Eval\((\varphi, \mathcal{C})\) corresponds to a fixed Boolean combination of languages in \({\rm NP}\), and so it must be contained in \({\rm BH}_k\) for some \(k \geq 1\). Notice that such a \(k\) does depend on \(\varphi\) but not on \(\mathcal{C}\).
We now turn our attention to the second item of the theorem. We will first describe a family of decision problems known to be complete for every level of the Boolean hierarchy. As usual, let us denote by \(\mathrm{\small SAT}\) the language of propositional formulas that are satisfiable, and by \(\mathrm{\small UNSAT}\) the language of propositional formulas that are not satisfiable. For each \(k \geq 1\) we define the language \(\mathrm{\small SAT}(k)\) recursively as follows:
\(\mathrm{\small SAT}(1) \;:= \;\{(\varphi_1) \;\mid \;\varphi_1 \in \mathrm{\small SAT}\}\);
\(\mathrm{\small SAT}(2i) \;:= \;\{(\varphi_1, \dots \varphi_{2i}) \;\mid \;(\varphi_1, \dots \varphi_{2i-1}) \in \mathrm{\small SAT}(2i-1) \, \wedge \, \varphi_{2i} \in \mathrm{\small UNSAT}\}\);
\(\mathrm{\small SAT}(2i+1) \;:= \;\{(\varphi_1, \dots \varphi_{2i+1}) \;\mid \;(\varphi_1, \dots \varphi_{2i}) \in \mathrm{\small SAT}(2i) \, \vee \, \varphi_{2i+1} \in \mathrm{\small SAT}\}\).
It is known that, for every \(k \geq 1\), \(\mathrm{\small SAT}(k)\) is \({\rm BH}_k\)-complete [43]. We will now fix a \(k \geq 1\) and prove that there exists an \(\mathrm{\small ExplAIner}\) formula \(\varphi_k\) such that \(\mathrm{\small SAT}(k)\) can be reduced in polynomial time to Eval\((\varphi_k, \mathsf{DTree})\), thus concluding the hardness item of the theorem.
We know from Lemma 5 that the following language is \({\rm NP}\)-hard: \[L = \{ (\mathcal{T}, \mathbf{e}, \mathbf{e}') \;\mid \;\mathcal{T}\text{ is a decision tree, } \mathbf{e}\text{ and } \mathbf{e}' \text{ are partial instances and } \mathcal{T}\models \neg\mathsf{mAXp}(\mathbf{e}, \mathbf{e}')\}.\] Also, because the class of decision trees satisfies the hypothesis of the first item of Theorem 6, we actually know that \(L\) is \({\rm NP}\)-complete. Hence, we have a polynomial-time algorithm that, given a propositional formula \(\psi\), constructs a decision tree \(\mathcal{T}_\psi\) and partial instances \(\mathbf{e}_{\psi}\), \(\mathbf{e}_{\psi}'\) such that: \[\label{sat95reduction} \psi \in \mathrm{\small SAT}\quad \iff \quad \mathcal{T}_\psi \models \neg \mathsf{mAXp}(\mathbf{e}_{\psi}, \mathbf{e}_{\psi}').\tag{3}\]
Let \((\psi_1, \ldots, \psi_k)\) be a tuple of \(k\) propositional formulas, and assume that, for each \(i \in \{1,\dots,k\}\), the decision tree \(\mathcal{T}_{\psi_i}\) has dimension \(n_i\). Then a decision tree \(\mathcal{T}\) of dimension \(d = k + \sum_{\ell=1}^k{n_\ell}\) is defined as follows:
Figure 3:
.
where, for each \(i \in \{1, \dots, k\}\), \(\mathcal{T}_{\psi_i}\) mentions the features: \[B_i \;:= \;\{s_i +1,\, s_i+2,\, \dots s_i+n_i\} \qquad \text{where } s_i = k + \sum_{\ell=1}^{i-1}{n_\ell}.\] This way, we ensure that, for every \(i \neq j\), \(\mathcal{T}_{\psi_i}\) and \(\mathcal{T}_{\psi_j}\) are defined over disjoint sets of features. Moreover, define the following partial instances of dimension \(d\):
For each \(i \in \{1, \ldots, k\}\), the partial instance \(\mathbf{e}_i\) is defined as \(\{0\}^{i-1} \cdot \{1\} \cdot \{0\}^{k-i} \cdot \{\bot\}^{d-k}\).
For each \(i \in \{1, \ldots, k\}\), the partial instances \(\mathbf{e}_{i,1}\) and \(\mathbf{e}_{i,2}\) are defined as follows:
\(\mathbf{e}_{i,1}[i] = \mathbf{e}_{i,2}[i] = 1\);
\(\mathbf{e}_{i,1}[j] = \mathbf{e}_{i,2}[j] = 0\) for every \(j \in \{1, \ldots, k\} \setminus \{i\}\);
\(\mathbf{e}_{i,1}[j] = \mathbf{e}_{\psi_i}[j - s_i]\) for every \(j \in B_i\);
\(\mathbf{e}_{i,2}[j] = \mathbf{e}_{\psi_i}'[j - s_i]\) for every \(j \in B_i\);
\(\mathbf{e}_{i,1}[j] = 0\) for every \(j \in \{k+1, \ldots, d\} \setminus B_i\);
\(\mathbf{e}_{i,2}[j] = \bot\) for every \(j \in \{k+1, \ldots, d\} \setminus B_i\).
Moreover, consider the following \(\mathrm{\small ExplAIner}\) formulas: \[\begin{align} \mathsf{rwAXp}(x,y,w) &:=& w \subseteq x \wedge w \subseteq y \wedge \mathsf{Full}(x) \wedge y \subseteq x \wedge (\mathsf{AllPos}(x) \to \mathsf{AllPos}(y)) \wedge (\mathsf{AllNeg}(x) \to \mathsf{AllNeg}(y)); \\ \mathsf{rmAXp}(x,y,w) &:=& \mathsf{rwAXp}(x,y,w) \;\wedge \;\neg \exists z \, \big(w \subseteq z \, \wedge \, \mathsf{rwAXp}(x,z,w) \, \wedge \, z \prec y\big). \end{align}\] These formulas should be interpreted as the usual predicates, but relativized to one branch of \(\mathcal{T}\). More concretely, the partial instance \(w\) will serve to select in which of the branches \(\mathcal{T}_{\psi_1}, \mathcal{T}_{\psi_2}, \dots, \mathcal{T}_{\psi_k}\) we will look at.
Notice that the decision tree \(\mathcal{T}\) and the partial instances \(\mathbf{e}_1\), \(\ldots\), \(\mathbf{e}_k\), \(\mathbf{e}_{1,1}\), \(\mathbf{e}_{1,2}\), \(\ldots\), \(\mathbf{e}_{k,1}\), \(\mathbf{e}_{k,2}\) can be constructed in polynomial time in the size of \((\psi_1, \ldots, \psi_k)\). Besides, from the definition of these elements, for every \(i \in \{1, \ldots, k\}\) it holds that \[\label{lem:bh-foilpm} \mathcal{T}_{\psi_i} \models\;\mathsf{mAXp}(\mathbf{e}_{\psi_i}, \mathbf{e}_{\psi_i}') \quad \iff \quad \mathcal{T}\models\;\mathsf{rmAXp}(\mathbf{e}_{i,1}, \mathbf{e}_{i, 2}, \mathbf{e}_i).\tag{4}\] Finally, let \(\varphi_k\) be the \(\mathrm{\small ExplAIner}\) formula obtained by constructing the following sequences of formulas \(\alpha_1, \dots, \alpha_k\), and then defining \(\varphi_k(x_{1,1}, x_{1,2}, x_1, \ldots, x_{k,1}, x_{k,2}, x_k) := \alpha_k(x_{1,1}, x_{1,2}, x_1, \ldots, x_{k,1}, x_{k,2}, x_k)\): \[\begin{align} \alpha_1 &:=& \neg \mathsf{rmAXp}(x_{1,1}, x_{1, 2}, x_1);\\ \alpha_{2 \ell} &:=& (\alpha_{2 \ell - 1} \wedge \mathsf{rmAXp}(x_{2\ell,1}, x_{2\ell, 2}, x_{2\ell})); \\ \alpha_{2 \ell + 1} &:=& (\alpha_{2 \ell} \vee \neg \mathsf{rmAXp}(x_{2\ell+1,1}, x_{2\ell+1, 2}, x_{2\ell+1})). \end{align}\] For example, we have that: \[\begin{align} \alpha_{2} & = & (\neg \mathsf{rmAXp}(x_{1,1}, x_{1, 2}, x_1) \wedge \mathsf{rmAXp}(x_{2,1}, x_{2, 2}, x_{2})) \\ \alpha_{3} & = & (\neg \mathsf{rmAXp}(x_{1,1}, x_{1, 2}, x_1) \wedge \mathsf{rmAXp}(x_{2,1}, x_{2, 2}, x_{2})) \vee \neg \mathsf{rmAXp}(x_{3,1}, x_{3, 2}, x_{3}) \end{align}\] Combining conditions 3 and 4 with the definition \(\varphi_k(x_{1,1}, x_{1,2}, x_1, \ldots, x_{k,1}, x_{k,2}, x_k)\), we conclude that \((\psi_1, \ldots, \psi_k) \in \mathrm{\small SAT}(k)\) if and only if \(\mathcal{T}\models \varphi_k(\mathbf{e}_{1,1}, \mathbf{e}_{1,2}, \mathbf{e}_1, \ldots, \mathbf{e}_{k,1}, \mathbf{e}_{k,2}, \mathbf{e}_k)\). Given that \(\mathrm{\small SAT}(k)\) is \({\rm BH}_k\)-complete and that the decision tree \(\mathcal{T}\) and the partial instances \(\mathbf{e}_{1,1}\), \(\mathbf{e}_{1,2}\), \(\mathbf{e}_1\), \(\ldots\), \(\mathbf{e}_{k,1}\), \(\mathbf{e}_{k,2}\), \(\mathbf{e}_k\) can be constructed in polynomial time in the size of \((\psi_1, \ldots, \psi_k)\), we conclude that Eval\((\varphi_k, \mathsf{DTree})\) is \({\rm BH}_k\)-hard. This completes the proof of the theorem. ◻
\(\mathrm{\small ExplAIner}\) allows us to express in a simple way the basic notions of explainability studied in this paper. Moreover, its evaluation problem is tractable given access to \(\mathrm{\small SAT}\) solvers. 4 shows how all the queries defined in Section 2.2 can be expressed in the \(\mathrm{\small ExplAIner}\) logic. Just for clarity we use unguarded universal quantifiers, which are not allowed according to the \(\mathrm{\small ExplAIner}\) syntax, because in these cases they can be rewritten as negations of unguarded existential quantifiers, as we discussed in Section 4.3. We also make use of some auxiliary predicates defined in the appendix (refer to Section 8.7).
Probably the most complicated formula of this section is the one used to express the query of relevant feature \(\mathsf{RF}(x, y)\). The idea there is to guess a weak abductive explanation \(w\) containing the assigned feature under consideration and verify that undefining the feature makes \(w\) lose the property of weak abductiveness. In fact, suppose first that \(y\) is indeed a relevant feature for \(x\). Then some abductive explanation \(w\) contains \(y\). Because \(w\) is minimal, undefining \(y\) from \(w\) cannot produce another weak abductive explanation, so the witness pair \(w, z\) exists. Conversely, if \(y\) is not a relevant feature for \(x\), then it cannot be contained in any minimal abductive explanation for \(x\). Assume toward a contradiction that there exist witnesses \(w\) and \(z\) for the formula, where \(w\) is a weak abductive explanation containing \(y\), \(z\) is obtained from \(w\) by undefining \(y\), and \(z\) is not a weak abductive explanation. Now let \(u \subseteq w\) be an abductive explanation. As \(y\) is not relevant, \(u\) cannot contain \(y\), and therefore \(u \subseteq z\). Since every completion of \(z\) is also a completion of \(u\), it would follow that \(z\) is a weak abductive explanation, a contradiction. Hence no such witness pair \(w, z\) can exist.
None
Figure 4: Formulas that express all queries in Section 2.2 using \(\mathrm{\small ExplAIner}\)..
It should be noted that if \(\mathcal{C}\) is a class of models such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) but Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \not\in {\rm P}\) (under standard complexity-theoretic assumptions), then we still have that the problem Eval\((\psi, \mathcal{C})\) is in the Boolean hierarchy for the \(\mathrm{\small ExplAIner}\) formulas \(\psi\) that do not mention the predicate \(\mathsf{AllNeg}(x)\). Hence, the evaluation problem for this restricted fragment is still in the Boolean hierarchy, thus satisfying our criteria for an interpretability logic. This is the case, for example, for \(\mathsf{CNF}\) formulas, for which validity checks can be done in polynomial time but checking unsatisfiability is \({\rm coNP}\)-complete. In this case, we can still express queries such as minimum change required and maximum change allowed, since they can be expressed in \(\mathrm{\small ExplAIner}\) without mentioning the predicate \(\mathsf{AllNeg}(x)\). Similarly, if \(\mathcal{C}\) is a class of models such that Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\) but Eval\((\mathsf{AllPos}(x), \mathcal{C}) \not\in {\rm P}\) (for example, \(\mathsf{DNF}\) formulas), then we still have that the evaluation problem is in the Boolean hierarchy for \(\mathrm{\small ExplAIner}\) formulas \(\psi\) that do not mention the predicate \(\mathsf{AllPos}(x)\).
Despite all the virtues of \(\mathrm{\small ExplAIner}\), unfortunately it is in general not able to solve computation problems efficiently. In fact, note that the ability to tractably evaluate queries over concrete partial instances does not directly imply that positive answers to the query can be constructed efficiently. We devote the rest of the paper to addressing this problem and propose a third logic that resolves it.
Given an \(\mathrm{\small ExplAIner}\) formula \(\varphi(x, u_1, \ldots, u_k)\), we use the notation \(\varphi[u_1, \ldots, u_k](x)\) to indicate that \(x\) is a distinguished variable and \(u_1, \ldots, u_k\) are parameters that define the possible values for \(x\). In general, we use this syntax when \(x\) stores an explanation given an assignment for the variables \(u_1\), \(\ldots\), \(u_\ell\). For example, we write \(\varphi[u](x) = \mathsf{AXp}(u, x)\) to indicate that \(x\) is an abductive explanation given an assignment for the variable \(u\) (that is, \(x\) is an abductive explanation for \(u\)).
For each query \(\varphi[x_1, \ldots, x_k](x)\) in \(\mathrm{\small ExplAIner}\) and \(\mathcal{C}\) a class of models, we define the computation problem \(\mathsf{Comp}(\varphi, \mathcal{C})\) as follows:
We proved in Section 4.3 that the \(\mathrm{\small ExplAIner}\) logic admits tractable evaluations over adequate classes of models, which allows us to check if a partial instance is an answer for some explainability query. The next step in the study of \(\mathrm{\small ExplAIner}\) is to establish the complexity of actually computing such answers. Unfortunately, the following result tells us that this problem cannot be solved with a polynomial number of calls to an \({\rm NP}\) oracle, showing an important limitation of \(\mathrm{\small ExplAIner}\).
Theorem 8. There exists an ExplAIner formula \(\varphi[y, z](x)\) such that \(\mathsf{Comp}(\varphi[y, z](x),\, \mathsf{DTree}) \not \in {\rm FP}^{{\rm NP}}\) unless \({\rm PH}\) collapses to \({\rm P}^{{\rm NP}}\).
Proof. Consider the following ExplAIner formula: \[\varphi(x, y, z) \;:= \;{\sf MaxRel}(x, y) \wedge \neg \exists w \;[{\sf MaxRel}(w, z) \wedge x \subseteq w \wedge \mathsf{AllNeg}(w)],\] where \({\sf MaxRel}(x,y)\), defined during the proof of Theorem 2, is a formula from the atomic layer of ExplAIner such that \(\mathcal{M}\models {\sf MaxRel}(\mathbf{e},\mathbf{e}')\) if and only if \(\mathbf{e}_\bot = \mathbf{e}'_\bot\), i.e., the sets of undefined features in \(\mathbf{e}\) and \(\mathbf{e}'\) are the same. Now consider the formula \(\varphi(y, z) := \exists x\;\varphi(x, y, z)\), which is a FOIL formula with predicates \(\{\subseteq, \preceq, \mathsf{AllPos}, \mathsf{AllNeg}\}\). We will show that Eval\((\varphi, \mathsf{DTree})\) is \({\rm NP}^{{\rm NP}}\)-hard by a Karp reduction from the following well-known \({\rm NP}^{{\rm NP}}\)-complete problem (see [44] for a reference): given a propositional formula \(\alpha(\boldsymbol{p}, \boldsymbol{q})\) in \(\mathsf{DNF}\), where \(\boldsymbol{p}\) and \(\boldsymbol{q}\) are sets of variables, decide if the quantified propositional formula \(\exists \boldsymbol{p} \forall \boldsymbol{q}\;\alpha(\boldsymbol{p}, \boldsymbol{q})\) is true. We will describe a polynomial-time reduction that constructs a decision tree \(\mathcal{T}_{\alpha}\) and partial instances \(\mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}'\) such that \(\exists \boldsymbol{p} \forall \boldsymbol{q}\;\alpha(\boldsymbol{p}, \boldsymbol{q})\) is true if and only if \(\mathcal{T}_{\alpha} \models \varphi(\mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\).
Let \(n\) be the number of terms in \(\alpha\). We construct a decision tree \(\mathcal{T}_{\alpha}\) of dimension \(n + |\boldsymbol{p}| + |\boldsymbol{q}|\). We partition the features of \(\mathcal{T}_{\alpha}\) into three consecutive blocks \(H\), \(E\) and \(U\), where \(|H| = n\), \(|E| = |\boldsymbol{p}|\), and \(|U| = |\boldsymbol{q}|\). The block \(H\) will be used to select a term from \(\alpha\), while \(E\) and \(U\) will encode truth assignments to the existential \(\boldsymbol{p}\) and to the universal variables \(\boldsymbol{q}\), respectively.
For every term \(h_r\) (\(1 \leq r \leq n\)) we construct a decision tree \(C_r\) over \(E\) and \(U\) features in such a way that an input to that tree encoding a truth assignment reaches a \(\mathbf{true}\) leaf if and only if the term \(h_r\) evaluated over that assignment is \(\mathbf{true}\). We now explain how to construct \(\mathcal{T}_{\alpha}\). We use the feature corresponding to term \(h_{1}\) as the root. For every \(i < n\), the outgoing edge of \(h_i\) labeled by \(1\) is connected to \(h_{i+1}\), and the outgoing edge of \(h_n\) labeled by \(1\) is connected to a \(\mathbf{false}\) leaf. Also, for every \(i\), we connect the outgoing edge labeled by \(0\) of \(h_i\) to a copy of the tree \(C_i\). An example is shown in 5.
Set \(\mathbf{e}_{\alpha} = \{\bot\}^{n} \cdot \{0\}^{|\boldsymbol{p}|} \cdot \{\bot\}^{|\boldsymbol{q}|}\) and \(\mathbf{e}_{\alpha}' = \{\bot\}^{n} \cdot \{0\}^{|\boldsymbol{p}|+|\boldsymbol{q}|}\). We now show that the reduction is correct.
First suppose that \(\exists \boldsymbol{p} \forall \boldsymbol{q}\;\alpha(\boldsymbol{p}, \boldsymbol{q})\) is true. Let \(\nu\) be a truth assignment for the variables \(\boldsymbol{p}\) such that for every truth assignment \(\sigma\) for the variables \(\boldsymbol{q}\) it holds that \(\alpha(\nu(\boldsymbol{p}), \sigma(\boldsymbol{q}))\) is true. Let \(\mathbf{e}_{\alpha}''\) be a partial instance with just its \(E\) features defined according to \(\nu\). Notice that \(\mathbf{e}_{\alpha}''\) and \(\mathbf{e}_{\alpha}\) have the same defined features. We claim that \(\varphi(\mathbf{e}_{\alpha}'', \mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\). In fact, let \(\mathbf{e}_{\alpha}'''\) be a partial instance with the same defined features as \(\mathbf{e}_{\alpha}'\) and such that \(\mathbf{e}_{\alpha}'' \subseteq \mathbf{e}_{\alpha}'''\). Notice that \(\mathbf{e}_{\alpha}'''\) naturally encodes a truth assignment \(\sigma\) for the variables \(\boldsymbol{q}\) together with \(\nu\). By taking a completion of \(\mathbf{e}_{\alpha}'''\) that has a \(0\) in the feature corresponding to a true term under the truth assignment \((\nu, \sigma)\) and a \(1\) in the features corresponding to all previous terms, we can see that \(\neg \mathsf{AllNeg}(\mathbf{e}_{\alpha}''')\). This shows that \(\varphi(\mathbf{e}_{\alpha}'', \mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\), and therefore \(\mathcal{T}_{\alpha} \models \varphi(\mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\).
Now suppose that \(\mathcal{T}_{\alpha} \models \varphi(\mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\), so that there exists a partial instance \(\mathbf{e}_{\alpha}''\) such that \(\varphi(\mathbf{e}_{\alpha}'', \mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\). Because \(\mathbf{e}_{\alpha}''\) has the same defined features as \(\mathbf{e}_{\alpha}\), we can define a truth assignment \(\nu\) for the variables \(\boldsymbol{p}\) according to \(\mathbf{e}_{\alpha}''\). Now let \(\sigma\) be any truth assignment for the variables \(\boldsymbol{q}\). We claim that \(\alpha(\nu(\boldsymbol{p}), \sigma(\boldsymbol{q}))\) is true. In fact, let \(\mathbf{e}_{\alpha}'''\) be the partial instance with the same defined features as \(\mathbf{e}_{\alpha}'\) and which corresponds to the pair \((\nu, \sigma)\). Because we have that \(\varphi(\mathbf{e}_{\alpha}'', \mathbf{e}_{\alpha}, \mathbf{e}_{\alpha}')\), it must be the case that \(\neg \mathsf{AllNeg}(\mathbf{e}_{\alpha}''')\). That means that there exists a completion of \(\mathbf{e}_{\alpha}'''\) that is evaluated as \(\mathbf{true}\) by \(\mathcal{T}_{\alpha}\). That necessarily means that there is a term in \(\alpha(\nu(\boldsymbol{p}), \sigma(\boldsymbol{q}))\) that is being satisfied. Hence \(\exists \boldsymbol{p} \forall \boldsymbol{q}\;\alpha(\boldsymbol{p}, \boldsymbol{q})\) is true.
This reduction shows that Eval\((\varphi, \mathsf{DTree})\) is \({\rm NP}^{{\rm NP}}\)-hard. To conclude the proof of the theorem, assume for the sake of contradiction that \(\mathsf{Comp}(\varphi[y, z](x),\, \mathsf{DTree}) \in {\rm FP}^{{\rm NP}}\). Then, it is clear that we would have Eval\((\varphi, \mathsf{DTree}) \in {\rm P}^{{\rm NP}}\). Finally, \({\rm P}^{{\rm NP}} = {\rm NP}^{{\rm NP}}\) implies that \({\rm PH}= {\rm P}^{{\rm NP}}\). ◻
To solve the problem that Theorem 8 signifies, we now propose \(\mathrm{\small Opt-FOIL}\), a logic that is defined by introducing a minimality operator over a subset of \(\mathrm{\small ExplAIner}\). As we will show in the next section, \(\mathrm{\small Opt-FOIL}\) meets all the criteria for an appropriate interpretability logic.
Our aim is to capture the right subset of \(\mathrm{\small ExplAIner}\) that meets all the criteria for an interpretability logic. For this, we will define a third logic called \(\mathrm{\small Opt-FOIL}\). We will show that the computation problem for this logic can be solved in polynomial time with a polynomial number of calls to an \({\rm NP}\) oracle.
We will say that a formula \(\rho(x, y, v_1, \ldots, v_\ell)\) from the atomic layer of \(\mathrm{\small ExplAIner}\) represents a strict partial order if, for every natural number \(n\) and assignment of partial instances of dimension \(n\) to the variables \(v_1\), \(\ldots\), \(v_\ell\), the resulting binary relation over the variables \(x\) and \(y\) is a strict partial order over the partial instances of dimension \(n\). Formally, \(\rho(x, y, v_1, \ldots, v_\ell)\) represents a strict partial order if, for every \(n \in \mathbb{N}\), \[\mathfrak{B}_n \models \;\forall v_1 \cdots \forall v_\ell \, \big[ \forall x \, \neg \rho(x, x, v_1, \ldots, v_\ell) \wedge \forall x \forall y \forall z \,\big( (\rho(x, y, v_1, \ldots, v_\ell) \wedge \rho(y, z, v_1, \ldots, v_\ell)) \to \rho(x, z, v_1, \ldots, v_\ell)\big)\big].\]
The variables \(v_1\), \(\ldots\), \(v_\ell\) in the formula \(\rho(x, y, v_1, \ldots, v_\ell)\) are considered as parameters that define a strict partial order. In fact, different assignments for these variables can give rise to different orders. Hence, we use the notation \(\rho[v_1, \ldots, v_\ell](x, y)\) to make explicit the distinction between the parameters \(v_1\), \(\ldots\), \(v_\ell\) and the variables \(x\), \(y\) that are instantiated with partial instances. For example, the strict partial order determined by the subsumption relation is defined by the formula \(\rho_1(x, y) = x \subset y\).
As a second example, consider the case where a certain feature must be disregarded when defining an order on partial instances (for instance, it is often undesirable to use the feature gender for comparisons). Such an order can be defined as follows. Notice that, with the appropriate values for the variables \(v_1\) and \(v_2\), the following formula checks whether the \(i\)-th feature of \(x\) is undefined: \[\mathsf{UF}(x, v_1, v_2) \;:= \;\neg(v_1 \subseteq x) \wedge \neg(v_2 \subseteq x).\] For example, if we are considering partial instances of dimension \(5\) and we need to check whether instance \(x\) has value \(\bot\) in the first feature, then we can use the values \(c_1 = (0, \bot, \bot, \bot, \bot)\) and \(c_2 = (1, \bot, \bot, \bot, \bot)\) for the variables \(v_1\) and \(v_2\), respectively. Moreover, let \[\mathsf{Pr}(x, y) \;:= \;x \subset y \wedge \neg \exists z \, (x \subset z \wedge z \subset y)\] be a formula that checks whether \(x\) is a predecessor of \(y\) under the order \(\subset\). Now define \[\mathsf{Strip}[v_1,v_2](x, y) \;:= \;(\mathsf{UF}(x,v_1,v_2) \wedge x=y) \;\vee \;(\neg \mathsf{UF}(x,v_1,v_2) \wedge \mathsf{Pr}(y,x) \wedge \mathsf{UF}(y,v_1,v_2)).\] Notice that, with the appropriate values for \(v_1\) and \(v_2\), \(\mathsf{Strip}[v_1,v_2](x,y)\) holds if and only if \(y\) is obtained from \(x\) by undefining the distinguished feature when necessary. Then, the following formula defines a strict partial order based on \(\subset\) but that disregards the \(i\)-th feature when comparing partial instances: \[\rho_2[v_1,v_2](x,y) \;:= \;\exists x' \exists y' \;\bigl(\mathsf{Strip}[v_1,v_2](x,x') \, \wedge \, \mathsf{Strip}[v_1,v_2](y,y') \, \wedge \, x' \subset y' \bigr).\]
For example, \(\rho_2[c_1, c_2](x, y)\) with constants \(c_1\) and \(c_2\) mentioned above defines a strict partial order that disregards the first feature when comparing partial instances of dimension \(5\).
Formulas from the atomic layer of \(\mathrm{\small ExplAIner}\) representing strict partial orders will be used in the definition of \(\mathrm{\small Opt-FOIL}\). Hence, it is necessary to have an algorithm that verifies whether this condition is satisfied in order to have a decidable syntax for \(\mathrm{\small Opt-FOIL}\). We will now prove that such an algorithm exists.
Proposition 9. The problem of verifying, given a formula \(\rho[v_1, \ldots, v_\ell](x, y)\) from the atomic layer of \(\mathrm{\small ExplAIner}\), whether it represents a strict partial order can be solved in \(2^{2^{\rm{poly}\big(|\rho| \cdot 3^{\rm{wd}(\rho)} \big)}}\) space, and, hence, in \(2^{2^{2^{\rm{poly}\big(|\rho| \cdot 3^{\rm{wd}(\rho)} \big)}}}\) time.
Proof. Let \(\rho(x, y, v_1, \ldots, v_\ell)\) be an arbitrary formula from the atomic layer of \(\mathrm{\small ExplAIner}\), that is, a formula over the vocabulary \(\{\subseteq, \preceq\}\). Then, we consider the following sentence: \[\begin{align} \varphi \;:= \;\forall v_1 \cdots \forall v_\ell \, \big[ \forall x \, \neg \rho(x, x, v_1, \ldots, v_\ell) \;\wedge \forall x \forall y \forall z \,\big( (\rho(x, y, v_1, \ldots, v_\ell) \wedge \rho(y, z, v_1, \ldots, v_\ell)) \to \rho(x, z, v_1, \ldots, v_\ell)\big)\big]. \end{align}\] Notice that \(\varphi\) has width \(\rm{wd}(\varphi) \leq \rm{wd}(\rho)+1\). By definition, determining if \(\rho\) corresponds to a strict partial order is equivalent to checking if for every structure \(\mathfrak{B}_n\) it holds that \(\mathfrak{B}_n \models \varphi\). Thanks to the second part of Theorem 5, we know that this can be done in the stated space. ◻
Proposition 9 serves as a theoretical upper bound to prove that \(\mathrm{\small Opt-FOIL}\) has a decidable syntax. Observe that if we restrict ourselves to formulas of bounded width, then the space complexity falls from triple exponential to double exponential in \(|\rho|\) (which implies that the time complexity is triple exponential in \(|\rho|\)). In practice, we expect formulas representing strict partial orders to be small and to have a simple structure, so we do not expect this theoretical high computational complexity to pose an actual implementation obstacle.
We now explain how strict partial orders will be used in the logic \(\mathrm{\small Opt-FOIL}\).
Given a formula \(\varphi[u_1, \ldots, u_k](x)\) from the quantified layer of ExplAIner and another formula \(\rho[v_1, \ldots, v_\ell](y, z)\) from the atomic layer of ExplAIner that represents a strict partial order, an \(\mathrm{\small Opt-FOIL}\) formula is an expression of the following form: \[\Psi[u_1, \ldots, u_k, v_1, \ldots, v_\ell](x) \;= \;\text{\rm min}[\varphi[u_1, \ldots, u_k](x), \rho[v_1, \ldots, v_\ell](y, z)].\]
Notice that \(x\), \(u_1, \ldots, u_k\), \(v_1, \ldots, v_\ell\) are the free variables of this expression, while the variables \(y\), \(z\) will be quantified. In particular, \(u_1, \ldots, u_k\) are the parameters that define the notion of explanation, \(v_1, \ldots, v_\ell\) are the parameters that define the strict partial order, and \(x\) is a variable used to store an explanation that is minimal in the sense given by the strict partial order. The semantics of \(\Psi[u_1, \ldots, u_k, v_1, \ldots, v_\ell](x)\) is defined by considering the following ExplAIner formula: \[\theta_{\text{\rm min}}(x, u_1, \ldots, u_k, v_1, \ldots, v_\ell) \;:= \;\varphi(x, u_1, \ldots, u_k) \;\wedge \; \neg \exists y \;\big(\varphi(y, u_1, \ldots, u_k) \, \wedge \, \rho(y, x, v_1, \ldots, v_\ell)\big).\] More precisely, given a model \(\mathcal{M}\) of dimension \(n\) and partial instances \(\mathbf{e}\), \(\mathbf{e}'_1, \ldots, \mathbf{e}'_k\), \(\mathbf{e}''_1, \ldots, \mathbf{e}''_\ell\) of dimension \(n\), we define that \(\mathcal{M}\models \Psi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k, \mathbf{e}''_1, \ldots, \mathbf{e}''_\ell](\mathbf{e})\) if and only if \(\mathcal{M}\models \theta_{\text{\rm min}}(\mathbf{e}, \mathbf{e}'_1, \ldots, \mathbf{e}'_k, \mathbf{e}''_1, \ldots, \mathbf{e}''_\ell)\).
The computation problem for \(\mathrm{\small Opt-FOIL}\) has to be defined considering the different roles of the variables in the formula \(\Psi[u_1, \ldots, u_k, v_1, \ldots, v_\ell](x)\). In particular, the parameters \(u_1, \ldots, u_k, v_1, \ldots, v_\ell\) should be given as input, while the value of \(x\) is the explanation to be computed. The following definition takes these considerations into account. As usual, we write \(\mathcal{C}\) to denote some class of models.
We now show that \(\mathrm{\small Opt-FOIL}\) fulfills our criteria by establishing that the computation problem for \(\mathrm{\small Opt-FOIL}\) can be solved in polynomial time with a polynomial number of calls to an \({\rm NP}\) oracle:
Theorem 10. Let \(\mathcal{C}\) be a class of models such that Eval\((\mathsf{AllPos}(x), \mathcal{C}) \in {\rm P}\) and Eval\((\mathsf{AllNeg}(x), \mathcal{C}) \in {\rm P}\). Then Comp\((\Psi, \mathcal{C}) \in {\rm FP}^{{\rm NP}}\) for every formula \(\Psi\) in Opt-FOIL.
As a corollary of this result, we obtain that \(\mathrm{\small Opt-FOIL}\) can be used to compute explanations in polynomial time using a polynomial number of calls to an \({\rm NP}\) oracle for the class of decision trees. Moreover, the same holds for more expressive representation classes, including \(\mathsf{d}\text{-}\mathsf{DNNF}\) circuits and fragments of the class of circuits corresponding to propositional formulas in conjunctive normal form (\(\mathsf{CNF}\)) whose satisfiability is decidable in polynomial time, such as 2-CNF formulas (\(2\mathsf{CNF}\)) and Horn CNF formulas (\(\mathsf{HORN}\)). We formally state these results in the following corollary.
Corollary 2. Let \(\varphi\) be an Opt-FOIL formula. Then Comp\((\varphi, \mathsf{d}\text{-}\mathsf{DNNF}) \in {\rm FP}^{{\rm NP}}\), Comp\((\varphi, 2\mathsf{CNF}) \in {\rm FP}^{{\rm NP}}\), and Comp\((\varphi, \mathsf{HORN}) \in {\rm FP}^{{\rm NP}}\).
Proof of Theorem 10. Let \(\rho[v_1, \ldots, v_\ell](x,y)\) be a formula from the atomic layer of ExplAIner that represents a strict partial order. We say that a sequence \((\mathbf{e}_1, \ldots, \mathbf{e}_k)\) of partial instances of dimension \(n\) is a path of dimension \(n\) in \(\rho[v_1, \ldots, v_\ell](x,y)\) if there exist partial instances \(\mathbf{e}'_1\), \(\ldots\), \(\mathbf{e}'_\ell\) of dimension \(n\) such that, for every \(i \in \{1, \ldots, k-1\}\), it holds that \[\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_i,\mathbf{e}_{i+1}).\]
The following lemma shows that, for a fixed formula \(\rho[v_1, \ldots, v_\ell](x,y)\), the lengths of such paths are polynomially bounded with respect to \(n\) (refer to Section 8.6 for the proof).
Lemma 6. Let \(\rho[v_1, \ldots, v_\ell](x,y)\) be a formula from the atomic layer of ExplAIner that represents a strict partial order. Then there exists a fixed polynomial \(p\) such that for every path \((\mathbf{e}_1, \ldots, \mathbf{e}_k)\) of dimension \(n\) in \(\rho[v_1, \ldots, v_\ell](x,y)\), it holds that \(k \leq p(n)\).
Lemma 6 gives us a simple algorithm to compute a solution for an \(\mathrm{\small Opt-FOIL}\) formula \[\begin{align} \text{\rm min}[\varphi[u_1, \ldots, u_k](x), \rho[v_1, \ldots, v_\ell](y, z)], \end{align}\] given as input a model \(\mathcal{M}\in \mathcal{C}\) of dimension \(n\) and partial instances \(\mathbf{e}'_1\), \(\ldots\), \(\mathbf{e}'_k\), \(\mathbf{e}''_1\), \(\ldots\), \(\mathbf{e}''_\ell\) of dimension \(n\). We first use an \({\rm NP}\) oracle to verify whether \(\mathcal{M}\models \exists x \, \varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](x)\), which is a formula from the quantified layer of ExplAIner. If \(\mathcal{M}\not\models \exists x \, \varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](x)\), then the answer is No. Otherwise, the \({\rm NP}\) oracle can be used to construct an initial partial instance \(\mathbf{e}_0\) such that \(\mathcal{M}\models \varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](\mathbf{e}_0)\). The idea is to maintain a current partial assignment \(\mathbf{e}''\) (originally set to \(\{\bot\}^n\)) of the features that is known to extend to some witness. For each feature, we query whether there exists a witness extending \(\mathbf{e}''\) but with that feature fixed to \(0\). If the answer is positive, we keep that feature as \(0\) in \(\mathbf{e}''\), otherwise we query whether there exists one extending \(\mathbf{e}''\) but with that feature fixed to \(1\). If that answer is positive, we keep that feature as \(1\), and if both answers are negative, then we leave the feature undefined. This way, the invariant is preserved at every step, and after at most \(2n\) oracle queries we obtain the partial instance \(\mathbf{e}_0\).
We then use the \({\rm NP}\) oracle to verify whether \[\begin{align} \mathcal{M}\;\models \;\exists x \, \big(\varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](x) \;\wedge \;\rho[\mathbf{e}''_1, \ldots, \mathbf{e}''_\ell](x, \mathbf{e}_0)\big); \end{align}\] which can be written as a formula from the quantified layer of ExplAIner by appending ‘\(\wedge \, \rho[\mathbf{e}''_1, \ldots, \mathbf{e}''_\ell](x, \mathbf{e}_0)\)’ within all the quantifiers of \(\varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](x)\). If the answer is positive, then again we use the \({\rm NP}\) oracle as described before to construct a partial instance \(\mathbf{e}_1\) such that \[\begin{align} \mathcal{M}\;\models \;\varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](\mathbf{e}_1) \;\wedge \;\rho[\mathbf{e}''_1, \ldots, \mathbf{e}''_\ell](\mathbf{e}_1, \mathbf{e}_0). \end{align}\] The algorithm continues in this way, constructing a sequence of partial instances \((\mathbf{e}_i, \mathbf{e}_{i-1}, \ldots, \mathbf{e}_0)\) that constitutes a path of dimension \(n\) in \(\rho[v_1, \ldots, v_\ell](y, z)\). The algorithm stops when the condition \[\begin{align} \mathcal{M}\;\models \;\exists x \, \big(\varphi[\mathbf{e}'_1, \ldots, \mathbf{e}'_k](x) \wedge \rho[\mathbf{e}''_1, \ldots, \mathbf{e}''_\ell](x, \mathbf{e}_i)\big) \end{align}\] does not hold, which by construction guarantees that \(\mathbf{e}_i\) is a minimal instance. Lemma 6 guarantees that \(\mathbf{e}_i\) will be found in a polynomial number of steps. Since in each step we call the \({\rm NP}\) oracle a polynomial number of times, this concludes the proof of the theorem. ◻
We now begin the study of the expressiveness of \(\mathrm{\small Opt-FOIL}\). As is customary, we say that a logic \(\mathcal{L}_1\) is contained in a logic \(\mathcal{L}_2\) if for every formula in \(\mathcal{L}_1\) there exists an equivalent formula in \(\mathcal{L}_2\). Moreover, \(\mathcal{L}_1\) is properly contained in \(\mathcal{L}_2\) if \(\mathcal{L}_1\) is contained in \(\mathcal{L}_2\) and \(\mathcal{L}_2\) is not contained in \(\mathcal{L}_1\). The following proposition shows that the expressive power of \(\mathrm{\small Opt-FOIL}\) is less than that of \(\mathrm{\small ExplAIner}\), which in turn has less expressive power than \(\mathrm{\small FOIL}\) with predicates \(\{\subseteq, \preceq, \mathsf{AllPos}, \mathsf{AllNeg}\}\).
Proposition 11. Assuming that the polynomial hierarchy does not collapse, Opt-FOIL is strictly contained in ExplAIner, and ExplAIner is strictly contained in FOIL with extended predicates.
Proof. For the first containment, let \[\Psi[u_1, \ldots, u_k, v_1, \ldots, v_\ell](x) = \text{\rm min}[\varphi[u_1, \ldots, u_k](x), \rho[v_1, \ldots, v_\ell](y, z)]\] be an \(\mathrm{\small Opt-FOIL}\) formula. As we discussed before, we can consider the equivalent \(\mathrm{\small ExplAIner}\) formula \[\theta_{\text{\rm min}}(x, u_1, \ldots, u_k, v_1, \ldots, v_\ell).\] Now, for the sake of contradiction, suppose that the containment is not strict. Let \(\varphi[y, z](x)\) be an \(\mathrm{\small ExplAIner}\) formula such that \(\mathsf{Comp}(\varphi[y, z](x),\, \mathsf{DTree}) \not \in {\rm FP}^{{\rm NP}}\) unless \({\rm PH}\) collapses to \({\rm P}^{{\rm NP}}\) (whose existence is guaranteed by Theorem 8). Let \(\Psi[y, z](x)\) be its equivalent expression in \(\mathrm{\small Opt-FOIL}\). By Theorem 10, the problem Comp\((\Psi[y, z](x), \mathsf{DTree})\) is in FP\(^{{\rm NP}}\). Thus, Comp\((\varphi[y, z](x), \mathsf{DTree})\) can be solved in FP\(^{{\rm NP}}\). This would imply the collapse of the polynomial hierarchy to \({\rm P}^{{\rm NP}}\). We conclude that the containment is strict.
For the second containment, each formula in \(\mathrm{\small ExplAIner}\) is a \(\mathrm{\small FOIL}\) formula with extended predicates by definition. It is strict because we can express \(\Sigma_2^{\rm{P}}\)-hard problems in \(\mathrm{\small FOIL}\) over decision trees (Theorem 2), but no \(\mathrm{\small ExplAIner}\) formula can express a \(\Sigma_2^{\rm{P}}\)-hard evaluation problem over decision trees unless \(\Sigma_2^{\rm{P}}\subseteq {\rm BH}\) (Theorem 7). ◻
The logic \(\mathrm{\small Opt-FOIL}\) allows us to express in a simple way all notions of explainability that we study in this paper. For example, recall from Section 4.2 that \(\mathsf{wAXp}(u,x)\) can be expressed as a formula from the quantified layer of ExplAIner. Therefore, taking \(\varphi[u](x) = \mathsf{wAXp}(u,x)\), the following \(\mathrm{\small Opt-FOIL}\) formulas encode the notions of minimal and minimum abductive explanations: \[\begin{align} \mathsf{AXp}[u](x) &=& \text{\rm min}[\varphi[u](x), y \subset z],\\ \mathsf{mAXp}[u](x) &=& \text{\rm min}[\varphi[u](x), y \prec z ]. \end{align}\] Likewise, \(\text{\rm min}[\varphi[u](x), \rho_2[v_1,v_2](y, z)]\) encodes the notion of abductive explanations for the order \(\rho_2[v_1,v_2](y, z)\) that disregards a feature. The different variants of contrastive explanations can be expressed similarly.
As a second example, consider the notion of minimum change required and the predicate \(\mathsf{LEH}\) defined in Section 8.7. Then, taking \[\varphi[u](x) = \mathsf{Full}(u) \wedge \mathsf{Full}(x) \wedge \neg (\mathsf{AllPos}(u) \leftrightarrow \mathsf{AllPos}(x))\] and \(\rho_3[u](y,z) = \mathsf{LEH}(u,y,z) \wedge \neg \mathsf{LEH}(u,z,y)\), we can express the notion of minimum change required in \(\mathrm{\small Opt-FOIL}\) as follows: \[\begin{align} \mathsf{MCR}[u](x) = \text{\rm min}[\varphi[u](x), \rho_3[u](y,z)]. \end{align}\] By reversing the order, the logic \(\mathrm{\small Opt-FOIL}\) can also be used to express notions of explainability that involve maximality conditions. For example, consider the query of maximum change allowed that asks for the maximum number of changes that can be made to an instance without changing the output of the classification model. Taking \[\varphi[u](x) = \mathsf{Full}(u) \wedge \mathsf{Full}(x) \wedge (\mathsf{AllPos}(u) \leftrightarrow \mathsf{AllPos}(x))\] and defining the reverse order \(\rho_4[u](y,z) = \rho_3[u](z,y)\), we can express the notion of maximum change allowed in \(\mathrm{\small Opt-FOIL}\) as follows: \[\begin{align} \mathsf{MCA}[u](x) = \text{\rm min}[\varphi[u](x), \rho_4[u](y,z)]. \end{align}\] An important advantage of \(\mathrm{\small Opt-FOIL}\) is that it allows for the combination of explainability notions. For example, given two instances \(u_1\) and \(u_2\) of the same dimension, consider the query \(\mathsf{CAXp}[u_1, u_2](x) = \mathsf{wAXp}(u_1,x) \wedge \mathsf{wAXp}(u_2,x)\) that checks whether \(x\) is a common weak abductive explanation for \(u_1\) and \(u_2\). Then the following \(\mathrm{\small Opt-FOIL}\) formula computes a common weak abductive explanation for two instances (if such an explanation exists): \[\begin{align} \Psi_1[u_1,u_2](x) = \text{\rm min}[\mathsf{CAXp}[u_1, u_2](x), y \subset z]. \end{align}\] Note that an answer to this query is not necessarily minimal with respect to all weak abductive explanations for either \(u_1\) or \(u_2\).
Finally, another advantage of \(\mathrm{\small Opt-FOIL}\) is that it allows for the exploration of the space of explanations for a given classification. For example, assume that we already have an abductive explanation \(u_1\) for an instance \(u\), which can be computed using the \(\mathrm{\small Opt-FOIL}\) formula \(\mathsf{AXp}[u](x)\). Our aim is to compute a second abductive explanation \(u_2\) for \(u\). Consider the formula: \[\begin{align} \mathsf{SAXp}[u,u_1](x) = \mathsf{wAXp}(u, x) \wedge \mathsf{wAXp}(u, u_1) \wedge \neg (u_1 \subseteq x). \end{align}\] This formula checks whether \(x\) is a weak abductive explanation for \(u\) that does not subsume the abductive explanation \(u_1\). Thus, an abductive explanation for the instance \(u\) that is different from \(u_1\) can be computed using the following \(\mathrm{\small Opt-FOIL}\) formula: \[\begin{align} \Psi_2[u,u_1](x) = \text{\rm min}[\mathsf{SAXp}[u, u_1](x), y \subset z]. \end{align}\] We can apply the same idea to other notions of explanation, such as the \(\mathsf{MCR}\) explainability query, in order to compute multiple explanations for the output of a classification model.
We have proposed a declarative approach to model interpretability based on query languages for explaining Boolean classification models. The starting point of our work is the observation that the growing number of explanation notions studied in formal XAI calls for a uniform language in which such notions can be specified, combined, and analyzed. This view is natural from a data management perspective: explanation notions become queries, models become the structures over which these queries are evaluated, and the main questions are those of expressiveness, evaluation complexity, and computation of answers.
Our first contribution was to revisit \(\mathrm{\small FOIL}\) from this perspective. We showed that, despite its foundational role, \(\mathrm{\small FOIL}\) is not well suited as a practical query language for explanations. On the one hand, it cannot express some central optimality-based notions, such as minimum abductive explanations, even over decision trees. On the other hand, its evaluation problem over decision trees is hard for every level of the polynomial hierarchy. These results show that a useful explainability language must carefully balance expressive power with controlled evaluation complexity.
To address this challenge, we introduced ExplAIner, a layered query language with an extended vocabulary for reasoning about partial instances and the behavior of Boolean models. We showed that ExplAInercan express a broad family of explanation notions, including abductive, contrastive, feature-based, and distance-based queries. At the same time, we proved that the evaluation problem for each fixed ExplAInerquery belongs to the Boolean hierarchy over every class of Boolean models for which the predicates \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be evaluated in polynomial time. This condition holds not only for decision trees, but also for more general representation classes such as deterministic and decomposable Boolean circuits.
We also introduced Opt-FOIL, an optimization-oriented fragment of ExplAInerfor computing explanations that are minimal with respect to strict partial orders. This fragment captures a wide range of optimality-based explanation tasks while retaining controlled computational behavior: under the same assumptions on \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\), explanations specified in Opt-FOILcan be computed in \(\mathrm{FP}^{\mathrm{NP}}\). Together, the results for ExplAInerand Opt-FOILshow that declarative specification and complexity-theoretic analysis can provide a principled foundation for model interpretability.
Several directions remain open. A first direction is to extend the framework beyond Boolean classification models. Although Boolean models are standard in formal XAI and already capture many explanation tasks, many applications involve multi-class outputs, non-Boolean features, or structured feature domains. It would be interesting to understand which parts of the present framework extend directly to these richer settings, and which additional predicates or language constructs are needed.
A second direction is to study further model representations. Our upper bounds are stated for every class of Boolean models over which \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\) can be evaluated in polynomial time, and this already includes decision trees and deterministic decomposable Boolean circuits. A natural next step is to identify additional representation classes that satisfy this condition. This would help clarify the connection between explainability languages and knowledge compilation more broadly.
A third direction concerns query optimization. One of the motivations for a declarative language is that different explanation notions can share common subqueries and operators. This suggests the possibility of developing optimization techniques for explainability queries, in the same spirit as query optimization in databases. Such techniques could exploit common subformulas, reuse calls to procedures for \(\mathsf{AllPos}\) and \(\mathsf{AllNeg}\), or identify fragments with better evaluation strategies.
Finally, it would be valuable to study richer answer mechanisms for explainability queries. In this paper, explanations are treated as partial instances satisfying a logical specification, possibly optimized with respect to a strict partial order. However, users may require different levels of detail, multiple alternative explanations, or rankings of explanations according to several criteria. Extending the language with principled mechanisms for enumeration, ranking, and comparison of explanations is an important step toward a more complete declarative framework for model interpretability.
Part of this work has been funded by ANID - Millennium Science Initiative Program - Code ICN17002. Diego Bustamante was partially funded by ANID - Subdirección de Capital Humano (Magíster Nacional, 2023, folio 22231282). María Alejandra Schild was financially supported by ANID (Doctorado Nacional, 2025, folio 21251617). Bernardo Subercaseaux is (partially) supported by the DARPA expMath program through the DARPA CMO contract number HR0011262E028.
We will first prove an auxiliary result. We start by introducing some terminology.
Let \(U = \{a_i \mid i > 0\}\) be a countably infinite set. We take a disjoint copy \(\overline{U} = \{\overline{a}_i \mid i > 0\}\) of \(U\). For an \(X \subseteq U \cup \overline{U}\), we define \[\begin{align} X_{U \setminus \overline{U}} \;& := \;\{a \in U \mid a \in X \text{ and } \overline{a} \not\in X\} \\ X_{U \cap \overline{U}} \;& := \;\{a \in U \mid a \in X \text{ and } \overline{a} \in X\} \\ X_{\overline{U} \setminus U} \;& := \;\{\overline{a} \in \overline{U} \mid \overline{a} \in X \text{ and } a \not\in X\} \end{align}\] The \(\ell\)-type of \(X\), for \(\ell \geq 0\), is the tuple \[\big(\min{\{\ell,|X_{U \setminus \overline{U}}|\}},\, \min{\{\ell,|X_{U \cap \overline{U}}|\}}, \, \min{\{\ell,|X_{\overline{U} \setminus U}|\}}\big).\] We write \(X \leftrightarrows_\ell X'\), for \(X,X' \subseteq U \cup \overline{U}\), if \(X\) and \(X'\) have the same \(\ell\)-type. If \(X \subseteq U \cup \overline{U}\), then \(X\) is well formed (wf) if for each \(i > 0\) at most one element from \(\{a_i,\overline{a}_i\}\) is in \(X\).
Lemma 7. Assume that \(X \leftrightarrows_{3^{k+1}} Y\), for \(X,Y \subseteq U \cup \overline{U}\) and \(k \geq 0\). Then:
For every wf \(X_1 \subseteq X\), there exists a wf \(Y_1 \subseteq Y\) such that \[X_1 \leftrightarrows_{3^k} Y_1 \;\;\text{ and } \;\;X\setminus X_1 \leftrightarrows_{3^k} Y \setminus Y_1.\]
For every wf \(Y_1 \subseteq Y\), there exists a wf \(X_1 \subseteq X\) such that \[X_1 \leftrightarrows_{3^k} Y_1 \;\;\text{ and } \;\;X\setminus X_1 \leftrightarrows_{3^k} Y \setminus Y_1.\]
Proof. Given \(Z \subseteq U\), we use \(\overline{Z}\) to denote the set \(\{ \overline{a} \in \overline{U} \mid a \in Z\}\), and given \(W \subseteq \overline{U}\), we use \(\overline{W}\) to denote the set \(\{ a \in U \mid \overline{a} \in W\}\). Let \(X_1\) be a wf subset of \(X\). Then we have that \(X_1 = X_{1,1} \cup X_{1,2} \cup X_{1,3} \cup X_{1,4}\), where \[\begin{align} X_{1,1} & \subseteq & X_{U \setminus \overline{U}},\\ X_{1,2} & \subseteq & \{ a \in U \mid a \in X_{U \cap \overline{U}}\},\\ X_{1,3} & \subseteq & \{ \overline{a} \in \overline{U} \mid a \in X_{U \cap \overline{U}}\},\\ X_{1,4} & \subseteq & X_{\overline{U} \setminus U}, \end{align}\] and \(\overline{X_{1,2}} \cap X_{1,3} = \emptyset\) (since \(X_1\) is wf). We construct a set \(Y_1 = Y_{1,1} \cup Y_{1,2} \cup Y_{1,3} \cup Y_{1,4}\) by considering the following rules.
If \(|X_{U \setminus \overline{U}}| < 3^{k+1}\), then \(|Y_{U \setminus \overline{U}}| = |X_{U \setminus \overline{U}}|\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,1} \subseteq Y_{U \setminus \overline{U}}\) in such a way that \(|Y_{1,1}| = |X_{1,1}|\) and \(|Y_{U \setminus \overline{U}} \setminus Y_{1,1}| = |X_{U \setminus \overline{U}} \setminus X_{1,1}|\).
If \(|X_{U \setminus \overline{U}}| \geq 3^{k+1}\), then \(|Y_{U \setminus \overline{U}}| \geq 3^{k+1}\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,1} \subseteq Y_{U \setminus \overline{U}}\) in the following way. If \(|X_{1,1}| < 3^k\), then \(|Y_{1,1}| = |X_{1,1}|\), and if \(|X_{U \setminus \overline{U}} \setminus X_{1,1}| < 3^k\), then \(|Y_{U \setminus \overline{U}} \setminus Y_{1,1}| = |X_{U \setminus \overline{U}} \setminus X_{1,1}|\). Finally, if \(|X_{1,1}| \geq 3^k\) and \(|X_{U \setminus \overline{U}} \setminus X_{1,1}| \geq 3^k\), then \(|Y_{1,1}| \geq 3^k\) and \(|Y_{U \setminus \overline{U}} \setminus Y_{1,1}| \geq 3^k\). Notice that we can choose such a set \(Y_{1,1}\) since \(|Y_{U \setminus \overline{U}}| \geq 3^{k+1}\).
If \(|X_{U \cap \overline{U}}| < 3^{k+1}\), then \(|Y_{U \cap \overline{U}}| = |X_{U \cap \overline{U}}|\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,2} \subseteq \{ a \in U \mid a \in Y_{U \cap \overline{U}}\}\) and \(Y_{1,3} \subseteq \{ \overline{a} \in \overline{U} \mid a \in Y_{U \cap \overline{U}}\}\) in such a way that \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\), \(|Y_{1,2}| = |X_{1,2}|\), \(|Y_{1,3}| = |X_{1,3}|\) and \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| = |X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})|\).
If \(|X_{U \cap \overline{U}}| \geq 3^{k+1}\), then \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,2} \subseteq \{ a \in U \mid a \in Y_{U \cap \overline{U}}\}\) and \(Y_{1,3} \subseteq \{ \overline{a} \in \overline{U} \mid a \in Y_{U \cap \overline{U}}\}\) in the following way.
If \(|X_{1,2}| < 3^k\), \(|X_{1,3}| < 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| \geq 3^k\), then \(|Y_{1,2}| = |X_{1,2}|\), \(|Y_{1,3}| = |X_{1,3}|\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| < 3^k\), \(|X_{1,3}| \geq 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| < 3^k\), then \(|Y_{1,2}| = |X_{1,2}|\), \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| = |X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})|\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| \geq 3^k\), \(|X_{1,3}| < 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| < 3^k\), then \(|Y_{1,3}| = |X_{1,3}|\), \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| = |X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})|\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| < 3^k\), \(|X_{1,3}| \geq 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| \geq 3^k\), then \(|Y_{1,2}| = |X_{1,2}|\), \(|Y_{1,3}| \geq 3^k\), \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| \geq 3^k\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| \geq 3^k\), \(|X_{1,3}| < 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| \geq 3^k\), then \(|Y_{1,3}| = |X_{1,3}|\), \(|Y_{1,2}| \geq 3^k\), \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| \geq 3^k\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| \geq 3^k\), \(|X_{1,3}| \geq 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| < 3^k\), then \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| = |X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})|\), \(|Y_{1,2}| \geq 3^k\), \(|Y_{1,3}| \geq 3^k\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{1,2}| \geq 3^k\), \(|X_{1,3}| \geq 3^k\) and \(|X_{U \cap \overline{U}} \setminus (X_{1,2} \cup \overline{X_{1,3}})| \geq 3^k\), then \(|Y_{1,2}| \geq 3^k\), \(|Y_{1,3}| \geq 3^k\), \(|Y_{U \cap \overline{U}} \setminus (Y_{1,2} \cup \overline{Y_{1,3}})| \geq 3^k\) and \(\overline{Y_{1,2}} \cap Y_{1,3} = \emptyset\). Notice that we can choose such sets \(Y_{1,2}\) and \(Y_{1,3}\) since \(|Y_{U \cap \overline{U}}| \geq 3^{k+1}\).
If \(|X_{\overline{U} \setminus U}| < 3^{k+1}\), then \(|Y_{\overline{U} \setminus U}| = |X_{\overline{U} \setminus U}|\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,4} \subseteq Y_{\overline{U} \setminus U}\) in such a way that \(|Y_{1,4}| = |X_{1,4}|\) and \(|Y_{\overline{U} \setminus U} \setminus Y_{1,4}| = |X_{\overline{U} \setminus U} \setminus X_{1,4}|\).
If \(|X_{\overline{U} \setminus U}| \geq 3^{k+1}\), then \(|Y_{\overline{U} \setminus U}| \geq 3^{k+1}\) since \(X \leftrightarrows_{3^{k+1}} Y\). In this case, we choose \(Y_{1,4} \subseteq Y_{\overline{U} \setminus U}\) in the following way. If \(|X_{1,4}| < 3^k\), then \(|Y_{1,4}| = |X_{1,4}|\), and if \(|X_{\overline{U} \setminus U} \setminus X_{1,4}| < 3^k\), then \(|Y_{\overline{U} \setminus U} \setminus Y_{1,4}| = |X_{\overline{U} \setminus U} \setminus X_{1,4}|\). Finally, if \(|X_{1,4}| \geq 3^k\) and \(|X_{\overline{U} \setminus U} \setminus X_{1,4}| \geq 3^k\), then \(|Y_{1,4}| \geq 3^k\) and \(|Y_{\overline{U} \setminus U} \setminus Y_{1,4}| \geq 3^k\). Notice that we can choose such a set \(Y_{1,4}\) since \(|Y_{\overline{U} \setminus U}| \geq 3^{k+1}\).
By definition of \(Y_{1,1}\), \(Y_{1,2}\), \(Y_{1,3}\) and \(Y_{1,4}\), it is straightforward to conclude that \(Y_1\) is wf, \(X_1 \leftrightarrows_{3^{k}} Y_1\) and \((X \setminus X_1) \leftrightarrows_{3^{k}} (Y \setminus Y_1)\).
We have just proved that for every wf \(X_1 \subseteq X\), there exists a wf \(Y_1 \subseteq Y\) such that \(X_1 \leftrightarrows_{3^k} Y_1\) and \(X\setminus X_1 \leftrightarrows_{3^k} Y \setminus Y_1\). In the same way, it can be shown that for every wf \(Y_1 \subseteq Y\), there exists a wf \(X_1 \subseteq X\) such that \(X_1 \leftrightarrows_{3^k} Y_1\) and \(X\setminus X_1 \leftrightarrows_{3^k} Y \setminus Y_1\). This concludes the proof of the lemma. ◻
We now consider structures of the form \(\mathfrak{A}^* = \langle 2^{X},\subseteq^{\mathfrak{A}^*} \rangle\), where \(X \subseteq U \cup \overline{U}\) and \(\subseteq^{\mathfrak{A}^*}\) is the relation that contains all pairs \((Y,Z)\), for \(Y,Z \subseteq X\), such that \(Y \subseteq Z\). Given two structures \(\mathfrak{A}^*_1\) and \(\mathfrak{A}^*_2\) of this form, perhaps with constants, we write \(\mathfrak{A}^*_1 \equiv_k^{{\rm wf}} \mathfrak{A}^*_2\) to denote that the Duplicator has a winning strategy in the \(k\)-round Ehrenfeucht-Fraı̈ssé game played on structures \(\mathfrak{A}^*_1\) and \(\mathfrak{A}^*_2\), but where Spoiler and Duplicator are forced to play wf subsets of \(U \cup \overline{U}\) only.
Consider structures \(\mathfrak{A}^*_1 = \langle 2^{X_1},\subseteq^{\mathfrak{A}^*_1} \rangle\) and \(\mathfrak{A}^*_2 = \langle 2^{X_2},\subseteq^{\mathfrak{A}^*_2} \rangle\) of the form described above. We claim that, for every \(k \geq 0\),
\[\label{eq:wf} X_1 \leftrightarrows_{3^k} X_2 \quad \Longrightarrow \quad \big(\mathfrak{A}^*_1,(X_1 \cap U)\big) \;\equiv_k^{{\rm wf}} \; \big(\mathfrak{A}^*_2,(X_2 \cap U)\big).\tag{5}\]
Before proving the claim 5 , we explain how it implies Lemma 1. Take a structure of the form \({\mathfrak{A}_n = \langle \{0,1,\bot\}^n,\subseteq^{\mathfrak{A}_n}\rangle}\), where \(\subseteq^{\mathfrak{A}_n}\) is the subsumption relation over \(\{0,1,\bot\}^n\). Take, on the other hand, the structure \(\mathfrak{A}_n^* = \langle 2^X,\subseteq^{\mathfrak{A}_n^*} \rangle\), where \(X = \{a_1,\dots,a_n,\bar a_1,\dots,\bar a_n\}\). It can be seen that there is an isomorphism \(f\) between \(\mathfrak{A}_n\) and the substructure of \(\mathfrak{A}_n^*\) induced by the wf subsets of \(X\). The isomorphism \(f\) takes an instance \(\mathbf{e}\in \{0,1,\bot\}^n\) and maps it to \(Y \subseteq X\) such that for every \(i \in \{1,\dots,n\}\), (a) if \(\mathbf{e}[i] = 1\) then \(a_i \in Y\), (b) if \(\mathbf{e}[i] = 0\) then \(\bar a_i \in Y\), and (c) if \(\mathbf{e}[i] = \bot\) then neither \(a_i\) nor \(\bar a_i\) is in \(Y\). By definition, the isomorphism \(f\) maps the tuple \(\{1\}^n\) in \(\mathfrak{A}_n\) to the set \(X \cap U = \{a_1,\dots,a_n\}\) in \(\mathfrak{A}^*_n\).
From claim 5 , it follows then that if \(n,p \geq 3^k\) it is the case that \[(\mathfrak{A}^*_n,\{a_1,\dots,a_n\}) \;\equiv_k^{{\rm wf}} \; (\mathfrak{A}^*_p,\{a_1,\dots,a_p\}).\] From our previous observations, this implies that \[(\mathfrak{A}_n,\{1\}^n) \;\equiv_k \; (\mathfrak{A}_p,\{1\}^p).\] We conclude, in particular, that \(\mathfrak{A}^+_n \equiv_k \mathfrak{A}^+_p\), as desired.
We now prove the claim in 5 . We do it by induction on \(k \geq 0\). The base cases \(k = 0\) and \(k= 1\) are immediate. We now move to the induction case for \(k+1\). Take structures \(\mathfrak{A}^*_1 = \langle 2^{X_1},\subseteq^{\mathfrak{A}^*_1} \rangle\) and \(\mathfrak{A}^*_2 = \langle 2^{X_2},\subseteq^{\mathfrak{A}^*_2} \rangle\) of the form described above, such that \(X_1 \leftrightarrows_{3^{k+1}} X_2\). Assume, without loss of generality, that for the first round the Spoiler picks the well formed element \(X'_1 \subseteq X_1\) in the structure \(\mathfrak{A}^*_1\). From Lemma 7, there exists \(X'_2 \subseteq X_2\) such that \[X'_1 \leftrightarrows_{3^k} X'_2 \;\;\text{ and } \;\;X_1\setminus X'_1 \leftrightarrows_{3^k} X_2 \setminus X'_2.\] By induction hypothesis, the following holds: \[\begin{align} \big(\langle 2^{X'_1},\subseteq \rangle,(X'_1 \cap U)\big) & \equiv^{\rm wf}_k & \big(\langle 2^{X'_2},\subseteq \rangle,(X'_2 \cap U)\big)\\ \big(\langle 2^{X_1 \setminus X'_1},\subseteq \rangle,((X_1 \setminus X'_1) \cap U)\big) & \equiv^{\rm wf}_k & \big(\langle 2^{X_2 \setminus X'_2},\subseteq \rangle,((X_2 \setminus X'_2) \cap U)\big). \end{align}\] A simple composition argument allows to obtain the following from these two expressions: \[\label{eq:final} \big(\langle 2^{X_1},\subseteq \rangle,(X_1 \cap U),X'_1\big) \;\equiv_k^{{\rm wf}} \;\big(\langle 2^{X_2},\subseteq \rangle, (X_2 \cap U),X'_2\big).\tag{6}\] This holds because \(X'_1 = (X_1 \cap U)\) iff \(X'_2 = (X_2 \cap U)\). In fact, assume that \(X'_1 = (X_1 \cap U)\), so that \(X'_1 \cap \overline{U} = \emptyset\). Since \(X'_1 \leftrightarrows_{3^k} X'_2\), it follows that \(X'_2 \subseteq X_2 \cap U\). On the other hand, \(X_1 \setminus X_1' = X_1 \cap \overline{U}\). As \(X_1 \setminus X_1' \leftrightarrows_{3^k} X_2 \setminus X'_2\), we conclude that \(X_2 \setminus X'_2 \subseteq \overline{U}\), and hence \(X_2 \cap U \subseteq X_2'\). Combining both inclusions, we obtain that \(X'_2 = (X_2 \cap U)\). The other direction is completely analogous.
But Equation 6 is equivalent with the following fact: \[\big(\langle 2^{X_1},\subseteq \rangle,(X_1 \cap U)\big) \;\equiv_{k+1}^{{\rm wf}} \;\big(\langle 2^{X_2},\subseteq \rangle, (X_2 \cap U) \big).\] This finishes the proof of Lemma 1.
Let \(\mathbf{e}_i\) and \(\mathbf{e}'_i\) be the moves played by Spoiler and Duplicator in \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1}\) and \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2}\), respectively, for the first \(i \leq k\) rounds of the Ehrenfeucht-Fraı̈ssé game \[\begin{align} \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1},\{1\}^{n+p},\{\bot\}^n \cdot \{1\}^p\big) \;\equiv_k \; \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2},\{1\}^{n+q},\{\bot\}^n \cdot \{1\}^q\big). \end{align}\] We write \(\mathbf{e}_i = (\mathbf{e}_{i1},\mathbf{e}_{i2})\) to denote that \(\mathbf{e}_{i1}\) is the tuple formed by the first \(n\) features of \(\mathbf{e}_i\) and \(\mathbf{e}_{i2}\) is the one formed by the last \(p\) features of \(\mathbf{e}_i\). Similarly, we write \(\mathbf{e}'_i = (\mathbf{e}'_{i1},\mathbf{e}'_{i2})\) to denote that \(\mathbf{e}'_{i1}\) is the tuple formed by the first \(n\) features of \(\mathbf{e}'_i\) and \(\mathbf{e}'_{i2}\) is the one formed by the last \(q\) features of \(\mathbf{e}'_i\).
The winning strategy for Duplicator is as follows. Suppose \(i-1\) rounds have been played, and for round \(i\) the Spoiler picks element \(\mathbf{e}_i \in \mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1}\) (the case when he picks an element in \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2}\) is symmetric). Assume also that \(\mathbf{e}_i = (\mathbf{e}_{i1},\mathbf{e}_{i2})\). The duplicator then considers the position \[\big((\mathbf{e}_{12},\dots,\mathbf{e}_{(i-1)2}),(\mathbf{e}'_{12},\dots,\mathbf{e}'_{(i-1)2})\big)\] on the game \((\mathfrak{A}_{\mathcal{M}_1},\{1\}^p) \equiv_k (\mathfrak{A}_{\mathcal{M}_2},\{1\}^q)\), and finds his response \(\mathbf{e}'_{i2}\) to \(\mathbf{e}_{i2}\) in \(\mathfrak{A}_{\mathcal{M}_2}\). The Duplicator then responds to the Spoiler’s move \(\mathbf{e}_i \in \mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1}\) by choosing the element \(\mathbf{e}'_i = (\mathbf{e}_{i1},\mathbf{e}'_{i2}) \in \mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2}\).
Notice, by definition, that \(\mathbf{e}_i = \{1\}^{n+p}\) iff \(\mathbf{e}'_i = \{1\}^{n+q}\). Similarly, \(\mathbf{e}_i = \{\bot\}^n \cdot \{1\}^{p}\) iff \(\mathbf{e}'_i = \{\bot\}^n \cdot \{1\}^{q}\). Moreover, it is easy to see that playing in this way the Duplicator preserves the subsumption relation. Analogously, the strategy preserves the \(\mathsf{Pos}\) relation. In fact, \(\mathbf{e}_i\) is a positive instance of \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1}\) iff \(\mathbf{e}_{i1}\) is a positive instance of \(\mathfrak{A}_\mathcal{M}\) or \(\mathbf{e}_{i2}\) is a positive instance of \(\mathfrak{A}_{\mathcal{M}_1}\). By definition, the latter follows if and only if \(\mathbf{e}_{i1}\) is a positive instance of \(\mathfrak{A}_\mathcal{M}\) or \(\mathbf{e}'_{i2}\) is a positive instance of \(\mathfrak{A}_{\mathcal{M}_2}\), which in turn is equivalent to \(\mathbf{e}'_i\) being a positive instance of \(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2}\).
We conclude that this is a winning strategy for the Duplicator, and hence that \[\begin{align} \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_1},\{1\}^{n+p},\{\bot\}^n \cdot \{1\}^p\big) \;\equiv_k \; \big(\mathfrak{A}_\mathcal{M}\oplus \mathfrak{A}_{\mathcal{M}_2},\{1\}^{n+q},\{\bot\}^n \cdot \{1\}^q\big). \end{align}\] This finishes the proof of Lemma 2.
To prove that \(\Sigma_{k+1}\)-QBF\((\mathsf{DTree})\) is in \(\Sigma_{k}^{\text{P}}\), note that we can decide in polynomial time if a given decision tree encodes a tautology. Therefore, we can use a \(\Sigma_k\)-alternating Turing machine for guessing the values for the first \(k\) quantifiers, we prune the decision tree according to those guesses, and then we solve the remaining universal quantifier directly.
For the hardness, we use a reduction from the following standard \(\Sigma_k^{\text{P}}\)-hard problem (see [45] for a reference): Given a 3CNF formula \(\varphi\) over the set \(X = \{x_1,\dots,x_m\}\) of propositional variables, is it the case that the expression \(\psi = \exists X_1 \forall X_2 \cdots \exists X_k \, \varphi\) holds, where \(X_1,\dots,X_k\) is a partition of \(X\) in \(k\) equivalence classes? Note that the hypothesis of \(k\) being odd is important here because if the last quantifier were universal, we could solve it directly as in the case of decision trees. From \(\psi\) we build in polynomial time a \(\Sigma_{k+1}\)-QBF \(\alpha\) over \(\mathcal{M}_\varphi\), where \(\mathcal{M}_\varphi\) is a decision tree that can be built in polynomial time from \(\varphi\), such that \[\label{eq:holds} \text{\psi holds} \quad \Longleftrightarrow \quad \text{\alpha holds.}\tag{7}\]
We now explain how to define \(\mathcal{M}_\varphi\) from the CNF formula \(\varphi\). Let \(\varphi = C_1 \wedge \cdots \wedge C_n\) be a propositional formula, where each \(C_i\) is a disjunction of three literals and does not contain repeated or complementary literals. Moreover, assume that \(\{x_1, \ldots, x_m\}\) is the set of variables occurring in \(\varphi\), and the proof will use partial instances of dimension \(n+m\). Notice that the last \(m\) features of such a partial instance \(\mathbf{e}\) naturally define a truth assignment for the propositional formula \(\varphi\). More precisely, for every \(i \in \{1, \ldots, n\}\), we use notation \(\mathbf{e}(C_i) = 1\) to indicate that there is a disjunct \(\ell\) of \(C_i\) such that \(\ell = x_j\) and \(\mathbf{e}[n+j] = 1\), or \(\ell = \neg x_j\) and \(\mathbf{e}[n+j] = 0\), for some \(j \in \{1,\ldots,m\}\). Furthermore, we write \(\mathbf{e}(\varphi) = 1\) if \(\mathbf{e}(C_i) = 1\) for every \(i \in \{1, \ldots, n\}\).
For each clause \(C_i\) (\(i \in \{1, \ldots, n\}\)), let \(\mathcal{M}_{C_i}\) be a decision tree of dimension \(n+m\) (but that will only use features \(n+1, \ldots, n+m\)) such that for every instance \(\mathbf{e}\): \(\mathcal{M}_{C_i}(\mathbf{e}) = 1\) if and only if \(\mathbf{e}(C_i) = 1\). Notice that \(\mathcal{M}_{C_i}\) can be constructed in constant time as it only needs to contain at most eight paths of depth 3. For example, assuming that \(C = (x_1 \vee x_2 \vee x_3)\), a possible decision tree \(\mathcal{M}_C\) is depicted in the following figure:
Figure 6:
.
Moreover, define \(\mathcal{M}_\varphi\) as the following decision tree.
Figure 7:
.
Recall that the set of features of \(\mathcal{M}_\varphi\) is \([1,n+m]\). The formula \(\alpha\) is defined as \[\exists P_1 \forall P_2 \cdots \exists P_k \forall P \, \mathcal{M}_\varphi,\] assuming that \(P_i\), for \(1 \leq i \leq k\), is the set \(\{n+\ell \mid x_\ell \in X_i\}\), and \(P = \{1,\dots,n\}\). That is, \(P_i\) is the set of features from \(\mathcal{M}_\varphi\) that represent the variables in \(X_i\) and \(P\) is the set of features that are used to encode the clauses of \(\varphi\).
We show next that the equivalence stated in 7 holds. For simplicity, we only do it for the case \(k = 1\). The proof for \(k > 1\) uses exactly the same ideas, only that it is slightly more cumbersome.
Assume, on the one hand, that \(\psi = \exists X_1 \varphi\) holds. That is, there exists an assignment \(\sigma_1 : X_1 \to \{0,1\}\) such that \(\varphi\) holds when variables in \(X_1\) are interpreted according to \(\sigma_1\). We show next that \(\alpha = \exists P_1 \forall P \mathcal{M}_\varphi\) holds, where \(P_1\) and \(P\) are defined as above. Take the partial instance \(\mathbf{e}_{\sigma_1}\) of dimension \(n + m\) that naturally “represents” the assignment \(\sigma_1\); that is:
\(\mathbf{e}_{\sigma_1}[i] = \bot\), for each \(i \in \{1,\dots,n\}\),
\(\mathbf{e}_{\sigma_1}[n+i] = \sigma_1(x_i)\), for each \(i \in \{1,\dots,m\}\) with \(x_i \in X_1\), and
\(\mathbf{e}_{\sigma_1}[n+i] = \bot\), for each \(i \in \{1,\dots,m\}\) with \(x_i \not\in X_1\).
To show that \(\alpha\) holds, it suffices to show that \(\mathcal{M}_\varphi(\mathbf{e}) = 1\) for every instance \(\mathbf{e}\) of dimension \(n+m\) that subsumes \(\mathbf{e}_{\sigma_1}\). Take an arbitrary such an instance \(\mathbf{e}\in \{0,1\}^{n+m}\). Notice that if \(\mathbf{e}[i] = 1\), for every \(i \in \{1,\dots,n\}\), then \(\mathcal{M}_\varphi(\mathbf{e}) = 1\) by definition of \(\mathcal{M}_\varphi\). Suppose then that there exists a minimum value \(i \in \{1,\dots,n\}\) such that \(\mathbf{e}[i] = 0\). Hence, to show that \(\mathcal{M}_\varphi(\mathbf{e}) = 1\) we need to show that \(\mathcal{M}_{C_i}(\mathbf{e}) = 1\). But this follows easily from the fact that \(\mathbf{e}\) naturally represents an assignment \(\sigma\) for \(\varphi\) such that the restriction of \(\sigma\) to \(X_1\) is precisely \(\sigma_1\). We know that any such an assignment \(\sigma\) satisfies \(\varphi\), and therefore it satisfies \(C_i\). It follows that \(\mathcal{M}_{C_i}(\mathbf{e}) = 1\).
Assume, on the other hand, that \(\alpha = \exists P_1 \forall P \mathcal{M}_\varphi\) holds. Then there exists a partial instance \(\mathbf{e}\) of dimension \(n+m\) such that the following statements hold:
\(\mathbf{e}[i] \neq \bot\) iff for some \(j \in \{1,\dots,m\}\) it is the case that \(i = n + j\) and \(j \in P_1\), and
for every \(\mathbf{e}' \in \textit{comp}(\mathbf{e})\) we have that \(\mathcal{M}_\varphi(\mathbf{e}') = 1\).
We show next that \(\psi = \exists X_1 \varphi\) holds. Let \(\sigma_1 : X_1 \to \{0,1\}\) be the assignment for the variables in \(X_1\) that is naturally defined by \(\mathbf{e}\). It suffices to show that each clause \(C_i\) of \(\varphi\), for \(i \in \{1,\dots,n\}\), is satisfied by the assignment that interprets the variables in \(X_1\) according to \(\sigma_1\). Let us define a completion \(\mathbf{e}'\) of \(\mathbf{e}\) that satisfies the following:
\(\mathbf{e}'[i] = 0\),
\(\mathbf{e}'[j] = 1\), for each \(j \in \{1,\dots,n\}\) with \(i \neq j\), and
\(\mathbf{e}'[n+j] = \sigma_1(x_j)\), if \(j \in \{1,\dots,m\}\) and \(j \in P_1\).
We know that \(\mathcal{M}_\varphi(\mathbf{e}') = 1\), which implies that \(\mathcal{M}_{C_i}(\mathbf{e}') = 1\) (since \(\mathbf{e}'\) takes value 0 for feature \(i\)). We conclude that \(C_i\) is satisfied by the assignment which is naturally defined by \(\mathbf{e}'\), which is precisely the one that interprets the variables in \(X_1\) according to \(\sigma_1\).
We induct on the depth of \(\varphi\). First we will see the atomic cases:
For atomic formulas of the form \(x_i = x_j\), we take \[\sum_{\substack{\rho \in \{0, 1, \bot \}^k \\ \rho_i \neq \rho_j}}{z_\rho} \; = \; 0.\]
For atomic formulas of the form \(x_i \subseteq x_j\), we take \[\sum_{\substack{\rho \in \{0, 1, \bot \}^k \\ \rho_i \neq \rho_j \; \land \; \rho_i \neq \bot}}{z_\rho} \; = \; 0.\]
For atomic formulas of the form \(x_i \preceq x_j\), we take \[\sum_{\substack{\rho \in \{0, 1, \bot \}^k \\ \rho_j = \bot}}{z_\rho} \; \leq \; \sum_{\substack{\rho \in \{0, 1, \bot \}^k \\ \rho_i = \bot}}{z_\rho}.\]
Now we describe the structural induction. For the negation, it is enough to take \(\operatorname{T}_\Gamma(\neg \psi)\bigl((z_\rho)_\rho\bigr)\) as \(\neg \operatorname{T}_\Gamma(\psi)\bigl((z_\rho)_\rho\bigr)\). If \(\varphi\) is of the form \(\psi_1 \circ \psi_2\), where \(\circ\) is a binary logical connective, then we take \(\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_\rho\bigr)\) as \[\operatorname{T}_\Gamma(\psi_1)\bigl((z_\rho)\bigr) \; \circ \; \operatorname{T}_\Gamma(\psi_2)\bigl((z_\rho)\bigr).\] Note that here it is important to use the inductive hypothesis with \(\Gamma\) that contains both the free variables of \(\psi_1\) and of \(\psi_2\). We need to be more careful if \(\varphi\) is of the form \(\exists u\, \psi(y_1, \dots, y_\ell, u)\). By changing the name of the variable if necessary, we can assume that \(u \not \in \Gamma\). Consider \(\Lambda = (x_1, \dots, x_k, u)\) and take the formula \[\operatorname{T}_\Lambda(\psi)\bigl((w_\tau)_{\tau\in\{0,1,\bot\}^{k+1}}\bigr)\] given by the inductive hypothesis. We take \(\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\) to be \[\exists (w_\tau)_{\tau\in\{0,1,\bot\}^{k+1}} \quad \operatorname{Proj}_{\Lambda \to \Gamma}((w_\tau)_\tau,\, (z_\rho)_\rho) \; \land \; \operatorname{T}_\Lambda(\psi)\bigl((w_\tau)_{\tau\in\{0,1,\bot\}^{k+1}}\bigr),\] where \(\operatorname{Proj}_{\Lambda \to \Gamma}((w_\tau)_\tau,\, (z_\rho)_\rho)\) is defined to be \[\bigwedge_{\rho\in\{0,1,\bot\}^{k}}{z_{\rho} = w_{(\rho, 0)} + w_{(\rho, 1)} + w_{(\rho, \bot)}}.\] Finally, if \(\varphi\) is of the form \(\forall u\, \psi(y_1, \dots, y_\ell, u)\), we define \(\Lambda\) as before and take \(\operatorname{T}_\Gamma(\varphi)\bigl((z_\rho)_{\rho\in\{0,1,\bot\}^{k}}\bigr)\) to be \[\forall (w_\tau)_{\tau\in\{0,1,\bot\}^{k+1}} \quad \bigl(\operatorname{Proj}_{\Lambda \to \Gamma}((w_\tau)_\tau,\, (z_\rho)_\rho) \; \rightarrow \; \operatorname{T}_\Lambda(\psi)\bigl((w_\tau)_{\tau\in\{0,1,\bot\}^{k+1}}\bigr) \bigr).\] For the second part of the lemma, note that for a subformula translated in a context \(\Gamma\) of size \(k\), the corresponding Presburger formula has \(3^k\) variables. In the atomic cases we just need to manage sums without repetitions over those variables. Boolean connectives also do not cause any problems. In the case of quantifiers, we need to increase the size of the context from \(k\) to \(k+1\) and we also add \(3^k\) projection formulas plus the recursive call. But because \(k+1 \leq \rm{wd}(\varphi)\) and there are \(O(|\varphi|)\) subformulas, the total output size is \(O(|\varphi| \cdot 3^{\rm{wd}(\varphi)})\) up to polynomial factors of \(\rm{wd}(\varphi)\). Notice that the same argument applies for proving that the computation itself can be done using at most that same space.
Consider the following similar problem. The input is a model \(\mathcal{M}'\), an instance \(\mathbf{e}'\) and a \(k \in \mathbb{N}\), and the question is whether there exists a partial instance \(\mathbf{e}\) that is a weak abductive explanation for \(\mathbf{e}'\) on \(\mathcal{M}'\) and whose number of defined features is at most \(k\). This problem was studied in [21], where it was shown to be \({\rm NP}\)-hard on decision trees. We show a reduction from this problem.
First assume that \(\mathcal{M}'(\mathbf{e}') = 1\). We create new variables \(X_{i}\) for \(i\in \{0,1,...,k\}\). Let \(\mathcal{M}\) be a new decision tree such that \(\dim(\mathcal{M}) = k + 1 + \dim(\mathcal{M}')\), depicted in the following figure:
We use \(X_{0}\) as the root of \(\mathcal{M}\). For every \(i < k\), the outgoing edge of \(X_i\) labeled by \(1\) is connected to \(X_{i+1}\), and the outgoing edge of \(X_k\) labeled by \(1\) is connected to a \(\mathbf{true}\) leaf. Connect all outgoing edges labeled by \(0\) to a copy of \(\mathcal{M}'\). Let \(\mathbf{e}_1 = \{1\}^{k+1} \cdot \mathbf{e}'\) and \(\mathbf{e}_2 = \{1\}^{k+1} \cdot \{\bot\}^{\dim(\mathcal{M}')}\) be partial instances of size \({\textit dim}(\mathcal{M})\). We claim that \(\mathbf{e}_2\) is a minimum abductive explanation for \(\mathbf{e}_1\) on \(\mathcal{M}\) if and only if the answer to the original problem was negative. For the case \(\mathcal{M}'(\mathbf{e}') = 0\) we can just set the value of the new leaf to \(\mathbf{false}\) and the same construction will work.
We now discuss why the reduction works. Suppose first that \((\mathcal{M}', \mathbf{e}', k)\) outputs \(\mathrm{\small Yes}\). It follows that there exists a partial instance \(\mathbf{e}\) on \(\mathcal{M}'\) that is a weak abductive explanation for \(\mathbf{e}'\) with at most \(k\) defined features. Now notice that the partial instance \(\{\bot\}^{k+1} \cdot \mathbf{e}\) is a weak abductive explanation for \(\mathbf{e}_1\) on \(\mathcal{M}\) and has at most \(k\) defined features. Because \(\mathbf{e}_2\) has \(k+1\) defined features, it follows that \(\mathbf{e}_2\) is not a minimum abductive explanation for \(\mathbf{e}_1\) on \(\mathcal{M}\).
Now suppose that \((\mathcal{M}', \mathbf{e}', k)\) outputs \(\mathrm{\small No}\). Then there is no weak abductive explanation for \(\mathbf{e}'\) on \(\mathcal{M}'\) with at most \(k\) defined features. This implies that there is also no partial instance \(\mathbf{e}\) on \(\mathcal{M}\) that is a weak abductive explanation for \(\mathbf{e}_1\) with at most \(k\) defined features. This is because any candidate weak abductive explanation for \(\mathbf{e}_1\) with at most \(k\) defined features leaves at least one of the new variables undefined, and therefore some completion of it reaches a copy of \(\mathcal{M}'\). Once it enters that copy of \(\mathcal{M}'\), its restrictions on the old coordinates would induce a weak abductive explanation for \(\mathbf{e}'\) on \(\mathcal{M}'\) with at most \(k\) defined features, contradicting the assumption. But we know that \(\mathbf{e}_2\) is a weak abductive explanation for \(\mathbf{e}_1\) with \(k+1\) defined features, so it is a minimum abductive explanation for \(\mathbf{e}_1\) on \(\mathcal{M}\), as we needed.
We first treat the parameter-free case \(\rho(x,y)\), and then we extend the idea to the general case.
Fix a dimension \(n\). Given a partial instance of dimension \(n\), define \(\#_0(\mathbf{e})\) as the number of occurrences of the symbol \(0\) in \(\mathbf{e}\), and likewise for \(\#_1(\mathbf{e})\) and \(\#_\bot(\mathbf{e})\). Moreover, for every \((p,q,r) \in \mathbb{N}^3\) such that \(p + q + r = n\), define \[\begin{align} L_{(p,q,r)} \;:= \;\{ \mathbf{e}\mid \mathbf{e}\text{ is a partial instance of dimension } n \text{ such that } \#_0(\mathbf{e}) = p,\, \#_1(\mathbf{e}) = q \text{ and } \#_\bot(\mathbf{e}) = r \}. \end{align}\] Notice that there are at most \(\binom{n+2}{2} \leq (n+1)^2\) different sets \(L_{(p,q,r)}\). We claim that if \(\mathbf{e}_1\) and \(\mathbf{e}_2\) are partial instances of dimension \(n\) such that \(\mathbf{e}_1, \mathbf{e}_2 \in L_{(p,q,r)}\) for the same triple \((p, q, r)\), then \(\mathfrak{B}_n \not\models \rho(\mathbf{e}_1, \mathbf{e}_2)\). From that we can conclude that the statement of the lemma holds for \(p(n) = (n+1)^2\), since if \((\mathbf{e}_1, \ldots, \mathbf{e}_k)\) is a path of dimension \(n\) in \(\rho(x,y)\), then each \(\mathbf{e}_i\) must belong to a different set \(L_{(p,q,r)}\).
For the sake of contradiction, suppose that \(\mathbf{e}_1, \mathbf{e}_2\) are two different partial instances of dimension \(n\) that belong to the same set \(L_{(p, q, r)}\) and such that \(\mathfrak{B}_n \models \rho(\mathbf{e}_1, \mathbf{e}_2)\). Then there exists a permutation \(\pi : \{1, \ldots, n\} \to \{1, \ldots, n\}\) such that \(\pi(\mathbf{e}_1) = \mathbf{e}_2\). Notice that for every pair \(\mathbf{e}\), \(\mathbf{e}'\) of partial instances of dimension \(n\) it holds that: \[\begin{align} \mathbf{e}\subseteq \mathbf{e}' &\quad\quad\Leftrightarrow\quad\quad \pi(\mathbf{e}) \subseteq \pi(\mathbf{e}')\\ \mathbf{e}\preceq\mathbf{e}' &\quad\quad\Leftrightarrow\quad\quad \pi(\mathbf{e}) \preceq\pi(\mathbf{e}'). \end{align}\] Thus, \(\pi\) is an automorphism for the structure \(\mathfrak{B}_n\). Because we have that \(\mathfrak{B}_n \models \rho(\mathbf{e}_1, \mathbf{e}_2)\), and \(\rho\) is defined over the vocabulary \(\{ \subseteq, \preceq\}\), it follows \(\mathfrak{B}_n \models \rho(\pi(\mathbf{e}_1), \pi(\mathbf{e}_2))\). But since \(\mathbf{e}_2 = \pi(\mathbf{e}_1)\), we also have that \(\mathfrak{B}_n \models \rho(\mathbf{e}_2, \pi(\pi(\mathbf{e}_1)))\). Because \(\rho(x, y)\) is transitive, it follows that \(\mathfrak{B}_n \models \rho(\mathbf{e}_1, \pi^2(\mathbf{e}_1))\). In the same way, we can conclude that \(\mathfrak{B}_n \models \rho(\mathbf{e}_1, \pi^k(\mathbf{e}_1))\) for every \(k \geq 1\). Given that the set of permutations of \(n\) elements with the composition operator forms a group of order \(n!\), we know that \(\pi^{n!}\) is the identity permutation, so that \(\pi^{n!}(\mathbf{e}_1) = \mathbf{e}_1\). Therefore, we conclude that \(\mathfrak{B}_n \models \rho(\mathbf{e}_1, \mathbf{e}_1)\), which leads to a contradiction since \(\rho(x,y)\) represents a strict partial order.
Consider now a formula \(\rho[v_1, \ldots, v_\ell](x,y)\) with parameters. As in the previous case, we fix a dimension \(n\). Moreover, we also fix a sequence \(\mathbf{e}'_1\), \(\ldots\), \(\mathbf{e}'_\ell\) of partial instances of dimension \(n\) (notice that the bound \(p(n)\) should not depend on those partial instances). Then, for every \((a_1, \ldots, a_\ell) \in \{0,1,\bot\}^\ell\), consider the set \[\begin{align} P_{(a_1, \ldots, a_\ell)} \;= \;\{i \in \{1, \ldots, n\} \;\mid \;\mathbf{e}'_j[i] = a_j \text{ for all } j \in \{1, \ldots, \ell\}\}, \end{align}\] that is, all positions for which the sequence \(\mathbf{e}'_1\), \(\ldots\), \(\mathbf{e}'_\ell\) realizes the pattern \((a_1, \ldots, a_\ell)\). Given \(s \in \{0, 1, \bot\}\), a pattern \(t \in \{0,1,\bot\}^\ell\) and a partial instance \(\mathbf{e}\) of dimension \(n\), define \(\#_{s, t}(\mathbf{e})\) as the number of indices \(i \in P_t\) such that \(\mathbf{e}[i]=s\). Notice that the numbers \(\#_{s, t}(\mathbf{e})\) are invariant under permutations of the features that map each pattern block onto itself.
We define an equivalence relation as follows. For two partial instances \(\mathbf{e}_1\) and \(\mathbf{e}_2\) of dimension \(n\), we write \(\mathbf{e}_1 \sim \mathbf{e}_2\) if \(\#_{s, t}(\mathbf{e}_1) = \#_{s, t}(\mathbf{e}_2)\) for every \(s \in \{0, 1, \bot\}\) and every \(t \in \{0,1,\bot\}^\ell\). Notice that there are at most \[\binom{n+3^{\ell+1}-1}{3^{\ell+1}-1} \leq \frac{\big(n+3^{\ell+1}-1\big)^{3^{\ell+1}-1}}{\big(3^{\ell+1}-1 \big)!}\] different equivalence classes. Because \(\ell\) is fixed, we can consider that number as our polynomial \(p(n)\).
We claim that if \(\mathbf{e}_1 \sim \mathbf{e}_2\), then \(\mathfrak{B}_n \not\models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \mathbf{e}_2)\). From that we can conclude, as in the parameter-free case, that the statement of the lemma holds. In fact, if \((\mathbf{e}_1, \ldots, \mathbf{e}_k)\) is a path of dimension \(n\) in \(\rho[v_1, \ldots, v_\ell](x,y)\), then each \(\mathbf{e}_i\) must belong to a different equivalence class.
For the sake of contradiction, suppose that \(\mathbf{e}_1, \mathbf{e}_2\) are two different partial instances of dimension \(n\) such that \(\mathbf{e}_1 \sim \mathbf{e}_2\) and \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \mathbf{e}_2)\). For each pattern block \(P_t\), consider a permutation \(\pi_t\) of \(P_t\) sending the restriction of \(\mathbf{e}_1\) on \(P_t\) to the restriction of \(\mathbf{e}_2\) on \(P_t\). Combining these permutations yields a permutation \(\pi : \{1, \ldots, n\} \to \{1, \ldots, n\}\) such that \(\pi(\mathbf{e}_1) = \mathbf{e}_2\). Notice that by the way we constructed the permutations \(\pi_t\) and the pattern blocks \(P_{t}\), we have that \(\pi(\mathbf{e}'_j) = \mathbf{e}'_j\) for every \(j \in \{1, \ldots, \ell\}\).
As in the parameter-free case, we have that \(\pi\) is an automorphism for the structure \(\mathfrak{B}_n\). Since \(\rho\) is a formula defined over the vocabulary \(\{\subseteq, \preceq\}\), and \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \mathbf{e}_2)\), it follows that \(\mathfrak{B}_n \models \rho[\pi(\mathbf{e}'_1), \ldots, \pi(\mathbf{e}'_\ell)](\pi(\mathbf{e}_1), \pi(\mathbf{e}_2))\). Because \(\pi(\mathbf{e}'_j) = \mathbf{e}'_j\) for every \(j \in \{1, \ldots, \ell\}\) and \(\mathbf{e}_2 = \pi(\mathbf{e}_1)\), we obtain that \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_2, \pi(\pi(\mathbf{e}_1)))\), and using that \(\rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](x, y)\) is transitive, we also have that \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \pi^2(\mathbf{e}_1))\). In the same way, it is possible to conclude that \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \pi^k(\mathbf{e}_1))\) for every \(k \geq 1\). Given that the set of permutations of \(n\) elements with the composition operator forms a group of order \(n!\), we know that \(\pi^{n!}\) is the identity permutation, so that \(\pi^{n!}(\mathbf{e}_1) = \mathbf{e}_1\). Therefore, we conclude that \(\mathfrak{B}_n \models \rho[\mathbf{e}'_1, \ldots, \mathbf{e}'_\ell](\mathbf{e}_1, \mathbf{e}_1)\), which leads to a contradiction since \(\rho[v_1, \ldots, v_\ell](x,y)\) represents a strict partial order.
Let \(\mathsf{GLB}\) (Greatest Lower Bound) be the following formula: \[\begin{align} \mathsf{GLB}(x,y,z) \;:= \;z \subseteq x \wedge z \subseteq y \wedge \forall w \, ((w \subseteq x \wedge w \subseteq y) \to w \subseteq z). \end{align}\] The interpretation of this predicate is such that for every model \(\mathcal{M}\) of dimension \(n\) and every sequence of instances \(\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3\) it holds that \(\mathcal{M}\models \mathsf{GLB}(\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3)\) if and only if \(\mathbf{e}_3\) is the greatest partial instance subsumed by \(\mathbf{e}_1\) and \(\mathbf{e}_2\), i.e., the partial instance with most defined features subsumed by both. This property allows us to measure the number of defined features on which the two instances agree. By using this predicate, let \(\mathsf{LEH}\) be a ternary predicate such that \(\mathcal{M}\models \mathsf{LEH}(\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3)\) if and only if the Hamming distance between \(\mathbf{e}_1\) and \(\mathbf{e}_2\) is less than or equal to the Hamming distance between \(\mathbf{e}_1\) and \(\mathbf{e}_3\). The relation \(\mathsf{LEH}\) can be expressed as a formula from the atomic layer of \(\mathrm{\small ExplAIner}\) as follows: \[\begin{align} \mathsf{LEH}(x,y,z) \;:= \;\mathsf{Full}(x) \wedge \mathsf{Full}(y) \wedge \mathsf{Full}(z) \;\wedge \exists w_1 \exists w_2 \, (\mathsf{GLB}(x,y,w_1) \wedge \mathsf{GLB}(x,z,w_2) \wedge w_2 \preceq w_1). \end{align}\]
Let \(\mathsf{LU}\) (Level Up) be the following formula: \[\begin{align} \mathsf{LU}(x, y) \;:= \;x \prec y \wedge \neg \exists z \;(x \prec z \wedge z \prec y), \end{align}\] such that \(\mathcal{M}\vDash \mathsf{LU}(\mathbf{e}_1, \mathbf{e}_2)\) if and only if \(\mathbf{e}_1\) has exactly one less defined feature than \(\mathbf{e}_2\). By using this predicate, let \(\mathsf{Add}\) be a ternary predicate such that \(\mathcal{M}\vDash \mathsf{Add}(\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3)\) if and only if \(\mathbf{e}_2\) is a feature subsumed by \(\mathbf{e}_3\) and \(\mathbf{e}_1\) is obtained from \(\mathbf{e}_3\) by undefining the feature \(\mathbf{e}_2\). The relation \(\mathsf{Add}\) can be expressed as formula from the atomic layer of \(\mathrm{\small ExplAIner}\) as follows: \[\begin{align} \mathsf{Add}(x,y,z) \;:= \;{\sf Single}(y) \wedge x \subseteq z \wedge \mathsf{LU}(x, z) \wedge y \subseteq z \wedge \neg(y \subseteq x). \end{align}\] Recall that \({\sf Single}(x)\) defines the set of partial instances with exactly one defined feature, and can be expressed as follows: \[{\sf Single}(x) := \exists y (y \subset x) \wedge \forall y (y \subset x \, \rightarrow \, \neg \exists z (z \subset y)).\]