15
INFORMATION SCIENCES 10, 331-345 (1976) 331 Fuzzy and Probabilistic Programs EUGENE S. SANTOS Department of Mathematics, Youngstown State University, Youngstown, Ohio Communicated by L. A. Zadeh ABSTRACT In this paper, a general formulation of fuzzy programs or fuzzy algorithms is introduced. The relationship between this formulation and other existing formulations is studied. I. INTRODUCTION Using the concept of the membership function of a fuzzy set [12], many important notions, which are fuzzy in nature, may be assigned a precise meaning and therefore made amenable to mathematical analysis. One such example is the notion of fuzzy programs or fuzzy algorithms, which was introduced in [13]. Intuitively, a fuzzy program or algoritghm is a way of imprecisely specifying a course of action. We encounter many such situations in our daily life. Familiar examples include cooking recipes, driving instruc- tions, etc. Two equivalent formulations of fuzzy programs or algorithms were introduced in [6] which correspond to the conventional Turing algorithms and Markov algorithms. These formulations provide a solid foundation for the study of fuzzy programs and algorithms. However, like their conventional counterparts, these formulations cannot be conveniently applied to most problems of practical interest. Another formulation of fuzzy programs or algorithms was introduced in [1], and generalizations of this formulation were given in [4, 11]. Although this formulation and its generalizations are satisfac- tory in dealing with certain practical problems, it is shown in the present paper that they are very restrictive in nature. The main objective of the present paper is to provide a formulation of fuzzy programs or algorithms which is general enough to encompass all existing formulations and yet suitable for dealing with problems of practical interest. The basic ideas behind this formulation are similar to those given in [8, 10]. ©American Elsevier Publishing Company, Inc., 1976

Fuzzy and probabilistic programs

Embed Size (px)

Citation preview

I N F O R M A T I O N S C I E N C E S 10, 331-345 (1976) 331

Fuzzy and Probabilistic Programs

EUGENE S. SANTOS Department of Mathematics, Youngstown State University, Youngstown, Ohio

Communicated by L. A. Zadeh

ABSTRACT

In this paper, a general formulation of fuzzy programs or fuzzy algorithms is introduced. The relationship between this formulation and other existing formulations is studied.

I. I N T R O D U C T I O N

Using the concept of the membership function of a fuzzy set [12], many important notions, which are fuzzy in nature, may be assigned a precise meaning and therefore made amenable to mathematical analysis. One such example is the notion of fuzzy programs or fuzzy algorithms, which was introduced in [13]. Intuitively, a fuzzy program or algoritghm is a way of imprecisely specifying a course of action. We encounter many such situations in our daily life. Familiar examples include cooking recipes, driving instruc- tions, etc. Two equivalent formulations of fuzzy programs or algorithms were introduced in [6] which correspond to the conventional Turing algorithms and Markov algorithms. These formulations provide a solid foundation for the study of fuzzy programs and algorithms. However, like their conventional counterparts, these formulations cannot be conveniently applied to most problems of practical interest. Another formulation of fuzzy programs or algorithms was introduced in [1], and generalizations of this formulation were given in [4, 11]. Although this formulation and its generalizations are satisfac- tory in dealing with certain practical problems, it is shown in the present paper that they are very restrictive in nature.

The main objective of the present paper is to provide a formulation of fuzzy programs or algorithms which is general enough to encompass all existing formulations and yet suitable for dealing with problems of practical interest. The basic ideas behind this formulation are similar to those given in [8, 10].

©American Elsevier Publishing Company, Inc., 1976

332 E U G E N E S. SANTOS

The main contents of the present paper are contained in the next four sections. In Section II, the basic formulation of fuzzy programs is introduced. There are many interesting models of fuzzy programs, including probabilistic programs, maximin programs [5], max-product programs [5], nondeterministic programs [3], etc. In order to provide a uniform definition for these and other models of fuzzy programs, the concepts of ordered semiring I4," and W- machine are introduced. The various models of fuzzy programs are then obtained by choosing the appropriate ordered semiring 14".

In Sections III and IV, the relationship between the formulation of fuzzy programs given in Section II and those given in [1,4, 6, 7, 11] are examined. It is shown, among other things, that the formulations given in [1,4, 11] are programs computable on a finite W-automaton, and the formulations given in [6,7] are programs computable on a Turing W-machines.

An example to fuzzy programs is given in the last section. This same example was also considered in [1, 11]. It is chosen to enable the readers to compare the various formulations involved.

II. F U Z Z Y P R O G R A M S

