Beruflich Dokumente
Kultur Dokumente
1 Introduction
Expert systems, neural networks and fuzzy systems are different ways of increasing
machine intelligence, but, in most cases, the effectiveness of a solution heavily de-
pends on the effectiveness of data access. Fuzzy logic [1, 2, 6, 7, 8] is useful both in
AI and human reasoning as well as in decision making and is well suited in searching
problems when we can define a set of search conditions, but we can accept a result
which resembles, at some degree, the expressed conditions.
A common DBMS is designed to process exact queries, e. g. select * from T
where name = "John". You are often allowed to set up queries with pattern matching
schemes, but more than often such searching features are restricted to the simplest se-
lect 9 from T where name like "Jo", meaning to retrieve all records with the field
name beginning with the string "John", such as "Jonathan" or "Johnny".
Moreover, if a query "fails" to retrieve any data, since there are no records in the
data base with the specified attributes, there is no way of making the DBMS retrieve
records with attributes similar to the ones specified by the user defined query.
Therefore, using a "traditional" DBMS, it is impossible to express similarity
queries. The purpose of FuzzyBase is to obtain results when the traditional query
fails: the program manages the gradual relaxing of the selection predicates of the query
executing a fuzzy algorithm. The process is carried on until the new query retrieves a
non-empty set of records in the data base: this set is the most similar to the one
originally searched by the user.
On summary, the concept of query itself is fuzzified: the user defined query
matches required data with grade one, while a fuzzy similarity query matches required
data with grade lower than one: the closer the similarity grade is to one, the greater
the retrieved data are like the ones searched by the user [9].
The capability of similarity queries imposes one major limitation. The fi~7-Afica-
tion must be driven by a set of rules which are strictly related to a specific application
domain: it would be impossible to perform an effective, non-trivial, relaxing activity
for a generic application domain. For this reason, FuzzyBase is parametrized, and
must be initialized for a specific application domain.
The fuzzy-logic inferential engine of FuzzyBase is able to formulate proper sugges-
tions about possible values of search keys. Possible search values are calculated by a
Contact Address: Claudio Sartori, DEIS - Univ. Bologna, Viale Risorgimento, 2, 1-40136
Bologna, Italy, Tel: +39 51 644.3554 (op. 3001, fax 3540), e-mail csartori@deis.unibo.it
386
crisp input is strictly boolean (non fuzzy): if the conditionfieldlN3 = <value> is true
(fuzzyfying its boolean value, it has membership degree 1), then the rule is computed
by the FLC; if it is false (membership degree 0), then the rule is not computed. This
behavior is the coherent reduction of fuzzy logic to binary (crisp) logic: if the MD as-
signed to the crisp rule is 0, fuzzy AND operator, implemented by the minimum
squares rule, will assign to fieldOUT a fuzzy value Medium with null MD, that
would not influence the possible value computation for fieldOUT.
The implemented FLC is a two fuzzy inputs, with crisp input, and one fuzzy out-
put system. It is, indeed, reducible to a one or none fuzzy input and none crisp input
simply by inserting value 0 into the fields containing attributes numbers.
3 FuzzyBase Architecture
The software is structured in some fundamental modules:
9 Search keys insertion module which contains the numerical search values fuzzyfica-
tion phase.
9 Fuzzy logic inference module, which generates possible values and controls of
numerical search values
9 Crisp controls modules, structured in absurd and warnings.
9 Fuzzy control module.
9 Query generation module, which provides a SQL query.
9 Similarity queries module, based on fuzzy logic.
9 Add-ons modules, for the update of statistics, dependent values computation, print,
session save and restore, parameters tuning.
Let us suppose that the stored values of the search key y e a r are between 1980 and
1995. The interval 1990-1993 is being searched. The fuzzyflcation of the search
interval computes the membership degree values as the heights of the intersections
between the projection of the search value and the membership function considered, as
in Figure lb, giving: MD(SmaI1) = 0, MD(Medium) = 0.5, MD(Large) = 0.78.
MEDIUM LARGE
SMALL MEDIUM LARGE
1,
0.78
0.5
0
minimumvalueinthedb maximum
valueinthedb ~ 9 9 5
1990 1993
a/ b)
F I G U R E | - P A R T I T I O N I N G ANF FUZZYFYING A SEARCH INTERVAL
Before finishing, the insertion module visualizes two windows containing the fol-
lowing information:
a) fields used as search keys
b) fields yet to be specify as search keys in the query.
The mandatory search keys, specified by the system installer into the s t a t i s t i c s ta-
ble, are supposed to be fundamental keys for retrieving the desired data into the data
base. For instance, it is useful to force the use as search keys of fields that permit a
great selectivity or that imply an important categorization of stored data.
should be observed that the coherence of the implemented crisp semantic is not mined
by the fuzzy operator between fuzzy inputs, that can be both AND or OR.
If the user asks FuzzyBase for a value of a given search key, the FLC consults the
partial view of the fuzzy rules table including only the rules with that key as fuzzy
output. The rules are read in blocks with same fuzzy inputs. In fact, a complex rule
involving two inputs and one output can be made explicit in sum of products, then
expressed as simple AND rules implicitly connected with OR operator.
For each rule in the block with the crisp condition true, the logic evaluation of the
rule is computed: a membership degree obtained by the minimum operator (AND
rule) or by the maximum operator (OR rule) between the two membership degrees of
the fuzzy inputs is assigned to the fuzzy output.
Fuzzy outputs of each rule block are superimposed according to the compositional
max-min rule [4]: the pointwise sum of the obtained fuzzy sets. From that the defuz-
zyfication phase computes the desired crisp output. The defuzzyfication method im-
plemented is the gravitational fuzzy-centroid method, which is considered to be the
most general in control applications [3, 4, 2].
The fuzzy centroids computed from each block are combined, if they are not too
far each other. The program computes an average sum of fuzzy centroids if their rela-
tive difference is smaller than 30% of the attribute's values interval of the stored data.
That's a designer's choice which can be taylored to the specific application.
All designer's choices, such as overlapping grade of fuzzy sets partitioning the
universes of discourse, or the fuzzy operators nature, or the defttzzyfication method are
easily changeable by the software installer or by the user itself. The actual choice of
partitioning the universe of discourse by the fuzzy sets overlapping for 25% of their
area is considered a good tradeoff for many control applications [2, 4].
The flow of this module is as follows: for each numerical search key, a possible
value is asked the suggestions module; that module, described in 3.2, is made of a
fuzzy inferential engine delivering a crisp output as possible value for a given search
key: if the possible value is too far from the search value chosen by the user, then a
warning is generated.
The fuzzy-generated waming do not force the user to change any search value, as
such records may still exist in the data base. The maximum distance between the
search value and the possible value is a designer's choice.
The new search interval, obtained reducing the membership degree, produces a
lower similarity degree of the new query in comparison with the previous one. The
query similarity degree is computed considering it as the fuzzy logic computation of
the selection predicate of the query using as values the membership degree of each
search key to its fuzzy interval. Moreover, to this relaxed query is associated an en-
larged selectivity factor: the new query is less selective.
a) b)
FIGURE 2 - RELAXING QUERY PREDICATES
1. If the new query is too different from the previous one, or if the selectivity factor
rated for the new query has raised enough, then the module stops the relaxing
phase, otherwise it considers the next search key and repeats steps 2, 3, and 4.
Remarks:
9 If the tx-cut associated to a search interval reaches zero, then the whole interval of
possible values is used as search interval: its selectivity is reduced to zero and it
works as if the query did not contain that selection predicate.
9 If all the yet specified search values are relaxed and the desired level of similar-
ity/selectivity is still not reachable, then the program restarts the relaxing proce-
dure from the beginning, always ordering the search keys by the chosen fit order.
9 There is a maximum number of iterations of this algorithm that causes the defini-
tive stop of the relaxing phase. It has been arranged in order to avoid infinite
looping, even if that eventuality has not occurred during software testing trials.
9 The whole procedure described above is still valid even if the initial search value
is not an interval, in fact we know that a trapezoidal fuzzy set can degenerate in
various shapes, such as a line, a triangle or a square.
degree between the initial and the final query. For example, if the user defined query,
written in SQL, is:
SELECT * FROM data
WHERE a = 1 AND b = 5 OR d = i0
and the fuzzy-relaxed query generated by the similarity module isi
SELECT * FROM data [a]
WHERE a > 0.8 AND a < 1.2 0.6
AND b > 4.9 AND b < 5.1 0.9
OR d > 8.3 AND d < ii.i 0.75
then, the boolean selection predicate, evaluated according to fuzzy logic using
values, gives: o~ (a) AND cx (b) OR o~ (d) = 0.6 AND 0.9 OR 0.75 -- 0.75. The value
0.75 is assumed to be the fuzzy similarity degree between the initial user query and
the query generated by the similarity module.
cients that are multiplied to the theoretical results. In this paper similitude is directly
identified by a fuzzy search in a data base of existing and well known gears. The fuz-
zyfication of similitude criteria is based on previous works of various authors that are
aimed to a first choice of the parameters of a new design. Initial requirements are
modified by using fuzzy numbers. This process is based on fuzzyfication criteria for a
specific field.
At the end of the process similar gears are found. It is probable that these require-
ments are not fulfilled by these existing gears. However, an expert data-base is de-
fined in this way. These data may be used to iteratively define the new design by us-
ing standard formulas in a manner very similar to the traditional design method. The
difference is that experience-based factor can be obtained from the expert data-base.
Another approach is to use a rule based expert system to modify the most similar ex-
isting gear in order to fulfill requirements. An expert system of this kind, written is
Prolog, was developed by one of the authors in his Doctorate thesis.
5 Conclusions
The paper presents FuzzyBase, a system for the generation of similarity queries in
relational DBMSs. Similarity is an important design technique in many technological
applications, such as gear design. FuzzyBase was developed upon a DBMS for PC:
Microsoft FoxPro for Windows, ver. 2.5, therefore it exhibits a comfortable graphic
user interface, perfectly integrated in the Microsoft Windows operating system. The
first test bed was the gear design problem described in section 4. The system is under
evaluation, but preliminary results are satisfactory.
6 Bibliography
[1] Zadeh L. A. : "Outline of a new approach to the Analysis of Complex System
and decision Process". IEEE Transaction on Systems, M a n , and Cybernetics,
vol. SMC-3, No. 1 January 1973
[2] Kosko B. : "Neural Networks and Fuzzy Systems: a dynamical systems ap-
proach to machine intelligence", Prentice-Hall International Inc., 1992.
[3] Bezdek J. : "Fuzzy Models. What are They, and W h y ? " , IEEE Transactions on
Fuzzy Systems, Vol. 1, No. 1, February 1993.
[4] Lee C. C.: "Fuzzy Logic in control systems: fuzzy logic controller - part 1 and
2", IEEE Trans. on Systems, Man and Cybernetics, vol. 20, pp. 404-435, 1990.
[5] Piancastelli L.: "Analisi ed implementazione eli un metodo di calcolo per mote
dentate basato sulla similitudine con applicazioni esistenti e gi/L collaudate",
Universitd di Bologna e Firenze PhD thesis in Applied Mechanics, 1988.
[6] Leung K.S., Wong M.H., Lain W.: "A fuzzy expert database system", IEEE
Trans. on Knowledge and Data Engineering, 4 -1989.
[7] Vassilliadis S., Triantafyllos G., Kobrosly W.: "A Fuzzy Reasoning Database
Question Answering System", IEEE Trans. on Knowledge and Data Engineer-
ing, December 1994.
[8] Zadeh L. A. : "The role of fuzzy logic in the management of uncertainty in ex-
pert systems", Fuzzy Sets and Systems 11 (1983).
[9] Zadeh L. A. : "Fuzzy Sets as a Basis for a thory of Possibility", Fuzzy Sets and
Systems 1 (1978).
[10] Selinger, P.G. et al. : "Access path selection in a relational database system",
ACM SIGMOD Conf., Boston, May 1979.