Weighted Conditional Knowledge Bases
with Integer Weights: an ASP Approach
Abstract
Weighted knowledge bases for description logics with typicality have been recently considered under a “concept-wise” multipreference semantics (in both the two-valued and fuzzy case), as the basis of a logical semantics of Multilayer Perceptrons. In this paper we consider weighted conditional knowledge bases in the two-valued case, and exploit ASP and asprin for encoding concept-wise multipreference entailment for weighted KBs with integer weights.
1 Introduction
Preferential approaches to common sense reasoning [27, 31, 29, 4, 24], have been extended to description logics (DLs), to deal with inheritance with exceptions in ontologies, by allowing for non-strict forms of inclusions, called typicality or defeasible inclusions, with different preferential semantics [19, 8] and closure constructions [11, 10, 20, 32, 12].
In recent work, a concept-wise multipreference semantics [17] has been proposed as a semantics of ranked knowledge bases, i.e. knowledge bases in which defeasible or typicality inclusions of the form (meaning “the typical ’s are ’s” or “normally ’s are ’s”) are given a rank, a natural number, representing their strength, where is a typicality operator [19] that singles out the typical instances of concept . The concept-wise multipreference semantics takes into account preferences with respect to different concepts, and integrates them into a single global preference relation, which is needed for the evaluation of general defeasible inclusions. Answer Set Programming (ASP) and, in particular, asprin [7], has been exploited to achieve defeasible reasoning under the multipreference approach for the lightweight description logic (a logic of the family [3]).
In [18], the concept-wise multipreference semantics has been adapted to deal with weighted knowledge bases, in which each typicality inclusion is associated to a weight, a real (positive or negative) number, representing its plausibility or implausibility. The multipreference semantics has been exploited to provide a preferential interpretation of Multilayer Perceptrons (MLPs), by representing the input-output behavior of the network. It has been further extended to the fuzzy case, and the fuzzy multipreference interpretation built from the network, for a given set of input stimuli, have been proven to be a model of the neural network, in the logical sense. To this purpose, the deep network has been interpreted as a weighted conditional knowledge base, i.e., a set of weighted defeasible inclusions, by regarding synaptic connections as weighted defeasible inclusions.
While decidability of the fuzzy multipreference entailment is an open problem, in this paper we consider the two-valued case and extend the ASP approach considered for ranked KBs [17] to deal with weighted conditional KBs, for integer weights. Differently from [17], the semantic closure construction used for weighted knowledge bases does not exploit a lexicographic order, as in Lehmann lexicographic closure [29] and in Brewka’s framework of basic preference descriptions [6], but a construction more related to Kern-Isberner’s c-representations [24, 25]. We develop an ASP encoding of the concept-wise multipreference semantics for weighted knowledge bases, and exploit asprin to achieve defeasible reasoning for weighted knowledge bases with integer weights. This is a first step towards the definition of multi-valued approximations of the fuzzy multipreference semantics for weighted knowledge bases, which may be of interest from the standpoint of explainable AI [2, 23].
2 The description logic
We consider the description logic of the family [3]. Let be a set of concept names, a set of role names and a set of individual names. The set of concepts can be defined as follows: where , and . is a nominal, a concept containing a single element. Observe that union, complement and universal restriction are not constructs. A knowledge base (KB) is a pair , where is a TBox and is an ABox. The TBox is a set of concept inclusions (or subsumptions) of the form , where are concepts. The ABox is a set of assertions of the form and where is a concept, , and .
An interpretation for is a pair where: is a non-empty domain—a set whose elements are denoted by —and is an extension function that maps each concept name to a set , each role name to a binary relation , and each individual name to an element . It is extended to complex concepts as follows: , , , and
The notion of satisfiability of a KB in an interpretation is defined as usual:
Definition 1 (Satisfiability and Entailment)
Given an interpretation :
- satisfies an inclusion if ;
- satisfies an assertion if and an assertion if .
Given a KB , an interpretation satisfies (resp. ) if satisfies all inclusions in (resp. all assertions in ); is a model of if satisfies and .
A subsumption (resp., an assertion , ), is entailed by , written , if for all models of , satisfies .
3 Weighted knowledge bases and the multipreference semantics
Let be a set of distinguished concepts, the concepts for which defeasible inclusions are defined. A weighted TBox is defined for each distinguished concept as a set of defeasible inclusions of the form with a weight. A weighted knowledge base over is a tuple , where is a set of strict concept inclusions, is an ABox and, for each , is a set of weighted defeasible inclusions, , where each is a typicality inclusion of the form , having weight , a real number.
Consider, for instance, the weighted knowledge base , over the set of distinguished concepts , with empty ABox, and with containing the set of strict inclusions:
contains the following weighted defeasible inclusions:
, - 50 , 100
, -70;
contains the defeasible inclusions:
, 90 , 80
, -30
The meaning is that, while an employee normally has a boss, he is not likely to be young or have classes. Furthermore, between the two defeasible inclusions and , the second one is considered to be less plausible than the first one. Given two employees Tom and Bob such that Tom is not young, has no boss and has classes, while Bob is not young, has a boss and has no classes, considering the weights above, we will regard Bob as being more typical than Tom as an employee. Note that negative weights represent penalties that could not be expressed by positive ranks in a ranked knowledge base.
The semantics of a weighted knowledge base has been defined [18] based on a concept-wise preference semantics, a semantics first exploited for ranked knowledge bases [17]. For each concept , a preference relation describes the preference among domain elements with respect to . Each has the properties of preferences in KLM-style ranked interpretations [29], i.e., it is a modular and well-founded strict partial order. More precisely, is well-founded if, for all , if , then ; is modular if, for all , implies ( or ).
To define a concept-wise semantics for weighted KBs, let us recall the notion of multipreference interpretation [17]: an interpretation is extended with a collection of preferences.
Definition 2 (Multipreference interpretation)
A multipreference interpretation is a tuple , where:
(a) is a domain, and an interpretation function, as in interpretations;
(b) for each , is an irreflexive, transitive, well-founded and modular relation over .
A preference relation determines the relative typicality of domain individuals with respect to concept . For instance, Tom may be more typical than Bob as a student (), but more exceptional than Tom as an employee ( ). The minimal -elements with respect to are taken as the most typical -elements.
For a multipreference interpretation to satisfy a weighted knowledge base , we require to satisfy the axioms in and , as usual in , and each preference relation to be constructed from , through a semantic closure construction, similar in spirit to the lexicographic closure [30], but more similar to to c-representation [24, 25]. The sum of the weights of the defeasible inclusions for satisfied by each domain element is considered; higher preference wrt is given to the domain elements whose associated sum (wrt ) is higher [18].
As has the finite model property [3], we can restrict to interpretations with a finite domain . We say that satisfies in , if or (otherwise violates in ). Given an interpretation and a domain element , the weight of wrt in is defined considering the inclusions , as follows:
(3) |
where is added at the bottom of all real values. Informally, given an interpretation , for , the weight of wrt is the sum of the weights of all defeasible inclusions for satisfied by in . The more plausible are the satisfied inclusions, the higher is the weight of . The lowest weight, , is given to all domain elements which are not instances of .
Based on this notion of weight of a domain element wrt a concept, one can construct a preference relation from a given interpretation . A domain element is preferred to element wrt if the sum of the weights of the defaults in satisfied by is higher than the sum of the weights of defaults in satisfied by : for ,
(4) |
Note that a strict modular partial order, and all -elements are preferred wrt to the domain elements which are not instances of . The higher is the weight of an element wrt the more preferred is the element. In the example, (for ) and, hence, , i.e., Bob is more typical than Tom as an employee.
Given the preferences for the distinguished concepts, we can interpret as the set of minimal elements w.r.t. preference .
To provide an interpretation of the typicality concept for an arbitrary (such as, for instance, ),
following [17],
a notion of global preference is introduced by exploiting a modified Pareto combination of the preference relations ,
which takes into account the specificity relation among concepts, e.g., that concept is more specific than concept (), and its properties override the properties of , when conflicting). The global preference relation is defined from as follows:
.
We interpret , for an arbitrary concept ,
as the set of minimal -elements with respect to (i.e., ).
This leads to the definition of a concept-wise multipreference model (cwm-model) of a weighted knowledge base
over , as a
a tuple , where
satisfies
and in ;
is defined from and , according to condition (4), for all ; and is the global preference relation.
Based on the notion of cwm-model of a KB, a notion of concept-wise entailment (or cwm-entailment) can be defined in a natural way for weigthed KBs. Let us restrict consideration to (finite) canonical models, i.e., models which are large enough to contain all the relevant domain elements (see [17]).
Definition 3 (cwm-entailment [18])
An inclusion is cwm-entailed from a weighted knowledge base if it is satisfied in all canonical cwm-models of .
As for ranked knowledge bases [17], it can be proven that this notion of cwm-entailment for weigthed KBs satisfies the KLM postulates of a preferential consequence relation, as the global preference relation is a strict partial order.
4 Encoding cwm-entailment in ASP and asprin for integer weights
From the computational point of view, in the case of knowledge bases integer weights, the notion of cwm-entailment can be reformulated as a problem of computing preferred answer sets, as done for ranked knowledge bases [17]. It is possible to adapt the ASP encoding for ranked knowledge bases to deal with the extension of with typicality inclusions with integer weights. The encoding has been developed by exploiting a fragment of Krötzsch’s Datalog materialization calculus [28] to generate the answer sets (representing canonical cwm-models), and asprin [7] to select preferred answer sets: asprin allows to do this according to preferences defined from a library, or with a preference program, as in this case.
In principle, verifying cwm-entailment of a typicality subsumption from , would require considering all typical -elements in all possible canonical cwm-models of , and checking whether they are all instances of . However, it is sufficient to consider, among all the (finite) cwm-models of , the polynomial models that we can construct using the fragment of the materialization calculus by Krötzsch [28], and a distinguished domain element to represent a prototypical -element. The preferred answer sets are those maximizing the weight of typicality inclusions satisfied by . As in the materialization calculus auxiliary constants are used to deal with existential rules. Differently from [17], we do not need other auxiliary predicates for the distinguished concepts .
Following [28], we assume that the knowledge base is in normal form [3], where a typicality inclusion is in normal form when . Extending the results by Krötzsch [28], it can be proven that, given a KB, a semantically equivalent KB in normal form (over an extended signature) can be computed in linear time [21].
The base program for the (normalized) knowledge base and a typicality subsumption is composed of three parts, . is the representation of in Datalog based on the materialization calculus [28], where , , are used for , , , and, for example, and are used, respectively, for and . Additionally, is introduced to describe the typical properties of concept with their weight , and is used for specifying preferences in asprin.
contains the subset of the inference rules for instance checking from the materialization calculus [28], those relevant for , for example, . For , we use an additional rule: . Additionally, contains the version of the same rules for subclass checking (where represents [28]), and a rule to define predicate describing the specificity relation among concepts (meaning that concept is more specific than concept ). also contains the rule: , which generates alternative answer sets, corresponding to different interpretations of , which may be an instance or not of any concept .
Let us notice that the rules enforcing -compliance in [17] are omitted. In fact, in a -compliant interpretation all typical elements are assumed to satisfy all typicality inclusions for in , an assumption which cannot be taken in the presence of defeasible inclusions with negative weights.
contains (when needed) normalized axioms defining in in terms of other concepts (e.g., replacing with and , and ) plus the facts , ,
Differently from the ASP encoding in [17], where the lexicographic strategy # [6] for ranked knowledge bases is used, the preference among individuals is now expressed as: iff , where and are integer values. Given a query , we have to verify that, in all canonical cwm-models of the KB, all the typical -elements are -elements. This verification is accomplished, by generating answer sets, corresponding to the cwm-models of the KB, and by selecting the preferred ones, in which the distinguished element represents a typical -element.
An answer set is preferred to answer set if, considering the typicality inclusions satisfied by in and in (and the relative weights and for each concept ), in the global preference relation, . The preference relations can be suitably encoded in the aspirin specification (based on the definition above), verifying which atoms are in (resp., in ) to determine the typicality inclusions satisfied by and , to establish whether . The (global) preference relation between answer sets can be defined by combining the preferences . A query is entailed by the knowledge base if, in all the preferred answer sets, is an instance of concept . It can be proven that this corresponds to verifying that is satisfied in all minimal -elements in all canonical cwm-models of the knowledge base.
Based on the reformulation of cwm-entailment as a problem of computing preferred answer sets, deciding cwm-entailment can be proven to be in for weighted knowledge bases with integer weights, as for ranked KBs. The proof of the result is similar to the proof of Proposition 7 in the online Appendix of [17], although here we use a different notion of preference , a different encoding, and do not consider -compliant interpretations. This result also extends to weighted knowledge bases with real valued weights, although our implementation in asprin does not deal with real valued weights.
5 Conclusions
In this paper we have described an ASP approach for reasoning in a defeasible extension of the description logic with weighted typicality inclusions. We have considered the case with integer weights, for which an encoding of the concept-wise multipreference entailment can be defined using ASP and asprin [7]. We have further considered a concept-wise semantics with multiple preferences, in which any distinguished concept has its own set of (weighted) typicality inclusions, and preference .
Related semantics with multiple preferences have been proposed, starting from Brewka’s framework of basic preference descriptions [6], in system ARS, as a refinement of System Z by Kern-Isberner and Ritterskamp [26]; in an extension of by Gil [15]; in a refinement of rational closure by Gliozzi [22]; by associating multiple preferences to roles by Britz and Varzinczak [9]; in ranked knowledge bases in [17]; and in the first-order logic setting by Delgrande and Rantsaudis [14].
The development of proof methods for multipreference entailment is motivated by the relationship between weighted conditionals under the (fuzzy) concept-wise multipreference semantics and multilayer perceptrons. Undecidability results for fuzzy description logics with general inclusion axioms [13, 5] motivate the investigation of multi-valued approximations of fuzzy multipreference entailment. This is a first step towards the definition of proof methods for multi-valued extensions of our concept-wise preferential semantics based on a notion of faithful interpretations [16]. Other possible extensions concern the definition of multiple typicality operators, based on the combination of selected concepts, and a temporal extension to capture the transient behavior of Multilayer Perceptrons.
Acknowledgement: We thank the referees for their helpful suggestions. This research is partially supported by INDAM-GNCS Project 2020.
References
- [1]
- [2] A. Adadi & M. Berrada (2018): Peeking Inside the Black-Box: A Survey on Explainable Artificial Intelligence (XAI). IEEE Access 6, pp. 52138–52160, 10.1109/ACCESS.2018.2870052.
- [3] F. Baader, S. Brandt & C. Lutz (2005): Pushing the envelope. In: Proc. 19th Int. Joint Conf. on Artificial Intelligence (IJCAI 2005), Edinburgh, Scotland, UK, pp. 364–369.
- [4] S. Benferhat, C. Cayrol, D. Dubois, J. Lang & H. Prade: Inconsistency Management and Prioritized Syntax-Based Entailment. In: Proc. IJCAI’93, Chambéry, France, 28/8 - 3/9, 1993, Morgan Kaufmann, pp. 640–647.
- [5] S. Borgwardt & R. Peñaloza (2012): Undecidability of Fuzzy Description Logics. In: Principles of Knowledge Representation and Reasoning: Proc. 13th Int. Conf., KR 2012, Rome, Italy, June 10-14, 2012.
- [6] G. Brewka (2004): A Rank Based Description Language for Qualitative Preferences. In: Proc. 16th Eureopean Conf. on Artificial Intelligence, ECAI’2004, Valencia, Spain, August 22-27, 2004, pp. 303–307.
- [7] G. Brewka, J. P. Delgrande, J. Romero & T. Schaub (2015): asprin: Customizing Answer Set Preferences without a Headache. In: Proc. AAAI 2015, pp. 1467–1474.
- [8] K. Britz, J. Heidema & T. Meyer (2008): Semantic Preferential Subsumption. In G. Brewka & J. Lang, editors: KR 2008, AAAI Press, Sidney, Australia, pp. 476–484.
- [9] K. Britz & I J. Varzinczak (2018): Rationality and Context in Defeasible Subsumption. In: FoIKS 2018, Budapest, May 14-18, 2018, pp. 114–132, 10.1007/978-3-319-90050-6_7.
- [10] G. Casini, T. Meyer, I. J. Varzinczak, & K. Moodley (2013): Nonmonotonic Reasoning in Description Logics: Rational Closure for the ABox. In: DL 2013, CEUR Workshop Proceedings 1014, pp. 600–615.
- [11] G. Casini & U. Straccia (2010): Rational Closure for Defeasible Description Logics. In: JELIA 2010, LNCS 6341, Springer, Helsinki, pp. 77–90, 10.1007/978-3-642-15675-5_9.
- [12] G. Casini, U. Straccia & T. Meyer (2019): A polynomial Time Subsumption Algorithm for Nominal Safe ELO under Rational Closure. Inf. Sci. 501, pp. 588–620, 10.1016/j.ins.2018.09.037.
- [13] M. Cerami & U. Straccia (2011): On the Undecidability of Fuzzy Description Logics with GCIs with Lukasiewicz t-norm. CoRR abs/1107.4212. Available at http://arxiv.org/abs/1107.4212.
- [14] J. Delgrande & C. Rantsoudis (2020): A Preference-Based Approach for Representing Defaults in First-Order Logic. In: 18th Int. Workshop on Non-Monotonic Reasoning, NMR2020, September 12th - 14th.
- [15] Oliver Fernandez Gil (2014): On the Non-Monotonic Description Logic ALC+T. CoRR abs/1404.6566.
- [16] L. Giordano (2021): On the KLM properties of a fuzzy DL with Typicality. In: 16th European Conf. on Symbolic and Quantitative Approaches to Reasoning with Uncertainty, ECSQARU 2021, Sept. 17-20, LNAI 12897, Springer, 10.1007/978-3-030-86772-040.
- [17] L. Giordano & D. Theseider Dupré (2020): An ASP approach for reasoning in a concept-aware multipreferential lightweight DL. TPLP 10(5), pp. 751–766, 10.1007/978-3-642-15675-521.
- [18] L. Giordano & D. Theseider Dupré (2021): Weighted defeasible knowledge bases and a multipreference semantics for a deep neural network model. In: Proc17th European Conf. on Logics in AI, JELIA 2021, May 17-20, LNCS 12678, Springer, pp. 225–242, 10.1007/978-3-030-75775-516.
- [19] L. Giordano, V. Gliozzi, N. Olivetti & G. L. Pozzato (2007): Preferential Description Logics. In: LPAR 2007, LNAI 4790, Springer, Yerevan, Armenia, pp. 257–272, 10.1007/978-3-540-75560-9_20.
- [20] L. Giordano, V. Gliozzi, N. Olivetti & G. L. Pozzato (2015): Semantic characterization of rational closure: From propositional logic to description logics. Artif. Intell. 226, pp. 1–33, 10.1016/j.artint.2015.05.001.
- [21] L. Giordano & D. Theseider Dupré (2018): Defeasible Reasoning in SROEL from Rational Entailment to Rational Closure. Fundam. Inform. 161(1-2), pp. 135–161, 10.3233/FI-2018-1698.
- [22] V. Gliozzi (2016): Reasoning about Multiple Aspects in Rational Closure for DLs. In: AI*IA 2016: 15th Int. Conf. of the Italian Assoc. for AI, Genova, Italy, Nov. 2016, pp. 392–405, 10.1007/978-3-319-49130-1_29.
- [23] R. Guidotti, A. Monreale, S. Ruggieri, F. Turini, F. Giannotti & D. Pedreschi (2019): A Survey of Methods for Explaining Black Box Models. ACM Comput. Surv. 51(5), pp. 93:1–93:42, 10.1145/3236009.
- [24] G. Kern-Isberner (2001): Conditionals in Nonmonotonic Reasoning and Belief Revision - Considering Conditionals as Agents. LNCS 2087, Springer, 10.1007/3-540-44600-1.
- [25] G. Kern-Isberner & C. Eichhorn (2014): Structural Inference from Conditional Knowledge Bases. Studia Logica 102(4), pp. 751–769, 10.1007/s11225-013-9503-6.
- [26] G. Kern-Isberner & M. Ritterskamp (2010): Preference Fusion for Default Reasoning Beyond System Z. J. Autom. Reasoning 45(1), pp. 3–19, 10.1007/s10817-009-9129-6.
- [27] S. Kraus, D. Lehmann & M. Magidor (1990): Nonmonotonic Reasoning, Preferential Models and Cumulative Logics. Artificial Intelligence 44(1-2), pp. 167–207, 10.1016/0004-3702(90)90101-5.
- [28] M. Krötzsch (2010): Efficient Inferencing for OWL EL. In: Proc. JELIA 2010, pp. 234–246, 10.1007/978-3-642-15675-5_21.
- [29] D. Lehmann & M. Magidor (1992): What does a conditional knowledge base entail? Artificial Intelligence 55(1), pp. 1–60, 10.1016/0004-3702(92)90041-U.
- [30] D. J. Lehmann (1995): Another Perspective on Default Reasoning. Ann. Math. Artif. Intell. 15(1), pp. 61–82, 10.1007/BF01535841.
- [31] J. Pearl: System Z: A Natural Ordering of Defaults with Tractable Applications to Nonmonotonic Reasoning. In: TARK’90, Pacific Grove, CA, USA, 1990, Morgan Kaufmann, pp. 121–135.
- [32] M. Pensel & A. Turhan (2018): Reasoning in the Defeasible Description Logic - computing standard inferences under rational and relevant semantics. Int. J. Approx. Reasoning 103, pp. 28–70, 10.1016/j.ijar.2018.08.005.