=Paper=
{{Paper
|id=Vol-2028/paper6
|storemode=property
|title=A Language of Case Differences
|pdfUrl=https://ceur-ws.org/Vol-2028/paper6.pdf
|volume=Vol-2028
|authors=Fadi Badra
|dblpUrl=https://dblp.org/rec/conf/iccbr/Badra17
}}
==A Language of Case Differences==
63 A Language of Case Differences Fadi Badra Université Paris 13, Sorbonne Paris Cité, LIMICS, (UMR S 1142), F-93430 Sorbonne Universités, UPMC Univ Paris 06, UMR S 1142, LIMICS, F-75006 INSERM, U1142, LIMICS, F-75006, Paris, France badra@univ-paris13.fr Abstract. This paper contributes to a line of research that consists in applying qualitative reasoning techniques to the formalization of the case-based inference, and in particular, to its adaptation phase. The im- portance of capturing case differences has long been acknowledged in adaptation research, but research is still needed to properly represent and reason upon case differences. Assuming that case differences can be expressed as a set of feature differences, we show that Category The- ory can be used as a mathematical framework to design a qualitative language in which both case differences, similarity paths and adaptation rules can be represented and reasoned upon symbolically. Keywords: case differences qualitative modeling similarity path adaptation 1 Introduction Qualitative modeling provides formalisms that focus on how people represent themselves and reason about dynamical systems. Qualitative representations partition continuous quantities, and turn them into entities that can be rea- soned upon symbolically [8]. The case-based inference aims at finding a com- plete description of a target problem by transferring information from a set of past problem-solving episodes, called cases, that are indexed in memory. Adap- tation is the part of this process that aims at modifying a retrieved case when it can not be reused as it is in the new situation. Previous work on applying qualitative modeling techniques to adaptation includes a qualitative represen- tation of relationships between quantities (called variations in [3]), such that co-occurrences of variations (called co-variations in [4]) can be interpreted as qualitative proportionalities. These proportionalities have been shown in [4] to play a great role in different commonsense inferences, and in particular, it has been suggested that adaptation was essentially an “analogical jump” performed on such proportionalities. In existing formalizations, adaptation is recognized as being part of the case- based reasoning cycle [1], but surprisingly, the adaptation step is not included in the case-based analogical inference [17]. A study of the literature shows the adaptation step is always performed after the analogical inference (i.e., retrieval, mapping, and transfer) has taken place, and only aims at modifying its result. Copyright © 2017 for this paper by its authors. Copying permitted for private and academic purpose. In Proceedings of the ICCBR 2017 Workshops. Trondheim, Norway 64 Some adaptation methods such as critique-based adaptation [11], or conservative adaptation [14] are used to resolve inconsistencies in the reused source case, whereas others such as differential adaptation [9], case-based adaptation [6] or adaptation by reformulation [15] modify the reused source case in order to fit the requirements on the target case. One of the reasons why adaptation is left out of the case-base inference is that adaptation essentially consists in reasoning on the differences that exist between two cases. While the importance of capturing case differences has long been acknowleged in adaptation research (see for example [13], for a recent review), research is still needed to properly represent and reason on case differences. Establishing a difference between two states is the result of a comparison process. Comparisons are qualitative judgements that play an important role in similarity assessment and in the analogical inference. According to [12], “ a comparison assembles two elements in order to come up with a third term that will tell their relationship ”. Comparison involves three ideas: the source of the comparison, the target of the comparison (what the source is compared to), and their relationship. For example, one could compare a sheep (the source) to a goat (the target), on how they forage (their relationship): a sheep would graze, whereas goats are browsers. Comparisons are usually made with respect to a particular feature (or property), shared by the objects under comparison, and which can be measured, like the size, the weight, or the type of forage [21]. Some results even suggests that people use aggregated features inferred from the features of individual objects to compare collections of objects [20]. Assuming that case differences can be expressed as a set of differences in feature value, we show that Category Theory can be used as a mathematical framework to design a qualitative language in which both case differences, but also “horizontal” connections of variations (similarity paths), and “vertical” con- nections (adaptation rules) can be represented and reasoned upon symbolically. The paper is organized as follows. The next section provides some preliminary definitions. Feature comparisons are modeled in Sec. 3 as labeled arrows, and formalized in Sec. 4 as morphisms of a category. Two constructions are made on such categories: products (Sec. 5), and paths (Sec.6). In Sec.7, comparisons are ordered by generality using a subsumption relation. Finally, Sec.8 concludes the paper. 2 Preliminaries Category theory is the mathematical study of algebras of functions [2]. A cat- egory consists of a set of objects and a set of arrows. For each arrow f , there are given objects dompf q and codpf q called the domain and the codomain of f . We write f : A ÝÑ B to indicate that dompf q A and codpf q B. For two arrows f and g such that codpf q dompg q, there is a given arrow g f called the composite of f and g. For each object A, there is a given arrow 1A : A ÝÑ A called the identity arrow of A. Arrows satisfy the associativity law : h pg f q ph g q f for all f : A ÝÑ B, g : B ÝÑ C, and h : C ÝÑ D. 65 Identity arrows verify f 1A 1B f f for all f : A ÝÑ B. An arrow f : A ÝÑ B is called an isomorphism if there is an arrow g : B ÝÑ A such that g f 1A and f g 1B . A groupoid is a category in which every ar- row is an isomorphism. The category Rel is the category where objects are sets and arrows are binary relations. The identity arrow on a set A is the identity relation: 1A tpa, aq P A A | a P Au. Given f A B and g B C, the composition g f is defined as: pa, cq P g f iff Db P B | pa, bq P f and pb, cq P g. Categories are mathematical structures which underlying structure is a quiver, i.e., a directed graph where loops and multiple arrows between two vertices are allowed, on which the definition of a category adds constraints on identity mor- phisms, associativity, and composition. A path in the graph of a category is a sequence ÝÑ ÝÑ . . . ÝÑ of arrows of C such that for all i, dompÝÝÝÑq codpÝÑq c1 c2 cn ci 1 ci A path category (or free category) generated by a directed graph is the category where the objects are vertices, and arrows are paths between objects. A func- tor F : C ÝÑ D between two categories C and D is a mapping of objects to objects and arrows to arrows that preserves domain and codomains, identities, and composition: F pf : A ÝÑ B q F pf q : F pAq ÝÑ F pB q, F p1A q 1F pAq , and F pg f q F pg q F pf q. The product C D of two categories C and D is the category of pairs and arrows. Its objects have the form pC, Dq, for C P C and D P D, and its arrows have the form pf, g q : pC, Dq ÝÑ pC 1 , D1 q for f : C ÝÑ D P C and g : C 1 ÝÑ D1 P D. Compositions and units are defined componentwise, i.e., pf 1 , g 1 q pf, g q pf 1 f , g 1 g q, and 1CD p1C , 1D q. 3 Modeling Feature Differences We are interested in modeling the comparison between two values of a same feature. In the following, the term feature denotes either a binary variable (i.e., a variable which takes one of the two values 0 or 1), or a nominal variable (i.e., a variable which takes nominal values, like the color), or a quantity (i.e., a variable which take values on ordinal, interval, or ratio scales [18]). The term feature space denotes the set of values taken by a particular feature. A straightforward way to represent a comparison from a source A to a target B is to trace an arrow from A to B and to label this arrow with a term that represents their relationship. For example, an arrow named g Ñ b can be used to represent the relationship in which the forage differs from g(raze) to b(rowse) from source to target (Fig. 1). The distinction between the source and the target gÑb A B Fig. 1: A comparison of two feature values represented by a labeled arrow. of a comparison makes the process by essence directional. It can be noted that 66 this remains true even if the underlying relation is symmetrical. To illustrate this, consider the symmetrical binary relation brother, which relates two people when they are brothers. For two brothers A and B, both brotherpA, B q and brotherpB, Aq hold (by symmetry), but A ÝÝÝÝÝÑ B and B ÝÝÝÝÝÑ A represent brother brother two different comparisons. When the source and the target of the comparison are values of a same feature space, the comparison relation is transitive: if A can be compared with B and B with C, then A can be compared with C [5]. Besides, the relation is invertible, by which we mean that it is not possible to compare an object A to an object B without also being able to “reverse the viewpoint” and compare B with A with another relationship (possibly the same). For example, if a sheep A can be compared to a goat B with the relationship g Ñ b (g stands for graze, and b for browse), then an inverse relationship b Ñ g can be used to compare B to A. It can be noted that feature value comparisons constitute a special case among similarity relationships. In the general case, similarity relationships are neither transitive nor invertible. For example, if Ted went to the same school as John and John went to the same school as Mary, it does not entail that Ted went to the same school as Mary. Comparisons may also not be invertible in simili (“a tree is like a man”) or metaphors (“love is a battlefield”): we might say “a man is like a tree”, meaning that a man has roots, but not “a tree is like a man” [21]. 4 Formalization Feature spaces can be formalized as categories, which we will call feature cat- egories. The objects are the values of the feature space, and arrows represent comparisons between these values. Category Theory seems to be a natural set- ting to represent such comparisons, since arrows (also called morphisms) are the main “building blocks” of categories as mathematical structures. The cat- egorical notion of composition of arrows corresponds to the transitivity of the comparison relation. Besides, each object of a category must be related to itself by an identity arrow. So representing a feature space as a category requires to distinguish identity arrows from difference arrows. Identity arrows, like d Ñ d or , have the same object as origin and destination, and express commonalities. Difference arrows, like d Ñ m of , have different origin and destination objects, and express differences. As all arrows are invertible in a feature category, the obtained category is a groupoid. For example, the category Bin (Fig. 2) represents the quantity space of Boolean values, by taking as objects the two Boolean values 1 (True) and 0 (False), and as arrows the possible comparisons between these values. Feature categories may also represent quantity spaces. For example, consider the category C , in which objects are elements of N, and there are three arrows Ý Ñ, ÝÑ, and ¡ ÝÑ. The arrow ÝÑ is the¡ identity arrow that links every integer x P N to itself. The arrow Ý Ñ (resp., ÝÑ) links two integers x and y whenever x y (resp., x ¡ y). Every arrow Ý Ñ is invertible since y ¡ x holds whenever x y. The category Area (Fig. 3) represents location areas of apartments. Its objects are 67 1Ñ0 0Ñ0 0 1 1Ñ1 0Ñ1 Fig. 2: The example category Bin, in which objects represent the Boolean values 0 and 1, and arrows represent comparisons between these values. the three nominal values d(owntown), m(idtown), and u(uptown), and its arrows the nine possible comparisons between them. mÑd dÑd d m mÑm dÑm u u Ñ Ñ d m m d Ñ Ñ u u u uÑu Fig. 3: The example category Area, in which objects represent the three ar- eas d(owntown), m(idtown), and u(uptown), and arrows represent comparisons between areas. 4.1 Semantics Feature categories are interpreted on a set (like a set of patients, of cooking recipes, etc.). Let X denote such a set. The semantics of a feature category C on a set X is given by a functor .I : C ÝÑ Rel, called the interpretation functor, which maps each object of the category C to a subset of X , and arrows to subsequent binary relations. The functor .I generalizes the notion of binary variation. The definition of a binary variation as proposed in [3] corresponds to the indicator function of .I , when it is restricted to a given arrow of C. If there exists a field function ϕ : X ÝÑ C, which maps each element of X to an object of C, the interpretation functor .I can be defined to map each object a of C to its inverse image by ϕ in X , i.e., to the set of elements of X which 68 take the value a for the property ϕ: aI tx P X | ϕpxq au for an object a of C p a Ñ bq a b X X I I I for an arrow a Ñ b of C For example, let X be a set of patients, and ϕ : X ÝÑ C be a field function that associates to each element of X an object of the category C , representing the age of the patient. The interpretation functor .I : C ÝÑ Rel maps each age value n P N to the set of patients having that age, and maps each compari- son to the corresponding binary relation. The binary relation pÝ ÑqI is the set of pairs pa, bq of patients such that b is (strictly) older than a. Likewise, let X be a set of apartments, and ϕ : X ÝÑ Area be a field function that associates to each element of X an object of the category Area. The interpretation functor .I : Area ÝÑ Rel maps each nominal value to the set of apartments having the corresponding location area, and maps each comparison to the corresponding bi- mÑd nary relation. The binary relation pÝÝÝÑqI is the set of pairs pa, bq of apartments such that a is located in midtown and b is located in downtown. 5 Representing Differences on Multiple Features The product C1 C2 . . . Cn of n comparison categories C1 , C2 ,. . . ,Cn has as objects the n-tuples pa1 , a2 , . . . , an q where ai is an object of Ci , and as arrows the n-tuples pa1 Ñ b1 , a2 Ñ b2 , . . . , an Ñ bn q, where ai Ñ bi is an arrow of Ci . mÑd For example, pÝÝÝÑ,Ý Ñq is an arrow in the product Area C , and could be used to represent the comparison between an apartment located in midtown and an apartment located in downtown, both having the same price. The interpretation functor .I is extended to products in such a way that an element x P X is in the interpretation of the product if it is common to all £a interpretations of Ci ’s: pa1 , a2 , . . . , an qI I for n objects a of C £ i i i i pa Ñ b , a Ñ b , . . . , a Ñ b q pa Ñ b q for n arrows a Ñ b of C 1 1 2 2 n n I i i I i i i i 6 Similarity 6.1 Analogy as Shared Differences Two pairs are analogous when the same comparison can be made between them. When comparisons represent relations, this idea is consistent with the idea of analogy as a transfer of a relational structure, as outlined by Structure-mapping Theory [10]. For example, in the Andromeda galaxy, the X12 planets resolve around the X12 star, which can be represented as comparisons of the form “A:X12 planet ÝÝÝÝÝÝÝÝÝÑ X12 star”. An analogy can be made between the resolve around 69 Andromeda galaxy and the solar system, by mapping these comparisons with comparisons such as “A:solar system planet ÝÝÝÝÝÝÝÝÝÑ sun”. But the idea resolve around of analogy as shared comparisons can be generalized to the comparisons made to establish feature differences, that do not represent relations. For example, a same comparison g Ñ b can be made from a sheep to a goat and from a cow to a moose: cow graze, whereas moose browse. As a result, a cow is to a sheep what a moose is to a goat. The same idea can be applied to logical proportions, which can be seen as shared comparisons. For two propositional variables x and y, there are four indicators: I1 px, y q x ^ y, I2 px, y q x ^ y, I3 px, y q x ^ y, and I4 px, y q x ^ y, and each logical proportion is defined by two distinct equivalences between these indicators [19]. For example, two pairs px, y q and pz, tq are in analogical proportion if I2 px, y q I2 pz, tq and I3 px, y q I3 pz, tq, i.e., if x ^ y z ^ t and x ^ y z ^ t (here, denotes the logical equivalence). Let Cx , Cy , Cz , and Ct be the feature categories constructed as in Fig. 4. The category Cx contains the xÑx xÑx x x xÑx xÑx Fig. 4: The category Cx , with two objects (x and x) for a propositional variable x, and arrows represent changes between these values. two objects x and x for the propositional variable x. The interpretation functor .I is defined using the valuation function v, which is a function from the set of propositional variables to t0, 1u, seen as the class of all subsets of a one-element set (0 is the empty set and 1 is the one-element set): aI v paq P t0, 1u for an object a of Cx pa Ñ bq a b t0, 1u t0, 1u I I I for an arrow a Ñ b of Cx The arrow px Ñ x, y Ñ y q of the product Cx Cy is interpreted as the binary relation px Ñ x, y Ñ y qI v px ^ y q v px ^ y q. Two pairs px, y q and pz, tq are in analogical proportion if the interpretation of the two arrows px Ñ x, y Ñ y q and pz Ñ z, t Ñ tq are the same, i.e., if px Ñ x, y Ñ y qI pz Ñ z, t Ñ tqI . Likewise, two pairs px, y q and pz, tq would be in paralogy if the interpretation of the arrows px Ñ x, y Ñ y q and pz Ñ z, t Ñ tq are the same. 6.2 Similarity Paths Let C be a feature category. A similarity path of C is a combination of arrows dÑd dÑm of C. For example, ÝÝÝÑ ÝÝÝÑ is a similarity path in the category Area. The free category F pCq generated by C is the category that has the paths of C as 70 arrows. This definition can be extended to the product Π C1 C2 . . . Cn of n comparison categories C1 , C2 ,. . . ,Cn . A path in Π is an arrow of the free dÑd ÑÑ m category F pΠ q generated by Π. For example, (ÝÝÝÑ,Ý Ñq pÝdÝÝ ,Ý Ñq is a path in the free category generated by the product Area C . The interpretation of a similarity path on the set X is given by the in- terpretation functor .I which by definition of functors, preserves composition: pÑ Ýc ÝÑ q pÝÑ d I d I q pÑÝc qI . Here, the composition operation on the arrows of the category Rel is the usual composition of binary relations. This definition can also be extended to the product Π C1 C2 . . . Cn of n feature categories C1 , C2 ,. . . ,Cn : for two sets of arrows ci , di P Ci , ppÝcÑ, . . . , ÝÑq 1 n c pÝdÑ, . . . , ÝÑqq 1 n d I pÝdÑ, . . . , ÝÑq 1 n d I1 pÝcÑ, . . . , ÝÑq n c I For example, for an apartment srce P X located in downtown, and an apartment tgt P X located in midtown, the pair psrce, tgtq is in the interpretation of dÑd ÑÑ Ñq if there is an apartment pb such the similarity path pÝÝÝÑ, Ý Ñq pÝdÝÝ ,Ý m dÑd Ñ that srce pÝÝÝÑ, Ý ÑqI pb pÝÝÝÑ, ÝÑqI tgt, that is, such that the location of pb is d m downtown and its price is strictly greater than the price of srce, and equal to the price of tgt. This definition is consistent with the notion of similarity path, which is defined in [16] as a sequence of relations srce pb0 r1 pb1 r2 pb2 . . . pbq1 rq pbq tgt such that the pbi ’s are problems and ri ’s are binary relations between problems. 7 Ordering Differences 7.1 A Subsumption Relation A subsumption operator enables to order comparisons by generality. Let C1 and C2 be two feature categories. For an arrow ÝÑ of C1 , and an arrow ÝÑ c1 c2 of C2 , we write ÝÑ ÝÑ to represent that whenever an A can be compared to c1 c2 B using the comparison ÝÑ c1 , then A can be compared to B using comparison ÝÑ. For example, in Π Area C , the subsumption relation ÝdÝÝ c2 ÑÑm ÝÑ represents the fact that any apartment located in downtown is more expensive than any apartment located in midtown. The subsumption operator can also relate the arrows of two product categories ΠC C1 C2 . . . Ck and ΠD D1 D2 . . . D` . For example, if ΠC C Area represents comparisons between the number of rooms and the location of apartments, and ΠD C represents comparisons in price, then pÝ Ñ, ÝmÝÝ ÑÑq d ÝÑ represents the fact that for a same number of rooms, an apartment located in downtown is more expensive than an apartment located in midtown. Subsumption relations ÝÑ ÝcÑ are interpreted as set inclusions in X X : c1 2 ÝcÑ ÝcÑ if ÝcÑI ÝcÑI 1 2 1 2 71 This definition extends naturally to product categories: pÝcÑ, . . . , ÝcÑq pÝdÑ, . . . , ÝdÑq if pÝcÑ, . . . , ÝcÑqI pÝdÑ, . . . , ÝdÑqI 1 k 1 ` 1 k 1 ` A subsumption relation corresponds to the notion of co-variation, that is de- fined in [4] as a functional dependency between variations, and may be used to represent adaptation rules. 7.2 Analogical Jump An analogical ”jump” consists in making the hypothesis that a subsumption relation on comparisons holds for a given pair of objects. From a logical point of view, an analogical jump is defined in [7] as the following hypothetical rule of inference: if P pxq P py q and Qpxq, then we can infer Qpy q For example, Bob’s car and John’s car share the property P of being a 1982 Mustang GLX V6 hatchbacks, and Bob’s car has the property Q of having a price of 3500 $. The inference is that the price of John’s car should also be around 3500 $. This schema can be rephrased using comparisons: from x Ý Ñ y, infer x ÝÑ y P Q In this schema, ÝÑ and ÝÑ are two comparisons representing respectively that P Q an element shares the property P with another element, and that it shares the property Q. This inference consists in making the hypothesis that the subsump- tion relation Ý Ñ ÝQÑ on comparisons holds for the pair px, yq. Such inference P can also be made when the comparisons represent differences. For example, if ΠC C Area represents comparisons between the number of rooms and the location of apartments, and ΠD C represents comparisons in price, then the subsumption relation pÝ Ñ, ÝmÝÝ ÑÑq d ÝÑ can be applied to a pair px, yq of apart- ments to infer that an apartment y located in downtown is more expensive than an apartment x with the same number of rooms, but located in midtown. 8 Conclusion Category Theory seems to be a natural setting to represent the feature compar- isons made when establishing case differences. We showed that it can be used to and to design a qualitative language in which both case differences, similarity paths and adaptation rules can be represented and reasoned upon symbolically. We believe that such results open the way to new qualitative formalizations of the case-based inference, that would be able to integrate both retrieval and adaptation in a same analogical process. 72 References 1. Aamodt, A., Plaza, E.: Case-based Reasoning: Foundational Issues, Methodological Variations, and System Approaches. AI Commun. 7, 39–59 (1994) 2. Adowey, S.: Category Theory. Oxford University Press (2010) 3. Badra, F.: Representing and Learning Variations. In: Int. Conf. Tools Artif. Intell. pp. 950–957. IEEE, Vietri sul Mare (2015) 4. Badra, F.: Reasoning with Co-variations. In: AIMSA. Varna, Bulgaria (2016) 5. Brown, R., Porter, T.: Category Theory: an abstract setting for analogy and com- parison. In: What is Categ. Theory? Adv. Stud. Math. Log., pp. 257—-274. Poli- metrica (2006) 6. Craw, S., Wiratunga, N., Rowe, R.C.: Learning adaptation knowledge to improve case-based reasoning. Artif. Intell. 170(16-17), 1175–1192 (nov 2006) 7. Davis, T.R., Russell, S.J.: A Logical Approach to Reasoning by Analogy. In: IJCAI Int. Jt. Conf. Artif. Intell. (1987) 8. Forbus, K.D.: Qualitative modeling. Wiley Interdiscip. Rev. Cogn. Sci. 2(4), 374– 391 (2011) 9. Fuchs, B., Lieber, J., Mille, A., Napoli, A.: Differential adaptation: An operational approach to adaptation for solving numerical problems with CBR. Knowledge- Based Syst. 68, 103–114 (apr 2014) 10. Gentner, D.: Structure-Mapping: A Theoretical Framework for Analogy. Cogn. Sci. 7(2), 155–170 (1983) 11. Hammond, K.J.: CHEF: A Model of Case-based Planning. In: AAAI Proc. pp. 267–271 (1986) 12. Hoquet, T.: La liaison comme comparaison : sciences de rapports et logique de la relation. Astérion (2014), http://asterion.revues.org/2515 13. Jalali, V., Leake, D., Forouzandehmehr, N.: Ensemble of Adaptations for Classifi- cation: Learning Adaptation Rules for Categorical Features, pp. 186–202. Springer International Publishing, Cham (2016) 14. Lieber, J.: Application of the Revision Theory to Adaptation in Case-Based Rea- soning: The Conservative Adaptation. In: ICCBR Proc. (2007) 15. Lieber, J., Napoli, A.: Correct and Complete Retrieval for Case-Based Problem- Solving. In: ECAI. pp. 68–72 (1998) 16. Melis, E., Lieber, J., Napoli, A.: Reformulation in case-based reasoning, pp. 172– 183. Springer Berlin Heidelberg, Berlin, Heidelberg (1998) 17. Ontañón, S., Plaza, E.: On Knowledge Transfer in Case-Based Inference. In: Dı́az- Agudo, B., Watson, I. (eds.) ICCBR Proc. pp. 312–326. Springer-Verlag Berlin Heidelberg (2012) 18. Paritosh, P.K.: Back of the Envelope Reasoning for Robust Quantitative Problem Solving Field of Computer Science. Tech. rep., Electrical Engineering and Com- puter Science Department, Northwestern University (2007) 19. Prade, H., Richard, G.: From analogical proportion to logical proportions: A sur- vey. Stud. Comput. Intell. 548, 217–244 (2014) 20. Scontras, G., Graff, P., Goodman, N.D.: Comparing pluralities. Cognition 123(1), 190–197 (2012) 21. Tversky, A.: Features of Similarity. In: Readings Cogn. Sci. A Perspect. from Psy- chol. Artif. Intell., pp. 290–302. Elsevier Inc. (oct 2013)