scieee Open visual document viewer

XFL3: A new fuzzy system specification language

Moreno Velo, Francisco José; Sánchez Solano, Santiago; Barriga Barros, Ángel; Baturone Castillo, María Iluminada; López, Diego R.

Abstract

This paper presents the main features of XFL3, a new language for fuzzy system specification, which has been defined as the starting point for the 3.0 version of our fuzzy system design environment, Xfuzzy [1]. Its main advantages with respect to its precursor, XFL [2], are its capability to admit user-defined membership functions, parametric operators, and linguistic hedges. Taking this language as the basis, different fuzzy system development tools are being implementing, which are also summarized briefly.

Full text

XFL3: A NEW FUZZY SYSTEM SPECIFICATION LANGUAGE F. J. Mo eno-Velo, S. Sánchez-Solano, A. Ba iga, I. Ba u one, D. R. López Ins i u o de Mic oelec ónica de Se illa - Cen o Nacional de Mic oelec ónica A da. Reina Me cedes s/n, (Edi . CICA), E-41012, Se illa, Spain 5 h WSES /IEEE Mul icon e ence on Ci cui s, Sys ems, Communica ions and Compu e s (CSCC 2001), pp. 361-366, Re hymnon, Julio 2001 © 2001 IEEE. Pe sonal use o his ma e ial is pe mi ed. Howe e , pe mission o ep in / epublish his ma e ial o ad e - ising o p omo ional pu poses o o c ea ing new collec i e wo ks o esale o edis ibu ion o se e s o lis s, o o euse any copy igh ed componen o his wo k in o he wo ks mus be ob ained om he IEEE. This ma e ial is p esen ed o ensu e imely dissemina ion o schola ly and echnical wo k. Copy igh and all igh s he ein a e e ained by au ho s o by o he copy igh holde s. All pe sons copying his in o ma ion a e expec ed o adhe e o he e ms and cons ain s in oked by each au ho ’s copy igh . In mos cases, hese wo ks may no be epos ed wi hou he explici pe - mission o he copy igh holde . 1 In oduc ion The de ini ion o o mal languages o uzzy sys em speci ica ion is usual o i s se e al ad an ages [3][4].Howe e , woobjec i esmaycon lic .Onone side, a high exp essi e language, able o apply all he uzzy logic-based o malisms, is desi ed. On he o h- e side, he inal sys em implemen a ion cons ain s ha e o be conside ed. In his sense, some languages ocus on exp essi eness [5][6], while o he s a e o- cused on so wa e o ha dwa e implemen a ions [7]. When ou g oup begun o design a uzzy sys em en- i onmen , ou aim was o mee bo h objec i es. This led us o he de ini ion o he o mal language XFL [2], which is he base o se e al ha dwa e- and so - wa e-o ien ed de elopmen ools ha cons i u e he X uzzy 2.0 design en i onmen [1]. As a s a ing poin o he 3.0 e sion o X uzzy, a new language, XFL3, which ex ends he ad an ages o XFL, has been de ined. XFL3 allows he use o de ine new membe ship unc ions and pa ame ic op- e a o s, and admi s he use o linguis ic hedges which pe mi o desc ibe mo e complex ela ionships among a iables [8]. In o de o inco po a e hese im- p o emen s, some modi ica ions ha e been made in he XFL syn ax. In addi ion, he new language XFL3, oge he wi h he ools based on i , employ Ja a as p og amming language. This means he use o an ad- an ageous objec -o ien ed me hodology and he lexibili y o execu ing he new e sion o X uzzy in any pla o m wi h JRE (Ja a Run ime En i onmen ) ins alled. 2 The XFL3 language XFL3 is a uzzy sys em speci ica ion language which p o ides he use wi h a g ea lexibili y o de ine he unc ions associa ed wi h he uzzy ope a o s and lin- guis ic a iables and which allows o exp ess com- plex ule bases. An XFL3 speci ica ion consis s o se e al objec s de ining ope a o se s, a iable ypes, and ule bases. The de ini ion o ma o hese elemen s is desc ibed in he ollowing. 2.1 Ope a o se s An ope a o se in XFL3 is an objec con aining he ma hema ical unc ions ha a e assigned o each uzzy ope a o . Fuzzy ope a o s can be bina y (like he T-no ms and S-no ms employed o ep esen lin- guis ic a iable connec ions, implica ion, o ule ag- g ega ions), una y (like he C-no ms o he ope a o s ela ed wi h linguis ic hedges), o can be associa ed wi h de uzzi ica ion me hods [9]. XFL3 de ines he ope a o se s wi h he ollowing o ma (Figu e 1): ope a o se iden i ie { ope a o assigned_ unc ion(pa ame e _lis ); ope a o assigned_ unc ion(pa ame e _lis ); ........... } I is no equi ed o speci y all he ope a o s. When one o hem is no de ined, i s de aul unc ion is as- XFL3: A New Fuzzy Sys em Speci ica ion Language F. J. MORENO-VELO, S. SÁNCHEZ-SOLANO, A. BARRIGA, I. BATURONE, D. R. LÓPEZ Ins i u o de Mic oelec ónica de Se illa (IMSE-CNM) A da. Reina Me cedes, s/n Edi . CICA. E-41012 Se illa. SPAIN [email p o ec ed]. h p://www.imse.cnm.es Abs ac : - This pape p esen s he main ea u es o XFL3, a new language o uzzy sys em speci ica ion, which has been de ined as he s a ing poin o he 3.0 e sion o ou uzzy sys em design en i onmen , X uzzy [1]. I s main ad an ages wi h espec o i s p ecu so , XFL [2], a e i s capabili y o admi use -de ined membe ship unc ions, pa ame ic ope a o s, and linguis ic hedges. Taking his language as he basis, di e en uzzy sys em de elopmen ools a e being implemen ing, which a e also summa ized b ie ly. Key-Wo ds: - Fo mal languages, CAD ools, Fuzzy sys ems. ___________________ This wo k has been pa ially suppo ed by he Spanish CICYT P ojec TIC98-0869 and he FEDER P ojec (Nº 1FD97-0956-C3-02). sumed. Table 1 shows he ope a o s (and hei de aul unc ions) cu en ly used in XFL3. The assigned unc ions a e de ined in ex e nal iles which we name as packages. The o ma o iden- i y a unc ion is “package. unc ion”. The package name (x l in Figu e 1) could be emo ed i he pack- age has been impo ed p e iously (using he com- mand “impo package;”). 2.2 Types o linguis ic a iables An XFL3 ype is an objec which desc ibes a ype o linguis ic a iable. This means o de ine i s uni e se o discou se, o name he linguis ic labels co e ing ha uni e se,and ospeci y hemembe ship unc ion associa ed o each label. The de ini ion o ma o a ype is as ollows (Figu e 2): ype iden i ie [min, max; ca d]{ label membe ship_ unc ion(pa ame e _lis ); label membe ship_ unc ion(pa ame e _lis ); ............. } whe e min and max a e he limi s o he uni e se o discou se and ca d (ca dinali y) is he numbe o i s disc e e elemen s. I ca dinali y is no speci ied, i s de aul alue (cu en ly, 256) is assumed. When lim- i s a e no explici ly de ined, he uni e se o dis- cou se is aken om 0 o 1. The o ma o he linguis ic label iden i ie is sim- ila o he ope a o iden i ie , ha is, “package. unc- ion” o simply “ unc ion” i he package whe e he use has de ined he membe ship unc ions has been al eady impo ed. XFL3 suppo s inhe i ance mechanisms in he ype de ini ions (like i s p ecu so , XFL). To exp ess inhe i ance, he heading o hede ini ion is as ollows (Figu e 2): ype iden i ie ex ends iden i ie { The ypes so de ined inhe i au oma ically he uni- e se o discou se and he labels o hei pa en s. The labels de ined in he body o he ype a e ei he added o he pa en labels o o e w i e hem i hey ha e he same name. 2.3 Rule bases A ule base in XFL3 is an objec con aining he ules which de ine he logic ela ionships among he lin- guis ic a iables. I s de ini ion o ma is as ollows (Figu e 3): ulebase iden i ie (inpu _lis : ou pu _lis ) using ope a o se { [ ac o ]i (an eceden )-> consequen _lis ; [ ac o ]i (an eceden )-> consequen _lis ; ............. } The de ini ion o ma o he inpu and ou pu a i- ables is “ ype iden i ie ”, whe e ype e e s o one o he linguis ic a iable ypes p e iously de ined. The ope a o se selec ion (sys emop in Figu e 3) is op- ional, so ha when i is no explici ly de ined, he de- Table 1: Ope a o s cu en ly de ined in XFL3. Ope a o Type De aul unc ion and bina y min(a,b) o bina y max(a,b) implica ion imp bina y min(a,b) also bina y max(a,b) no una y (1-a) s ongly una y (a)2 mo eo less una y (a)1/2 sligh ly una y 4*a*(1-a) de uzzi ica ion de uz de uzzi ica ion cen e o a ea ope a o se sys emop { and x l.min(); o x l.max(); imp x l.min(); s ongly x l.pow(3); mo eo less x l.pow(0.4); } Fig. 1: Example o ope a o se de ini ion. ype inpu 1 [0,100] { sho x l. iangle(0,25,50); medium x l. iangle(25,50,75); all x l. iangle(50,75,100); } ype inpu 2 ex ends inpu 1 { e y_sho x l. iangle(-10,0,25); e y_ all x l. iangle(75,100,110); } Fig. 2: Example o a iable ype de ini ion. aul ope a o s a e employed. I is also shown in Figu e 3 how con idence weigh s (wi h de aul al- ues o 1) can be applied o he ules. A ule an eceden desc ibes he ela ionships among he inpu a iables. XFL3 allows o exp ess complex an eceden s by combining basic p oposi- ions wi h connec i es o linguis ic hedges (Table 2 and Figu e 4). On he o he side, each ule conse- quen desc ibes he assigna ion o a linguis ic a i- able o an ou pu a iable as “ a iable = label” (Figu e 3). 2.4 Sys em global beha io The desc ip ion o he sys em global beha io means o de ine he global inpu and ou pu a iables o he sys em as well as he ule base hie a chy. This de- sc ip ion in XFL3 is as ollows (Figu e 5): sys em (inpu _lis : ou pu _lis ) { ule_base_iden i ie (inpu s : ou pu s); ule_base_iden i ie (inpu s : ou pu s); ............. } The de ini ion o ma o he global inpu and ou - pu a iables is he same o ma employed in he de - ini ion o he ule bases. The inne a iables which may appea es ablish se ial o pa allel in e connec- ions among he ule bases. Inne a iables mus i s - ly appea as ou pu a iables o a ule base be o e being employed as inpu a iables o o he ule bases (Figu e 5). 3 Func ion packages Fou ypes o unc ions can be de ined in XFL3: bi- na y unc ions, una y unc ions, membe ship unc- Table 2: Example o uzzy p oposi ions Basic p oposi ions Desc ip ion a iable == label equal o a iable >= label equal o g ea e han (Fig. 3a) a iable <= label equal o smalle han (Fig. 3b) a iable > label g ea e han (Fig. 3c) a iable < label smalle han (Fig. 3d) a iable != label no equal o (Fig. 3e) a iable %= label sligh ly equal o (Fig. 3 ) a iable ~= label mo eo less equal o (Fig. 3g) a iable += label s ongly equal o (Fig. 3h) Complex p oposi ions Desc ip ion p oposi ion & p oposi ion and ope a o p oposi ion | p oposi ion o ope a o ! p oposi ion no ope a o % p oposi ion sligh ly ope a o ~ p oposi ion mo eo less ope a o + p oposi ion s ongly ope a o ulebase base1(inpu 1 x, inpu 2 y : ou pu z) using sys emop { i ( x == medium & y == medium) -> z = all; [0.8] i ( x<=sho | y != e y_ all ) -> z = sho ; i ( +(x> all) & (y ~= medium) ) -> z = all; ............. } Fig. 3: Example o ule base de ini ion. sys em (inpu 1 x, inpu 2 y : ou pu z) { ulebase1(x, y : inne 1); ulebase2(x, y : inne 2); ulebase3(inne 1, inne 2 : z); } Fig. 4: Example o sys em beha io de ini ion. (a) (b) (e) (g) (h) ( ) (c) (d) Fig. 5: Illus a ing linguis ic hedges. ions, and unc ions associa ed wi h de uzzi ica ion me hods. A g ea ad an age o XFL3 is ha hese unc ions can be de ined eely by he use in ex e nal iles (named as packages). The de ini ion o ma is as ollows: bina y iden i ie { blocks } una y iden i ie { blocks } m iden i ie { blocks } de uz iden i ie { blocks } The blocks ha de ine a unc ion include i s name (and possible alias), he pa ame e s which speci y i s beha io as well as he cons ain s on hese pa ame- e s, he desc ip ion o i s beha io in he di e en languages o which i could be compiled (ja a, ansi_c and cplusplus, o ins ance), and e en he de- sc ip ion o i s di e en ial unc ion (i i is employed in g adien -based lea ning mechanisms). This in o - ma ion is he basis o gene a e au oma ically a Ja a class ha inco po a es all he unc ion capabili ies and can be employed by any XFL3 speci ica ion. Re- ga ding de uzzi ica ion me hods, some o hem can be only employed wi h ce ain membe ship unc- ions. To exp ess his dependence, he block de ined- o indica es hose allowed membe ship unc ions. The use o packages allows he designe o de ine any desi ed unc ion. The s anda d package cu en ly used in XFL3 (and named x l) con ains he mos usu- al unc ions, as shown in Table 3. 4 Example o an XFL speci ica ion One o he main ea u es o XFL3 is he inclusion o linguis ic hedges and hie a chical s uc u es on he de ini ion o uzzy sys ems. The modula di ision o he sys em desc ip ion allows he designe o con- on he de elopmen o complex sys ems. In his sense, linguis ic hedges can be used o dec ease he numbe o linguis ic labels employed and o exp ess logic ules mo e compac ly [10]. As an example o complex sys em modelling, we ha e conside ed he classic p oblem o pa king a uck in a loading dock [11]. In his p oblem, only he case o backwa d d i ing is gene ally conside ed. Howe e , his makes i e y di icul o he uck o pa k when s a ing a a bad-o ien ed posi ion as shown in Figu e 6. The app oxima ion we ha e ol- lowed is o di ec ly emula e how we will ac as d i - e s, which o us is a wo s ep decision p oblem: o decide whe he mo ing o wa ds o backwa ds and, depending on he case, o selec he p ope angle o he wheels. This knowledge is, hence, ep esen ed by a hie a chical sys em. In pa icula , ou ule bases a e employed, as shown a he bo om o Figu e 7. The ule base di ec ion emula es ou non uzzy mak- ing decision abou he di ec ion o mo emen . On he con a y, he ule bases o wa d and backwa d emu- la es ou uzzy decision abou he wheel angle when d i ing o wa d o backwa d. Finally, he ule base swi ch chooses he p ope u n as a unc ion o he mo emen di ec ion. This example does no a emp o illus a e an op- imum way o sol ing he uck-dock p oblem bu he e iciency o XFL3 o ep esen ing expe linguis ic knowledge. In his sense, he ype de ini ions o he a iables ha e been educed by using he g ea e and smalle linguis ic hedges, and he ule base de ini- ions ha e been compac ed hanks o combina ions o connec i es and hedges, as we exp ess linguis ically. Figu e 8 shows he esul s o wo simula ions. In he i s one, he uck s a s a he bo om-le co ne , wi h a no h-eas o ien a ion. The sys em decides o d i e o wa d app oaching he uck o he e ical and, once a ha posi ion, leads i backwa ds o he Table 3: The s anda d package x l. Func ion ype Possible assigned unc ions Bina y min, p od, bounded_p od, d as ic_p od, max, sum, bounded_sum, d as ic_sum, dienes_ eshe , mizumo o, lukasiewicz, dubois_p ade, zadeh, goguen, godel, sha p. Una y no , sugeno, yage , pow, pa abola. Membe ship unc ions apezoid, iangle, isosceles, slope, bell, sigma, ec angle, sin- gle on De uzzi ica ion me hods Cen e O A ea, Fi s O Maxima, Las O Maxima, MeanO Maxima, FuzzyMean, Weigh edFuzz- yMean, Quali y, GammaQuali y. angle (x,y) Fig. 6: Example o he uck-dock p oblem. dock. The second simula ion begins a he bo om- igh co ne in a sou h-wes di ec ion. In his case, he uck is d i en backwa ds ill an ho izon al o ien a- ionis eached, henis di ec ed o wa d o he e ical and inally goes back o he dock. 5 Summa y o he XFL3-based ools The co e o any applica ion de eloped wi h XFL3 is based on he use o Ja a classes which con ain he whole s uc u e and unc ionali y o he speci ica- ions o be wo ked wi h. Using hese classes and he Ja a g aphic lib a ies, se e al ools ha e been buil Fig. 7: Summa y o he XFL3 speci ica ion o a uzzy con ol sys em o he uck-dock p oblem. ope a o se opse { de uz x l.FuzzyMean(); and x l.p od(); } ype TC ispX [-50.0,50.0] { ... } ...... ype TWheel [-30.0,30.0] { ... } ulebase backwa d(TX x, TAngle angle : TWheel wheel) using opse { ... } ulebase o wa d(TX x, TAngle angle : TWheel wheel) using opse { ... } ulebase swi ch(TWheel bw, TWheel w, TDi dd : TWheel wheel, TDi di ) using opse { ... } ulebase di ec ion(TC ispX x,TC ispY y,TC ispAngle angle,TOldDi olddi : TDi di ) using opse { i (y > a ) -> di = backwa d; i (y == a & olddi <= ze o ) -> di = backwa d; i (y == a & olddi > ze o ) -> di = o wa d; i (y <= nea & x != cen e & angle <= RI & angle >= LE) -> di = o wa d; i (y <= nea & x != cen e & (angle > RI | angle < LE)) -> di = backwa d; i (x == cen e & y == nea & angle <= RS & angle >= LS) -> di = backwa d; i (x == cen e & y == nea & (angle > RI | angle < LE)) -> di = backwa d; i (x == cen e & y == nea & (angle == LE | angle == RI)) -> di = o wa d; i (x == cen e & y < nea & angle == CE) -> di = s op; i (x == cen e & y < nea & (angle > RI | angle < LE)) -> di = backwa d; i (x == cen e & y < nea & angle < CE & angle >= LE) -> di = o wa d; i (x == cen e & y < nea & angle > CE & angle <= RI) -> di = o wa d; } sys em (TX x,TC ispY y,TAngle angle,TOldDi olddi : TWheel wheel,TDi di ec ion){ di ec ion(x, y, angle, olddi : dd); backwa d( x, angle : bw); o wa d( x, angle : w); swi ch( bw, w, dd : wheel, di ec ion); } NB NB NB NB NB NM PB PB PB PB PB ulebase backwa d NM NS NS NS NS NS PS PS PS PS PS NM NMNM NM NM PM PM PM PM PM PM PM ZE <LE LE LS CE RS RI >RI <LE LE CE RI >RI x angle backwa d o wa d swi ch wheel x angle di ec ion y olddi di ec ion PS PM PM PB NS PS NB NM NM NS PS ulebase o wa d NM PM PB NB NS PS NM NB PS PB NS NS PBPB PM NS NB NB NM NS PS PS PM ZE <LE LE LS CE RS RI >RI <LE LE CE RI >RI x angle TC ispX TC ispY igh cen e le a nea TC ispAngle TX LE LS CE RS RI TDi TAngle TOldDi TWheel ZE PS PM PBNB NM NSs opbackwa d o wa d CE RILE LE LS CE RS RI ze o <LE >RI <LE >RI <LE >RI > ze o< ze o (a) (b) Fig. 8: Simula ion esul s on he uck-dock p oblem. which allow exploi ing he XFL3 ea u es h ough he di e en de elopmen s ages o a uzzy sys em design. Cu en ly, he eisa ailablea uzzysys emedi ion ool, named x edi . I allows de ining he ope a o se s, a iable ypes, ule bases, and sys em s uc u e h ough a g aphical use in e ace, as shown in Figu e 9. Two g aphic ep esen a ion ools, named x 2dplo and x 3dplo , ha e been also de eloped. They allow illus a ing he uzzy sys em beha io by i s ou pu / inpu su ace in a wo o h ee dimensional space. A ool o au oma ically adjus ing uzzy sys ems desc ibed wi h XFL3 is also a ailable. This ool, named x sl, p o ides he use wi h se e al lea ning algo i hms and allows selec ing which sys em pa- ame e s a e going o be uned and which no . Be- sides, his oolincludes wome hods o p e- and pos - p ocessing o elimina ing non signi ican ules and labels and o clus e ing he ou pu a iables, hus simpli ying hei associa ed ypes. The inal s ep o any design p ocess is he syn he- sis s ep which can lead o a so wa e o ha dwa e sys- em implemen a ion. To ease he so wa e syn hesis, h ee ools ha e been de eloped, x j,x c and x cpp, which gene a e, espec i ely, he sys em desc ip ion in Ja a, C, and C++ languages. These and o he ools unde de elopmen a emp o co e all he di e en s ages o a uzzy sys em de- sign om i s linguis ic desc ip ion o i s inal imple- men a ion (ei he so wa e o ha dwa e) and will cons i u e he 3.0 e sion o he X uzzy en i onmen . 6 Conclusions This pape has in oduced he XFL3 language, which has been de eloped a e accumula ing expe ience wi h hedesigno heX uzzy2.0en i onmen .XFL3 eases he desc ip ion and manipula ion o complex uzzy sys ems hanks o he use o qui e use -de ined membe ship unc ions, uzzy ope a o s (including linguis ic hedges), and ule bases (admi ing hie a - chical s uc u es). An illus a i e example has been included o show he e iciency o XFL3 o apidly ansla e linguis ic knowledge. Based on his lan- guage, se e al ools a e being de eloped o cons i u e he new e sion o X uzzy, which could be execu ed on any pla o m con aining he Ja a Run ime En i- onmen . Re e ences: [1] D. R. López, C. J. Jiménez, I. Ba u one, A. Ba iga, S. Sánchez-Solano. "X uzzy: A Design En i on- men o Fuzzy Sys ems", P oc. 7 h IEEE In . Con . on Fuzzy Sys ems (FUZZIEEE’98), pp. 1060-1065, Ancho age, May 1998. [2] D. López, F. J. Mo eno, A. Ba iga, S. Sánchez-So- lano. "XFL: A Language o he De ini ion o Fuzzy Sys ems", P oc. 6 h IEEE In . Con . on Fuzzy Sys e- ms (FUZZIEEE’97), pp. 1585-1591, Ba celona, Jul., 1997. [3] M. Bonne , S. Maye , A. Raggl, W. Slany, “FLIP++: A uzzy logic in e ence lib a y”, Fuzzy Logic in A i icial In elligence: Towa ds In elligen Sys ems, Ma in, T.P., Ralescu, A.L., Eds., Sp in- ge -Ve lag, 1997. [4] Z. A. Sosnowski, “FLISP - a language o p oces- sing uzzy da a”, Fuzzy Se s and Sys ems, No 37, pp. 23-32, 1990. [5] O.G.Dua e, G. Pé ez. “UNFUZZY: Fuzzy Logic Sys em analysis, design, simula ion and implemen- a ion so wa e”, P oc. 1999 Eus la -Es yl Join Con ., pp. 251-254 Mallo ca, 1999. [6] R. Ha wig, C. Labinsky, S. No dho , B. Lando , P. Jensch, J. Schwanke. "F ee Fuzzy Logic Sys em Design Tool: FOOL", P oc. 4 h Eu opean Cong ess on In elligen Techniques and So Compu ing (EUFIT’96), pp. 2274-2277, Aachen, Sep. 1996. [7] J. Yen, R. Langa i, L.A. Zadeh, Eds., Indus ial Applica ions o Fuzzy Logic and In elligen Sys ems, IEEE P ess, 1995. [8] L.A. Zadeh, “A uzzy-se - heo e ic in e p e a ion o linguis ic hedges”, J. Cybe n, ol. 2, pp. 4-34, 1972. [9] E.H. Ruspini, P.P. Bonissone, W. Ped ycz, Eds., Handbook o Fuzzy Compu a ion, Ins i u e o Phy- sics Pub., 1998. [10] M. Sugeno, T. Yasukawa, “A uzzy-logic-based app oach o quali a i e modeling”, IEEE T ans. Fuzzy Sys ems, ol. 1, no. 1, pp. 7-31, 1993. [11] S.G. Kong, B. Kosko, “Adap i e Fuzzy Sys ems o Backing up a T uck-and-T aile ”, IEEE T ans. Neu- al Ne wo ks, ol. 3, no. 2, pp.211-223, 1992. Fig. 9: Main window o he x edi ool.