In this section, a mathematical formulation of fuzzy programs is introduced. Relationships between this formulation and the existing ones [I, 4, 6, 7, 11] are discussed in subsequent sections.

DEFINITION. An instruction is a string of one of the following forms:

Start : go to L L : do F; go to L~

L : i f P t h e n g o t o ( L i , L 2 . . . . . Ln)

L : halt

where n = 1,2, 3 . . . . ; L, Lt, L2 . . . . . Ln E E (the labels); F E °7 (the function or operation symbols); and P E °) n (the n-valued predicate or test symbols). The four types of instructions are called, respectively, start, operation, test, and halt instructions. If an instruction start with the label L, then L is called the label of the instruction. A program is a finite set ~" of instruction containing exactly one start instruction and no two instructions in ~r have the same label.

Except for the concept of test instructions, the definition of the various concepts introduced above are essentially the same as those given in [8, 10], and readers are referred there for further details and motivations. The idea behind the concept of test instructions as defined above is as follows: in the deterministic case, the symbol P is to represent an n-valued predicate, i.e.,

F U Z Z Y A N D PROBABILISTIC P R O G R A M S 333

P is a function which assumes values in the set (1,2, 3 . . . . . n}, and if the value of P is f, then the next instruction to be executed has label L r. C.learly, if n = 2, then the concept of test instructions defined above reduces to the correspond- ing concept given in [8, 10].

In the above definition, F and P are merely symbols and no meaning has yet been given to them. The problem of giving meaning to these symbols and the various concepts defined above will be the main concern of the rest of this section.

There are many interesting models of fuzzy programs. The following concept will enable us to give a uniform definition for these models, as well as other models, of fuzzy programs.

DEFINITION. An ordered semiring is a quadruple ( IV, ~ , ®, -< ) where W is a nonempty set, ~9 and ® are binary operations on W and < is a partial ordering relation on W satisfying the following conditions:

(1) for every a, b , c ~ W,

a ~ b = b ~ a ,

a ® b = b ® a ,

a ~ ( b ~ c ) = ( a ~ b ) ~ c ,

a ® ( b ® c ) = ( a ® b ) ® c ,

and

a ® ( b ~ c ) = (a®b) + ( a ® c);

(2) there exists 0, 1 E W such that a ~ ) 0 = a = 0 ~ a and a ® 1 = a = 1 ® a for all a ~ W;

(3) for every a,b E IV, a .< a + b and b -< a + b.

The concept of semiring was introduced in [9] to serve as a unifying concept for the various existing models of finite automata. However, the structure of a semiring alone is not sufficient for our present endeavor, since we are often faced with the problem of applying the ~ operator to an infinite set. A simple solution to the problem is the concept of ordered semiring introduced above. Unfortunately, condition (3) of the definition of ordered semiring rules out such semiring as the semiring associated with generalized automata [9]. However, this is a small price to pay since it is difficult, if not impossible, to extend addit ion to an infinite set of real numbers.

Examples of ordered semiring which yield interesting models of fuzzy

334 E U G E N E S. SANTOS

programs include: W w = ( R +, + ,x, < ), W x =([0, !], max, min, < ), Wi = ([0, I], rain, max, > ), Wr = ([0, 1 ], max, x, ~< ), and Wu = (( 0, 1 }, max, min, < ), where R÷ is the set of all nonnegative real numbers.

DEFINITION. Let (W, ~ , ®, -< ) be an ordered semiring, a E W and W 0 C IV. a is an upper bound of W 0 is and only if b -< a for all b E W 0. a is the least upper bound of W 0, in symbols, a - - Lub W 0, if and only if a is an upper bound of W 0 and for every upper bound b of Wo, a -< b. a is the sum of all elements

