Design Issues of Fuzzy Logic Programming Languages

0 downloads 0 Views 104KB Size Report
a Prolog-like logic programming language. 1. ... taining a fuzzy version of Prolog, which is by far the most well known ... using resolution, until the empty clause is eventually obtained. .... unification has been determined useful in, for example,.
Design Issues of Fuzzy Logic Programming Languages Pedro M´arquez Laboratory for Logic, Databases and Advanced Programming Department of Computer Science New Mexico State University Box 3001/ CS, Las Cruces, NM, USA 88003 [email protected]

Abstract

by both applications and theoretical issues. For example, in [25] it is established that a fuzzy Prolog could be used to perform fuzzy inferences, to describe fuzzy systems, and to solve fuzzy problems. In general, applications impose such different demands on the language that it is virtually impossible to satisfy them in its entirety. This paper is organized as follows. In section 2 we introduce the language Prolog and the aspects of it that could be or have been fuzzyfied in some way or another. In section 3 we discuss about the problems faced when we try to fuzzify a particular aspect. Finally, in section 4 we present our conclusions.

Logic Programming (LP) has been successfully applied to solve many problems in Artificial Intelligence and many other areas. However, LP is unable to deal with uncertain, imprecise or vague information. On the other hand, Fuzzy Sets and Fuzzy Logic have demonstrated their applicability in dealing with uncertainty, and have motivated the research on extending classic LP to add fuzzy reasoning. However, a full fledged implementation of a fuzzy logic programming language universally accepted and/or in production does not exists yet. There are many reasons for this, and we present some of them in this paper. The aim of this paper is to briefly survey some of the major design problems we faced in implementing a fuzzy version of a Prolog-like logic programming language.

2. Logic Programming In this section we introduce classic logic programming from the perspective of those theoretical aspects that can be fuzzified. These aspects refer to both its syntax and its semantics. We assume that readers are familiar with the basic concepts of logic programming. See for example [11].

1. Introduction Logic Programming (LP) has been applied successfully to solve problems in many areas, and in particular in Artificial Intelligence (AI). LP, however, is based on two-valued logic and it is not well suited to model the uncertain, imprecise or vague information found in real-world problems. Since the founding of fuzzy sets and fuzzy logic by Zadeh in 1965 [26], many attempts have been made to develop a fuzzy logic programming language. Much of this effort has been focused in obtaining a fuzzy version of Prolog, which is by far the most well known logic programming language. See for example [7], [6], [23], [1]. There is no general consensus regarding what fuzzifying logic programming exactly means or how to do it. Existing fuzzy logic programming languages get their names from fuzzifying different parts or aspects of the language. In general, design decisions have been driven

Definition 2.1 A definite program clause is a clause of the form ∀(A ← B1 , . . . , Bn ), where A and the Bi ’s are atoms, ∀(·), is the universal closure, and A ← B is interpreted as A ∧ ¬B. A is called the head and B1 , . . . , Bn is the conjunction of the Bi ’s, called the body of the program clause. The body of the program clause may be absent, in which case the program clause is called a unit clause. Definition 2.2 A definite program is a finite set of definite program clauses. Definition 2.3 A definite goal is a clause of the form ∀(← B1 , . . . , Bn ), where each Bi is called a subgoal. 1

