similarities between powersets of terms

13
Available online at www.sciencedirect.com Fuzzy Sets and Systems 144 (2004) 213–225 www.elsevier.com/locate/fss Similarities between powersets of terms P. Eklund a , M.A. Gal an b , J. Medina c ; 1 , M. Ojeda-Aciego c ; ;1 , A. Valverde c ;1 a Department of Computer Science, Abo Akademi University, Abo FIN-20520, Finland b Department of Computing Science, Ume a University, Ume a SE-901 87, Sweden c Dept. Matem atica Aplicada, Universidad de M alaga, M alaga E-29071, Spain Abstract Generalisation of the foundational basis for many-valued logic programming builds upon generalised terms in the form of powersets of terms. A categorical approach involving set and term functors as monads allows for a study of monad compositions that provide variable substitutions and compositions thereof. In this paper, substitutions and uniers appear as constructs in Kleisli categories related to particular composed powerset term monads. Specically, we show that a frequently used similarity-based approach to fuzzy unication is compatible with the categorical approach, and can be adequately extended in this setting; also some examples are included in order to illuminate the denitions. c 2003 Elsevier B.V. All rights reserved. Keywords: Similarities; Fuzzy unication; Category theory and unication; Generalised terms 1. Introduction Many-valued and possibilistic extensions of logic programming involve lattice-theoretic considera- tions with respect to sets of truth-values, and proper handling of many-valued sets of terms to allow for an appropriate theory for unication. Much work has been done focusing only on generalisations of truth values. For a survey on many-valued extensions of propositional calculi, see [13]. Restricting to nitely many truth values, using the framework suggested in [21], a many-valued predicate cal- culus using conventional terms was proposed in [17]. Recent years show an emerging development that allows also for the use of generalised terms; for instance, an application of fuzzy unication This work has been developed as a cooperation organised within COST 274. Corresponding author. Dept. Matem atica Aplicada, Universidad de M alaga, Aptdo. de Correos 4114, M alaga E-29080, Spain. E-mail address: [email protected] (M. Ojeda-Aciego). 1 Partially supported by MCyT Project BFM-1054-C02-02. 0165-0114/$ - see front matter c 2003 Elsevier B.V. All rights reserved. doi:10.1016/j.fss.2003.10.021

Upload: p-eklund

Post on 26-Jun-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Available online at www.sciencedirect.com

Fuzzy Sets and Systems 144 (2004) 213–225www.elsevier.com/locate/fss

Similarities between powersets of terms�

P. Eklunda, M.A. Gal)anb, J. Medinac;1, M. Ojeda-Aciegoc;∗;1, A. Valverdec;1

aDepartment of Computer Science, �Abo Akademi University, �Abo FIN-20520, FinlandbDepartment of Computing Science, Ume �a University, Ume �a SE-901 87, Sweden

cDept. Matem+atica Aplicada, Universidad de M+alaga, M+alaga E-29071, Spain

Abstract

Generalisation of the foundational basis for many-valued logic programming builds upon generalised termsin the form of powersets of terms. A categorical approach involving set and term functors as monads allowsfor a study of monad compositions that provide variable substitutions and compositions thereof. In this paper,substitutions and uni2ers appear as constructs in Kleisli categories related to particular composed powersetterm monads. Speci2cally, we show that a frequently used similarity-based approach to fuzzy uni2cation iscompatible with the categorical approach, and can be adequately extended in this setting; also some examplesare included in order to illuminate the de2nitions.c© 2003 Elsevier B.V. All rights reserved.

Keywords: Similarities; Fuzzy uni2cation; Category theory and uni2cation; Generalised terms

1. Introduction

Many-valued and possibilistic extensions of logic programming involve lattice-theoretic considera-tions with respect to sets of truth-values, and proper handling of many-valued sets of terms to allowfor an appropriate theory for uni2cation. Much work has been done focusing only on generalisationsof truth values. For a survey on many-valued extensions of propositional calculi, see [13]. Restrictingto 2nitely many truth values, using the framework suggested in [21], a many-valued predicate cal-culus using conventional terms was proposed in [17]. Recent years show an emerging developmentthat allows also for the use of generalised terms; for instance, an application of fuzzy uni2cation

� This work has been developed as a cooperation organised within COST 274.∗ Corresponding author. Dept. Matem)atica Aplicada, Universidad de M)alaga, Aptdo. de Correos 4114, M)alaga E-29080,

Spain.E-mail address: [email protected] (M. Ojeda-Aciego).

1 Partially supported by MCyT Project BFM-1054-C02-02.

0165-0114/$ - see front matter c© 2003 Elsevier B.V. All rights reserved.doi:10.1016/j.fss.2003.10.021

214 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

to possibilistic logic can be found in [6]. Achievements seen so far, however, have restricted toconstants to be used in various term sets [2,11].

In this paper we propose to use powersets of terms in their full range, i.e. allowing also touse functions in the operator domain. In order to allow for this, we propose the study of mon-ads and monad compositions that can categorically mimic composition of variable substitutionsinvolving variable assignments using powersets of terms rather than just terms. A categorical ap-proach provides a well-founded formalism and also reveal the properties of powersets of termsrequired for such compositions of variable substitutions. Generalised terms based on monad com-positions, and used in a uni2cation framework, require inventiveness concerning the provision ofmonad compositions [10]. Further, new monads can be constructed e.g. by using techniques given bysubmonads [9].

In the classical situation, a substitution of variables can be considered as a mapping � : X →T�Y ,from a set of variables X to a set of terms over an operator domain �, using variables in Y .Given two substitutions �1 : X →T�Y and �2 : Y →T�Z , its composition �2 ? �1 : X →T�Z cannotbe the composition of the mappings. However, the ‘composite’ �2 ? �1 can be de2ned by thecomposition

X �1→ T�Y T��2→ T�T�ZZ→T�Z

if we can justify mapping . The T��2 mapping comes from the functoriality of the term constructor.The ‘Iattening’ Z mapping could be obtained if the functor T� is provided with a ‘multiplication’.Later in the paper we will make these notions precise. Moving from conventional terms to a cate-gorical framework involving powersets of terms calls for a level of formalism required to fully makeuse of the categorical machinery.

It is not an easy task to identify situations in which the underlying behaviour corresponds to aprecise categorical concept. For instance, note that in the classical case, terms over terms are Iattenedto terms. This is possible due to a Iattening operator which embeds terms over terms into terms.There exists a categorical construction involving operators comprising the properties above, namelythe monad. The existence of such Iattening operators is not obvious, and usually not credited to theterm monad.

Continuing the discussion about composition, it is easy to see that the expression above correspondsto that of the Kleisli category of a monad T , and this, in fact, is one of the key reasons that makesthe categorical uni2cation a success. In [24], it is shown how uni2cation may be considered asan instance of a colimit in a suitable category, and how general constructions of colimits providerecursive procedures for computing the uni2cation of terms.

Approaching the generalisation of terms means also to consider a generalised concept of substi-tutions, when variables are not replaced by terms but by many-valued sets of terms. Consider asubstitution of a variable by a (crisp) set of terms, for instance [x={t1; t3; t6}; y={t2; t3}]. In this case,a variable substitution, should be � : X →PT�Y where P denotes the powerset functor. The IatteningZ : PT�PT�Z →PT�Z is now far from obvious. However, as the composed functor PT� can indeedbe extended to a monad, the technique to be used is to consider the corresponding Kleisli categoryof this monad, which enables to compose respective substitutions in a proper way.

Regarding other recent approaches to fuzzy or many-valued uni2cation, there are several referenceswhich include concepts as either fuzzy equality relation, or fuzzy equivalence relation, or similarity

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 215

relation. For a formal treatment of similarities and equalities used in many-valued predicate logics,see [13]. In this paper, we generalise a similarity frequently used between terms, that is, in theimage of the functor T , to a similarity between standard sets of terms and between terms on setsof variables, interpreting the construction in the image of the functors PT and TP, respectively; thisapproach gives us the possibility of de2ning uni2ers between generalised terms.

The paper is organised as follows. In Section 2, we provide required de2nitions and notations ofthe categorical framework. Section 3 introduces the concept of similarity, and some examples aredeveloped for selected functors: the term functor, the powerset term functor and the term powersetfunctor. Later, in Section 4 the de2nitions of variable substitutions and uni2er are given for gener-alised terms. Section 5 includes some illuminating examples. Finally, in Section 6 some conclusionsand pointers to related work are presented.

2. Powerset and term monads