in W0, in symbols, a - - ~ W 0, if and only if a - - Lub {a I + a2+" "" + a,[al Wo, i-~ 1,2 . . . . . n and n = 1,2,3 . . . . }.

PROPOSmON 2.1. Let (W, ~ , ®, < ) be an ordered semiring. (a) O • a for all a E W.

(b) Y. { a,,a2 . . . . . an} = a l ~ a 2 ~ . . . + an for all a l e W, i= 1,2 . . . . . n, and n-- 1,2,3 . . . . .

In what follows, if no confusion is likely to arise, then we shall write W for the ordered semiring ( W, ~ , ®, < ).

DEFINITION. Let W be an ordered semiring, and let U and V be nonempty sets. A W-function f from U into V is a function from V × U into W.

R~MARK. f ( v lu ) is the weight or grade that the value of the function at u i s v .

DEFINITION. Let W be an ordered semiring. A W-machine is a function defined on the set {I} t_J ~- tA ~ tA { O ) for which there exist sets X (the

input set), M (the memory set) and Y (the output set) such that: (i) a.~ z is a W-function from X into M; (ii) for every F E ~', a31Lr is a W-function from M into M; (iii) for every P Q P , there exists a positive integer n such that 91~ e is a

W-function from M into (1,2 . . . . . n); and (iv) ¢AL 0 is a W-function from M into Y. The four kinds of functions given in (i), (ii), (iii), and (iv) are called,

respectively, input, operation, test, and output functions.

In the above definition, we assume the symbols I and O (standing for input and output, respectively) are identifiers not belonging to either the sets ~ or P . Moreover, we used the subscript notation a'AL~ as an alternate to the functional value notation °31L(I).

If W is taken to be Ww, Wx, WI, Wr, or WN, then the corresponding W-machine will be referred to, respectively, as weighted, maximin, minimax, maxproduct, or nondeterministic machines. Besides these machines, there are two other interesting types of machines, namely, the probabilistic and the deterministic machines. A probabilist ic machine is a weighted machine in which the input, operation, test, and output functions are all probabilistic.

FUZZY AND PROBABILISTIC PROGRAMS 335

A Ww-funct ionf from U into V is probabilistic if and only if for all u E U,

( f ( v [u ) :v E V} exists and is less than or equal to 1. A deterministic

machine is any W-machine in which the input, operation, test, and output functions are all deterministic. A W-function f from U into V is deterministic if and only if for every u E U, there exists a VoE V such thatf(vo[u)= 1 and f(v[ u)= 0 for all v 4: v0. The concept of deterministic machines coincides with the concept of machines defined in [8, 10].

NOTATION. Let o-~ be a W-machine and n = 1,2, 3 . . . . . Pn is the subset of P consisting of all P E P such that M e is a W-function from M into (1,2 . . . . . n}.

DEFINITION. Let P E o ) . If ¢-~e (rim) = ¢AiLP (rim') for all m, m ' E M and f-- 1,2 . . . . . n, then P is said to be unconditional. A test instruction L: if P then go to (L~, L v . . . , Ln) where P is unconditional is called an unconditional test instruction.

REMARK. In the deterministic case, an unconditional test instruction corresponds to an unconditional GO TO statement. These unconditional test instructions make it unnecessary to consider programs in which a weight is assigned for the next instruction to be executed.

DEFINITION. Let ~r be a program and ~ a W-machine. 7r is admissible on 9It, or ¢A~ admits ~r, if and only if (i) for every operation instruction of the form L: do F; go to L', F E 9 , and (ii) for every test instruction of the form L: if P, then go to (LI, L 2 . . . . . L,,), PEa), , .

NOTATION. Let ~" be a program and M a W-machine which admits ~r. t r r p w p l

For every LI,L E ~, mt ,m2EM, and wE W, we write (L ,ml)---~(L ,m2) if and only if we have either an instruction of the form

L' : do F; go to L

belonging to rr, in which case L"ffi L and w= ~ILF (m2[m 0, or an instruction of the form

L ' : i f P then go to (LI, L 2 . . . . . L,,)

belonging to ~r, in which case m~ = m2, L" = L r for some f = 1,2 . . . . . n, and

w = 9L e (fire). Otherwise, (L', m l ) ~ ~rL", m y x where 0 is the additive identity

of W.

DEFINITION. A computation by the program ~r on the W-machine °31L which admits 7r is a finite sequence

x, Lo, mo, Li ,m I . . . . . Ln, mn,y (2.1)

336 E U G E N E S. SANTOS

where x E X,y E Y, L i E E, m i ~ M, i = 0, 1 . . . . . n, in which L 0 is the label con- tained in the start instruction of ~r, and L, is the label of some half instruction in ~r. The weight associated with (2.1) is an element w ~ W such that w = Wo® w l ® w 2 ® . . . ®w,+ I where wiE W, i = 0 , 1,2 . . . . . n + 1, w0= ~ t ( m o [ x ) , wn+ ~

w1

= °31Lo(Y[m,), and for every i = 1,2 . . . . . n, (Li_l,mi_l)--*(Li, mi). The computa- tion (2.1) is feasible if and only if its weight w ~ 0 . The x a n d y in (2.1) are called, respectively, the input and output of the computat ion (2.1).

D~HNITIO~. Let ~r be a program and 0~ a W-machine which admits 7r.

For each x E X and y E Y, define 9~,, (y lx) to be ~ W o, if ~ W 0 exists, where W 0 is the set of weights associated with some computat ion by ~r on ~.-~ with input x and output y.

In general, cAlL,, (y lx) is not always defined. If ¢AL,~ (y[x) is defined, then it represents the weight that the program ~r computed on the machine M yields output y given input x.

It is easy to verify that for W = Wx, WI, Wp, or W N, 91L, (y[x) is defined for all x E X a n d y E Y. Thus cAlL,, is a W-function from X into Y. In addition, if ¢Y~ is a probabilistic machine and ~r is a program admissible on e ~ , then ~--'~ (y lx) is also defined for all x ~ X a n d y ~ V. Moreover, in this case, 9~ is a probabilistic function from X into Y.

DEFINITION. A program ~r together with a W-machine which admits rr is called a W-program. In general, any W-program will be referred to as a fuzzy program. Moreover, if °31L is a so-and-so machine and 7r is a program admissi- ble on cAlL, then we shall call the pair (Tr, glL) a so-and-so program.

The above discussions give a precise formulation of the concepts of maxi- min programs, probabilistic programs, max-product programs, nondeterminis- tic programs, deterministic programs, and other types of fuzzy programs. It is clear that a deterministic program behaves in exactly the same manner as a program defined in [8, 10]. Moreover, except for the role of input /ou tput , a deterministic program is essentially an ordered pair (S, 5~ ), where S is a program schema and 5 is an interpretation of S, as defined in [14].

III. G E N E R A L I Z E D FUZZY M A C H I N E S

Another formulation of fuzzy programs was introduced in [1], and general- izations of this formulation were discussed in [4, 1 1]. Although this formulation and its generalizations are satisfactory in dealing with certain practical prob- lems, it will be shown in this section that this formulation of fuzzy programs together with its generalizations are very special cases of the fuzzy programs defined in the previous section, and hence are very restrictive.

FUZZY A N D PROBABILISTIC P R O G R A M S 337

DEFINITION. A generalized machine is a 6-tuple A = (K, S, xI',s o, T, I4") where K and S are finite nonempty sets, IV is an ordered semiring, xt, is a Iv-function f r o m K × S i n t o S , s 0 E S a n d TC_S.

In the above defintion, K is the set of machine instructions, S is the set of internal states, W is a weight space, q' is the state-transition function, s o is the initial state, and T is the set of final states. In the definition of gener- alized machine given in [1 l], W is assumed to be a lattice ordered semigroup. It is clear that every lattice ordered semigroup with identity is an ordered semiring. Since all lattice ordered semigroups which are of interest in the theory of fuzzy programs have identity, therefore the above definition of generalized machines is a generalization of the corresponding concept defined in [11]. This generalization enables us to consider the probabilistic case by taking W = IV,, and imposing certain constraints on q'. (Observe that it is impossible to obtain the probabilistic case from the definition given in [11] with W being a lattice ordered semigroup.)

NOTATION. Let C be a nonempty set. C* is the free semigroup generated by C with identity e. If/.t E C*, then lg(~) will denote the length of/~.

DEFINITION. Let A =(K ,S ,9 , so , T, IV) be a generalized machine. The W-function xI, will be extended to a A-function from K* × S into S as follows by induction on lg(g), g ~ K*:

1 i f s ' = s " q ' (s" le ' s ' )= 0 i f s ' ~ s "

and

q'(s"l ~,~,0, s')= E ('I'(s"l ~,,~)®,I'(~'1 ~ o , s ) : ~ s )

where s ',s" E S, Ix E K *, and/. toe K.

In [11], the extension of 't' is done by using the operation V of a lattice instead of the sum ~, defined above. The former method of definition rules out probabilistic machines as a type of generalized machines.

DEFINITION. A generalized fuzzy machine is an ordered pair (A,~) where A = (K, S, 9 , s 0, T, IV) is a generalized machine and Y. is a finite set of fuzzy instructions and each fuzzy instruction o E Y. is a Iv-function from S into K.

In the defintion of generalized fuzzy machines given in [1 l], the generalized fuzzy machine may have a weight space different from the weight space of its generalized machine. Although this is mathematically possible, it is rather unnatural as we shall see in the sequel. For this reason, we shall consider only

338 E U G E N E S. SANTOS

generalized fuzzy machines whose weight space is the same as the weight space of its generalized machines.

DEHrarnON. Let (A, E) be a generalized fuzzy machine where A =(K,S ,q ' , so , T, W). Any element ~ of Y..* is called an elementary fuzzy program, and any function from E* into W is called a fuzzy program.

In [1, 11], a fuzzy program is defined to be a regular expression over Y.. Clearly, it is a special case of the above definition.

DEHNmON. Let (A, Z) be a generalized fuzzy machine where A = (K, S, xI',s 0, T, W) and let ~ = olo 2 • • • o, E Y.* where o i E Y. for all i = 1,2 . . . . . n. An execution of ~ on A is a sequence

S0, gl,Sl,~2 . . . . . IZ,,S, (3.1)

where si E S and p~ ~ K for all i = 1 ,2 , . . . ,n and s, ~ T. The weight associated with execution (3.1) is an element w E W such that w = w~ ® w'~ ® w2®

w'2®" " ® w , ® w;, where for every i = 1,2 . . . . . n, w i = oi(I~ilsi-1) and w~ = q'(s,.] I~,si-O. The execution (3.1) is feasible if and only if w ~ 0 . The s, in expression (3.1) is called the final state of the execution.

DEFINmON. Let (A,Z) be a generalized fuzzy machine where A

= (K, S, xt,, So, T, W). For every ~ ~ Z* and s ~ S, define A (s]O) to be ~ W 0

where W 0 is the set of weights associated with some execution of ~ on A with final state s, if s ~ T, and define A (s[O)--0 if s ~ T.

THEOREM 3.1. There exists a W-machine cAlL where X = Y = U ' f o r some set U, such that for every general fuzzy machine (A, 3~) where A

= (K, S, xt', s o, T, W), ~ C_ U', and S C_ U, there exists a program 7r which is admissible on tAIL for which °')iL , (slO) = A (sl~) for all s ~ S and ~ E Y.*.

Proof. Let °3E be a W-machine with X = Y= U* for some set U, M = U* × U*, ~ = {Fo) U {Fu :u E U) and P = {Pu :u E U} U ¢Yo, where for every ct, fl, y, 8 E U*, and f = l, 2,

1 if a = e and fl----/, ¢YL/((cqfl)[V)-- 0 otherwise

1 i f ~ = f l ~-')E°(a[(fl'7))= 0 otherwise '

10 if a - - - r and 8- -uf l for some M r o ( ( , ~ , f l ) l ( v , 8 ) ) = u e u

otherwise

FUZZY A N D PROBABILISTIC PROGRAMS 339

1 i f / 3 = S a n d a = y u 9rC~"((~'/3)l(Y'8))= 0 otherwise

¢3Le,(fl(a'/3 )) _- [ I

0

if f = 1 and/3 = m" for some I" E U* or f = 2 and/3 =/= u~" for all z E U* otherwise

and P0 is the collection of all unconditional test function. Observe that °31L, except for the unconditional test functions, is essentially the one-way finite automaton defined in [8, 10]. Let Y-= (cq,o2 . . . . . on}, K = {/zl,/z 2 . . . . . /z,}, and S = {So, S~ . . . . . st}. Define or to be the program consisting of the following instructions:

Start : go to Lg

L/ : if Pi then go to ( Lj°, Lj i + ' )

Lj i° : do F0; go to Lj il

Ljil: if Ps i then go to (LIj, L2j . . . . . L,j)

Lrj : if PV then go to ~ (L0, L, . . . . . r - )

Lg+l : do F,f;go to L

L : halt

where i= 1,2 . . . . . n ; j = 0 , 1,2 . . . . . t ; f = 1,2 . . . . . r; ~ E ( ~ : s e E T ) ; °3K~, is a W-function from M into { 1,2 . . . . . r} such that °'.)Le/(qlm) = oi(tZqlSj) for all m E M and q = 1,2 . . . . . r; and ¢3L/, is a W-function from M into { 1,2 . . . . . n + 1) such that °3L, (q m)=~t'(s ~lttk,s.) for all m E M and q = l , 2 n + l

• k j I q - - y . . . .

Observe that the instruction with label Lj n and L~j simulate, respectively, the action of oi and 't'. Thus, it is easy to verify that 9rC,(sl~)=A(sl~) for all s E S and a E Y.*.

It follows from the above proof that the formulations of Chang [1], Tawaka and Mizumoto [11], etc. are very restrictive since the finite automaton has very limited computational capability.

IV. T U R I N G FUZZY A L G O R I T H M S

A natural way to formalize the concept of fuzzy algorithms is via the concept of Turing fuzzy machines. A brief discussion of Turing fuzzy machines was given in [13] and detail formulation of this concept for the maximin and probabilistic cases can be found in [6] and [7], respectively, In this section, we shall examine the relationship between Turing fuzzy machines and fuzzy programs.

340 E U G E N E S. SANTOS

DEFINITION. Let W be an ordered semiring. A Turing W-machine is specified by a sextuple Z=(U,S, V,C,p,so) where U, S, V, and C are finite nonempty sets, U U V C_ C, S O C = ~ (empty set); p is a W-function from T x S into S x (C U { + , - , • }), + , - , • ~ C; and s0~ S. Moreover, for every c E C, p(s',. [c,s) =0 for s~s' .

In the above definition, U, V, and C are, respectively, the set of input, output, and tape symbols. S is the state set and s o is the initial state, p(s',zlc,s) is the weight of the "next act" of the Turing W-machine given that its present state is s and the tape symbol c is scanned. Like the conventional Turing machines [2], the "next act" of the Turing W-machine may be one of the following:

(1) z ~ C*: replace c by z and go to state s'. (2) z = + : move one square to the right and go to state s'. (3) z = - ' move one square to the left and go to state s'. (4) z = . " stop.

In what follows, if Z= (U, S, V,p,so) is a Turing W-machine, then we shall assume that b E C and b ~ U U V. The symbol b stands for blank.

DEFINITION. Let Z=(U,S, V,p,so) be a Turing W-machine and a E (C U S)*. a is an instantaneous description of Z if and only if (i) a contains exactly one s ~ S and s is not the rightmost symbol of a, (ii) the leftmost symbol of a is not b, and (iii) the rightmost symbol of a is not b unless it is the symbol immediately to the right of s. The collection of all instantaneous descriptions of A will be denoted by D (Z).

DEFINITION. Let Z=(U,S, V,C,p,so) be a Turing W-machine. p z is the W-function from D(Z) into D(Z) such that for every a,fl E D(Z),

pZ(B~)=

p(s',c'lc,s) ifa=gsc& fl=~s'c'~, c '8~e o r a = ~ ' s c , B=gs'b, c'=e

p(s',+lc,s ) ifa=~scc'& fl=~cs'c'& ~cv~b o r a = s c c ' & B=s'c'& c=b o r a = ~ ' s c , fl=~cs'b, ~cv~b o r a = s c , ~=s'b, c=b

p(s ' , - lc ,s ) ifa--~c'sc6, ,6=~s'c'c6, c6v~b ora=~c'sc, fl=~s'c', c=b ora=sc6, fl=s'bcS, c6¢b ora=sc, fl=s'b, c=b

0 otherwise

where ~',8 ~ C * , s,s'ES, c,c'EC, and zEC.

FUZZY A N D PROBABILISTIC PROGRAMS 341

DEFINITION. Let Z = (U, S, K, C,p,so) be a Turing W-machine. A computa- tion of Z with input x E U* and output y ~ I/* is a finite sequence

ct0, at, % . . . . . a, (4.1)

of elements of D (Z) where % = SoX and cq = fls ' /where fly =y , s E S. The weight associated with computation (4. l) is 60 =pZ(alla0)® p z ( % l a O ® . . . ® pZ(a , la ,_O®p(s , . Ic ,s ) where c is the symbol contained in a, which is immediately to the right of s.

DEFIr~[TION. Let Z = (U, S, V, C,p,so) be a Turing W-machine. For every

x E U* a n d y E V*, define Z ( y l x ) to be ~ W 0, if it exists, where W 0 is the

set of weights associated with some computation of Z with input x and output y.

We shall refer to the Turing W-machine where W is W w, W x, W t, W r, or W~ as Turing weighted machines, Turing maximin machines, Turing minimax machines, Turing max-product machines, or Turing nondeterministic machines, respectively. In addition, a Turing weighted machine in which p is probabilistic will be referred to as a Turing probabilistic machine, and any Turing W-machine in whichp is deterministic will be referred to as a Turing deterministic machine.

It is clear that Turing deterministic machines behave in exactly the same manner as conventional Turing machines [2]. Moreover, despite the differences in definitions, the behavior of Turing maximin machines and Turing probabil- istic machines are essentially the same as Turing fuzzy algorithms [6] and simple probabilistic Turing machines [7].

THEOREM 4.1. There exists a W-machine with X C_ ~* and Y C_ Y.* for some set Y. such that for every Turing W-machine Z = ( U, S, V, C,p,so) with C C_ Y., there exists a program ~r which is admissible on 9L with the property that for every x ~ U* and y ~ U*, 91L (ylx) and Z (ylx) are either both defined or both undefined, and if both are defined, then ~L (YlX)= Z (ylx).

Proof. Let °31L be a W-machine with M = ( ~ U (1'})*, 1' is a pointer which does not belong to Y., X C_ Y., Y c_ Y., ~ = { MR, ML ) U { Fa : a E Z }, and = ( P o : a E Z } U °~0, where for every x E X , y ~ E , c t , f lEM, and [ = 1,2,

1 if a = l'x ~ l ( a l x ) - - 0 otherwise

1 9 ~ ° ( Y l a ) = { 0

i fy is obtained from a by omitting $ otherwise

342 E U G E N E S. S A N T O S

1 ifct=),~cS, f l = ) , ~ a S f o r s o m e 3 , , S E E * a n d c E E °31LF°(fllc0---- 0 otherwise

¢JlLMR(flla)----{ ~ otherwiseifa=y$c~'f l=TcTdf°rs°me' / 'SEY'*andcEZ

-G~ML( ]~ lot) = { i if ct = "fc~c'8,fl = yTcc'~ for some 1',8 E E * and c,c' E~, otherwise

0

if f = 1 and a=¥Ta8 for some y,~ E Z * or f = 2 and a~'[~a8 for all 1',~ E E * otherwise

and Po is the col lect ion of all uncondi t iona l test functions. Observe that . ~ , except for the uncondi t iona l test functions, behaves in essential ly the same manner as the Turner machine def ined in [10]. Let S = {So, S t . . . . . s,}, C = (ct,c2 . . . . . Cm}, Cm÷l = + , C,,+1 = -- , and Cm+3 = ". Define 7r to be the p rogram consist ing of the fol lowing instruct ions:

S ta r t : go to L0~

Lij : if Pcj then go to ( L/o, Lij + l )

L/o: if P~ then go to 1 2 (Lo, Lo . . . . . L ~ ÷3,L~,L~ . . . . . L ~ +3 . . . . . C , L ~ . . . . . L : ÷~)

L/ : do Fcj; go to Lil

Lim+ t : doFMR;gotoLn L~m+2: do FML; go to Lil Li m+3 : halt

where i = 0 , 1 , 2 , . . . , n ; j = 1,2 . . . . . m; and ¢3Le/ is a W-funct ion f rom M into {1,2 . . . . . ( n + l ) ( m + 3 ) } such that

e3Le/(Q_[a)=[i(sr'cdcj'si) if a = yl 'cjS, cl = ~ + f ( m + 3 ) ,

f = 0 , 1 , 2 . . . . . n, and e = 1,2 . . . . . m + 3 .

otherwise

It is easy to verify that ~ and ~r have the desired propert ies.

DEFINITION. L e t f be a W-funct ion f rom X into Y. f is computab le if and only if there exists a Tur ing W-machine Z = (U, S, V, C,p,so) such that X = U*,

FUZZY A N D PROBABILISTIC P R O G R A M S 343

Y-- V*, and f ( y l x ) = Z (ylx) for all x E X and y ~ Y. In this case, we say that f is computable by Z or Z computes f.

D~HYmON. A W-function M is computable if and only if the output, operation, test, and output functions are all computable.

Observe that if °3L is computable, then the sets X, Y, and M are at most countable. Moreover, it is easy to construct a Turing W-machine to simulate the computations of a program which is admissible on a computable W- machine. More precisely, we have the following:

THEOREM 3.2. Let 9L be a computable W-machine with input set X and output set Y, and ~r a program admissible on ~ff~. There exists a Turing W- machine Z = ( U, S, V, C,p, So) such that X = U*, Y = V*, and for every x E X and y E Y, qYZ ( y l x ) and Z (y l x ) are either both defined or both undefined, and i f both are defined, the ~L~ ( y l x ) = Z (y lx) .

IV. AN EXAMPLE OF FUZZY P R O G R A M

Several examples of fuzzy programs were given in [1, 1 I]. In order to illustrate how to fit these examples into the formulation given in Section II, we discuss briefly in this section one of these examples.

In this example, a sequence of driving instructions and a map is given. A driver is supposed to use this information to find his destination. For simplicity, we assume that the map is digitized and hence it could be repre- sented by a set of points on the plane whose coordinates are integers, where each point in the set represent a point on the road. Typical driving instructions include "go straight about n unit distances," "turn left," "turn right," "go straight until the nth landmark," etc., where the "landmark" could be a street light, a gasoline station, etc.

In order to fit the above problem into the formulation given in Section II, we will have to construct an appropriate W-machine °')IL. The W-machine o-~ has memory set M consisting of triples (a ,b ,v) where (a,b) is a point on the plane with integral coordinates which represents the location of the car, and v is a unit vector which represents the direction in which the car is headed. The input set X-- M and the output set Y consists of ordered pairs (a, b) where a and b are integers. The input function °31Lj corresponds to the identitiy function and the output function °3lLo corresponds to the function which maps every (a, b, v) into (a, b). Moreover, °31L does not have any test functions but has several operation functions, one for each type of driving instructions. Using these operation functions, the ith driving instruction in a sequence of driving instructions can be translated into an operation instruction of the form

344 E U G E N E S. SANTOS

L;_ ~: do Fi; go to Li. The collection of all such operation instructions together with the instructions "Start: go to L0" and "L, : halt," where n is the length of the sequence, forms a program rr. The computation by ~r on 91L behave in a manner specified by the sequence of driving instructions and the map.

It remains to show how to construct the corresponding operation function for each driving instruction. For simplicity, we shall consider only the driving instruction "go straight about n unit distances." The corresponding operation function _G~L~, may be defined as follows:

6~F ((a 2, b2, v2)l(al, bl, vl ))

=f , , (V (a2 -a , )2+(b2 -b t ) 2 )G((a2,b2,v2)l(al,b,,vl))

wheref , (d) is the weight associated with the distance d and Gn((a2, b2, v2) ](a~, b~, v0) is the weight associated with the statement "the location (a2, b2) and the direction v2 can be attained by going 'straight' from the location (a~,bl) and headed in the vl direction." Typical examples of f , and (3, for the maximin case are:

L ( d ) = l + [ ( n - d ) / c ] ~

where c is a parameter,

and G is a deterministic function where Gn((a2, b2, v2)(al, b~, v 0 ) = 1 if and only if vl = v2, the vector from (al,bO to (a2,b2) is parallel to vl, and every point on the line segment joining (a I, b0 and (a2, b2) having integral coordinates is a point on the map. Observe that the functionf~ depends only on n while G depends only on the map. Operation functions of other driving instructions can be constructed in a similar manner.

For practical purposes, the fuzzy program (Tr, 9E) obtained above is applicable only to a given input (a, b, v) where (a, b) and v denotes the original location and direction of the car. However, theoretically, (~r, ~.'~ ) may accept any input from the input set X, and a3iL,, ((a 2, b2)l(a~, bl, v)) gives the weight that the car will arrive at location (a2,b2) given that its original location and direction are (al,b 0 and v, respectively.

REFERENCES

1. S. K. Chang, On the execution of fuzzy programs using finite-state machines, IEEE Trans. Computer 21, 241-253 (1972).

2. M. Davis, Computability and Unsolvability, McGraw-Hill, New York, 1958. 3. R. W. Floyd, Nondeterministic algorithms, J. Assoc. Comput. Mach. 14, 636-644 (1967).

F U Z Z Y A N D P R O B A B I L I S T I C P R O G R A M S 345

4. R. Jakwbowski and A. Kasprzak, Application of fuzzy programs to the design of

matching technology, Bull. Acad. Pol. Sci. 11 (1973).

5. E. S. Santos, Maximin sequential-like machines and chains, Math. Sys. Theory 3, 300-309

(1969).

6. E. S. Santos, Fuzzy algorithms, Inform. Control 17, 326-339, (1970).

7. E. S. Santos, Computability by probabilistic Turing machines, Trans. An. Math. Soc.

159, 165-184 (1971).

8. E. S. Santos, Machines, programs, and languages, J. Cybernet., to appear. 9. E. S. Santos, Finite automata over a semiring, presented to the Computer Science Conf.,

Detroit, Mich., (1974). 10. D. Scott, Some definitional suggestions for automata theory, J. Comp. Sys. Theory 1,

187-212 (1967).

11. K. Tanaka and M. Mizumoto, Fuzzy programs and their executions, Proc. U.S.-Japan

Sere. on Fuzzy Sets and Their Appl., to appear.

12. L. A. Zadeh, Fuzzy sets, Inform. Control 8, 338-353 (1965).

13. L. A. Zadeh, Fuzzy algorithms, Inform. Control 12, 94-102 (1968).

14. M. Zohar, Program schemas, in Currents in the Thoery of Computing, A. H. Aho, Ed.,

Prentice-Hall, Englewood Cliffs, N.J., 1973, pp. 90-142.

Received August, 1975.