Definition 2.4 The empty clause is the clause with no consequence nor antecedent, and it is considered as a contradiction. Definition 2.5 A Horn clause is either a definite program clause or a definite goal. Definition 2.6 A ground term/atom/clause is a term/atom/clause not containing variables. The declarative semantics of a logic program is given by the model-theoretic semantics of formulas in first order logic. Truth values of these formulae depend on the meanings of its constants, function symbols and predicate symbols, i.e., on its interpretation. Only those interpretations that constitute a model of the formula are of interest. The method for making inferences, i.e., to deduce formulas that are logical consequence of the axioms represented by a program, is based on resolution [20], which is basically a refutation system. The top-down semantics of a program P and a goal G is as follows. G is negated and added to the axioms of P . The system then derives successive goals using resolution, until the empty clause is eventually obtained. During these derivations, goal’s variables are bound and given as output of the program. That is, the system’s job is to determine the unsatisfiability of P ∪ {G} . Although in general it is impossible to determine, it suffices to consider only Herbrand interpretations to show unsatisfiability. The bottom-up semantics of a program P constitutes its meaning. This is inductively defined as follows: The set of ground unit clauses of P is in the meaning of P . A ground goal G is in the meaning of P if there is a ground program clause G ← B1 , . . . , Bn such that B1 , . . . , Bn are in the meaning. That is, the bottomup semantics consists of all the ground instances that are deducible from the program.

3. Fuzzy Logic Programming As seen above, logic programming is based on Horn clauses, i.e., universally quantified implication statements made of consequents with zero or one (positive) atoms, and antecedents made of the conjunction of zero or more atoms. Possible improvements to this scheme [24] could be to allow for a conjunction of literals (positive and negative atoms) or even to allow for arbitrary first order logic formulas as clause bodies. Although this is theoretically possible, it would lead us to significantly different schemes from classic (Horn) logic programming. We will concentrate only on this latter scheme and in the ways it could be fuzzified.

3.1. Quantifiers One reason why we would like to fuzzify the universal quantifier is to have fuzzy goals. Recall that a (crisp) goal is clause of the form ∀(← B1 , . . . , Bn ). The relationship between deductive databases and logic programming has been very well established, see e.g. [13]. Thus, fuzzy goals would be particularly useful in implementing fuzzy deductive databases. Similarly to what is possible to do in classic logic programming, a fuzzy logic programming language should provide the tools for constructing fuzzy databases. When we use logic programming to construct databases, a goal constitutes a query to the database which is made of facts (unit clauses). Reasons for introducing fuzzy sets in query models have been given elsewhere [4], as well as its use in building natural language communication systems [19]. Fuzzy quantifiers would allow to use words like most, almost, few, several, etc. in fuzzy queries. However, it is not possible to fix a meaning to these quantifiers as they depend generally on the application. Hence, it is necessary to find a way to generalize them. The general approach for dealing with fuzzily quantified expressions of the form ”QA are B”, where Q is a fuzzy quantifier and A and B are (possibly fuzzy) sets, is based on the cardinality of the sets and its proportion [28]. Other approaches involve the evaluation of the extension to which all A’s are B’s up to some exceptions, see e.g. [4].

3.2. Logical Connectives Logic programming makes use of three logical connectives: ¬ (not), ∧ (and), and ∨ (or). The logical connective → (material implication) is defined as A → B ≡ ¬A ∨ B. There exists a wealth of possible fuzzy definitions for all these connectives [9] and, thus, some decisions need to be made about what implementations should be built in the language and how to support user-defined operators. For example, we could want that our language satisfies the Law of Contradiction in order to implement, for example, simple syllogism [25]. Due to the big number of ways logic connectives can be implemented, experimental studies have been conducted to determine their best implementation depending on, for example, in a selection strategy and a particular application [8]. Since the fixed point semantics of a logic program constitutes also its meaning, the selection of fuzzy connectives for a fuzzy logic programming language is of capital importance as they will directly impact on the meaning of a fuzzy program.

3.3. Inference Rule

3.4. Resolution Principle

Inference in logic programming is based on modus ponens. This inference rule establishes that given that ”A is true” and ”A → B is true”, one can deduce that ”B is true”. That is, it is a procedure that uses implication to derive true statements from true statements. In fuzzy logic, however, truth is a matter of degree. In this case we should we able to deduce imprecise statements from imprecise statements. Inferences in fuzzy logic are made by applying the combination-projection principle (CPP), which establishes that the possibility distribution ΠX associated with a variable xk ∈ X = {x1 , . . . , xn }, whose domains are U1 , . . . , Un , respectively. U = U1 , . . . , Un is the domain of X, and it is obtained by combining in a suitable manner the distributions Πi ∈ {Π1 , . . . , Πm } associated with subsets Xi ⊆ X, to get the distribution ΠX associated with X. Finally, ΠX is projected on the domain Uk of xk as follows:

Logic programming is basically a refutation system based on the resolution principle [20]. The basic idea of resolution is to check whether a set S of clauses contains the empty clause. If so, then S is unsatisfiable; else, it should be checked if the empty clause can be derived from S. In essence, resolution is an inference rule that generates resolvents from a set of clauses as follows [5]:

Πxk (u) = sup{ΠX (u1 , . . . , u, . . . , un ) : ui ∈ Ui , i 6= k} The compositional rule of inference (CRI) is a special formulation of CPP, and a particular case of CRI allows us to do approximate reasoning to draw vague conclusions from vague premises in what is called generalized modus ponens: Let A, A∗ , and B be fuzzy subsets of U and V , respectively. Let the fuzzy implication A → B be defined by a fuzzy relation R on U × V . Then, the fuzzy subset B ∗ induced by ”x is A∗ ” and ”if x is A then y is B” is defined by B ∗ = A∗ ◦ (A → B) = A∗ ◦ R, or in terms of indicator functions: B ∗ (u) = ∨x∈U {A(u) ∧ R(u, v)}. More generally, the t-norm ∧ can be replaced by an arbitrary t-norm t in the composition operation among the relations. If we are interested in obtaining B ∗ = B when A∗ = A, then we need to choose adequately t and → by solving a set of functional equations [18]. This approximate reasoning technique was introduced by Zadeh [27]. However, not all systems use it due that the relation R defining the X − Y dependency have not been studied sufficiently in cases where it is defined by a collection of rules, and also because the computation of B ∗ implies the solution of a nonlinear program which requires time. Because of these efficiency problems, research has been done in finding efficient implementations for specific distributions, see e.g. [?]. Besides these potential problems, it is known that CRI can lead, in some cases, to disappointing results [14]. This has motivated research on defining the properties a function implementing modus ponens should fulfill depending on the type of the implication function, e.g. S-implication or R-implication [22].

Definition 3.1 (Resolution for Propositional Logic) For any two clauses C1 and C2 , if there is a literal L1 in C1 that is complementary to a literal L2 in C2 , then delete L1 and L2 from C1 and C2 , respectively, and construct the disjunction of the remaining clauses. The constructed clause is a resolvent of C1 and C2 . The definition of the resolution principle for firstorder logic is essentially the same, except that it involves unification (discussed below). Here, there are basically three main concerns about resolution. The first one is that predicates are twovalued, i.e. the truth value of a predicate p is T (p) ∈ {0, 1} . The second one is that resolution is based on the concept of a complementary pair of literals. The third one is that of unification. Since a predicate p in fuzzy logic can have a truth value T (p) ∈ [0, 1], we cannot apply bare resolution as it does not cover all possible combinations of truth values in [0,1]. In fact, Lee [10] proved that if every clause Si ∈ S = {S1 , . . . , Sn } in a set of clauses S has a truth value T (Si ) ≥ 0.5 (i.e. is more than ”halftrue”), then we are guaranteed that all logical consequences obtained by resolution will not be smaller than 0.5 when not, and, and or are defined as 1−(·), min, and max, respectively. One immediate implication of this theorem is that all clauses should have a truth value of at least 0.5 to be considered true. This, of course, reduces in one half the range of usable truth values to (0.5,1], imposing an unnecessary burden on its semantics. After the work of Lee, some other extensions of resolution into larger ranges of truth values have been attempted, e.g. [15], [21]. It should be noted, however, that the threshold of 0.5 obtained by Lee comes from the use of 1 − x as the definition of negation. That is, 0.5 is the solution to the equation x = 1 − x. This value is called the equilibrium of the function, namely, f (x) = 1 − x. That is, it is the value for which f (x) = x. It has been shown that every fuzzy complement has at most one equilibrium, and if the complement is continuous, then the equilibrium is unique [9]. One immediate consequence of this result is that Lee’s theorems could be generalized for suitable