A monad can be seen as the abstraction of the concept of adjoint functors and, in a sense, anabstraction of universal algebra. It is interesting to note that monads are useful not only in universalalgebra, but they are also an important tool in topology when handling regularity, iteratedness andcompacti2cations, and also in the study of toposes and related topics. See [1,3] for category theoreticnotions.

As remarked in [3], the naming and identi2cation of monads, in particular as associated withadjoints, can be seen as initiated around 1958. Godement was, at that time, one of the very 2rstauthors to use monads, then only named as “standard constructions”. Huber in 1961 showed thatadjoint pairs give rise to monads. Kleisli [18] and Eilenberg and Moore [7] proved the converse in1965. The construct of a Kleisli category was thus made explicit in those contributions. Lawvere [19]introduced universal algebra into category theory. This can be seen as the birth of the term monad.These developments then contain all categorical elements for substitution theories. The exploitationof terms and uni2cations within logic programming is formally described in [22] as early as in 1965.It is therefore somewhat surprising that the categorical connection to uni2cation was not found untiltwenty years later by Rydeheard and Burstall in [24].

In the following subsections we will provide de2nitions and notations for monads and Kleislicategories. Further, we will present those set functors that can be extended to monads, and whichare relevant from the many-valued point of view. We will also review some results concerningmonad compositions.

2.1. Monads and Kleisli categories

A monad (or triple, or algebraic theory) over a category C is written as �= (�; �; ), where� : C→ C is a covariant functor, and � : id→� and : � ◦�→� are natural transformations forwhich ◦� = ◦ � and ◦�� = ◦ �� = id� hold.

A Kleisli category C� for a monad � over a category C is de2ned as follows: Objects in C�

are the same as in C, and the morphisms are de2ned as homC�(X; Y ) = homC(X;�Y ), that is mor-phisms f: X +Y in C� are simply morphisms f: X →�Y in C, with ��

X : X →�X being the identitymorphism.

216 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

Composition of morphisms is de2ned as

(X f+ Y ) ◦ (Y g+ Z) = X�Z ◦�g◦f→ �Z:

The Kleisli category is equivalent to the full subcategory of free �-algebras of the monad, and itsde2nition makes it clear that arrows are substitutions.

The term functor T�, or T for short, with TX being the set of terms over the operator domain� and the variable set X , is extended to a monad in the usual way. The categorical uni2cationalgorithm in [24] is based on the Kleisli category of the term monad.

In this paper we will follow the categorical notation adopted in [10], where a term !(m1; : : : ; mn)is more formally written as (n; !; (mi)i6n).

2.2. Set functors extended to monads

In the previous section we have used the, perhaps more intuitive, notation PX to denote thepowerset of X . From now on, in a generalised context we feel more comfortable with the notation2X to represent the classical boolean powerset, according to the general notation LX where L-fuzzysubsets are considered.

Consider ordinary powersets and let 2X denote the set of subsets of X , so that 2 denotes theordinary powerset functor. With �X : X → 2X given by �X (x) = {x} and X : 22X → 2X given byX (B) =

⋃B, we have the well-known ordinary powerset monad 2= (2; �; ).

The extension to many-valued sets is according to [12]. Let L be a completely distributive lattice.The covariant powerset functor Lid is obtained by LidX = LX , i.e. the set of mappings (or L-fuzzy

sets) � : X →L. For a morphism Xf→ Y in Set, we use

Lidf(�)(y) =∨

f(x)=y

�(x):

Further, �X : X →LidX is de2ned by

�X (x)(x′) ={

1 if x = x′;0 otherwise

and X : LidLidX →LidX by

X (�)(x) =∨

�∈LidX

�(x) ∧ �(�):

In [20] it was proved that Lid = (Lid; �; ) is a monad. Note that for L = {0; 1} we have Lid = 2.

2.3. Monad compositions

Monad compositions require the use of a swapper transformation � (see below) together withconditions related to this swapper. In [4], a set of such conditions was given and the conditions werecalled distributive laws. Conditions on monad composability are discussed, also e.g. in [5,8,10,15].

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 217

In [10] we made use of a swapper �X : TLX →LTX de2ned in the base case by �X |T 0LX = idLX ,and further inductively given by

�X (l)((n′; !′; (mi)i6n)) =

∧i6n

�X (li)(mi) if n = n′ and ! = !′;

0 otherwise;

where l = (n; !; (li)i6n)∈T�LX , �¿0, li ∈T�iLX , �i¡�, and it was proved that the composition ofthe monads Lid and T� is as well a monad.

In case of L = 2, the swapper �X : T2X → 2TX coincides with the expected result given by intuition,and can be written in set-theoretical terms as follows: for the base case �X |2X = id2X and, otherwiseby recursion as

�X (l) = {(n; !; (mi)i6n) |mi ∈ �X (li)}:The natural transformation �2T : id→ 2T specializes to �2T

X (x) = {x}, and the natural transformation2T : 2T2T → 2T is for R = {(nj; !j; (rij)i6nj) | j∈ J}∈ 2T2TX given by

{(nj; !j; (mij)i6nj) | j ∈ J; mij ∈ �TX (rij)}:Later the ad hoc swapper construction was abstracted and, in [8] a generalisation of Beck’s conditionswas given as follows:

Let �= (�; ��; �) and �= ('; �'; ') be monads and let � : ' ◦�→� ◦' be a naturaltransformation such that the following conditions hold:

� ◦ �'� = ��';

� ◦ '�� = ��';

�' ◦ �' ◦ '�' ◦ '�� = �' ◦ �� ◦ �'� ◦ �'�:

Then � •�= (� ◦'; ��' ◦ �'; �' ◦ �'' ◦��') is a monad.The result above gave a set of suPcient conditions for the compositionality of two given monads,provided we have a swapper. Although the result above provides a very abstract framework forgeneralised terms, for the purposes of this paper, when discussing possible de2nitions for uni2ersusing similarities, we will use the 2T monad only.

3. Similarities

There are several references in the literature that include concepts as either fuzzy equality relation,or fuzzy equivalence relation, or similarity relation. We will adopt the latter terminology which willbe formally de2ned later. It should be remarked that it is useful to consider similarities from atopos-theoretic point of view. The topos oriented situation where Heyting algebras have idempotentconjunctions is not acceptable in many-valued considerations and thus we need amendments suchas those involving monoidal non-idempotent conjunctions, leading to the weak topos framework,see [14,26] for more details. The position of this paper is, however, not to include topos-theoreticconsiderations at this stage, as our primary purpose is to demonstrate how the concept of uni2erscan be extended to consider also powersets of terms.

218 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

In this section, we recall the concept of similarity and, for selected functors such as the termfunctor, the powerset term functor and the term powerset functor, some examples are developed. Wewill assume that L denotes a completely distributive lattice.

A similarity on X is a mapping E : X ×X →L satisfying

E(x; x) = 1 (reIexivity);

E(x; y) = E(y; x) (symmetry);

E(x; y) ∧ E(y; z) 6 E(x; z) (transitivity)

for all x; y; z ∈X:Given two terms (n; !; (mi)i6n) and (n′; !′; (m′

i)i6n′), we need now to obtain a similarity betweenthem. Intuitively, we must join the similarity between ! and !′ with the combined similaritiesbetween respective components mi and m′

i. In order to be more precise, let � be a set of operations,and let further E� be a similarity on �, which will be used to de2ne a similarity on TX .

Proposition 3.1. Let ET : TX ×TX →L be a relation on TX such that

ET (x; x) = 1 (1)

for all x∈X , and for terms t = (n; !; (mi)i6n), and t′ = (n′; !′; (m′i)i6n′),

ET (t; t′) =

E�(!;!′) ∧∧i6n

ET (mi; m′i) if n = n′;

0 otherwise:(2)

Then ET is a similarity on TX .

Proof. The proof considers the iterative construction in order to build upon the fact that a join ofequality relations is again an equality relation.

The reIexivity of ET follows easily by structural induction and the reIexivity of E�.Using symmetry of E� we obtain

ET ((n; !; (mi)i6n); (n; !′; (m′i)i6n)) = E�(!;!′) ∧

∧i6n

ET (mi; m′i)

= E�(!′; !) ∧∧i6n

ET (m′i ; mi)

= ET ((n; !′; (m′i)i6n); (n; !; (mi)i6n)):

Transitivity of E� gives

ET ((n; !; (mi)i6n); (n; !′; (m′i)i6n)) ∧ ET ((n; !′; (m′

i)i6n); (n; !′′; (m′′i )i6n))

= E�(!;!′) ∧∧i6n

ET (mi; m′i) ∧ E�(!′; !′′) ∧

∧i6n

ET (m′i ; m

′′i )

= E�(!;!′) ∧ E�(!′; !′′) ∧∧i6n

(ET (mi; m′i) ∧ ET (m′

i ; m′′i ))

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 219

6 E�(!;!′′) ∧∧i6n

ET (mi; m′′i )

= ET ((n; !; (mi)i6n); (n; !′′; (m′′i )i6n)):

Note that the de2nition of similarity on TX adopted in this paper diQers from the one adopted in[25] in that the latter requires additionally that ET (x1; x2) = 0 if x1 �= x2.

For uni2cation purposes we will need a similarity between powersets of terms, and for this purposewe will now use ET in order to de2ne a similarity on 2TX . The choice of this similarity on 2TX isless obvious than the one on TX . For the similarity on 2TX we adopt the viewpoint of combiningall similarities of pairwise terms from respective sets of terms.

Proposition 3.2. Let ET be a relation satisfying conditions (1) and (2). The relation

E2T : 2TX × 2TX →L

de:ned for all M1; M2 ∈ 2TX as

E2T (M1; M2) =∧

m1∈M1

∨m2∈M2

ET (m1; m2) ∧∧

m2∈M2

∨m1∈M1

ET (m1; m2) (3)

is a similarity on 2TX .

Proof. The proof is included for the sake of completeness. A similar proof has been presented in[23] in the case of implication measures.

ReIexivity and symmetry are obvious. For transitivity, we will prove two partial inequalities, inwhich the notation MN means the set of all the functions from N to M .

Firstly,∨m∈M

ET (m1; m) ∧∧

m∈M

∨m2∈M2

ET (m;m2) =∨

m∈M

ET (m1; m) ∧∨

f∈MM2

∧m′∈M

ET (m′; f(m′))

=∧

m∈M

ET (m1; m) ∧∨

f∈MM2

∧m′∈M

ET (m′; f(m′))

=∨

m∈Mf∈MM

2

∧m′∈M

(ET (m1; m) ∧ ET (m′; f(m′)))

6∨

m∈M

f∈MM2

(ET (m1; m) ∧ ET (m;f(m)))

6∨

m∈Mf∈MM

2

(ET (m1; f(m)))

=∨

m2∈M2

ET (m1; m2)

220 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

and similarly,∨m∈M

ET (m;m2) ∧∧

m∈M

∨m1∈M1

ET (m1; m) 6∨

m1∈M1

ET (m1; m2):

Thus, transitivity follows from

E2T (M1; M) ∧ E2T (M;M2) =∧

m1∈M1

∨m∈M

ET (m1; m) ∧∧

m∈M

∨m1∈M1

ET (m1; m)

∧∧

m∈M

∨m2∈M2

ET (m;m2) ∧∧

m2∈M2

∨m∈M

ET (m;m2)

=∧

m1∈M1

(∨m∈M

ET (m1; m) ∧∧

m∈M

∨m2∈M2

ET (m;m2)

)

∧∧

m2∈M2

(∨m∈M

ET (m;m2) ∧∧

m∈M

∨m1∈M1

ET (m1; m)

)

6∧

m1∈M1

∨m2∈M2

ET (m1; m2) ∧∧

m2∈M2

∨m1∈M1

ET (m1; m2)

= E2T (M1; M2):

Regarding similarities in 2T , recall the approach used in [11] which introduced the pseudosimilarity(it is not reIexive) below

E′(M1; M2) =∧

m1 ;m2∈M1∪M2

E′T (m1; m2):

However, the proposition above shows that there are reasonable similarities in 2T .A similarity on T2X can now easily be given using the similarity on 2TX .

Proposition 3.3. The relation

ET2 : T2X × T2X → L

de:ned as

ET2(l1; l2) = E2T (�X (l1); �X (l2)); (4)

where �X : T2X → 2TX is the swapper, is a similarity on T2X .

Proof. ReIexivity and symmetry are obvious. Transitivity follows from

ET2(l1; l) ∧ ET2(l; l2) = E2T (�X (l1); �X (l)) ∧ E2T (�X (l); �X (l2))

6E2T (�X (l1); �X (l2))

= ET2(l1; l2):

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 221

Note that, although we have the similarity of T2, it is still an open question whether the functorcomposition T2 can be extended to a monad. This is why in the following section we restrict ourattention to standard powersets of terms.

4. Uni�ers

In this section we introduce the concepts of variable substitutions and uni2ers, in particular withinthe context of powersets of terms. In the classical situation, variable substitutions are mappingsassigning variables to terms, i.e. mappings / : X →TY .

For powersets of terms in a generalised setting, given a monad � such that the composition �•T�

still provides a monad, variable substitutions should then be viewed as mappings

/ : X → �TY:

Given a term M ∈�TX in form of a generalised powerset of terms, the result M/ of applying avariable substitution / on M is given by

M/ = (�TY ◦ �T/)(M)

i.e. M/ is kind of a Iattening of a set of terms over sets of terms, where �TY provides the Iattening

operation. Note that in the particular case of � being the identity monad, M/ is nothing but theexpected classical result when applying the variable substitution / to the term M ∈TX .

We will focus on the particular case of �= 2. To illuminate our constructions, let � = {c1; c2; u1;u2}, where ci are nullary operators (constants), and ui unary operators, i = 1; 2. Further, let xbe a variable. Table 1 shows similarity values for some typical pairs of generalised terms. ForM2 = {u2(x)}, note the eQect of the variable substitutions /(x) = c1 and u1(c1).

Variable substitutions can obviously be de2ned more generally over monads (F; �F ; F). Indeedfor an object A∈FX , and a variable substitution / : X →FY , we will have

A/ = (FY ◦ F/)(A):

When composing substitutions, the utility of the Iattening operator again becomes explicit.

De�nition 4.1. The composition of two substitutions /′: X →�TY and /′′: Y →�TZ is given by

/′/′′ = �TZ ◦ �T/′′ ◦ /′

i.e. the composition in the Kleisli category Set�T for the powerset monad � • T over the categoryof sets.

For � being the identity monad, variable substitutions correspond to the classical case, where useof the idempotency of “terms over terms” is usually not made very explicit.

To continue with the case of �= 2, given M1; M2 ∈ 2TX , let [M1; M2] represent an equationover 2TX . In order to propose a de2nition of generalised uni2ers for equations we will assume theexistence of similarities, as those in the previous section.

222 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

Table 1Equality of generalised terms

M1 M2 E2T (M1; M2)

{t1} {t1; t2; t3} ET (t1; t2) ∧ ET (t1; t3){u1(c1)} {u1(u1(c1))} 0{u1(c1)} {u2(x)} E�(u1; u2) ∧ ET (c1; x){u1(c1); u1(c2)} {u2(c1); u2(c2)} E�(u1; u2){u1(c1); u2(c2)} {u1(c2); u2(c1)} E�(u1; u2) ∨ E�(c1; c2)

De�nition 4.2. A uni2er of the equation [M1; M2] over 2TX is a substitution, / : X → 2TY , such thatE2T (M1/;M2/) equals

sup{E2T (M1#;M2#) |# is a substitution}:

It might be possible that the supremum above could not be attained by any substitution. Theparticular features of the lattice or the underlying application might require a weaker version of thede2nition, as follows:

Let / be a substitution, and [M1; M2] an equation over 2TX . We say that / is a uni2er ifE2T (M1; M2)6E2T (M1/;M2/), that is, if the substitution increases the similarity degree. Note that auni2er / is a so called extensional mapping according to [16].

5. Examples

Examples in this section are included in order to provide illuminations of our notions. Moreelaborate examples can be found in application papers, such as those dealing with fuzzy control.

5.1. Similarity between numerical functions

A possible situation in which the use of similarities is required is given below as a similaritybetween numerical real-valued functions. The similarity is de2ned in terms of a ‘uniform distance.’Suppose that when solving a functional equation, we apply diQerent iterative methods and, therefore,diQerent approximations are obtained. The diQerent approximations obtained to the actual solutionf are classi2ed in classes of functions [f]5i according to an increasing numerable sequence ofbounds 51; 52; : : : ; 5n¡1 and the following measure: A function g is in the class [f]5i if and only if|f(x) − g(x)|¡5i and g =∈ [f]5j for all j¡i.

Let us designate a canonical representative g5i for each class [g]5i , and consider the set� = {f; g5i}16i6n. The relation E� : �×�→ [0; 1] given by

E�(f;f) = 1 = E�(g5i ; g5i);

E�(g5i ; g5j) = 1 − max{5i; 5j} if i �= j

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 223

and

E�(f; g5i) = 1 − 5i = E�(g5i ; f)

indeed de2nes a similarity relation. The similarities E2T and ET are de2ned in terms of E� as statedpreviously.

Now, the similarity between two composite functions, for instance g5i(f(x)) and f(g5i(x)), canbe considered as terms over the variable x and, therefore, calculated using ET by the expression

ET (g5i(f(x)); f(g5i(x))) = 1 − 5i:

Furthermore, we compare the similarity of two sets of functions as sets of terms:

M1 = {f(f(x)); f(g5(x))};M2 = {g5(f(x)); f(g5(x))}:

The similarity between M1 and M2 is then given by

E2T (M1; M2) = 1 − 5:

Let us now consider the sets N1 and N2:

N1 = {f(a); g5(x1)};N2 = {f(x1); g5(a)}:

Then, E2T (N1; N2) = 1 − 5.Let /1; /2 : X → 2TY be the substitutions given by /1(x1) = {a; y}, and /2(x1) = {a}. Then E2T (N1/1;

N2/1) = 1 − 5 and E2T (N1/2; N2/2) = 1. Note that in this case /2 is a most general uni2er. In factthe composition of /1 and /2 is again /1.

5.2. Quali:cation for course participance

In order to qualify for participance in a course, C, the students should (preferentially) have takenthe courses c1; c2; c3. Alternatively, students may obtain part of the contents of these courses bystudying the courses n1; n2.

The lectures for the courses c1 and n1 are held at the same time. The same happens for thecourses c2 and n2. This means that the students should choose between studying either c1 or n1 andstudying either c2 or n2.

The relation between the contents in the diQerent courses are given by the similarity relation inTable 2. In order to admit students to participate in C, it is needed to check which students havean education more ‘similar’ to the one required.

In the following, a student will be represented by the set of courses (s)he has studied. LetR = {c1; c2; c3} be the set of requirements. The student S1 = {c1; n2} has studied the courses c1; n2.The level of agreement with the C course for this student is then E2T (S1; R) = 0:2.

For S2 = {c3; n1; n2}, the level of agreement is E2T (S2; R) = 0:6, and for S3 = {c2; c3; n1}, the levelis also E2T (S3; R) = 0:6.

224 P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225

Table 2Similarities between courses

E c1 c2 c3 n1 n2

c1 1 0.2 0.2 0.6 0.2c2 0.2 1 0.2 0.2 0.7c3 0.2 0.2 1 0.2 0.2n1 0.6 0.2 0.2 1 0.2n2 0.2 0.7 0.2 0.2 1

If we know that a student has taken at least the courses c1; n2, i.e. Sx = {c1; n2; x}, then a mostgeneral uni2er in this case is /(x) = {c3} with corresponding level of agreement E2T (Sx/; R) = 0:7.Note that /′(x) = {c2; c3} is also a uni2er. Then E2T (Sx/′; R) = 0:7 and not 1 as we might haveexpected. The reason for this is that we are comparing similarity of sets, even if in a real case thisuni2er is not worth to be considered since the student cannot study c2 and n2 simultaneously.

6. Conclusions and future work

We have shown how generalised terms, as given by powersets of terms, can be handled in equa-tional settings involving substitutions and uni2ers. The utility of categorical techniques as provided bymonads is obvious and indeed encouraging for further investigations on more elaborate compositionsand categorical techniques for uni2cation as initiated in [24].

In further work it is important to merge our eQorts with developments, such as in [2], that havefocused more on semantic aspects of many-valued logic programming. Semantic approaches seemto be fruitful in particular within possibilistic logic frameworks. These developments, however, stillhave a rather specialised use of terms as they typically restrict to using powersets of constantsinstead of generalised terms in their full range. However, restricting to powersets of constants seemsmore to be a struggle with uni2cation than with proof procedural issues, and there are no indicationsthat the specialised use of terms is enforced by the semantic developments, such as those seen inpossibilistic logic. The procedural issues being important it is equally worthwhile to underline theimportance of further studies on monad compositions.

Acknowledgements

We are grateful to the anonymous referees who helped us signi2cantly to improve the paper andalso drew our attention to further categorical issues to be considered in future work related to theseproblems.

References

[1] J. Ad)amek, H. Herrlich, G. Strecker, Abstract and Concrete Categories, Wiley, New York, 1990.

P. Eklund et al. / Fuzzy Sets and Systems 144 (2004) 213–225 225

[2] T. Alsinet, L. Godo, A complete calculus for possibilistic logic programming with propositional variables, Proc.Uncertainty in AI’00 Conf., Stanford, CA, 2000, pp. 1–10.

[3] M. Barr, C. Wells, Toposes, Triples and Theories, Springer, Berlin, 1985.[4] J. Beck, Distributive laws, Seminars on Triples and Categorical Homology Theory, 1966/67, Lecture Notes in

Mathematics, vol. 80, Springer, Berlin, 1969, pp. 119–140.[5] J.R. Caruncho Castro, Triples theory, Department of Algebra of the Univ. de Santiago de Compostela, Reports Series,

Alxebra 5, 1971 (in Spanish).[6] D. Dubois, H. Prade, S. Sandri, Possibilistic logic augmented with fuzzy uni2cation, in: Proc. of IPMU’96, Granada,

Spain, 1996, pp. 1009–1014.[7] S. Eilenberg, J.C. Moore, Adjoint functors and triples, Illinois J. Math. 9 (1965) 381–398.[8] P. Eklund, M.A. Gal)an, J. Medina, M. Ojeda-Aciego, A. Valverde, Generalised terms and composition of monads,

Proc. X Spanish Conf. on Fuzzy Logic and Technologies (ESTYLF 2000), Sevilla, Spain, pp. 155–160.[9] P. Eklund, M.A. Gal)an, J. Medina, M. Ojeda-Aciego, A. Valverde, Composing submonads, Proc. 31st IEEE Int.

Symp. on Multiple-Valued Logic (ISMVL 2001), Warsaw, Poland, May 22–24, 2001, pp. 367–372.[10] P. Eklund, M.A. Gal)an, M. Ojeda-Aciego, A. Valverde, Set functors and generalised terms, Proc. IPMU 2000, 8th

Information Processing and Management of Uncertainty in Knowledge-Based Systems Conf., vol. III, Madrid, Spain,2000, pp. 1595–1599.

[11] F. Formato, G. Gerla, M.I. Sessa, Similarity-based uni2cation, Fund. Inform. 41 (4) (2000) 393–414.[12] J.A. Goguen, L-fuzzy sets, J. Math. Anal. Appl. 18 (1967) 145–174.[13] P. H)ajek, Metamathematics of Fuzzy Logic, Kluwer Academic Publishers, Dordrecht, 1998.[14] U. HTohle, Presheaves over GL-monoids, in: U. HTohle, E.P. Klement (Eds.), Non-classical Logics and their

Applications to Fuzzy Subsets, Kluwer Academic Publishers, Dordrecht, 1995, pp. 127–157.[15] M.P. Jones, L. Duponcheel, Composing monads, Research Report YALEU/DCS/RR-1004, Yale University, New

Haven, Connecticut, USA, December 1993.[16] F. Klawonn, J. Gebhardt, R. Kruse, Fuzzy control on the basis of equality relations—with an example from idle

speed control, IEEE Trans. Fuzzy Systems 3 (1995) 336–350.[17] F. Klawonn, R. Kruse, A Lukasiewicz logic based Prolog, Mathware Soft Comput. 1 (1994) 5–29.[18] H. Kleisli, Every standard construction is induced by a pair of adjoint functors, Proc. Amer. Math. Soc. 16 (1965)

544–546.[19] F.W. Lawvere, Functorial semantics of algebraic theories, Dissertation, Columbia University, 1963.[20] E.G. Manes, Algebraic Theories, Springer, Berlin, 1976.[21] J. Pavelka, On fuzzy logic I, II, III, Zeitschr. Math. Logik Grundl. Math. 25 (1979) 45–52, 119–134, 447–464.[22] J.A. Robinson, A machine-oriented logic based on the resolution principle, J. Assoc. Comput. Mach. 12 (1965)

23–41.[23] E.H. Ruspini, On the semantics of fuzzy logic, Internat. J. Approx. Reasoning 5 (1991) 45–88.[24] D.E. Rydeheard, R.M. Burstall, A categorical uni2cation algorithm, Proc. Summer Workshop on Category Theory

and Computer Programming, 1985, Lecture Notes in Computer Science, vol. 240, Springer, Berlin, 1986, 493–505.[25] M.I. Sessa, Translations and similarity-based logic programming, Soft Comput. 5 (2001) 160–170.[26] L.N. Stout, A survey of fuzzy set and topos theory, Fuzzy Sets and Systems 42 (1991) 3–14.