Hybrid MKNF knowledge bases [Motik and Rosati (2010)], based on the logic of minimal knowledge and negation as failure (MKNF) [Lifschitz (1991)], is one of the most influential yet mature formalisms for combining open world ontology languages, such as description logics (DLs) [Baader et al. (2003)] and the OWL-based ones [Hitzler et al. (2009)]
, with closed world rule-based languages, like logic programs under the stable model semantics[Baral (2003)]. The semantics of hybrid MKNF knowledge bases is captured by MKNF models. It is shown that the data complexity of reasoning within hybrid MKNF knowledge bases is in many cases not higher than reasoning in the corresponding fragment of logic programming [Motik and Rosati (2010)]. For instance, if the underlying DL fragment is of polynomial data complexity, then the data complexity of instance checking after combining with nondisjunctive (normal) rules is coNP-complete. However, despite many efficient solvers for logic programs [Heule and Schaub (2015)], there is few work on computing MKNF models of hybrid MKNF knowledge bases—the only known reasoning methods are based on the brute-force, guess-and-verify approach [Motik and Rosati (2010)]. In this approach, the set of K-atoms is partitioned into two subsets, the set of true K-atoms and the set of false K-atoms, in each possible way, and whether it corresponds to an MKNF model is verified by an operator similar to the immediate consequence operator in logic programming.
Most modern SAT/ASP solvers are built under the DPLL architecture [Nieuwenhuis et al. (2006)]
, where propagating a partial assignment is a key process. Recall that a DPLL-based solver is a search engine whose basic operation is to make decisions, propagate a partial assignment at each decision point, and backtrack when a conflict is encountered. Typically, a competitive solver also implements powerful heuristics for variable selection, and conflict analysis and clause learning[Zhang and Malik (2002)]. Propagating a partial assignment can result in substantial pruning of the search space—all the propagated truth values are committed in expanding the given partial assignment. In this context, the larger the computed set of truth values, the stronger is the propagator. Apparently, the cost of computing such a set should also be taken into consideration. As an example, BCP (Boolean Constraint Propagation, also called Unit Propagation) is considered the most important part of a SAT solver [Malik and Zhang (2009)], and a SAT solver typically spends more than of its time running BCP. In ASP, the well-known Expand function in smodels [Simons et al. (2002)] plays a central role in constraint propagation for weight constraint logic programs, but the feature of lookahead is often abandoned due to its high cost. Also, viewing inferences in ASP as unit propagation on nogoods, along with other techniques, has made clasp among the most competitive solvers for ASP as well as for SAT [Gebser et al. (2012)]. More recently, for answer set programs with external sources [Eiter et al. (2016)], the approach of guessing truth values of external sources is replaced with evaluations under partial assignments, which produces substantial gains in search efficiency.
Despite all of these advances, for hybrid MKNF knowledge bases, the fundamental issue of what constitutes constraint propagation for a DPLL-based search engine has not been addressed. The brute-force, guess-and-verify proof method is still the state-of-the-art.
To formulate a well-founded semantics for normal hybrid MKNF knowledge bases, knorr2011local knorr2011local proposed a well-founded operator to compute consequences that are satisfied by every MKNF model of a hybrid MKNF knowledge base by an alternating fixpoint construction. The operator computes the least fixpoint iteratively from the least element in a bilattice and enjoys a polynomial data complexity when the underlying DL is polynomial.
It is important to distinguish constraint propagation from computing the well-founded semantics - while the latter computes one least fixpoint, the former can be viewed as computations by a family of operators, each of which is applied to a different partial partition (partial partitions are analogue to partial interpretations in SAT/ASP). We say that such an operator is instantiated, or induced, from the related partial partition, and call it an instance operator. If such an instance operator is monotonic, we then can analyze its properties by applying the Knaster-Tarski fixpoint theory [Tarski (1955)] and view the computation of its least fixpoint as the process of constraint propagation that extends the given partial partition. Thus, in this paper the term well-founded operator refers to the corresponding family of instance operators. We show that if we apply this idea to Knorr et al.’s operator, an instance operator may not be converging. Thus, Knorr et al.’s operator does not provide a satisfactory solution for constraint propagation.
In this paper, we address the problem of constraint propagation for normal hybrid MKNF knowledge bases. The main contributions are the following:
We extend the notion of unfounded sets to normal hybrid MKNF knowledge bases and show that desirable properties for logic programs [Leone et al. (1997)] can be generalized to normal hybrid MKNF knowledge bases; in particular, MKNF models are precisely unfounded-free models. We provide a procedure to compute the greatest unfounded set of a normal hybrid MKNF knowledge base w.r.t. a partial partition, which has polynomial data complexity when the underlying DL is polynomial.
We introduce two new well-founded operators, with one being stronger than the other. We show that both are stronger than the one proposed in [Knorr et al. (2011)] when applied to arbitrary partitions.
Employing either of the two operators as the underlying propagator, we formulate a DPLL-based procedure to determine whether an MKNF model exists for a normal hybrid MKNF knowledge base; in case the answer is positive, the procedure can be adopted to compute all MKNF models by backtracking. This provides another DPLL-based NP inference engine, as the decision problem is NP-complete when the underlying DL component is trackable [Motik and Rosati (2010)].
We show that the two proposed operators have different utilities. The stronger one serves as a stronger propagator in a DPLL-based search engine, and the weaker one has the desired property that it can be used to simplify the given hybrid MKNF knowledge base before we proceed to compute MKNF models. It thus provides a theoretical basis for implementing the simplification process in a grounder for normal hybrid MKNF knowledge bases.
2.1 Minimal knowledge and negation as failure
The logic of minimal knowledge and negation as failure (MKNF) [Lifschitz (1991)] is based on a first-order language (possibly with equality ) with two modal operators, , for minimal knowledge, and , for negation as failure. In MKNF , a first-order atom is a formula of the form , where are terms and is a predicate in . MKNF formulas are first-order formulas with and . An MKNF formula is ground if it contains no variables, and is the formula obtained from by replacing all free occurrences of the variable with term .
A first-order interpretation is understood as in first-order logic. The universe of a first-order interpretation is denoted by . A first-order structure is a nonempty set of first-order interpretations with the universe for some fixed . An MKNF structure is a triple , where and are sets of first-order interpretations with the universe . We define the satisfaction relation between an MKNF structure and an MKNF formula . Then we extend the language by object constants representing all elements of and call these constants names:
( is a first-order atom) if is true in ,
if and ,
if for some name ,
if for all ,
if for some .
The symbols , , , , and are interpreted as usual.
An MKNF interpretation is a nonempty set of first-order interpretations over the universe for some . An MKNF interpretation satisfies an MKNF formula , written , if for each .
An MKNF interpretation is an MKNF model of an MKNF formula if
there is no MKNF interpretation such that and for every .
For example, with the MKNF formula , it is easy to verify that the MKNF interpretation is an MKNF model of .
In this paper, we consider only MKNF formulas that do not contain nested occurrences of modal operators and every first-order atom occurring in the formula is in the range of a modal operator. Specifically, a K-atom is a formula of the form and a not-atom is a formula of the form , where is a first-order formula.
2.2 Hybrid MKNF knowledge bases
Following [Motik and Rosati (2010)], a hybrid MKNF knowledge base consists of a decidable description logic (DL) knowledge base translated into first-order logic and a rule base , which is a finite set of MKNF rules. An MKNF rule has the following form, where , and are function-free first-order atoms:
If , is a normal MKNF rule; if , is a positive MKNF rule; if and , is an MKNF fact. A hybrid MKNF knowledge base is normal if all MKNF rules in are normal; is ground if it does not contain variables; and is ground if all MKNF rules in are ground.
We also write an MKNF rule of form (1) as , where is , , is , and is , and we identify , , , with their corresponding sets of K-atoms and not-atoms. With a slight abuse of notion, we denote .
Let be a hybrid MKNF knowledge base and an MKNF rule. We define an operator for , , and , respectively, as follows, where
is the vector of the free variables appearing in:
For simplicity, in the rest of this paper we may identify with the MKNF formula .
An MKNF rule is DL-safe if every variable in occurs in at least one non-DL-atom occurring in the body of . A hybrid MKNF knowledge base is DL-safe if all MKNF rules in are DL-safe. A notion called standard name assumption is applied to hybrid MKNF knowledge bases to avoid unintended behavior [Motik and Rosati (2010)], under which interpretations are Herbrand ones with a countably infinite number of additional constants. If is DL-safe, then is semantically equivalent to in terms of MKNF models where is ground, hence decidability is guaranteed.
In the rest of this paper, we consider normal hybrid MKNF knowledge bases containing ground MKNF rules and use the standard name assumption for first-order inferences.
2.3 Alternating fixpoint construction
We briefly review the operator based on an alternating fixpoint construction introduced in [Knorr et al. (2011)].
Let be a (ground) hybrid MKNF knowledge base. The set of K-atoms of , written , is the smallest set that contains:
all ground K-atoms occurring in , and
a K-atom for each ground -atom occurring in .
A partial partition of consists of two sets, where and . For a subset of , the objective knowledge of w.r.t. is the set of first-order formulas .
For two pairs and , we define if and , if and , and .
Let be a normal hybrid MKNF knowledge base and . The operators , are defined on subsets of as follows:
Note that, both and are monotonic. We denote by and , respectively, the least fixpoint of the corresponding operator.
Let be a normal hybrid MKNF knowledge base. We define two sequences and as follows:
Let be a normal hybrid MKNF knowledge base. The coherent well-founded partition of is defined by .111Note that, in general, may not be consistent, i.e., it is not guaranteed that the condition holds.
Clearly, the number of iterations in the construction of the coherent well-founded partition is linear in the number of K-atoms in . If the entailment relation can be computed in polynomial time, so can each iteration as well as the coherent well-founded partition.
3 Unfounded Set and Well-Founded Operators
In this section, we define the notion of unfounded set for (ground) normal hybrid MKNF knowledge bases, present an algorithm to compute the greatest unfounded set, and then introduce two new well-founded operators. At the end, we discuss the relations of these operators with the one based on the alternating fixpoint construction.
3.1 Unfounded sets
In logic programming, an unfounded set in general refers to a set of atoms that fail to be derived by rules. In the context of hybrid MKNF knowledge bases, the concept becomes more involved due to possible inferences with the knowledge expressed in the underlying ontology.
Given a set of normal MKNF rules , we define .
A set is an unfounded set of a normal hybrid MKNF knowledge base w.r.t. a partial partition of , if for each and each such that
for each , is consistent, in particular, is consistent when ,
there exists an MKNF rule satisfying one of the following conditions:
A K-atom in an unfounded set is called an unfounded atom.
Roughly speaking, for a modal atom to be unfounded w.r.t. , any group of rules that can help derive it, along with , must contain at least one rule which is not applicable given . Since the condition must be satisfied for each , when is a minimal set such that , the existence of such a rule blocks the derivation.
More precisely, an unfounded set w.r.t. is one such that for each , if is derivable from (the objective heads of) rules in and objective knowledge , where is not in conflict with any false atom based on , then there exists at least one rule in such that either its body is not satisfied by or the body being satisfied depends on some atoms in .
It is not difficult to verify that, when , this notion of unfounded sets coincides with the one for the corresponding logic programs [Van Gelder et al. (1991)].
Consider , where and . Since there exists no with and is consistent, is an unfounded set of w.r.t. .
Let be a normal hybrid MKNF knowledge base, a partial partition of . If and are unfounded sets of w.r.t. , then is an unfounded set of w.r.t. .
As the union of two unfounded sets is also an unfounded set, the greatest unfounded set of w.r.t. , denoted , exists, which is the union of all unfounded sets of w.r.t. .
Let be a normal hybrid MKNF knowledge base, a partial partition of , and an unfounded set of w.r.t. . For any MKNF model of with , for each .
In logic programming, a declarative characterization of stable models is that they are precisely unfounded-free models (see, e.g. [Alviano et al. (2011)]). The same property holds for normal hybrid MKNF knowledge bases under the notion of unfounded set defined in this paper.
Let be a normal hybrid knowledge base and an MKNF model of . Define by and . Then, is the greatest unfounded set of w.r.t. .
We provide an approach to computing the greatest unfounded set of w.r.t. , i.e., . First, we define an operator as follows:
Clearly, is monotonic. We thus define the function to be the least fixpoint of . We show that the greatest unfounded set can be computed from .
Let be a normal hybrid MKNF knowledge base and a partial partition of . .
Clearly, the number of iterations in the construction of is linear in the number of K-atoms in . If the entailment relation can be computed in polynomial time, then can be computed in polynomial time, and the same holds for computing the greatest unfounded set of w.r.t. .
3.2 A well-founded operator
By applying the process of computing the greatest unfounded set w.r.t. a partial partition, we can define a new well-founded operator.
Let be a normal hybrid MKNF knowledge base, and a partial partition of . We introduce the well-founded operator of as follows:
Note that, is monotonic, i.e., if , then
Notice also that each partition induces an instance operator . Thus, we have defined a family of monotonic operators. We often just write , and call it a well-founded operator, to mean the family of instance operators induced from partial partitions.
The well-founded partition of a normal hybrid MKNF knowledge base is defined by the least fixpoint of the instance operator .
In particular, we define
The well-founded partition of is . If the entailment relation can be computed in polynomial time, then can be computed in polynomial time.
Example 1 (Continued)
The well-founded partition of in Example 1 can be computed as follows:
3.3 An expanding well-founded operator
Here, we introduce another well-founded operator extended from . The idea is to apply unit propagation to increase the propagation power of .
Let be a normal hybrid MKNF knowledge base, a partial partition of . We use to denote the partial partition that can be derived from based on by unit propagation. Formally, it is defined in Algorithm 1.
Then we introduce the expanding well-founded operator of as follows:
For example, consider a hybrid MKNF knowledge base , where and . By the definition of , we have and , and thus is inconsistent. For this example, the result shows that no MKNF model exists under the condition that .
Since is monotonic, is monotonic as well. Again, above we have defined a family of monotonic operators. We may write , and call it a well-founded operator, to mean the family of these instance operators.
The expanding well-founded partition of a normal hybrid MKNF knowledge base is defined by the least fixpoint of the instance operator .
Similarly, we define
The expanding well-founded partition of is . If the entailment relation can be computed in polynomial time, then can be computed in polynomial time.
Note that, since , the expanding well-founded operator is an extension of the well-founded operator .
Let be a normal hybrid MKNF knowledge base and a partial partition of . and .
The following example shows that is possible.
Example 1 (Continued)
The expanding well-founded partition of can be computed as follows:
Then , which corresponds to the unique MKNF model of .
3.4 Relations to coherent well-founded partition
In this subsection, we show the relations of the new well-founded operators proposed in this paper with the one based on the alternating fixpoint construction.
Let be a normal hybrid MKNF knowledge base. .
From Proposition 3.4, we have .
The above theorem shows that the well-founded partition is equivalent to the coherent well-founded partition. On the other hand, given a partial partition for a normal hybrid MKNF knowledge base , returns an expansion of . Similarly, for the purpose of adopting alternating fixpoint construction for constraint propagation, we may attempt to define and from the sequences and with and .
As shown below, may not coincide with .
Consider , where and consists of
We have , while
The next example shows that, when applied to an arbitrary partial partition, the alternating fixpoint construction may not converge.
Consider , where and consists of
Let . Then
However, the sequences and do not converge.
Note that .
Note that the non-converging issue does not arise when the alternating fixpoint construction commences only from the least partition . However, for the goal of constraint propagation, converging must be guaranteed when applied to arbitrary partitions.
Let be a normal hybrid MKNF knowledge base and a partial partition of . , for each .
4 Computing MKNF Models
We show that both well-founded operators can be used to compute MKNF models of a normal hybrid MKNF knowledge base in a DPLL-based procedure. We first provide some properties.
Let be a normal hybrid MKNF knowledge base, a partial partition of , , and . Then for any MKNF model of with ,
The theorem can be proved from Proposition 3.2, i.e., given an unfounded set of w.r.t. , if is an MKNF model of satisfying , then for each .
Let be a normal hybrid MKNF knowledge base, the well-founded partition of , and the expanding well-founded partition of .
If and , then is the only MKNF model of .
If and , then is the only MKNF model of .