combinations of families of fuzzy complements, t-norms and t-conorms. The second concern about resolution refers to the use of a complementary pair of literals, say P and ¬P . As it is known, in fuzzy logic the complementary laws T (x) ∨ T (¬x) = 1, and T (x) ∧ T (¬x) = 0, do not hold. This condition is fundamental to resolutionrefutation systems since the eventual derivation of the empty clause (a contradiction) depends on it. Perhaps, this is the reason for which there have been very few discussions about how the idea of refutation can be used in fuzzy logic. See, for example, [21], [17], [16]. One immediate consequence of this problem is that suitable definitions for fuzzy resolvent need to be investigated.

3.5. Unification To extend propositional resolution into first-order logic it is necessary to employ unification. We could say the same in the fuzzy arena, assuming that we had a reasonable fuzzy resolution principle. It has been stated that the main purpose of a logic programming system is to compute bindings for variables that are output by the system. These bindings are computed by unification. In essence, the unification algorithm takes a finite set of simple expressions (terms or atoms) and outputs the most general unifier, which is made of the composition of all the substitutions that make each expression in the set syntactically identical. A motivation behind a fuzzy unification would be to substitute the syntactic matching by a semantic one, similarly to what is done in Constraint Logic Programming (CLP). However, in contrast with CLP, fuzzy unification is still a concept not totally accepted, perhaps because it is not yet a precisely syntactically and semantically defined concept. Work reported in this area uses, e.g., linguistic hedges for fuzzy matching [25], similarity relations [2], [1], and even probability theory [3]. Fuzzy unification has been determined useful in, for example, information retrieval systems where ”acceptable” answers to a query cannot be satisfactorily handled by crisp unification [2], [1]. Perhaps more importantly, we conjecture that fuzzy unification could open the door towards the more powerful paradigm of fuzzy constraint logic programming [12].

4. Conclusions We presented the fundamental issues that should be considered in the design of a fuzzy logic programming language. These concerns are, (a) the set of fuzzy

logic connectives to be used in program clauses, (b) the search for a reasonable definition of fuzzy resolution, as well as one for (c) fuzzy unification. It has been shown that the set of fuzzy logical connectives has a significant impact on the meaning of a program, as they determine the conditions of satisfiability of formulae. We commented on how the lack of the complementary laws in fuzzy logic enforces to adjust the resolution principle. Finally, we have also commented on the importance of fuzzy unification and conjectured that this could lead us towards the more powerful paradigm of fuzzy constraint logic programming. Since all these aspects are tightly interrelated, a design decision on one of them will surely impact the rest. Much work still needs to be done before we can come up with a fuzzy logic programming theory with semantic properties that are as elegant as that of classic logic programming.

Acknowledgments. The author is very thankful to Dr. Gopal Gupta for his invaluable suggestions and comments.

References [1] F. Arcelli and F. Formato. A fuzzy logic programming language. Proceedings of the Joint Conference on Declarative Programming, 1997. [2] F. Arcelli, F. Formato, and G. Gerla. Similitude-based unification as a foundation of fuzzy logic programming. Proceedings of the First International Workshop on Logic Programming and Soft Computing: Theory and Applications, 1996. [3] J. Baldwin, T. Martin, and B. Pilsworth. The implementation of fprolog - a fuzzy prolog interpreter. Fuzzy Sets and Systems, 23:119–129, 1987. [4] P. Bosc, L. Lietard, and H. Prade. On fuzzy queries involving fuzzy quantifiers. Proceedings of the ECAI96 Workshop on Uncertainty in Information Systems, 1996. [5] C. Chang and R. Lee. Symbolic Logic and Mechanical Theorem Proving. Academic Press, San Diego, CA, 1973. [6] M. Ishizuka and N. Kanai. Prolog-elf incorporating fuzzy logic. Proceedings of 9th IJCAI, pages 701–703, 1985. [7] H. Kikuchi and M. Mukaidono. Profil - fuzzy interval logic prolog. Preprints of the International Workshop on Fuzzy Systems Applications, pages 205–206, 1998. [8] Y. Kim and L. J. Kohout. Comparison of fuzzy implication operators by means of weighting strategy in resolution based automated reasoning. Communications ACM, pages 396–404, 1992.

[9] G. J. Klir and B. Yuan. Fuzzy Sets and Fuzzy Logic Theory and Applications. Prentice-Hall, Inc., Upper Saddle River, NJ, 1995. [10] R. Lee. Fuzzy logic and the resolution principle. Journal of the ACM, 19(1):109–119, 1972. [11] J. W. Lloyd. Foundations of Logic Programming, Second Extended Edition. Springer-Verlag, Berlin, Germany, 1987. [12] P. M´ arquez. FCLP(N) Fuzzy Constraint Logic Programming with Fuzzy Sets - in preparation. PhD thesis, New Mexico State University, 1998. [13] J. E. Minker. Foundations of Deductive Databases and Logic Programming. Morgan Kaufmann, Los Altos, Calif., 1988. [14] M. Mizumoto. Fuzzy Reasoning with a Conditional Proposition If-Then-Else - Fuzzy Set and Possibility Theory. R.R. Yager, Ed. Pergamon Press, New York, NY, 1982. [15] M. Mukaidono. Fuzzy Inference of Resolution Style - Fuzzy Set and Possibility Theory, R.R. Yager, Ed. Pergamon Press, New York, NY, 1982. [16] M. Mukaidono. Foundations of Fuzzy Logic Programming - Between Mind and Compute. World Scientific, River Edge, NJ, 1993. [17] M. Mukaidono, Z. Shen, and L. Ding. Fundamentals of fuzzy prolog. International Journal of Approximate Reasoning, 3:179–193, 1989. [18] H. Nguyen and W. E.A. A First Course in Fuzzy Logic. CRC Press, Boca Raton, FL, 1997. [19] W. Okamoto, S. Tano, A. Inoue, and R. Fujioka. Inference method for natural language propositions involving fuzzy quantifiers and truth qualifiers. Proceedings of the IEEE International Conference on Fuzzy Systems, 1995. [20] J. A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12(1):23–41, 1965. [21] Z. Shen, L. Ding, and M. Mukaidono. Fuzzy resolution principle. IEEE International Symposium on MultipleValued Logic, pages 210–215, 1988. [22] L. Valverde and E. Trillas. On modus ponens in fuzzy logic. IEEE International Symposium on MultipleValued Logic, pages 294–301, 1985. [23] H. Virtanen. A study in fuzzy logic programming. Proceedings of the 12th European Meeting on Cybernetics and Systems, pages 249–256, 1994. [24] S. Y. Yans. Foundations of fuzzy logic programming and debugging. Proceedings of the IEEE International Symposium and Multiple-Valued Logic, 1989. [25] H. Yasui, Y. Hamada, and M. Mukaidono. Fuzzy prolog based on lucasiewicz implication and bounded product. Proceedings of the IEEE International Conference on Fuzzy Systems, pages 949–954, 1995. [26] L. Zadeh. Fuzzy sets. Information and Control, 8:338– 353, 1965. [27] L. Zadeh. A theory of approximate reasoning. Machine Intelligence, 9:149–194, 1979. [28] L. Zadeh. A computational approach to fuzzy quantifiers in natural languages. Computer Mathematics with Applications, 9:149–183, 1983.

Suggest Documents