Fuzzy Linguistic Logic Programming and its Applications

The paper introduces fuzzy linguistic logic programming, which is a combination of fuzzy logic programming, introduced by P. Vojtas, and hedge algebras in order to facilitate the representation and reasoning on human knowledge expressed in natural la…

Authors: ** - **P. Vojtáš** (퍼지 논리 프로그래밍 창시자) - **Nguyen** (헤지 대수 이론의 선구자) - **Wechler** (헤지 대수 구조 연구) - **Dinh‑Khac** (역수식어 개념 도입) - **기타 공동 저자** (논문에 명시된 바에 따라) *(정확한 저자 명단은 원문을 참고하십시오.)* --- **

T o app e ar in The ory and Pr actic e of L o gic Pr o gr amming (TPLP) 1 F uzzy Linguistic L o gic Pr o g r amming and its Applic ations V AN HUNG LE, FEI LIU Dep artment of Computer Scienc e and Computer Engine ering L a T r ob e University, Bundo or a, VIC 3086, Austr alia ( e-mail: vh2le@stu dents.lat robe.edu.au; f.liu@la trobe.edu .au ) DINH KHANG TRAN F aculty of I nformation T ech nolo gy Hanoi University of T ech nolo gy, Vietnam ( e-mail: khangtd@it-h ut.edu.vn ) submitte d 29 January 2008; r evise d 22 De cemb er 2008, 5 Mar ch 2009; ac c epted 2 April 2 009 Abstract The paper introduces fuzzy linguistic logic programming, whic h is a com bination of fuzzy logic programming, introdu ced b y P . V o jt´ a ˇ s, and h ed ge algebras in order to f acilitate t he representa tion and reasoning on human kno wledge exp ressed in natural languages. In fuzzy linguistic logic programming, truth v alues are linguistic ones, e.g., V eryT rue , V eryProb- ablyT rue , and LittleF alse , taken f rom a hedge algebra of a linguistic truth va riable, and linguistic hedges (mo difiers) can b e used as un ary conn ectives in form ulae. This is mo- tiv ated by th e fact that humans reason mostly in terms of linguistic terms rather th an in terms of n umb ers, and linguistic hedges are often used in natural languages to express different level s o f emphasis . T he paper presen ts: ( i ) th e l anguage of fuzzy l inguistic logi c programming; ( ii ) a declarativ e semantics in terms of Herbrand interpretations and mod- els; ( iii ) a p rocedu ral semantics whic h directly manipulates linguistic terms to compute a lo w er b oun d to the tru t h v alue of a query , and p ro ves its soundn ess; ( iv ) a fixp oint seman tics of logic programs, and based on it, prov es the completeness of the pro ced ural seman tics; ( v ) sev eral applicatio ns of fuzzy linguistic log ic programming; and ( vi ) an idea of implementing a system to execute fuzzy linguistic log ic programs. KEYWORDS : F uzzy logi c programming, hedge algebra, linguistic v alue, linguistic hedge, computing with words, databases, querying, threshold compu tation, fuzzy con trol 1 In tro duction People usually use w ords (in natural languages), which are inherent ly imprecise, v ague and qualita tive in nature, to descr ib e real world information, to ana lyse, to reason, and to make decisions. Moreov er, in natura l lang uages, linguistic hedges are very often used to sta te different levels of emphasis. Therefor e, it is nece ssary to inv es tigate logic al systems tha t c an directly work with words, and make use of linguistic hedges since such sy stems will make it eas ier to represent and rea son on knowledge express ed in natural languag es. 2 V. H. L e, F. Liu and D. K . T ra n F uzzy logic, which is derived from fuzzy set theory , in tro duced b y L. Zadeh, deals with reasoning t hat is approximate ra ther than exact, as in classical predicate lo gic. In f uzzy logic, the truth v a lue domain is not the classic al s et { F alse , T rue } or { 0 , 1 } , but a set of linguistic truth v alues (Zadeh 1975 b) or the whole unit interv al [0,1 ]. Moreov er, in fuzzy lo gic, linguistic hedges play an ess ential role in the genera - tion of the v a lues of a linguistic v ariable and in the mo dificatio n of fuzzy predicates (Zadeh 1989). F uzz y logic provides us with a v ery powerful to ol for handling impre- cision a nd uncerta int y , which ar e very often encountered in rea l world infor mation, and a capacity for representing a nd reasoning on knowledge expr essed in linguistic forms. F uzzy logic prog ramming, int ro duced in V o jt´ a ˇ s (2001), is a formal mo del of an extension of logic pr ogramming without negation working with a truth functional fuzzy logic in na rrow sense. I n fuzzy logic progra mming, atoms a nd rules, which are many-v a lued implicatio ns, are graded to a certain degree in the interv al [0 ,1]. F uzzy log ic programming allows a wide v ariety of man y-v alued connectives in order to co ver a g reat v ariety of applications. A sound and complete pro cedural seman tics is provided to compute a low er bo und to the truth v alue of a query . Nev ertheless, no pro o fs of extended versions o f Mgu a nd Lifting lemmas are given. F uzzy logic progra mming ha s applicatio ns such as thres hold computation, a data mo del for flexible querying (P o korn´ y and V o jt´ a ˇ s 2001) , and fuzzy con trol (Ger la 2005). The theory of hedge algebra s, introduced in Nguyen and W echler (1 990; 1992), forms an alg ebraic approa ch to a natural qualitative seman tics o f linguistic terms in a ter m do main. The hedge-a lgebra- based semantics of ling uistic ter ms is qual- itative, relative, and dep endent on the or der-based structur e of the term domain. Hedge algebra s have b een shown to hav e a r ich algebr aic structure to repr esent linguistic do mains (Nguyen et al. 1999), and the theory can b e effectively applied to pro blems such as ling uistic re asoning (Nguyen et al. 1999) and fuzzy co ntrol (Nguyen et al. 2008). The notion of an in v erse ma pping o f a hedg e is defined in Dinh-Khac et al. (20 06) for monotonic hedge algebr as, a sub class of linear hedge algebras . In this work, w e integrate fuzzy logic progr amming and hedge algebras to build a logica l system tha t facilitates the r epresentation and reas oning on knowledge expressed in natural languages. In our logical sys tem, the set of truth v alues is that of linguistic ones taken fro m a hedge algebra of a linguistic truth v ar iable. F urthermor e, we consider only finitely many truth v alues. On the one hand, this is due to the fact that nor mally , peo ple use finitely ma n y degrees o f qua lit y or quantit y to describ e real world applications whic h ar e granulated (Za deh 1997). On the other hand, it is rea sonable to pr ovide a logica l system suita ble for computer implemen tation. In fact, the finiteness of the truth do main allo ws us to obtain the Least Herbrand mo del for a finite logic progra m after a finite n umber of itera tions of an immediate co nsequences op era tor. Moreov er, w e allow the use of ling uistic hedges as unary connectives in form ulae to express different lev els of ac cent uation on fuzzy predicates. T he p ro cedura l semantics in V o jt´ a ˇ s ( 2001) is extended to deduce a lower bo und to the truth v alue of a q uery b y directly computing with linguistic terms. The paper is orga nised as follo w s: the next section gives a motiv ating example for F u zzy Linguistic L o gic Pr o gr amming 3 the developmen t of fuzzy linguistic logic pro gramming; Section 3 pres ent s linguistic truth domains taken from hedg e alg ebras of a tr uth v ariable, inv erse mapping s of hedges, many-v a lued mo dus p onens w.r.t. such doma ins; Sec tion 4 pre sents the theory of fuzzy linguistic logic pro gramming, defining the language , declarative semantics, pro cedura l s emantics, and fixpoint semantics, and pro ving t he soundness and completenes s of the pro cedural semantics; Section 5 and Section 6 resp ectively discuss several applications and an idea for implemen ting a s ystem where suc h logic progra ms can be executed; the last section s ummarises the paper. 2 Motiv ation Our motiv ating exa mple is adapted from the hotel r eserv atio n system des crib ed in Naito et al. (1995). Here, we use logic pro gramming nota tion. A r ule to find a conv enient hotel for a business tr ip can be defined as follows: c onvenient hotel ( Business lo c ation , Time , H ot el ) ← ∧ ( ne ar to ( Business lo c ation , Hotel ) , r e asonable c ost ( Hotel , Time ) , fine building ( Hotel )) · with truth v alue= V eryT rue That is, a ho tel is regarded to b e co nv enient for a business tr ip if it is near the business lo cation, has a reaso nable cos t at the co nsidered time, and is a fine building. Here, fine building(Hotel) is an atomic formula (atom), whic h is a fuzzy predicate symbol with a list of arguments, having a t ruth v alue. There is a n option that the truth v alue of fine building of a hotel is a num b er in [0,1] and is ca lculated by a function of its age as in Naito et al. (1 995). Ho wev er, in fact, the age of a hotel may not b e enough to reflect its fineness s ince the fineness a lso depends on the constr uc- tion quality and the surroundings. Similarly , the truth v alue o f r easonable cost can be c omputed as a function of the hotel rate at the time. Nevertheless, since the rate v aries from seas on to season, the function should be mo dified a ccordingly to reflect the reasonableness for a pa rticular time. Th us, a more r ealistic and appropriate way is to assess the fineness a nd the reasona bleness of the cost of a hotel using linguistic truth v alues, e.g., P robablyT rue , a fter considering a ll possible factors. Note that there ca n be more than one wa y to define the conv enience of a hotel, and the ab ov e rule is only one o f them. F urthermo re, since any of such rules may not b e abso lutely true for everybo dy , each rule should hav e a degree of truth (truth v alue). F or example, V eryT rue is the truth v alue of the a bove r ule. In additio n, since linguistic hedges are usually used to sta te different levels o f emphasis, we desire to use them to express different degrees o f r equirements on the criteria. F or exa mple, if w e wan t to emphasise clo seness, we can use the for m ula V ery near to(Business lo cation,Hotel) instead of nea r to(Business lo cation,Hotel) in the rule, and if we do not care muc h ab out the cost, we can relax the criter ion by using the hedge Pro bably for the atom reasonable cost(Hotel,Time) . Thus, the rule becomes: c onvenient hotel ( Business lo c ation , Time , H otel ) ← 4 V. H. L e, F. Liu and D. K . T ra n ∧ ( V ery ne ar to ( Business lo c ation , Hotel ) , Pr ob ably r e asonable c ost ( Hotel , Time ) , fine building ( Hotel )) · with truth v alue= V eryT rue In our o pinion, in order to model knowledge expres sed in natural languag es, a for- malism should address the tw ofold usag e of ling uistic hedges, i.e., in generating linguistic v alues and in mo difying predicates. T o the b est of our knowledge, no existing fr ameworks of logic prog ramming have addressed the pr oblem o f using lin- guistic truth v a lues as well as allowing linguistic hedges to mo dify fuzzy pr edicates. 3 Hedge algebras and lingui stic truth domains 3.1 He dge algebr as Since the mathematical structures o f a given set of truth v alues pla y an impo rtant role in studying the corres po nding logics, we pr esent her e an appro priate mathe- matical structure of a linguistic domain of a linguistic v ariable T ruth in particular, and that o f an y linguistic v ariable in general. In an algebraic appr oach, v alues of the ling uistic v ariable T ruth such as T rue , V eryT rue , P robablyF alse , V eryP robablyF alse , and so o n ca n b e conside red to b e generated from a set of generator s (primary terms) G = { F alse , T rue } using hedges from a set H = { V ery , Mor e , Pr ob ably , · · ·} as una ry o pe rations. Ther e exists a natur al ordering among these v alues, with a ≤ b meaning that a indicates a degree of truth less than or eq ual to b . F or example, T rue < V eryT rue a nd F alse < LittleF alse , where a < b iff a ≤ b a nd a 6 = b . The r elation ≤ is ca lled the semantically order ing r elation (SOR) on the term domain, denoted b y X . There a re natura l semantic pr op erties of ling uistic terms and hedges that can b e formulated in terms of the SO R a s follows. Let V, M, L, P , and A stand for the hedges V ery , More, Little, Probably , a nd Appro ximately , respectively . ( i ) Hedges either incr ease or decrease the mea ning o f ter ms they mo dify , so they ca n b e regar ded a s ordering op era tions , i.e., ∀ h ∈ H , ∀ x ∈ X , either hx ≥ x or hx ≤ x . The fact tha t a hedg e h mo difies terms more than or equa l to another hedge k , i.e., ∀ x ∈ X , hx ≤ kx ≤ x o r x ≤ kx ≤ hx , is denoted by h ≥ k . Note that since the s ets H and X a re disjoint, w e ca n use the same nota tion ≤ for different ordering relatio ns o n H and on X without a ny confusion. F or example, w e hav e L > P ( h > k iff h ≥ k and h 6 = k ) since, fo r insta nce, L T rue < PT rue < T rue and LF alse > PF alse > F alse . ( ii ) A hedge has a semantic effect on other s, i.e., it either strengthens o r weak ens the degree o f mo dification of other hedg es. If h str engthens the deg ree of mo difi- cation of k , i.e., ∀ x ∈ X , hkx ≤ kx ≤ x or x ≤ kx ≤ hkx , then it is said that h is p ositive w.r.t. k ; if h weak ens the degr ee of modifica tion o f k , i.e., ∀ x ∈ X , kx ≤ hkx ≤ x or x ≤ hkx ≤ kx , then it is said that h is negative w.r.t. k . F or in- stance, V is p ositive w.r .t. M since, e .g., VMT rue > MT rue > T rue ; V is nega tive w.r.t. P s ince, e.g., PT rue < VPT rue < T rue . ( iii ) An imp or tant semantic prop erty of hedges, called seman tic heredity , is that F u zzy Linguistic L o gic Pr o gr amming 5 hedges c hange the meaning of a term a little, but so mewhat pre serve the o riginal meaning. Thus, if ther e a re tw o terms hx and kx , where x ∈ X , such that hx ≤ kx , then all terms generated from hx using hedges are less than or e qual to all terms gener ated from kx . This prop erty is formulated by: ( a ) If hx ≤ kx , then H ( hx ) ≤ H ( kx ), whe re H ( u ) denotes the set of a ll terms genera ted from u by means of hedge s, i.e., H ( u ) = { σ u | σ ∈ H ∗ } , where H ∗ is the s et of a ll strings o f symbols in H inc luding the empt y one. F o r example, since MT rue ≤ VT rue , we hav e VMT rue ≤ L VT rue and H ( MT rue ) ≤ H ( VT ru e ); ( b ) If tw o terms u and v are incompar able, then all terms g enerated from u are incompara ble to all terms generated from v . F or example, since AF alse and PF alse are incompara ble, V A F alse and MPF alse are incomparable too . Two terms u a nd v are said to b e indep endent if u / ∈ H ( v ) and v / ∈ H ( u ). F or example, VT rue and PMT ru e a re indep endent, but V T rue and L V T rue a re not since L VT rue ∈ H ( VT rue ). Definition 1 ( He dge algebr a ) (Nguyen and W echler 1990) An abstract algebra X = ( X , G , H , ≤ ), where X is a term domain, G is a set of primar y terms , H is a set of linguistic hedges , and ≤ is an SOR on X , is called a hedge algebra (HA) if it satisfies the follo wing: (A1) Each hedge is either positive o r negative w.r.t. the others, includin g itself; (A2) If terms u and v ar e independent, then, for all x ∈ H ( u ), we ha ve x / ∈ H ( v ). In addition, if u and v ar e incomparable, i.e., u 6 < v a nd v 6 < u , then so are x and y , for ev er y x ∈ H ( u ) and y ∈ H ( v ); (A3) If x 6 = hx , then x / ∈ H ( hx ), and if h 6 = k and hx ≤ kx , then h ′ hx ≤ k ′ kx , for all h , k , h ′ , k ′ ∈ H and x ∈ X . Moreover, if hx 6 = kx , then hx and kx are independent; (A4) If u / ∈ H ( v ) and u ≤ v ( u ≥ v ), then u ≤ hv ( u ≥ hv ) for any h ∈ H . Axioms (A2)-(A4) are a weak formulation of the semantic heredity of hedg es. Given a ter m u in X , the expressio n h n · · · h 1 u is called a representation of x w.r.t. u if x = h n · · · h 1 u , and, furthermor e, it is called a canonica l representation of x w.r.t. u if h n h n − 1 · · · h 1 u 6 = h n − 1 · · · h 1 u . The following prop ositio n shows how to compar e any t wo terms in X . The no- tation x u | j denotes the suffix o f length j of a representation of x w.r.t. u , i.e., for x = h n · · · h 1 u , x u | j = h j − 1 · · · h 1 u , where 2 ≤ j ≤ n + 1, and x u | 1 = u . Let I / ∈ H be an artificial hedg e called the iden tit y on X defined b y the r ule ∀ x ∈ X , Ix = x . Pr op osition 1 (Nguyen and W echler 1992) Let x = h n · · · h 1 u , y = k m · · · k 1 u b e tw o c anonical representations of x and y w.r.t. u , resp ectively . Then, there ex ists the larges t j ≤ min ( m , n ) + 1 (here, a s a conv en tion it s hould b e unders to o d tha t if j = min ( m , n ) + 1 , then h j = I , for j = n + 1, and k j = I , for j = m + 1) such that ∀ i < j , h i = k i , and ( i ) x = y iff n = m and h j x u | j = k j x u | j ; ( ii ) x < y iff h j x u | j < k j x u | j ; ( iii ) x and y are incomparable iff h j x u | j and k j x u | j are incomparable. 6 V. H. L e, F. Liu and D. K . T ra n 3.2 Li ne ar symmetric he dge algebr as Since w e allo w hedge s to be unary connectives in f ormulae, there is a need to b e able to compute the truth v alue of a hedge-mo dified formula from that of the or iginal. T o this end, the notion of a n inv er se mapping of a hedge is utilised. In order to define this no tion, w e restrict o urselves to linear HAs. The set of prima ry terms G usually c onsists o f tw o compara ble o nes, denoted by c − < c + . F or the v ariable T ruth , we have c − = F alse < c + = T rue . Such HAs ar e calle d sy mmetr ic ones. F o r sy mmetric HAs, the s et o f hedges H can be divided in to t w o disjoint subsets H + and H − defined as H + = { h | hc + > c + } and H − = { h | hc + < c + } . Tw o hedges h and k ar e s aid to b e con verse if ∀ x ∈ X , hx ≤ x iff kx ≥ x , i.e., they a re in differ ent subsets; h and k are said to be co mpatible if ∀ x ∈ X , h x ≤ x iff kx ≤ x , i.e., they ar e in the same subset. Two hedges in each of sets H + and H − may b e co mparable, e.g., L and P , or incomparable, e.g., A a nd P . Th us, H + and H − bec ome po sets. Definition 2 ( Line ar symmetric he dge algebr a ) A sy mmetric HA X = ( X , G = { c − , c + } , H , ≤ ) is said to b e a linea r symmetric HA (lin-HA, for sho rt) if the set of hedges H is divided into H + = { h | hc + > c + } and H − = { h | hc + < c + } , and H + and H − are linearly ordered. Example 1 Consider an HA X = ( X , G = { c − , c + } , H = { V , M , P , L } , ≤ ). X is a lin-HA as follows. V and M are positive w.r.t. V , M , and L , and negative w.r .t. P ; P is p ositive w.r.t. P , and negative w.r.t. V , M , a nd L ; L is p ositive w.r.t. P , and negative w.r.t. V , M , and L . H is de comp osed into H + = { V , M } and H − = { P , L } . Moreo ver, in H + , w e ha ve M < V , and in H − , w e ha ve P < L . Definition 3 ( Sign function ) (Nguyen and W echler 1990) A function Sign : X → {− 1 , 0 , +1 } is a mapping de- fined recursively as follows, wher e h , h ′ ∈ H and c ∈ { c − , c + } : a) Sign ( c − ) = − 1, Sign ( c + ) = +1; b) Sign ( hc ) = − Sign ( c ) if either h ∈ H + and c = c − or h ∈ H − and c = c + ; c) Sign ( hc ) = Sign ( c ) if either h ∈ H + and c = c + or h ∈ H − and c = c − ; d) Sign ( h ′ hx ) = − S ign ( hx ), if h ′ hx 6 = hx , and h ′ is negative w.r .t. h ; e) Sign ( h ′ hx ) = Sign ( hx ), if h ′ hx 6 = hx , and h ′ is pos itive w.r.t. h ; f ) Sign ( h ′ hx ) = 0 if h ′ hx = hx . Based on th e function Sign , we hav e a criter ion to compa re h x and x as follo ws: Pr op osition 2 (Nguyen and W echler 1990) F or a ny h and x , if Sign ( hx ) = +1 , then hx > x , and if Sign ( hx ) = − 1, then hx < x . In Ng uyen and W echler ( 1992), HAs are extended b y augmen ting t wo ar tificial hedges Φ a nd Σ defined as Φ( x ) = infimum ( H ( x )) a nd Σ( x ) = supr emum ( H ( x )), for all x ∈ X . An HA is said to b e free if ∀ x ∈ X a nd ∀ h ∈ H , hx 6 = x . It is F u zzy Linguistic L o gic Pr o gr amming 7 shown that, for a free lin- HA of the v ariable T ruth w ith H 6 = ∅ , Φ( c + ) = Σ( c − ), Σ( c + ) = 1 ( AbsolutelyT rue ), and Φ( c − ) = 0 ( AbsolutelyF alse ). Let us put W = Φ( c + ) = Σ( c − ) (called the middle truth v alue ); we ha ve 0 < c − < W < c + < 1. Definition 4 ( Linguistic trut h domain ) A linguistic truth domain X taken fro m a lin-HA X = ( X , { c − , c + } , H , ≤ ) is defined as X = X ∪ { 0 , W , 1 } , where 0 , W , and 1 a re the least, the neutral, and the greatest elements of X , resp ectively . Pr op osition 3 (Nguyen and W echler 1992) F or an y lin- HA X = ( X , G , H , ≤ ), th e ling uistic truth domain X is linear ly ordered. The usual op era tions are defined on X as follows: ( i ) negation : g iven x = σ c , where σ ∈ H ∗ and c ∈ { c + , c − } , y is called the negation of x , denoted by y = − x , if y = σ c ′ and { c , c ′ } = { c + , c − } . F or example, hc + is the negation o f hc − . In particular, − 1 = 0, − 0 = 1 , and − W = W ; ( ii ) co njunction : x ∧ y = min( x , y ); ( iii ) disjunction : x ∨ y = max( x , y ). Pr op osition 4 (Nguyen and W echler 1992) F o r an y lin-HA X = ( X , G , H , ≤ ), the following hold: ( i ) − hx = h ( − x ) for any h ∈ H ; ( i i ) − − x = x ; ( iii ) x < y iff − x > − y . It is shown that the identit y hedge I is the lea st elemen t of the sets H + ∪ { I } and H − ∪ { I } , i.e., ∀ h ∈ H , h ≥ I . Definition 5 ( Ext en de d or dering r elation ) An e xtended ordering r elation on H ∪ { I } , denoted by ≤ e , is defined based on the ordering relatio ns on H + ∪ { I } and H − ∪ { I } as follows. Given h , k ∈ H ∪ { I } , h ≤ e k iff: ( i ) h ∈ H − , k ∈ H + ; or ( ii ) h , k ∈ H + ∪ { I } a nd h ≤ k ; or ( iii ) h , k ∈ H − ∪ { I } a nd h ≥ k . W e denote h < e k iff h ≤ e k and h 6 = k . Example 2 F or the HA in Ex ample 1 , in H ∪ { I } we hav e L < e P < e I < e M < e V . It is s traightforw ard to show the following: Pr op osition 5 F or all h , k ∈ H ∪ { I } , if h < e k , then hc + < kc + . 3.3 Inverse mappings of he dges In fuzzy logic, kno wledge is usually represented in terms of pairs consisting of a v ague sent ence and its degree of truth , which is also expressed in linguistic terms. A v ague sentence ca n b e repr esented by an expr ession u ( x ), wher e x is a v ariable or a constant, and u is a fuzzy pr edicate. F or example, the assertion “ It is quite true that John is studying ha rd ” can be represented by a pair ( study har d ( john ) , QuiteT rue ). According to Za deh (1979; 1975a), the following assessments can be considered to be a pproximately seman tically equiv a lent: “ It is v ery tr ue that Lucia is young ” and 8 V. H. L e, F. Liu and D. K . T ra n “ It is true that Lucia is very young ”. Tha t means if we hav e ( young ( lucia ) , V eryT rue ), we also hav e ( V ery young ( lucia ) , T rue ). Thus, the hedge “ V ery ” can be mov ed from the truth v alue to the fuzzy pr edicate. This is gener alised to the following r ule: ( R 1) ( u ( x ) , hT rue ) ⇒ ( hu ( x ) , T rue ) How ever, the rule is not complete, i.e., in some cases we ca nnot use it to deduce the truth v alue of a hedg e-mo dified fuzzy pr edicate fr om that of the original. F or instance, given ( young ( lucia ) , V eryT ru e ), we canno t compute the truth v a lue o f Pr ob ably young ( lucia ) using the ab ove rule. The no tion of an in verse mapping of a hedge , whic h is an extension o f Rule ( R 1 ), pro vides a so lution to this problem. The idea b ehind this notion is that the truth v alue o f a hedge-mo dified fuzzy predicate can be a function of that of the orig inal. In other w ords, if we mo dify a fuzzy pre dicate by a hedge, it s tr uth v alue will b e c hanged b y the inv erse mapping of that hedge. Now, we will work out the conditions that an inv erse mapping of a hedge sho uld sa tisfy . W e denote the inv erse mapping o f a hedge h b y h − . First, since h − is an extensio n of Rule ( R 1), we should ha ve h − ( hT rue ) = T ru e . Second, int uitively , the more true a fuzzy predicate is, the more true is its hedge- mo dified one, so h − should be monoto ne, i.e., if x ≥ y , then h − ( x ) ≥ h − ( y ). Third, it s eems to b e natural that b y mo difying a fuzzy pr edicate using a hedge in H + such a s V ery or More , we accentuate the fuzzy pr edicate, so the truth v alue sho uld decrease . F or exa mple, the tr uth v alue of V ery young ( lu cia ) should be less than that of young ( lu cia ). Similarly , by applying a hedge in H − such as Probably or Little , we deaccentuate the f uzzy predica te; th us, the truth v alue should increase. F or example, the truth v alue of Pr ob ably high inc ome ( t om ) should b e greater than tha t of high inc ome ( t om ). This is a lso in acco rdance with the fuzzy- set-based in terpr etation of hedges (Za deh 1972), in which hedges such as V e ry ar e called accentuators and can b e defined as V ery x = x 1+ α , where x is a fuzzy predicate express ed by a fuzzy set and α > 0, and hedges s uch as Probably a re called deac c e n tuators and ca n b e defined as Pr ob ably x = x 1 − α (note that the degree of mem be rship of each element in x is in [0,1]). In summar y , this can be formulated as: for a ll h , k ∈ H ∪ { I } suc h that h ≤ e k and for all x , w e should have h − ( x ) ≥ k − ( x ). As a con ven tion, w e alwa ys as sume that fo r all x , I − ( x ) = x . Definition 6 ( An inverse mapping of a he dge ) Given a lin-HA X = ( X , { c + , c − } , H , ≤ ) and a hedge h ∈ H , a mapping h − : X → X is called an in verse mapping of h iff it satisfies the following co nditions: h − ( hc + ) = c + (1) x ≥ y ⇒ h − ( x ) ≥ h − ( y ) (2) h ≤ e k ⇒ h − ( x ) ≥ k − ( x ) (3) where k − is an inv erse mapping of another hedge k ∈ H ∪ { I } . Since 0, W, and 1 ar e fixed po int s, i.e., ∀ x ∈ { 0 , W , 1 } and ∀ h ∈ H , hx = x (Nguyen and W echler 1992) , it is reaso nable to assume that ∀ h ∈ H , h − (0) = 0 , h − ( W ) = W , and h − (1) = 1. F u zzy Linguistic L o gic Pr o gr amming 9 W e show why w e hav e to use lin-HAs in o rder to de fine the notion of an in- verse mapping of a hedge. Co nsider an HA c ontaining tw o incompara ble hedges P ( Pr ob ably ) , A ( Appr oximately ) ∈ H − . W e can see that since A c + and Pc + are incomparable, P − ( A c + ) a nd P − ( Pc + ) = c + should b e either incomparable or equal. The tw o v a lues cannot be incompara ble since every truth v alue is compara- ble to c + and c − , and it might not b e very meaningful to keep b oth P and A in the set o f hedges if we have P − ( A c + ) = P − ( Pc + ) = c + . Inv ers e ma ppings of hedges alw ays exist; in the follo wing, w e giv e an example of inv ers e mappings of hedges for a gener al lin-HA . Example 3 Consider a lin-HA X = ( X , { c + , c − } , H , ≤ ) with H − = { h − q , h − q +1 , · · · , h − 1 } and H + = { h 1 , h 2 , · · · , h p } , where p , q ≥ 1. Let us denote h 0 = I . Without loss of generality , we supp ose that h − q > h − q +1 > · · · > h − 1 and h 1 < h 2 < · · · < h p . Therefore, we have h − q < e h − q +1 < e · · · < e h − 1 < e h 0 < e h 1 < e h 2 < e · · · < e h p , and thus h − q c + < · · · < h − 1 c + < c + < h 1 c + < · · · < h p c + . W e always assume that, for all k 1 , k 2 ∈ H and c ∈ { c + , c − } , k 2 k 1 c 6 = k 1 c , i.e., Sign ( k 2 k 1 c ) 6 = 0. First, w e build inv er se ma ppings of hedges h − r ( x ), for all x ∈ H ( c + ), as f ollows: ( i ) x = c + . F or all r such that − min ( p , q ) ≤ r ≤ min ( p , q ), we put h − r ( c + ) = h − r c + . In pa rticular, h − 0 ( c + ) = h 0 c + = c + . If p > q , for all q + 1 ≤ r ≤ p , h − r ( c + ) = W . If p < q , for all − ( p + 1) ≥ r ≥ − q , h − r ( c + ) = 1 . It can b e ea sily verified tha t, for all h ∈ H ∪ { I } , h − ( c + ) satisfies Co ndition (3). ( ii ) x = σ h s c + , where σ ∈ H ∗ and h s 6 = I , i.e ., s 6 = 0. If r = s , we put h − r ( σ h r c + ) = c + ; hence , Condition (1) is satis fied. O therwise, we hav e r 6 = s . If s − r < − q , we put h − r ( σ h s c + ) = W ; if s − r > p , we put h − r ( σ h s c + ) = 1. Otherwise, w e hav e − q ≤ s − r ≤ p . F or a certain hedg e k , Sign ( h p kc + ) can b e either -1 or +1 . If Sign ( h p kc + ) = +1, by P rop osition 2, we have kc + < h p kc + . Th us, it follows that h − q kc + < · · · < h − 1 kc + < kc + < h 1 kc + < · · · < h p kc + . F or exa mple, we have Sign ( VPc + ) = +1 and LPc + < PPc + < Pc + < MPc + < VPc + . Similarly , if Sign ( h p kc + ) = − 1, we hav e h − q kc + > · · · > h − 1 kc + > kc + > h 1 kc + > · · · > h p kc + . F or instance, we hav e Sign ( VL c + ) = − 1 a nd LL c + > PL c + > L c + > ML c + > VL c + . In summary , the ordering of the elements in the set { h t kc + : − q ≤ t ≤ p } can have one of the tw o ab ov e reverse direc tions. Therefore, for a pair ( s , s − r ), there are t wo cases: (a) The or derings of the elements in the sets { h t h s c + : − q ≤ t ≤ p } and { h t h s − r c + : − q ≤ t ≤ p } hav e the sa me direction, i.e., we hav e h − q h s c + < · · · < h − 1 h s c + < h s c + < h 1 h s c + < · · · < h p h s c + and h − q h s − r c + < · · · < h − 1 h s − r c + < h s − r c + < h 1 h s − r c + < · · · < h p h s − r c + , or h − q h s c + > · · · > h − 1 h s c + > h s c + > h 1 h s c + > · ·· > h p h s c + and h − q h s − r c + > ··· > h − 1 h s − r c + > h s − r c + > h 1 h s − r c + > · · · > h p h s − r c + . In this case, we put h − r ( σ h s c + ) = σ h s − r c + . (b) The orderings hav e reverse directio ns, i.e ., we hav e h − q h s c + < ··· < h − 1 h s c + < h s c + < h 1 h s c + < · · · < h p h s c + and h − q h s − r c + > · · · > h − 1 h s − r c + > h s − r c + > h 1 h s − r c + > · · · > h p h s − r c + , o r h − q h s c + > · · · > h − 1 h s c + > h s c + > h 1 h s c + > · · · > h p h s c + and h − q h s − r c + < · · · < h − 1 h s − r c + < h s − r c + < h 1 h s − r c + < · · · < h p h s − r c + . W e put h − r ( σ h s c + ) = δ h s − r c + , wher e δ is o btained as follows. If σ is 10 V. H. L e, F. Liu and D. K . T ra n empt y , then so is δ . Otherwise, suppose that σ = σ ′ h t , where t 6 = 0. If − q ≤ − t ≤ p , we put δ = h − t ; if − t < − q , then δ = h − q ; if − t > p , then δ = h p . It ca n be seen that what we ha ve done her e is to make inverse ma ppings of hedges mo notone. In particular, if r = 0, then s = s − r . Th us, (b) is not the case, and by (a), w e hav e h − 0 ( σ h s c + ) = σ h s c + ; this co mplies with the a ssumption I − ( x ) = x , for all x . Second, for x ∈ H ( c − ), we define h − r ( x ) based on the ab ove case as follows. Note that from x ∈ H ( c − ), we ha ve − x ∈ H ( c + ). If − m in ( p , q ) ≤ r ≤ min ( p , q ), w e put h − r ( x ) = − h − − r ( − x ); if p > q , for all q + 1 ≤ r ≤ p , h − r ( x ) = − h − − q ( − x ); if p < q , for all − ( p + 1) ≥ r ≥ − q , h − r ( x ) = − h − p ( − x ). Finally , as usual, h − (1) = 1, h − ( W ) = W , and h − (0) = 0, for all h . It can b e easily seen that, for a ll x ∈ H ( c + ) and h ∈ H ∪ { I } , h − ( x ) ∈ H ( c + ) ∪ { W , 1 } , and, for all x ∈ H ( c − ) and h ∈ H ∪ { I } , h − ( x ) ∈ H ( c − ) ∪ { W , 0 } . It has been shown in th e above exa mple tha t the in verse mapping s s atisfy Condition (1). In the following, w e prov e that they also satisfy Co nditions (2) and (3). Pr op osition 6 The mappings defined ab ove s atisfy Condition (3 ), i.e., h ≤ e k ⇒ h − ( x ) ≥ k − ( x ). Pr o of W e prov e that if h < e k , then h − ( x ) ≥ k − ( x ). Assume that h = h r 1 , k = h r 2 , where r 1 < r 2 . First, w e prov e the case x ∈ H ( c + ). The case x = c + has be en shown to s atisfy Condition (3) in Example 3. Co nsider the case x = σ h s c + , where s 6 = 0. F ro m r 1 < r 2 we hav e s − r 1 > s − r 2 . The case s − r 2 < − q , i.e., h − r 2 ( σ h s c + ) = W , is trivial; so is the case s − r 1 > p , i.e., h − r 1 ( σ h s c + ) = 1. Otherwise , − q ≤ s − r 2 < s − r 1 ≤ p ; thus, h − ( x ) = δ 1 h s − r 1 c + and k − ( x ) = δ 2 h s − r 2 c + , for so me δ 1 and δ 2 . Since h s − r 1 c + > h s − r 2 c + , b y Pro p osition 1 , w e ha ve h − ( x ) > k − ( x ). Second, consider the ca se x ∈ H ( c − ). Since − x ∈ H ( c + ), from the abov e case, we hav e, for all t , h − p ( − x ) ≤ h − t ( − x ) ≤ h − − q ( − x ), a nd by Prop os ition 4, − h − p ( − x ) ≥ − h − t ( − x ) ≥ − h − − q ( − x ). If − r 1 > p , then h − r 1 ( x ) = − h − p ( − x ); if − r 2 < − q , then h − r 2 ( x ) = − h − − q ( − x ). Thus, we a lwa ys hav e h − r 1 ( x ) ≥ h − r 2 ( x ). Otherwis e, p ≥ − r 1 > − r 2 ≥ − q ; thus, h − r 1 ( x ) = − h − − r 1 ( − x ) and h − r 2 ( x ) = − h − − r 2 ( − x ). W e hav e h − − r 1 ( − x ) ≤ h − − r 2 ( − x ); thus, − h − − r 1 ( − x ) ≥ − h − − r 2 ( − x ), i.e., h − r 1 ( x ) ≥ h − r 2 ( x ). Finally , for x ∈ { 0 , W , 1 } , we hav e h − ( x ) = k − ( x ) = x . Pr op osition 7 The mappings defined ab ove s atisfy Condition (2 ), i.e., x ≥ y ⇒ h − ( x ) ≥ h − ( y ). Pr o of Suppo se x > y . Co nsider h − r ( x ) and h − r ( y ), for some r . First, w e prov e the case x , y ∈ H ( c + ). There are thre e possible cases : (1) x = c + and y = σ h t c + , where t < 0. If t − r < − q , then h − r ( y ) = W ≤ h − r ( x ); if − r > p , then h − r ( x ) = 1 ≥ h − r ( y ). Otherwise, − q ≤ t − r < − r ≤ p , th us h − r ( x ) = h − r c + and h − r ( y ) = δ h t − r c + . Since h − r c + > h t − r c + , w e ha ve h − r ( x ) > h − r ( y ). (2) y = c + and x = σ h t c + , where t > 0. The pr o of is similar t o that of (1 ). F u zzy Linguistic L o gic Pr o gr amming 11 (3) x = σ h t c + and y = δ h s c + , where t ≥ s . If s − r < − q , then h − r ( y ) = W ≤ h − r ( x ), and if t − r > p , then h − r ( x ) = 1 ≥ h − r ( y ). Otherwise, − q ≤ s − r ≤ t − r ≤ p ; th us, h − r ( x ) = σ ′ h t − r c + and h − r ( y ) = δ ′ h s − r c + . There are tw o cases: (3.1) t − r > s − r . Since h t − r c + > h s − r c + , b y Propo sition 1, h − r ( x ) > h − r ( y ). (3.2) t = s . Supp ose x = σ 1 h m h s c + and y = δ 1 h n h s c + , where if m = 0, then σ 1 is empt y , and if n = 0, th en δ 1 is empt y . There are tw o cases: (3.2.1) m 6 = n . Since x > y , b y Pro p osition 1, h m h s c + > h n h s c + . If h m h s − r c + > h n h s − r c + , by (a), h − r ( x ) = σ 1 h m h s − r c + and h − r ( y ) = δ 1 h n h s − r c + . B y Pr op osition 1, h − r ( x ) > h − r ( y ). Otherwise, h m h s − r c + < h n h s − r c + . W e pr ov e the c ase m > n , and the cas e m < n ca n b e proved similarly . Since m > n and h m h s − r c + < h n h s − r c + , we ca n see that the v alues h z h s − r c + , wher e z = p , p − 1 , · · · , − q , a re increasing while the index z is decr easing. Thus, for all z , h p h s − r c + ≤ h z h s − r c + ≤ h − q h s − r c + . If − m < − q , then b y (b), h − r ( x ) = h − q h s − r c + . In any case, h − r ( y ) = h z h s − r c + , for some z . Therefore, h − r ( x ) ≥ h − r ( y ). Similarly , if − n > p , then b y (b), h − r ( y ) = h p h s − r c + ; thus, h − r ( x ) ≥ h − r ( y ). Otherwise, − q ≤ − m < − n ≤ p . By (b), h − r ( x ) = h − m h s − r c + and h − r ( y ) = h − n h s − r c + . Since − m < − n , we hav e h − m h s − r c + > h − n h s − r c + , i.e., h − r ( x ) > h − r ( y ). (3.2.2) m = n . Since x > y , by Pro po sition 1, there ex ist k 1 , k 2 ∈ H ∪ { I } and k 1 6 = k 2 , a nd σ 2 , δ 2 , γ ∈ H ∗ such that x = σ 2 k 1 γ h m h s c + , y = δ 2 k 2 γ h m h s c + , and k 1 γ h m h s c + > k 2 γ h m h s c + . Also, since x > y , we have m = n 6 = 0 (as a conven tion, all hedges app ear ing b efore h 0 = I in a representation o f a v alue hav e no e ffect). There are t wo cases: either h m h s c + > h s c + or h m h s c + < h s c + . W e prov e the case h m h s c + > h s c + , and the other can b e pr ov ed similarly . Since h m h s c + > h s c + , by Prop ositio n 2, Sign ( h m h s c + ) = +1. There are tw o cases: (3.2.2.1) h m h s − r c + < h s − r c + . By (b ), in an y case, h − r ( x ) = h − r ( y ). (3.2.2.2) h m h s − r c + > h s − r c + . By (a), h − r ( x ) = σ 2 k 1 γ h m h s − r c + and h − r ( y ) = δ 2 k 2 γ h m h s − r c + . Since h m h s − r c + > h s − r c + , S ign ( h m h s − r c + ) = +1 = Sign ( h m h s c + ). By Definition 3, Sign ( k 1 γ h m h s − r c + ) = Sign ( k 1 γ h m h s c + ) and Sign ( k 2 γ h m h s − r c + ) = Sign ( k 2 γ h m h s c + ). Since k 1 γ h m h s c + > k 2 γ h m h s c + , there are thre e cases: (3.2.2.2.1 ) k 1 γ h m h s c + > k 2 γ h m h s c + ≥ γ h m h s c + . Thus, by definition, k 1 > k 2 . Moreov er, by Pro po sition 2, Sign ( k 1 γ h m h s c + ) = +1 and Sign ( k 2 γ h m h s c + ) ∈ { 0 , +1 } . Th us, Sign ( k 1 γ h m h s − r c + ) = + 1, i.e., k 1 γ h m h s − r c + > γ h m h s − r c + . Since k 1 > k 2 , k 1 γ h m h s − r c + ≥ k 2 γ h m h s − r c + ≥ γ h m h s − r c + ; th us , h − r ( x ) ≥ h − r ( y ). (3.2.2.2.2 ) γ h m h s c + ≥ k 1 γ h m h s c + > k 2 γ h m h s c + . The proo f is simila r to that o f (3.2.2.2.1 ). (3.2.2.2.3 ) k 1 γ h m h s c + ≥ γ h m h s c + ≥ k 2 γ h m h s c + . B y Pro po sition 2, Sign ( k 1 γ h m h s c + ) = Sign ( k 1 γ h m h s − r c + ) ∈ { 0 , +1 } and Sign ( k 2 γ h m h s c + ) = Sign ( k 2 γ h m h s − r c + ) ∈ { 0 , − 1 } . Thus, k 1 γ h m h s − r c + ≥ γ h m h s − r c + and k 2 γ h m h s − r c + ≤ γ h m h s − r c + . Since k 1 γ h m h s c + > k 2 γ h m h s c + , o ne of Sign ( k 1 γ h m h s − r c + ) and Sign ( k 2 γ h m h s − r c + ) m ust differ fr om 0; thus k 1 γ h m h s − r c + > k 2 γ h m h s − r c + . Therefor e, h − r ( x ) > h − r ( y ). Second, consider the case x , y ∈ H ( c − ). In any cas e, h − r ( x ) = − h − z ( − x ) and h − r ( y ) = − h − z ( − y ), for so me z . Since x , y ∈ H ( c − ), we ha ve − x , − y ∈ H ( c + ). By the above ca se, x > y ⇒ − x < − y ⇒ h − z ( − x ) ≤ h − z ( − y ) ⇒ h − r ( x ) ≥ h − r ( y ). Finally , if x ∈ H ( c + ) ∪ { W , 1 } and y ∈ H ( c − ) ∪ { 0 , W } , then h − ( x ) ≥ W ≥ h − ( y ); and if x = 1, then h − ( x ) ≥ h − ( y ). 12 V. H. L e, F. Liu and D. K . T ra n 3.4 Li mite d he dge al gebr as In the presen t w o rk, w e only deal wit h finite linguistic truth domains. The rationale for this is as follows. First, in daily life, humans only use linguistic ter ms with a limited length. This is due to the fact that it is difficult to dis tinguish the different meaning of terms with man y he dges suc h as V ery Little Probably T rue and More Little Probably T rue . Hence, we can ass ume that a pplying any hedge to truth v alues that have a certain nu mber l of hedges will not change their meaning. In other w o rds, canonical representations of all terms w.r.t. pr imary terms ha ve a length of at most l + 1. Second, according to Zadeh (1975b), in most a pplications to approximate rea - soning, a small finite set o f fu zzy truth v alue s w ould, in general, b e sufficient since each fuzzy truth v alue repres ent s a fuzzy set rather than a single element of [0,1]. Third, more imp ortantly , it is rea sonable for us to consider only finitely man y truth v alues in orde r to pr ovide a lo gical system that can b e implemented fo r computers. In fact, we la ter show that with a finite truth domain, we can obtain the Least Herbrand mo del for a finite pr ogram after a finite num b er of iteratio ns of an immediate conseque nces opera tor. Definition 7 ( l-limite d HA ) An l- limited HA, where l is a positive integer, is a lin-HA in whic h c anonical representations of all terms w.r.t. pr imary terms ha ve a length of at most l + 1. F or an l -limited HA X = ( X , G , H , ≤ ), s ince the set of hedges H is finite, so is the linguistic truth domain X . In the following, we giv e a pa rticular example of in verse mapping s of hedges for a 2-limited HA. Example 4 Consider a 2-limited HA X = ( X , { c + , c − } , { V , M , P , L } , ≤ ) with L < e P < e I < e M < e V . W e hav e a linguistic truth domain X = { v 0 = 0 , v 1 = V Vc − , v 2 = MVc − , v 3 = Vc − , v 4 = PVc − , v 5 = L V c − , v 6 = VMc − , v 7 = MMc − , v 8 = Mc − , v 9 = PMc − , v 10 = LMc − , v 11 = c − , v 12 = VPc − , v 13 = MPc − , v 14 = Pc − , v 15 = PPc − , v 16 = LPc − , v 17 = LL c − , v 18 = PL c − , v 19 = L c − , v 20 = ML c − , v 21 = VL c − , v 22 = W , v 23 = VL c + , v 24 = ML c + , v 25 = L c + , v 26 = PL c + , v 27 = LL c + , v 28 = LPc + , v 29 = PPc + , v 30 = Pc + , v 31 = MPc + , v 32 = VPc + , v 33 = c + , v 34 = LMc + , v 35 = PMc + , v 36 = Mc + , v 37 = MMc + , v 38 = VMc + , v 39 = L Vc + , v 40 = PVc + , v 41 = Vc + , v 42 = MVc + , v 43 = VVc + , v 44 = 1 } . Based on the inv er se mappings defined in Ex ample 3, we can build the inv erse mappings for this 2-limited HA with some mo difications . Since we a re w orking with the 2-limited HA, if h − ( x ) = W , fo r x ∈ H ( c + ), we ca n put h − ( x ) = VL c + , the minimum v a lue of H ( c + ); if h − ( x ) = 1, for x ∈ H ( c + ), we can put h − ( x ) = VVc + , the maximum v alue of H ( c + ); if h − ( x ) = W , fo r x ∈ H ( c − ), we can put h − ( x ) = VL c − , the maximum v alue of H ( c − ); and if h − ( x ) = 0 , for x ∈ H ( c − ), we can put h − ( x ) = VV c − , the minim um v alue o f H ( c − ). Changes ar e also made to the inv erse mappings of hedg es with a v a lue in { c − , c + } . This means that in verse mappings of hedges a re not unique. This is acceptable since reasoning based o n fuzzy F u zzy Linguistic L o gic Pr o gr amming 13 T able 1. Inv er se ma ppings of hedges V − M − P − L − 0 0 0 0 0 kVc − VVc − VVc − kMc − c − a kMc − VVc − kVc − c − kPc − a c − Vc − Mc − Pc − L c − VPc − VMc − PMc − LL c − VL c − MPc − MMc − LMc − PL c − VL c − Pc − Mc − c − L c − VL c − PPc − PMc − VPc − ML c − VL c − LPc − LMc − VPc − VL c − VL c − LL c − LMc − VPc − VL c − VL c − PL c − LMc − MPc − VL c − VL c − L c − c − Pc − VL c − VL c − ML c − VPc − PPc − VL c − VL c − VL c − PPc − LPc − VL c − VL c − W W W W W VL c + VL c + VL c + LPc + PPc + ML c + VL c + VL c + PPc + VPc + L c + VL c + VL c + Pc + c + PL c + VL c + VL c + MPc + LMc + LL c + VL c + VL c + VPc + LMc + LPc + VL c + VL c + VPc + LMc + PPc + VL c + ML c + VPc + PMc + Pc + VL c + L c + c + Mc + MPc + VL c + PL c + LMc + MMc + VPc + VL c + LL c + PMc + VMc + c + L c + Pc + Mc + Vc + kMc + kPc + c + kVc + VVc + a kVc + c + kMc + VVc + VVc + a 1 1 1 1 1 a k is any of the hedge s, including the iden tity I . logic is approximate, and in verse mappings of hedges should b e built ac cording to applications. Inv ers e mappings of hedges for the 2-limited HA are sho wn in T able 1, in whic h the v alue of an inv ers e mapping of a hedge h − , app earing in the first row, of a v alue x , app earing in the first column, is in the co rresp onding c ell. F or exa mple, M − ( PPc + ) = ML c + . Note that the v alues of x app ear in an ascending o rder. 3.5 Many -value d mo dus p onens Our logic is truth-functional, i.e., the truth v a lue of a compo und f ormula, built from its comp onents us ing a logical connective, is a function, which is c alled the truth function of the connective, of the truth v alues of the components. Our procedura l seman tics is developed based on ma ny-v a lued mo dus p onens. In 14 V. H. L e, F. Liu and D. K . T ra n order to guarantee the soundness of man y-v alued mo dus p onens, the truth function of an implication, called a n implicator , must be residual to the t-norm , a commuta- tive and asso cia tive binary oper ation o n the truth do main, ev a luating many-v alued mo dus p onens (H´ a jek 1998). The many-v a lued mo dus p onens s ynt actically lo ok s like: ( B , b ) , ( A ← B , r ) ( A , C ( b , r )) Its so undness semantically states that whenever f is an interpretation s uch that f ( B ) ≥ b , i.e., f is a mo del of ( B , b ), and f ( A ← B ) = ← • ( f ( A ) , f ( B )) ≥ r , i.e., f is a mo del of ( A ← B , r ), then f ( A ) ≥ C ( b , r ), where ← • is an implicator, and C is a t-norm. This means the truth v alue of A under any mo del o f ( B , b ) and ( A ← B , r ) is at least C ( b , r ). Mo re precisely , let r b e a low er bound to the truth v alue of the implication h ← b , let C b e a t-norm, and let ← • be its residual implicato r; we hav e: C ( b , r ) ≤ h iff r ≤ ← • ( h , b ) (4) According to H´ ajek (19 98), from ( 4), we hav e: ( ∀ b )( ∀ h ) C ( b , ← • ( h , b )) ≤ h (5) ( ∀ b )( ∀ r ) ← • ( C ( b , r ) , b ) ≥ r (6) Note that t-norms are not necessary to b e a truth function of any co njunction in our language. Recall that in many-v alued logics, there ar e sev eral prominent sets of connectives called Luk asiewicz, G¨ o del, and pro duct logic ones. Each of the sets has a pair of residual t-nor m and implica tor. Since our truth v alues a re linguistic, we cannot use the pro duct lo gic connectives. Given a ling uistic tr uth do main X , since all the v alues in X are linearly or dered, we assume that they ar e v 0 ≤ v 1 ≤ · · · ≤ v n , where v 0 = 0 and v n = 1. The Luk asiewicz t-norm and implicator c an be defined on X as follows: C L ( v i , v j ) =  v i + j − n if i + j − n > 0 v 0 otherwise ← • L ( v j , v i ) =  v n if i ≤ j v n + j − i otherwise and those o f G¨ odel can b e: C G ( v i , v j ) = min ( v i , v j ) ← • G ( v j , v i ) =  v n if i ≤ j v j otherwise Clearly , each of the implicator s is the re siduum of the corr esp onding t-norm. It can also b e seen that t-norms are mo notone in all a rguments, and implicators ar e non-decreas ing in the first argumen t and non-incr easing in the seco nd. F u zzy Linguistic L o gic Pr o gr amming 15 4 F uzzy li nguistic logic programmi ng 4.1 L angu age Like V o jt´ a ˇ s (2 001), our la nguage is a man y sorted (typed) predicate language. Le t A denote the set of all a ttributes. F or each sort of v aria bles A ∈ A , there is a set C A of c onstant s ymbols, which a re names o f elements of the domain of A . In order to a chiev e the Least Herbra nd mo del after a finite num ber of iter ations o f an immediate c onsequences op er ator, we do not allow any function symbo ls. This is not a severe res triction since in m any database applications, there are no f unction symbols in volved. Connectives c an b e: conjunctions ∧ (also ca lled G¨ odel) a nd ∧ L ( Luk as iewicz); the disjunction ∨ ; implications ← L ( L uk asiewicz) and ← G (G¨ odel); a nd linguistic hedges as unary co nnectives. F or a ny co nnective c different from hedges, its truth function is denoted by c • , a nd for a hedge connective h , its truth function is its inv ers e mapping h − . The o nly quan tifier allo w ed is the universal qua n tifier ∀ . A term is either a constant o r a v ariable. An atom or atomic formula is o f the form p ( t 1 , · · · , t n ), where p is an n-ar y predicate sym b ol, and t 1 , · · · , t n are terms of cor resp onding attributes A 1 , · · · , A n . A b o dy formula is defined inductively as follows: ( i ) An atom is a b o dy fo r- m ula. ( ii ) If B 1 and B 2 are bo dy formulae, then so are ∧ ( B 1 , B 2 ), ∨ ( B 1 , B 2 ), and hB 1 , where h is a hedge. Here, we use the prefix nota tion for connectives in b o dy formulae. A rule is a graded implica tion ( A ← B · r ), where A is an atom called r ule hea d , B is a b o dy formula called rule bo dy , a nd r is a truth v alue different from 0. ( A ← B ) is called the logica l part of th e rule. A fact is a gra ded a tom ( A · b ), where A is a n ato m ca lled the logical part o f the fact, and b is a truth v a lue differen t from 0. Definition 8 ( F uzzy lingu ist ic lo gic pr o gr am ) A fuzzy linguistic logic prog ram (progr am, for short) is a finite set of rules a nd f acts, where truth v alue s are f rom the linguistic truth do main of an l -limited H A, hedges used in bo dy formulae (if any) b elong to the set of hedges o f the HA, and there are no t wo rules (facts) having the same logical part, but differe n t truth v a lues. W e follo w P rolog con vent ions wher e predicate symbols and c onstants b eg in with a low er -case letter, and v ariables beg in with a capital letter. Example 5 Assume we use the truth domain from the 2 -limited HA in Ex ample 4, that is, X = ( X , { F alse , T ru e } , { V , M , P , L } , ≤ ), and w e hav e the follo wing kno wledge ba se: ( i ) The sentence “ If a studen t studies v er y ha rd, and his/her university is prob- ably high-ranking, then he/ she will be a goo d employ ee ” is V ery More T rue . ( ii ) The sentence “ The university where Ann is studying is high-r anking ” is V ery T rue . ( iii ) The sen tence “ Ann is studying hard ” is Mo r e T rue . Let gd em, st hd, hira un , and T stand for “ g o o d employee ”, “ study har d ”, 16 V. H. L e, F. Liu and D. K . T ra n “ high-ra nking university ”, a nd “ T rue ”, resp ectively . Then, t he knowledge base can be repr esented by th e following pro gram: ( gd em ( X ) ← G ∧ ( V st hd ( X ) , P hir a u n ( X )) · VMT ) ( hir a un ( ann ) · VT ) ( st hd ( ann ) · MT ) Note that the predicates st hd ( X ) and hir a un ( X ) in the only rule are mo dified b y the hedges V a nd P , resp ectively . W e assume a s usual that the under lying language of a progra m P is defined b y constants (if no such c onstant exists, we add some constant such a s a to for m ground terms) a nd predicate symbols app ea ring in P . With this understanding, we can no w refer to the Herbr and u niverse of sort A , whic h consists of all ground terms of A , by U A P , and to the Herbr and b ase of P , which consists of a ll ground a toms, by B P (Lloyd 198 7). A program P can be represented as a partial mapping: P : F ormulae → X \ { 0 } where the domain of P , denoted by dom ( P ), is finite and co nsists only of logica l parts of rules a nd facts, and X is a linguistic truth doma in. The truth v alue of a rule ( A ← B · r ) is r = P ( A ← B ), and that of a fact ( A · b ) is b = P ( A ). Since in our logical system w e only wan t to obtain the computed answers for queries, we do not lo ok for 1-tauto logies to extend the capa bilities of the sys tem although we can have some due to the fact that our co nnectives are classica l man y- v alued ones (see H´ ajek (1998)). 4.2 De clar ati ve semantics Since we are working with logic pro grams without neg ation, it is rea sonable to co n- sider only fuzzy Herbrand in ter pretations and models. Given a program P , let X b e the linguistic truth domain; a fuzzy linguistic Herbrand interpretation (in ter preta- tion, for sho rt) f is a mapping f : B P → X . The ordering ≤ in X can be extended to the set of in terpretations a s follows. W e say f 1 ⊑ f 2 iff f 1 ( A ) ≤ f 2 ( A ) for a ll ground atoms A . Clear ly , the set of a ll interpretations of a progr am is a complete lattice under ⊑ . The least interpretation c alled the bottom in ter pr etation , deno ted by ⊥ , maps ev er y ground ato m to 0 . An interpretation f can b e extended to all gro und for mulae, denoted by f , using the unique homomorphic extensio n a s follows: ( i ) f ( A ) = f ( A ), if A is a gr ound atom; ( ii ) f ( c ( B 1 , B 2 )) = c • ( f ( B 1 ) , f ( B 2 )), where B 1 , B 2 are ground formulae, a nd c is a binary co nnective; ( iii ) f ( hB ) = h − ( f ( B )), where B is a ground b o dy form ula, and h is a hedge. F or non-gr ound for mu lae, since all the formulae in the la nguage are considered universally quantified, the interpretation f is defined as f ( ϕ ) = f ( ∀ ϕ ) = inf ϑ { f ( ϕϑ ) | ϕϑ is a ground instance of ϕ } F u zzy Linguistic L o gic Pr o gr amming 17 where ∀ ϕ means universal quan tificatio n of all v ariables with free occurrence in ϕ . An interpretation f is a mo del of a pr ogram P if for all formulae ϕ ∈ dom ( P ), we ha ve f ( ϕ ) ≥ P ( ϕ ). Ther efore, P ( ϕ ) is understoo d as a low er b ound to the tr uth v alue of ϕ . A query is an atom used as a question ? A pro mpting the sy stem. Definition 9 ( Corr e ct answer ) Given a pro gram P , let X b e the linguistic truth do main. A pair ( x ; θ ), wher e x ∈ X , and θ is a substitution, is called a correct answer for P and a q uery ? A if for an y mo del f of P , w e hav e f ( A θ ) ≥ x . 4.3 Pr o c e dur al semantics Given a progr am P a nd a que ry ? A , w e want to c ompute a low er b ound for the truth v alue of A under a ny model of P . Recall that in the theory of many-v alued mo dus p onens (H´ ajek 199 8), given ( A ← B · r ) and ( B · b ), we hav e ( A · C ( b , r )). As in V o jt´ a ˇ s (200 1), our pro cedur al seman tics utilises admiss ible rules . Admissible rules act on tuples o f w ords in the alphab et, denoted by L e P , which is the disjoin t union of the a lphab et of the language of dom ( P ) augmented by the truth functions of the co nnectives (except ← i and ← • i ) and symbo ls C i , a nd the linguistic truth domain. Definition 10 ( A dmissible ru les ) Admissible rules are defined as follows: Rule 1. F rom (( XA m Y ); ϑ ) infer (( X C ( B , r ) Y ) θ ; ϑθ ) if 1. A m is an atom (called the sele cte d atom ) 2. θ is an mgu of A m and A 3. ( A ← B · r ) is a r ule in the prog ram. Rule 2. F rom ( XA m Y ) infer ( X 0 Y ). This rule is usually used fo r situatio ns where A m do es not unify with any r ule head or logica l par t of fac ts in the prog ram. Rule 3 . F rom ( XhBY ) infer ( Xh − ( B ) Y ) if B is a non-empty b o dy formula, and h is a hedge. Rule 4. F rom (( XA m Y ); ϑ ) infer (( XrY ) θ ; ϑθ ) if 1. A m is an atom (also called the selected atom) 2. θ is an mgu of A m and A 3. ( A · r ) is a fact in the program. Rule 5. If there are no mo re predicate symbols in the word, replace all connectives ∧ ’s, and ∨ ’s with ∧ • , and ∨ • , r esp ectively . Then, since this word contains only some additiona l C ’s, h − ’s, a nd truth v alues, ev aluate it. The substitution remains unch anged. Note that o ur rules except Rule 3 are the sa me as thos e in V o jt´ a ˇ s (20 01). 18 V. H. L e, F. Liu and D. K . T ra n Definition 11 ( Compute d answer ) Let P b e a prog ram and ? A a query . A pair ( r ; θ ), where r is a truth v alue, and θ is a substitution, is said to be a computed answ er fo r P and ? A if ther e is a sequence G 0 , · · · , G n such that 1. every G i is a pair co nsisting of a word in L e P and a substitution 2. G 0 = ( A ; id ) 3. every G i +1 is inferred from G i by one of the admissible rules (here we also utilise the usual P rolog renaming o f v ariables along der iv ation) 4. G n = ( r ; θ ′ ) and θ = θ ′ restricted to v ar iables of A , and w e say that the c omputation has a length of n . Let us g ive an example of a computatio n. Example 6 W e take the prog ram in E xample 5, that is: ( gd em ( X ) ← G ∧ ( Vst hd ( X ) , Phir a u n ( X )) · VMT ) ( hir a un ( ann ) · VT ) ( st hd ( ann ) · MT ) Given a query ? gd em ( ann ), we can hav e the following co mputation (since the query is ground, the substitution in the computed answer is the identit y): ? gd em ( ann ) C G ( ∧ ( V st hd ( ann ) , P hir a un ( ann )) , VMT ) C G ( ∧ ( V − ( st hd ( ann )) , P hir a un ( ann )) , VMT ) C G ( ∧ ( V − ( st hd ( ann )) , P − ( hir a un ( ann ))) , V MT ) C G ( ∧ ( V − ( MT ) , P − ( hir a un ( ann ))) , VMT ) C G ( ∧ ( V − ( MT ) , P − ( VT )) , VMT ) C G ( ∧ • ( V − ( MT ) , P − ( VT )) , VMT ) Using the inv er se mappings of hedg es in T able 1, we hav e C G ( ∧ • ( V − ( MT ) , P − ( VT )), VMT ) = C G ( min ( PT , VVT ) , VMT ) = C G ( PT , VMT ) = PT . Hence, the sentence “ Ann will be a go o d emplo yee ” is at lea st Pro bably T r ue . This result is r easonable as follows: one of the conditions cons tituting the result is the one saying that “ The student studies very hard ”; since “ Ann is studying hard ” is MT ( More T rue ), the truth v alue of “ Ann is s tudying very hard ” is V − ( MT ); and since MT < VT , we hav e V − ( MT ) < V − ( VT ) = T , and V − ( MT ) = PT is acceptable. If w e use the Luk asiewicz implication instead of t he G¨ odel implication in the rule, then in the co mputation, the G¨ o del t-norm will be replaced by the Luk as iewicz t- norm, and, fina lly , we hav e a n answ er ( gd em ( ann ) · ML T ). F rom the definition of the pro cedural seman tics, w e can see tha t in order to increase the c ha nces of fi nding a goo d computed answ er which has a better truth v alue along a computation, we should do the following: ( i ) If there is more than one r ule or fact whos e rule heads o r logical pa rts can F u zzy Linguistic L o gic Pr o gr amming 19 be unifiable with the selected atom, a nd of such rules or fac ts there is only one to which the highest truth v alue is assigned, t hen w e c ho o se it fo r the next step. ( ii ) If there is o ne fact a mong such rules or facts which are as so ciated with the highest truth v alue, then we c ho ose the fact fo r the next step since the t-norm ev aluating such a rule alw ays yields a low er tr uth v alue than that of the fact. ( iii ) If there is mor e than one such a rule, but no facts, which ha ve the hig hest truth v alue, then we choose the one with the G¨ odel implication for the next step since in this case, the G¨ odel t-norm usually , but not a lwa ys (since it also dep ends on the b o dies of the r ules), yields a b etter truth v alue than the Luk asiewicz t-no rm. In Example 6, it has b een shown that with the same bo dy formula, the rule with the G¨ odel implication yields a b etter re sult ( PT ) than the rule with the Luk asiewicz implication ( ML T ). 4.4 Sou ndness of the pr o c e dur al semantics The or em 1 Every computed answer for a pro gram P and a quer y ? A is a correct a nswer for P and ? A . Pr o of Assume that a pair ( r ; θ ) is a co mputed answ er f or P a nd ? A . Let f b e any mo del of P ; w e will pro v e that f ( A θ ) ≥ r . The proof is b y induction o n length n of computations. First, suppose that n = 1. Hence, either Rule 2 or Rule 4 has b een applied. The case of Rule 2 is obvious since r = 0. The case of Rule 4 implies that P has a fact ( C · r ) such that A θ = C θ . Therefore, f ( A θ ) = f ( C θ ) ≥ f ( C ) ≥ P ( C ) = r . Next, supp ose that the result holds for computed answers coming from computa- tions of le ngth ≤ k − 1, where k > 1. W e prove that it also holds for a computation of length k . Assume that the sequence of the substitutions in the computation is θ 1 , · · · , θ k (some of them are the identit y), where θ = θ 1 · · · θ k restricted to v ar iables of A . Since the length o f the computation k > 1, the first admissible rule to b e a pplied is Rule 1 . This means there ex ists a rule ( C ← i B · c ) in P such that A θ 1 = C θ 1 . F or each atom D in the rule b o dy B θ 1 , there exists a computation o f le ngth ≤ k − 1 for it. Suppo se d is the computed truth v alue for D in that computatio n; by the induction hypo thesis, we hav e d ≤ f ( D θ 2 · · · θ k ). F urthermore, s ince the truth functions of the conjunctions, the disjunction, and inv erse mappings of hedges are non-decreas ing in all their arguments, if b is the computed truth v alue for the whole r ule b o dy B θ 1 , whic h is calc ulated from all the d for eac h a tom D using the truth functions o f the connectives, then b ≤ f ( B θ 1 θ 2 · · · θ k ). Therefor e, we hav e : r = C i ( b , c ) ≤ C i ( f ( B θ 1 · · · θ k ) , c ) ≤ ( ∗ ) C i ( f ( B θ 1 · · · θ k ) , f ( C θ 1 · · · θ k ← i B θ 1 · · · θ k )) = C i ( f ( B θ 1 · · · θ k ) , ← • i ( f ( C θ 1 · · · θ k ) , f ( B θ 1 · · · θ k ))) ≤ ( ∗∗ ) f ( C θ 1 · · · θ k ) = f ( A θ 1 · · · θ k ) = f ( A θ ), where (*) holds since f is a mo del of P , and (**) follows from (5). 20 V. H. L e, F. Liu and D. K . T ra n 4.5 Fix p oint semantics Similar to Kr a jˇ ci et al. (2004), the immediate cons equences op er ator, intro duced by v an Emden and Kowalski, can be generalised to the case of fuzzy linguis tic logic progra mming as follows. Definition 12 ( Imme diate c onse quenc es op er ator ) Let P b e a progr am. The op erato r T P mapping from interpretations to interpre- tations is defined as follows. F or every interpretation f and every ground atom A ∈ B P , T P ( f )( A ) = max { sup {C i ( f ( B ) , r ) : ( A ← i B · r ) is a ground instance o f a rule in P } , sup { b : ( A · b ) is a ground instance of a fact in P }} . Since P is function-free, eac h Herbra nd universe U A P of a so rt A is finite, and so is its Herbra nd base B P . Hence, for ea ch A ∈ B P , there are a finite num ber o f gro und instances o f rule heads and logical parts o f facts which match A . Therefore, the suprema in the definition of T P are in fac t maxima. Similar to Medina et al. (2004), w e hav e the following res ults. The or em 2 The operato r T P is monotone. Pr o of Let f 1 and f 2 be tw o interpretations such that f 1 ⊑ f 2 ; we prov e tha t T P ( f 1 ) ⊑ T P ( f 2 ). First, let us pro ve f 1 ( B ) ≤ f 2 ( B ) for a ll gro und bo dy form ula e B by induction on the structure of the form ula e. In the base cas e wher e B is a gr ound a tom, w e hav e f 1 ( B ) = f 1 ( B ) ≤ f 2 ( B ) = f 2 ( B ). F or the inductive c ase, cons ider a gr ound bo dy formula B . By case analysis and the induction h y po thesis, we hav e B = ∧ ( B 1 , B 2 ), or B = ∨ ( B 1 , B 2 ), or B = hB 1 such that f 1 ( B 1 ) ≤ f 2 ( B 1 ) and f 1 ( B 2 ) ≤ f 2 ( B 2 ). By definition, we hav e f 1 ( B ) = ∧ • ( f 1 ( B 1 ) , f 1 ( B 2 )) ≤ ∧ • ( f 2 ( B 1 ) , f 2 ( B 2 )) = f 2 ( B ), or f 1 ( B ) = ∨ • ( f 1 ( B 1 ) , f 1 ( B 2 )) ≤ ∨ • ( f 2 ( B 1 ) , f 2 ( B 2 )) = f 2 ( B ), or f 1 ( B ) = h − ( f 1 ( B 1 )) ≤ h − ( f 2 ( B 1 )) = f 2 ( B ), resp ectively . Thus, f 1 ( B ) ≤ f 2 ( B ) for all gr ound bo dy formulae B . Now, let A be a ny ground atom. If A do es not unify with a ny rule head or log ical part of facts in P , then T P ( f 1 )( A ) = T P ( f 2 )( A ) = 0 . Otherwise, since the v alue of the second sup in Definition 1 2 do es not dep end on the interpretations, what we need to cons ider now is the first sup . F o r any ground instance ( A ← i B · r ) of a rule in P , since B is ground, we have C i ( f 1 ( B ) , r ) ≤ C i ( f 2 ( B ) , r ). By taking s uprema for all gro und instances ( A ← i B · r ) o n b oth sides , w e hav e su p {C i ( f 1 ( B ) , r ) } ≤ sup {C i ( f 2 ( B ) , r ) } . There fore, T P ( f 1 )( A ) ≤ T P ( f 2 )( A ) for all g round atoms A . The or em 3 The operato r T P is contin uous. F u zzy Linguistic L o gic Pr o gr amming 21 Pr o of Recall that a mapping f : L → L , where L is a complete la ttice, is said to b e contin uous if for ev ery dir ected subset X of L , f ( sup ( X )) = sup { f ( x ) | x ∈ X } . Let us prov e that for each directed set X o f interpretations, T P ( sup ( X )) = sup { T P ( f ) | f ∈ X } . Since T P is monotone, we hav e su p { T P ( f ) | f ∈ X } ⊑ T P ( sup ( X )). On the other hand, since the Herbra nd base B P and the tr uth domain a re finite, the se t of all Herbrand in terpretations of P is finite. Therefore, for each finite dir ected s et X of in terpretations, we have an upper b ound of X in X . This, tog ether with the monotonicity of T P , leads to T P ( sup ( X )) ⊑ sup { T P ( f ) : f ∈ X } . The or em 4 An in ter pretation f is a model of a pro gram P iff T P ( f ) ⊑ f . Pr o of First, assume t hat f is a model of P ; we prov e that T P ( f ) ⊑ f . Let A b e any ground atom. Consider the follo wing cases: ( i ) If A is neither a ground instance o f a logical pa rt o f f acts nor a ground instance of a rule head in P , then T P ( f )( A ) = 0 ≤ f ( A ). ( ii ) F or each ground instance ( A · b ) o f a fa ct, say ( C · b ), in P , s ince f is a mo del of P , a nd A is a ground instance of C , we ha ve b = P ( C ) ≤ f ( C ) ≤ f ( A ). Hence, f ( A ) ≥ sup { b | ( A · b ) is a g round instance of a fact in P } . ( iii ) F or each ground instance ( A ← i B · r ) of a rule, say ( C · r ), in P , we hav e: C i ( f ( B ) , r ) = C i ( f ( B ) , P ( C )) ≤ ( ∗ ) C i ( f ( B ) , f ( A ← i B )) = C i ( f ( B ) , ← • i ( f ( A ) , f ( B ))) ≤ ( ∗∗ ) f ( A ), where (*) holds since ( A ← i B ) is a ground instance of C , and (**) follows fro m (5). Therefore, f ( A ) ≥ sup {C i ( f ( B ) , r ) | ( A ← i B · r ) is a ground instance of a rule in P } . Thu s, b y definition, T P ( f )( A ) ≤ f ( A ) for all A ∈ B P . Finally , let us sho w that if T P ( f ) ⊑ f , then f is a mo del of P . Let C b e an y for mula in dom ( P ). There are t w o cases: ( i ) ( C · c ), where c is a tr uth v alue, is a fact in P . F or each ground insta nce A of C , by h yp othesis and definition, we hav e f ( A ) ≥ T P ( f )( A ) ≥ sup { b | ( A · b ) is a ground instance o f a fact in P } ≥ c = P ( C ). Therefore , f ( C ) = inf { f ( A ) | A is a ground instance of C } ≥ P ( C ). ( ii ) ( C · c ) is a r ule in P . F or eac h gro und ins tance A ← j D of C , b y h yp o thesis and definition, we have f ( A ) ≥ T P ( f )( A ) ≥ sup {C i ( f ( B ) , r ) | ( A ← i B · r ) is a g round instance of a rule in P } ≥ C j ( f ( D ) , c ) = C j ( f ( D ) , P ( C )). Hence, f ( A ← j D ) = ← • j ( f ( A ) , f ( D )) ≥ ( ∗ ) ← • j ( C j ( f ( D ) , P ( C )) , f ( D )) ≥ ( ∗∗ ) P ( C ), where (*) holds s ince ← • i is non-decreas ing in the first ar gument, and (**) follows from (6). Co nsequently , f ( C ) = inf { f ( A ← j D ) | ( A ← j D ) is a ground insta nce of C } ≥ P ( C ). Since the given immediate consequence s o pe rator T P satisfies Theorem 3 and Theorem 4, a nd the set o f Herbrand interpretations of the prog ram P is a co mplete lattice under the re lation ⊑ , due to K naster and T a rski (T ar ski 1955), the Least Herbrand mo del of the pr ogram P is exa ctly the least fixp oint o f T P and can b e 22 V. H. L e, F. Liu and D. K . T ra n obtained b y iterating T P from the botto m in terpretation ⊥ after ω iteratio ns, wher e ω is the smallest limit ordinal (apar t from 0). F urther more, s ince the tr uth domain X a nd the Her brand ba se B P are finite, the le ast mo del of P can b e obtained a fter at mos t O ( | P || X | ) steps, where | A | denotes the ca rdinality of the set A . This is an impo rtant too l fo r dealing with re cursive progr ams, for which computations can be infinite. 4.6 Completeness of the pr o c e dur al semantics The following theor em shows that T n P ( ⊥ ) in fa ct builds c omputed answers for ground atoms. The or em 5 Let P b e a pr ogram and A a gr ound a tom. F or all n , there exists a computation for P and the query ? A suc h that the computed a nswer is ( T n P ( ⊥ )( A ); id ). Pr o of Note that since A is ground, the substitutions in all computed answ ers are alw ays the iden tit y . W e prov e the result b y induction o n n . Suppo se fir st tha t n = 0. Since T 0 P ( ⊥ )( A ) = 0, there is a co mputation for P and ? A in which only Rule 2 is applied with the computed answer (0; id ). Now supp os e that the result holds for n − 1, where n ≥ 1; w e prov e that it also holds for n . There are t wo cases: ( i ) A do es no t unify with any rule head or logical part of facts in P . Then, T n P ( ⊥ )( A ) = 0, and the computation is the same as the case n = 0. ( ii ) Otherwise , since the suprema in the definition of T P are in fact maxima , there exists either a ground instance ( A · b ) of a fa ct in P such that T n P ( ⊥ )( A ) = b or a ground instance ( A ← i B · r ) of a rule in P such that T n P ( ⊥ )( A ) = C i ( T n − 1 P ( ⊥ )( B ) , r ). F or the former case, ther e is a computation for P and ? A in which only Rule 1 is applied, and the computed answer is ( b ; id ). F or the la tter, by the induction h ypo thesis, for each gr ound atom B j in B , there exists a co m- putation s uch that T n − 1 P ( ⊥ )( B j ) is the computed truth v alue for B j . Therefore, the computed truth v alue of the w hole b o dy B is T n − 1 P ( ⊥ )( B ), calculated from all T n − 1 P ( ⊥ )( B j ) a long the complexity of B using the truth functions of the co nnec- tives. Clearly , there is a computation fo r P a nd ? A in which the first rule to be applied is Rule 1 carried out on the rule in P which has ( A ← i B · r ) as its ground instance, and the res t is a combination of the computations of each B j in B . It is clear that the computed truth v alue for ? A in this computation is T n P ( ⊥ )( A ). The completeness r esult for the c ase of g round queries is shown as follows. The or em 6 F or every co rrect answ e r ( x ; id ) of a program P and a ground query ? A , there exists a computed answ er ( r ; id ) for P and ? A such that r ≥ x . F u zzy Linguistic L o gic Pr o gr amming 23 Pr o of Since ( x ; id ) is a correct answer of P and ? A , for every mo del f of P , we hav e f ( A ) ≥ x . In particular , let M P be the Least Her brand mo del of P ; M P ( A ) = T w P ( ⊥ )( A ) ≥ x . Recall that T w P ( ⊥ )( A ) = sup { T n P ( ⊥ )( A ) : n < w } . Since w is a finite n um b er, the sup op era tor is in fact a maximum. Hence, ther e exists n < w such that T n P ( ⊥ )( A ) = T w P ( ⊥ )( A ). By Theo rem 5, there exists a co mputation for P and ? A such that the computed answer is ( T n P ( ⊥ )( A ); id ); thus, the theor em is prov ed. The completeness for the case of non-gr ound queries can b e obtained b y employing some extended versions of Mgu lemma and Lifting lemma (Lloyd 1987) as follows. W e define several mor e notions. Consider a computation o f length n for a pro- gram P and a q uery ? A ; we call each G i , i = 0 · · · ( n − 1), in the s equence of the computation an intermediate quer y , and the part of the co mputation from G i to G n an in ter media te computation o f length n − i . Thus, a computation is a s pec ial int ermediate co mputation with i = 0. Similar to Lloyd (1987) , we define an unre- stricted computation (a n unrestric ted intermediate computation ) as a computation (an intermediate computation) in which the substitutions θ i in ea ch step ar e not necessary to be most general unifiers (mgu), but only required to b e unifiers. In the following pro o fs, since it is clea r for which progr am a computed answer is, we may o mit the prog ram a nd state that the computed a nswer is for the (in- termediate) query , or the query has the co mputed answ er. The same conv ention is applied to (unrestricted) (intermediate) computations and correct answers. L emma 1 ( Mgu L emma ) Let P b e a progra m a nd G i an in ter mediate query . Suppose that there is a n unre- stricted in termediate computation for P and G i . Then, there exists an in ter mediate computation for P and G i with the s ame computed truth v alue and length such that, if θ i +1 , · · · , θ n are the unifiers from the unrestricted in termediate computation, and θ ′ i +1 , · · · , θ ′ n are the mgu’s fro m the in termediate computatio n, then ther e exits a substitution γ such that θ i +1 · · · θ n = θ ′ i +1 · · · θ ′ n γ . Pr o of The pr o of is by induction o n the length of the unres tricted int ermediate compu- tation. Supp ose fir st that the length is 1, i.e., n = i + 1. Since if either Rule 2 or Rule 5 is a pplied, the unifier is the ident ity (an mgu), and Rule 1 and Rule 3 can- not b e the la st rule to b e applied in an unrestr icted intermediate computation, the rule to be a pplied here is Rule 4. Since Rule 4 is the las t rule to be applied in the unrestricted int ermediate computatio n, it can b e shown that the unrestricted inter- mediate computation is also an unrestricted computation o f length 1 . This mea ns i = 0. Supp ose that G 0 = ( A m ; id ), wher e A m is an atom. Then, ther e exists a fact ( A · b ) in P s uch that θ 1 is a unifier of A m and A , and b is the computed truth v alue. Assume that θ ′ 1 is an mgu of A m and A . Then, θ 1 = θ ′ 1 γ for some γ . Clearly , there is a computatio n for P a nd ? A m carried out on the same fact ( A · b ) with length 1, the co mputed tr uth v alue b , and the mgu θ ′ 1 . Now supp ose that the result holds for length ≤ k − 1 , where k ≥ 2 ; we prov e 24 V. H. L e, F. Liu and D. K . T ra n that it also holds for length k . Assume that there is an unr estricted intermediate computation for P a nd G i of length k with the sequence of unifiers θ i +1 , · · · , θ n , where n = i + k . Co nsider the tra nsition from G i to G i +1 . Since k ≥ 2, it cannot be an application of Rule 5 and th us is one of the following c ases: ( i ) Either Rule 2 or Rule 3 is applied. Then, θ i +1 = id . B y the induction hypoth- esis, there exists an in ter mediate computation for P and G i +1 of leng th k − 1 with mgu’s θ ′ i +2 , · · · , θ ′ n such tha t θ i +2 · · · θ n = θ ′ i +2 · · · θ ′ n γ for some γ . Th us, there is an in- termediate computation for P and G i of length k w ith mgu’s θ ′ i +1 = id , θ ′ i +2 , · · · , θ ′ n and θ i +1 · · · θ n = θ ′ i +1 · · · θ ′ n γ . ( ii ) E ither Rule 1 or Rule 4 is applied. Hence, θ i +1 is a unifier for the s elected atom A in G i and an atom A ′ , which is either a rule head (if Rule 1 is applied) o r a logical part of a fact (if Rule 4 is applied) in P . T here exis ts an mgu θ ′ i +1 for A and A ′ such that θ i +1 = θ ′ i +1 ϑ for some ϑ . Therefore, if w e use θ ′ i +1 instead of θ i +1 in the transition, w e will obtain an in termediate query G ′ i +1 such that G i +1 = G ′ i +1 ϑ since G i +1 and G ′ i +1 are all obtained from G i by replacing A with the same expression, then applying θ i +1 or θ ′ i +1 , r esp ectively . Now consider the transitio ns from G i +1 to G n − 1 . Since they cannot b e an application of Rule 5 , th ere are t wo possible cases: ( a ) All the transitions use only Rule 2 o r Rule 3. Thus, all the unifiers are the ident ity . If we a pply the s ame rule on the corresp onding a tom (for the ca se of Rule 2) or on the c orresp onding b o dy for mula (for the case o f Rule 3 ) for ea ch t ransition from the int ermediate quer y G ′ i +1 , we will obtain a sequence G ′ i +1 , · · · , G ′ n − 1 , and it can be shown tha t for all i + 1 ≤ l ≤ n − 1, G l = G ′ l ϑ . Since the last transitio n from G n − 1 to G n uses Rule 5, G n − 1 do es not hav e a n y predicate symbols, and neither do es G ′ n − 1 . Thus, they ar e identical. As a result, G i has an intermediate computation G i , G ′ i +1 , · · · , G ′ n − 1 , G n with mgu’s θ ′ i +1 and the identities. ( b ) There exists the smallest m s uch tha t i + 1 ≤ m ≤ n − 2, and th e transition from G m to G m +1 uses either Rule 1 or Rule 4. Hence, all the transitions from G i +1 to G m use only Rule 2 o r Rule 3. As ab ov e, w e can hav e a sequence G ′ i +1 , · · · , G ′ m such that for all i + 1 ≤ l ≤ m , G l = G ′ l ϑ . Now we will prove the result for the case that Rule 1 is applied in the transition from G m to G m +1 , and the case for Rule 4 can be prov ed similarly . The application of Rule 1 in the transition implies that there exists a rule ( A ′′ ← j B · r ) in P such tha t θ m +1 is a unifier o f the selected atom A m in G m and A ′′ . Since we utilise the usual Pr olog renaming o f v a riables along deriv a tion, we can assume tha t ϑ do es not act o n any v ariables of A ′′ or B . Supp ose that A ′ m is the corr esp onding selec ted atom in G ′ m , w e hav e A m = A ′ m ϑ . Therefo re, ϑθ m +1 is a unifier for A ′ m and A ′′ since A ′ m ϑθ m +1 = A m θ m +1 = A ′′ θ m +1 = A ′′ ϑθ m +1 . Now applying Rule 1 to G ′ m on the selected atom A ′ m and the r ule ( A ′′ ← j B · r ) w ith the unifier ϑθ m +1 , we o btain a n intermediate query G ′ m +1 . Since ( C j ( B , r )) θ m +1 = ( C j ( B , r )) ϑθ m +1 and G m = G ′ m ϑ , we hav e G ′ m +1 = G m +1 . Thus, G i has a n unres tricted intermediate co mputation with the sequence G i , G ′ i +1 , · · · , G ′ m , G m +1 , · · · , G n and the unifiers θ ′ i +1 , θ i +2 , · · · , θ m , ϑθ m +1 , θ m +2 , · · · , θ n . By the induction hypo thesis, G ′ m has a n intermediate computation with the sequence G ′ m , G ′ m +1 , · · · , G ′ n , the mgu’s θ ′ m +1 , · · · , θ ′ n , and the s ame co mputed truth v alue such that ϑθ m +1 θ m +2 · · · θ n = θ ′ m +1 · · · θ ′ n γ for some γ . Since θ i +2 , · · · , θ m are the ident ity , G i has an intermediate computation with the sequence G i , G ′ i +1 , · · F u zzy Linguistic L o gic Pr o gr amming 25 · , G ′ m , G ′ m +1 , · · · , G ′ n and the mgu’s θ ′ i +1 , θ i +2 , · · · , θ m , θ ′ m +1 · ·· , θ ′ n , a nd we ha ve θ i +1 · · · θ m θ m +1 θ m +2 · · · θ n = θ ′ i +1 θ i +2 · · · θ m ϑθ m +1 θ m +2 · · · θ n = θ ′ i +1 θ i +2 · · · θ m θ ′ m +1 · · · θ ′ n γ . L emma 2 ( Lifting L emma ) Let P b e a prog ram, ? A a query , a nd θ a substitution. Supp ose there exists a computation f or P a nd the query ? A θ . Then there exists a computation for P and ? A of the same length and the same computed truth v alue such that, if θ 1 , · · · , θ n are mgu’s fr om the co mputation for P and ? A θ , and θ ′ 1 , · · · , θ ′ n are mgu’s fr om the computation for P and ? A , then there exis ts a substitution γ s uch that θθ 1 · · · θ n = θ ′ 1 · · · θ ′ n γ . Pr o of The pro of is similar to that in Lloyd (1987). Supp ose that the computation for P and ? A θ has a sequence G 0 = ( A θ ; id ) , G 1 , · · · , G n . Consider the admissible rule to be applied in the transition from G 0 to G 1 . W e will pr ov e the result for the case of Rule 1, and it can be pr ov ed similarly for the others . The application of Rule 1 implies that there exists a r ule ( A ′ ← j B · r ) in P such that θ 1 is an mgu o f A θ and A ′ . W e a ssume that θ does no t act on any v ariables of A ′ or B ; thus, θ θ 1 is a unifier for A and A ′ . No w applying Rule 1 to G ′ 0 = ( A ; id ) on the rule ( A ′ ← j B · r ) with the unifier θθ 1 , w e ha ve G ′ 1 = G 1 . Therefore, we obtain an unrestricted computation for P and ? A , which looks like the given computation for P a nd ? A θ , except that the first in termedia te query G ′ 0 is diff erent, and the first unifier is θθ 1 . N ow applying the mgu lemma , w e obtain the result. W e also ha ve a lemma which is an extension of Le mma 8.5 in Lloyd (1987) . L emma 3 Let P b e a prog ram and ? A a query . Supp ose that ( x ; θ ) is a correct answer for P and ? A . Then there exists a computation for P a nd the query ? A θ with a computed answer ( r ; id ) suc h that r ≥ x . Pr o of The pro of is similar t o that in Lloyd (1987) . Supp os e that A θ has v a riables x 1 , · ·· , x n . Let a 1 , · · · , a n be distinct cons tant s not app ear ing in P or A , and let θ 1 be the substitution { x 1 / a 1 , · · · , x n / a n } . Since for a ny mo del f of P , f ( A θ θ 1 ) ≥ f ( A θ ) ≥ x , and A θ θ 1 is gro und, ( x ; id ) is a co rrect answer for P and ? A θθ 1 . By Theorem 6, there exists a co mputation fo r P and ? A θ θ 1 with a computed answer ( r ; id ) suc h that r ≥ x . Since the a i do not appear in P or A , b y replacing a i with x i ( i = 1 , · · · , n ) in this computation, we o btain a computatio n for P and ? A θ w ith the computed answer ( r ; id ). The completeness o f the procedura l sema nt ics is sta ted as follo w s. The or em 7 Let P be a progr am, and ? A a q uery . F o r every cor rect answer ( x ; θ ) for P a nd ? A , there exis ts a co mputed a nswer ( r ; σ ) for P and ? A , and a substitution γ such that r ≥ x and θ = σ γ . 26 V. H. L e, F. Liu and D. K . T ra n Pr o of Since ( x ; θ ) is a cor rect answer for P and ? A , by Lemma 3 , there exis ts a c omputa- tion for P and the quer y ? A θ with a computed answer ( r ; id ) such that r ≥ x . Sup- po se the sequence o f mgu’s in the computation is θ 1 , · · · , θ n . Then A θ θ 1 · · · θ n = A θ . By the lifting lemma, th ere exis ts a c omputation for P and ? A with t he s ame com- puted truth v a lue r a nd mgu’s θ ′ 1 , · · · , θ ′ n such that θ θ 1 · · · θ n = θ ′ 1 · · · θ ′ n γ ′ , for so me substitution γ ′ . Let σ b e θ ′ 1 · · · θ ′ n restricted to the v ariables in A . Then θ = σ γ , where γ is an appropriate r estriction of γ ′ . Clearly , the proo fs o f Mgu and Lifting lemmas her e can b e similarly applied to fuzzy logic progra mming and the fr ameworks of lo gic pr ogra mming developed based on it suc h as multi-adjoin t logic pr ogramming (see , e.g., Medina et al. (2004)). 4.7 Mor e examples Example 7 Assume that we use the tr uth domain from the 2- limited HA in Example 4, that is, X = ( X , { F alse , T rue } , { V , M , P , L } , ≤ ), and ha ve the following kno wle dge base: ( i ) The sentence “ A hotel is co nv enient for a business trip if it is v e ry near to the business lo cation, has a re asonable cost at the time, and is a fine building ” is V ery T rue . ( ii ) The sentence “ A hotel ha s a reaso nable cost if either its dinner cos t or its hotel rate a t the time is reaso nable ” is V ery T rue . ( iii ) The sentence “ Causew ay ho tel is near Midto wn Plaza ” is Little More T r ue . ( iv ) The sentence “ Caus e wa y hotel is a fine building ” is Probably More T rue . ( v ) The sentence “ Ca usewa y ho tel has a reasonable dinner cost in No vem b er ” is V ery More T rue . ( vi ) The sentence “ Causewa y ho tel has a reasonable hotel rate in Nov ember ” is Little Probably T rue . Let cn ht , ne to, r e co , fn bd, r e di, re rt, Bu lo, mt, cw a nd T stand for “ con- venien t ho tel”, “near to” , “rea sonable cost”, “fine building”, “ reaso nable dinner cost”, “reaso nable ho tel rate”, “busines s lo ca tion”, “Midtown P laza”, “Causeway hotel”, and “ T rue”, res pe ctively . Then, the knowledge base can b e repre sented b y the follo wing program: ( cn ht ( Bu lo , Time , H otel ) ← G ∧ ( V ne to ( Bu lo , Hotel ) , r e c o ( Hotel , Time ) , fn b d ( Hotel )) · VT ) ( r e c o ( Hotel , Time ) ← L ∨ ( r e di ( Hotel , Time ) , r e rt ( Hotel , Time )) · VT ) ( ne to ( mt , cw ) · LMT ) ( fn b d ( cw ) · PMT ) ( r e di ( cw , nov ) · VMT ) ( r e rt ( cw , nov ) · LPT ) Note that althoug h the conjunctions and disjunction are binary connectives, they can be easily extended to have a ny arity g reater than 2 . F u zzy Linguistic L o gic Pr o gr amming 27 Given a query ? cn ht ( mt , nov , cw ), w e can hav e the follo wing computation (the substitution in the c omputed answ e r is the identit y): ? cn ht ( mt , nov , cw ) C G ( ∧ ( V ne to ( mt , cw ) , r e c o ( cw , n ov ) , fn b d ( cw )) , VT ) C G ( ∧ ( V − ( ne to ( mt , cw )) , r e c o ( cw , nov ) , fn b d ( cw )) , VT ) C G ( ∧ ( V − ( LMT ) , r e c o ( cw , nov ) , fn b d ( cw )) , VT ) C G ( ∧ ( V − ( LMT ) , r e c o ( cw , nov ) , PMT ) , VT ) C G ( ∧ ( V − ( LMT ) , C L ( ∨ ( r e di ( cw , nov ) , r e rt ( cw , nov )) , VT ) , PMT ) , VT ) C G ( ∧ ( V − ( LMT ) , C L ( ∨ ( VMT , r e rt ( cw , nov )) , VT ) , PMT ) , V T ) C G ( ∧ ( V − ( LMT ) , C L ( ∨ ( VMT , LPT ) , VT ) , PMT ) , VT ) C G ( ∧ • ( V − ( LMT ) , C L ( ∨ • ( VMT , LPT ) , VT ) , PMT ) , VT ) Using the in verse mappings of hedges in T a ble 1 , w e ha ve C G ( ∧ • ( V − ( LMT ) , C L ( ∨ • ( VMT , LPT ) , VT ) , PMT ) , V T ) = C G ( ∧ • ( V − ( LMT ) , C L ( VMT , VT ) , PMT ) , VT ) = C G ( ∧ • ( LPT , PMT , PMT ) , VT ) = C G ( LPT , VT ) = LPT . Th us, the computed an- swer is ( LPT ; id ), and the sentence “ Causeway hotel is c onv enient for a business trip to Midt own Pla za in Nov ember ” is at least Little Probably T rue . Now, if we want to relax the first condition in the sentence ( i ), we ca n replace the phrase “ very near to ” by a phrase “ probably near to ” . Then, similarly , we can hav e a s imilar program and the following computation: ? cn ht ( mt , nov , cw ) C G ( ∧ ( P ne to ( mt , cw ) , r e c o ( cw , nov ) , fn b d ( cw )) , VT ) · · · C G ( ∧ • ( P − ( LMT ) , C L ( ∨ • ( VMT , LPT ) , VT ) , PMT ) , VT ) Using the inverse mappings in T able 1, w e hav e a computed a nswer ( PMT ; id ). Similarly , if we remov e the hedge for the first condition in the sentence ( i ), we can ha ve a similar program and the following computation: ? cn ht ( mt , nov , cw ) C G ( ∧ ( ne to ( mt , cw ) , r e c o ( cw , nov ) , fn b d ( cw )) , VT ) · · · C G ( ∧ • ( LMT , C L ( ∨ • ( MPT , LPT ) , VT ) , PMT ) , VT ) Thu s, w e hav e a computed answer ( LMT ; id ). It can b e seen that with the same hotel ( Causew ay ), the time ( No vem b er ), and the business lo ca tion ( Midtown Pla za ), b y similar co mputations, if we put a higher requir ement fo r the condition “ near to ” , we obtain a low er tr uth v alue. More precisely , with the conditions “ very near to ” , “ near to ”, and “ pr obably near to ”, we obtain the truth v alues LPT , LMT , and PMT , r esp ectively , and LPT < LMT < PMT . This is r easonable and in acc ordance with common sense. 28 V. H. L e, F. Liu and D. K . T ra n 5 Applications 5.1 A data mo del for fuzzy li nguistic datab ases with flexi ble queryi ng Information stor ed in data bases is not a lwa y s pr ecise. Basic ally , tw o imp ortant issues in resea rch in this field a re representation of uncerta in information in a database and provision of more flexibilit y in the informa tion retriev al pro cess, no- tably via inclusion of ling uistic ter ms in queries. Also , the rela tionship b etw een deductive databases and logic progra mming ha s be en well establis hed. Therefor e, fuzzy linguistic log ic pr ogra mming (FLLP ) can pro vide a too l f or constructing fuzzy linguistic databases equipped with flexible querying. The model is an extension of Datalog (Ullman 1988) without negation and pos- sibly with recur sion, whic h is similar to that in Pokorn´ y and V o jt´ a ˇ s (2 001), called fuzzy ling uis tic Datalo g (FLDL). It allows o ne to find a nswers to queries o ver a fuzzy linguistic database (FLDB) using a fuzzy linguistic kno wledge base (FLKB). An FLDB is a (cris p) r elational database in whic h an a dditional attribute is added to every r elation to store a linguistic truth v alue for each tuple, and an FLK B is a fuzzy ling uistic Datalog prog ram (FLDL prog ram). Her e, we a lso work on safe rules, i.e., every v ariable app earing in the rule he ad of a rule als o app ears in the rule b o dy . An FLDL pro gram consists of finite sa fe rules a nd facts. Moreover, in an FLDL pro gram, a fuzzy predica te is either a n e xtensional da tabase (E DB) pr ed- icate, the log ical part o f a fact, whose r elation is stor ed in the data base, o r an int ensional database (IDB) predicate whic h is defined by r ules, but not b oth. W e can ex tend the monotone subset , c onsisting of selection, Cartesian pro duct, equijoin, pro jection, and union, of relationa l a lgebra (Ullman 1 988) for the case of our relations and create a new one called hedge mo dification . W e call this collection of operatio ns fuzzy linguistic rela tional a lgebra (FLRA). Based on the o per ations, we can conv ert rules with the sa me IDB predicate in their heads to an expression of FLRA ; the express ion yields a r elation for the pred- icate. F urthermo re, it can b e observed that the w ay the expres sion calculates the truth v alue of a tuple in the relation for the IDB predicate is the same as the wa y the immediate consequences op er ator T P do es for the cor resp onding gro und atom (Pokorn´ y and V o jt´ a ˇ s 2 001). Thus, similar to t he classical case , the FLRA aug- men ted by the immediate co nsequences op erato r is sufficient to ev aluate recur sive FLDL pr ograms , and every query over an FLKB re presented b y an FLDL program can b e exactly ev alua ted by finitely iterating the opera tions of FLRA fro m a set of relations for t he EDB predicates. 5.2 Thr eshold c omputation This is the cas e when o ne is interested in lo oking for a computed a nswer to a q uery with a tr uth v alue not les s than some thresho ld t . Assume that at a certain point in a computatio n w e need to find an answer to the selected atom A m with a threshold t m . Since C c ( x , y ) ≤ min ( x , y ), for c ∈ { L , G } , the selected rule or fact which will b e used in the next step must hav e a tr uth v a lue not less t han t m . If there is no suc h rule or f act, w e can cut the computation branc h. F u zzy Linguistic L o gic Pr o gr amming 29 F or the cas e that A m will b e unified with the rule head of s uch a rule, the truth v alue of the whole b o dy o f the rule must no t b e less tha n t m +1 = inf { b |C ( b , r ) ≥ t m } , where r is the truth v alue o f the rule a nd r ≥ t m . If the implica tion us ed in the rule is the G¨ odel implication, then t m +1 = t m ; if it is t he Luk asiewicz implication, then t m +1 = v n + k − j , where r = v j , t m = v k are t wo v alues in the truth domain X , and v n = 1. Since n ≥ j ≥ k , w e hav e t m +1 ≥ t m , a nd if r < 1 , we hav e t m +1 > t m . Recall that a r ule b o dy ca n b e built from its co mpo nents using the conjunctions, the disjunction, and hedg e connectives. Therefore, we have: ( i ) F or the case of G¨ odel conjunction, t m +1 is the next threshold fo r each of its comp onents, a nd if t m +1 > t m , for all m (this will happ en if all the implicatio ns are Luk asie wicz, and all the truth v alues of rules are less than 1), w e can estimate the depth of the search tree according to the threshold t and the hig hest truth v alue of rules. ( ii ) F o r the case of Luk asie wicz conjunction, if all the truth v alues of the facts in the prog ram are les s tha n 1 (thus the co mputed truth v a lue o f any co mpo nent in any b o dy formula is less tha n 1), the nex t threshold for each of the comp onents is greater than t m +1 . Hence, similar to the ab ov e c ase, we can also work out the depth of the searc h tree . ( iii ) F or the c ase of disjunction, one of the comp onents of the rule bo dy must hav e a computed truth v alue a t leas t t m +1 . ( iv ) Finally , the problem o f finding a computed truth v alue for a hedge-mo dified formula hB with a threshold u can be reduced to that of B with a new threshold u ′ = inf { v | h − ( v ) ≥ u } . 5.3 F uz zy c ontr ol Control theo ry is aimed at de termining a function f : X → Y whose in tended meaning is that given an input v alue x , f ( x ) is the correct v alue of co nt rol signal. A fuzzy appro ach to control employs an approximation o f s uch a (ideal) function by a system of fuzzy IF-THEN rules of the form “IF x is A THEN y is B ” , where A and B a re labels of fuzzy subsets. In the liter ature, there are s everal attempts to reduce fuzzy control to fuzzy lo gic in nar row sense. Gerla (2005; 2001) prop osed an interesting reductio n in which a fuzzy I F-THEN r ule “IF x is A THEN y is B ” is translated into a fuzzy logic progra mming rule ( go o d ( x , y ) ← A ( x ) ∧ B ( y ) · λ ), wher e A and B are now consider ed as fuzzy predicates. The truth v alue λ is understo o d a s the degr ee of c o nfidence of the exp er ts in s uch a rule, and by default, λ = 1. T he intended meaning of the new predic ate go o d ( x , y ) is that given an input v alue x , y is a go o d v a lue for the control v aria ble. The refore, the information carr ied by a system o f fuzzy IF-THEN rules can be represented by a fu zzy logic program. More precisely , a s ystem of f uzzy IF-THEN rules: IF x is A 1 THEN y is B 1 · · · (7) IF x is A n THEN y is B n can be asso cia ted with the following prog ram P : ( go o d ( x , y ) ← A 1 ( x ) ∧ B 1 ( y ) · 1) 30 V. H. L e, F. Liu and D. K . T ra n · · · ( go o d ( x , y ) ← A n ( x ) ∧ B n ( y ) · 1) (8) ( A i ( r ) · r A i ), for r ∈ X , i = 1 · · · n ( B j ( t ) · t B j ), for t ∈ Y , j = 1 · · · n where r A i is the deg ree of tr uth to whic h an input v a lue r s atisfies a predicate A i , and t B j is the degr ee of truth to which an output v alue t satisfies a predicate B j . Each element r ∈ X or t ∈ Y is consider ed a s a constant. Thus, the language of P is a tw o-sor ted predicate o ne, and we hav e tw o Her brand univ erses U X P = X and U Y P = Y . Since the truth v alues of the rules are a ll e qual to 1, Luk as iewicz and G¨ odel t-no rms yield the same res ults in computations; ther efore, without loss of generality we ca n use t he same notation fo r the im plications. By iterating the T P op erator from the b o ttom in terpretation ⊥ , we obtain the Least Herbrand mo del M P of P . In fact, it ca n be shown that M P = T 2 P ( ⊥ ). Let us put G ( r , t ) = M P ( go o d ( r , t )). Indeed, G ( r , t ) ca n b e int erpreted as the de gree of pre ference on the output v alue t ∈ Y , given the input v alue r ∈ X . Therefor e, the pur po se of the pr ogram P is not to compute the ideal function f : X → Y , but to define a fuzzy predicate go o d expressing a grade d opinion on a p os sible control v alue t w.r.t. a given input v a lue r . Clea rly , given a n input v alue r , it sho uld b e better to take a v alue t tha t maximises G ( r , t ). Note tha t the v alue G ( r , t ) is no t a true v a lue, but a lower bound to the truth v alue of go o d ( r , t ). In other words, we can sa y that given r , t ca n be prov ed to be go o d at least at the level G ( r , t ). It is worth noticing that in fuzzy control, it is quite o ften that t he lab els o f fuzzy subsets in a system o f fuzzy IF-THEN r ules, i.e., A i and B i in the system (7), are hedge-mo dified ones, e.g., V er ylarge and V eryfast . Thus, our lang uage ca n be used to represent the as so ciated progra m in a very natural wa y since we allow using linguistic hedges to mo dify fuzzy predica tes. C learly , in suc h a pr ogra m, all t he facts ( A i ( r ) · r A i ) and ( B j ( t ) · t B j ) w e need ar e o nly for primary predicates (predicates without hedge mo dification) such as larg e or fast , but not for all predica tes a s in the case o f fuzzy logic prog ramming. 6 Implementat ion In the literature, there has b een rese arch o n m ulti-adjoint logic progr amming (MALP) (see, e.g., Medina et a l. (2004)), whic h is an extension of fuzzy logic pro gramming in which truth v alues can b e elemen ts of any complete bounded lattice instea d of the unit interv al. Also, there have been several attempts to implement systems wher e m ulti-adjoint logic programs can be executed. Due to the similarit y betw een MALP and FLLP , the implemen tatio n of a system for exec uting fuzzy linguistic logic pro- grams can b e c arried out based o n the systems built for multi-adjoin t ones. In the sequel, w e sk etc h an idea f or implemen ting such a system, which is inspir ed b y the FLOPER (F uzzy LOgic Progr amming Environment for Research) system describ ed in Morcillo and Moreno (2008). The main ob jectiv e is to translate fuzzy linguistic logic programs in to Prolog o nes which ca n be safely executed inside any standard Prolog in terpreter in a completely F u zzy Linguistic L o gic Pr o gr amming 31 transpare n t way . W e tak e the following program a s an illustr ative example: ( gd em ( X ) ← G ∧ L ( V st hd ( X ) , P hir a un ( X )) · VMT ) ( hir a un ( ann ) · VT ) ( st hd ( ann ) · MT ) F or simplicity , instead of computing with the truth v alues , we can compute with their indexes in the truth domain. Th us, the pr ogram can b e co ded as: gd em ( X ) < go del & luka ( he dge v ( st hd ( X )) , he dge p ( hir a un ( X ))) with 3 8 · hir a un ( ann ) with 4 1 · st hd ( ann ) with 3 6 · where 38, 41, a nd 36 a re re sp ectively the indexes o f the truth v alues VMT , VT , and MT in the truth domain in E xample 4 . During the parsing pro ces s, the s ystem produces Prolo g co de as follows: ( i ) Each atom appear ing in a fuzzy rule is tra nslated in to a P rolog atom extended by an additional argument, a truth v a riable o f the form TV i , which is intended to store the tr uth v a lue obtained in the subsequent e v aluation of the atom. ( ii ) The truth functions of th e binary connectives a nd the t-norms can b e easily defined b y standard Pr olog clauses as follows: and go del ( X , Y , Z ) : − ( X = < Y , Z = X ; X > Y , Z = Y ) · and luka ( X , Y , Z ) : − H is X + Y − n , ( H = < 0 , Z = 0; H > 0 , Z = H ) · or go del ( X , Y , Z ) : − ( X = < Y , Z = Y ; X > Y , Z = X ) · where n is the index of the tr uth v alue 1 in the truth domain (in E xample 4, n = 44). Note that and go del is the t-nor m C G as w ell as the truth function of the conjunction ∧ ( ∧ G ) while and luka is the t- norm C L and a lso the truth function of the conjunction ∧ L , and or go del is the truth funct ion of the disjunction ∨ . Inv ers e mappings of hedges can b e defined by listing all c ases in the form of ground Prolog facts (except in verse mappings of 0, W , and 1). Mor e pre cisely , the inv ers e mappings in T able 1 can b e defined as follo ws: inv map ( H , 0 , 0) · · · · inv map ( l , 17 , 2 1) · · · · inv map ( v , 3 3 , 25) · · · · inv map ( H , 44 , 44 ) · where 33, 25, 17, and 21 are indexes of the v alues c + , L c + , LL c − , and VL c − , respec- tively; the fact inv map ( v , 3 3 , 25) · defines the case V − ( c + ) = L c + while the fact inv map ( l , 1 7 , 21) · defines the case L − ( LL c − ) = VL c − . The facts inv map ( H , 0 , 0) · , inv map ( H , 22 , 22 ) · , and inv map ( H , 44 , 44) · , where H is a v ariable of hedges, de- fine the mapping s: for all h , h − (0) = 0, h − ( W ) = W , and h − (1) = 1. 32 V. H. L e, F. Liu and D. K . T ra n ( iii ) Each fuzzy rule is translated into a Prolo g clause in which the ca lls to the atoms app ear ing in its b o dy mu st b e in an a ppropriate or der. More precisely , the call to the ato m cor resp onding to an op eratio n must be after the ca lls to the ato ms corres po nding to its ar guments in order for the truth v ar iables to b e cor rectly instantiated, and the last c all must b e to the ato m corr esp onding to the t-norm ev aluating the r ule. F o r example, the rule in the previous program can be translated int o the f ollowing Pr olog clause: gd em ( X , TV 0) : − st hd ( X , TV 1 ) , inv map ( v , TV 1 , TV 2 ) , hir a un ( X , TV 3) , inv map ( p , TV 3 , TV 4 ) , and luka ( TV 2 , TV 4 , TV 5 ) , and go del ( TV 5 , 38 , TV 0) · ( iv ) Eac h fuzzy fact is t ranslated into a P rolog fact in which the additional ar gument is just its truth v alue instead of a truth v ariable. F or the ab ove program, the tw o fuzzy fac ts a re trans lated into tw o Prolog facts hir a un ( ann , 4 1) and st hd ( ann , 36). ( v ) A quer y is translated into a P rolog goal that is a n atom with a n additional argument, a truth v ariable to store the computed truth v alue. F or instance, the query ? gd em ( X ) is translated into the Pr olog g oal: ? − gd em ( X , T ruth value ). Given the ab ove program and the ab ove query , a P rolog interpreter will return a computed answ er [ X = ann , T ruth value = 29 ], i.e., we have ( gd em ( ann ) · PPT ). 7 Conclusi ons and future work W e have presented fuzzy linguis tic logic pro gramming as a result of integrating fuzzy logic pro gramming and hedge algebr as. The main aim of this work is to facilitate the r epresentation and reaso ning on knowledge expr essed in natural language s, where v a gue sent ences are often assessed b y a degree of truth expressed in linguistic terms rather than in n um b ers, and linguistic hedges are usually used to indica te different levels of emphasis . It is well known that in o rder for a formalism to mo del such knowledge, it sho uld address the tw ofold usa ge of linguistic hedges, i.e., in generating linguistic v alues and in modifying pr edicates. Hence, in this work we use linguistic truth v alues and a llow linguistic hedges as pre dicate modifiers. More precisely , in a fuzzy linguistic lo gic progr am, each fact or rule is grade d to a certa in degree sp ecified b y a v alue in a linguistic truth doma in ta ken from a hedge a lgebra of a truth v a riable, a nd hedg es ca n b e used as unary connectives in b o dy form ula e. Besides the declarative s emantics, a sound a nd complete pro cedural semantics which dir ectly manipulates linguistic terms is provided to compute a lo w er b ound to the truth v a lue of a quer y . Thus, it can b e r egarded as a metho d of co mputing with words. A fixp oint semantics of log ic progra ms is defined a nd provides an imp ortant to ol to handle recur sive pr ogra ms, for whic h computations can b e infinite. It has b een shown that knowledge bases expressed in natura l languages can b e represented b y o ur languag e, and the theory has several applications such as a data mo del for fuzzy linguistic databa ses with flexible query ing, threshold computation, and fuzzy con tro l. Finding more applications for the th eory and implemen ting a system where fuzzy linguistic logic programs can b e executed are directions f or our future work. F u zzy Linguistic L o gic Pr o gr amming 33 References Dinh-Khac, D. , H ¨ olldobler, S. , and Tran, D. K. 2006. The fuzzy linguistic de- scription logic ALC FL . In Pro c. of the 11th International Conference on Information Processing and Managemen t of Uncertaint y in Knowledge-Based Systems (IPMU’2006) . 2096–21 03. Gerla, G. 2001. F uzzy control as fuzzy d ed uction system. F uzzy Sets and Systems 121 , 409–425 . Gerla, G. 2005 . F uzzy logic programming and fuzzy control. Stu dia Logica 79 , 23 1–254. H ´ ajek, P. 1998 . Metamathematics of F uzzy Logic . Kluw er, Dordrec ht, The N etherlands. Kraj ˇ ci, S. , Lencses, R. , and V ojt ´ a ˇ s, P. 2004 . A co mparison of fuzzy and annotated logic p rogramming. F uzzy Sets an d Systems 144 , 1 73–192. Llo yd, J. W. 1987. F oun d ations of logic programming . Sprin ger V erlag, Berlin, German y . Medina, J. , Ojeda-A ci ego, M. , and Vojt ´ a ˇ s, P. 2004 . Similarit y- based unification: a multi-adjo int approac h. F uzzy S ets and Systems 146, 1, 43–62. Mor cillo, P. J. a nd Moreno, G. 2008. Using floper for running/debugging fuzzy logic programs. In Pro c. of th e 12th Internatio nal Conference on Information Processing and Managemen t of Uncertaint y in Knowledge-Ba sed Systems (IPMU’2008) , L. Magdalena, M. O jeda-A ciego, and J. V erdegay, Eds. M´ alaga, 481–4 88. Naito, E. , Oza w a, J. , Ha y ashi, I. , and W akami, N. 1995. A prop osal of a fuzzy connective with learning function and q uery netw orks for fuzzy retriev al systems. In F u zziness in Database Management Systems , P . Bosc and J. Kacprzy k, Eds. Physica- V erlag, 345–364. Nguyen, C. H. , Tra n , D. K. , Huy nh, V. N. , and Nguyen , H. C. 1999. Linguistic- v alued logic and their application to fuzzy reasoning. International Journal of Uncer- taint y , F uzziness and Kno wledge-Based Systems 7 , 347–36 1. Nguyen, C. H. , Vu, N. L. , and Le, X . V . 2008. Optimal hedge-algebras-based controller: Design and application. F uzzy S ets and Systems 159 , 968–989 . Nguyen, C. H. an d Wechler, W . 1990. Hedge algebras: An algebraic approach to structure of sets of linguistic truth v alues. F uzzy Sets an d Systems 35 , 281–293. Nguyen, C. H. and Wechler, W. 1992. Extended hedge algebras and t h eir app lication to fuzzy logi c. F uzzy Sets and Systems 52 , 259–281. Pok orn ´ y, J. and Vo jt ´ a ˇ s, P. 2001. A data mo del for flexible qu erying. In Adva nces in Databases and Information Systems, ADBIS ’01 , A. Caplinsk as and J. Eder, Eds. Springer V erlag, 280–293. LNCS 2151. T arski, A. 1955. A lattice-theoretical fixp oint theorem an d its applications. Pacific Journal of Ma thematics 5 , 285 –309. Ullman, J. D. 19 88. Principles of Database a nd Kn owledge-Base Systems . V ol. I. Com- puter Science Press , United States of A m erica. Vo jt ´ a ˇ s, P. 2001. F uzzy logic programmi ng. F uzzy S ets and S ystems 124 , 361–370. Zadeh, L. A. 1972. A fuzzy- set-theoretic in terpretation of linguistic hedges. Journal of Cyb ernetics 2, 3, 4–3 4. Zadeh, L. A. 1975a. The concept of a linguistic v ariable and its application in app roximate reasoning. In formation Sciences 8, 9 , 199–249, 301– 357, 43–8 0. Zadeh, L. A. 1975b. F uzzy logic and appro ximate reasoning. Synthese 30 , 40 7–428. Zadeh, L. A. 1979. A theory of approximate reas oning. In Machine Intellige nce , J. E. Hay es, D. Mic h ie, and L. I. Mikulich, Eds. V ol. 9. Wil ey , 149–194. Zadeh, L. A. 1989. Kn o wledge representati on in fuzzy logic. IEEE T ransactions on Knowl edge a nd Data Engineering 1, 1, 89 –99. Zadeh, L. A. 1997. T o w ard a theory of fuzzy information gra nulation and its centralit y in human reasoning and fuzzy logic. F uzzy Sets and Systems 90 , 111–127.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment