University of Montana ScholarWorks at University of Montana Theses, Dissertations, Professional Papers Graduate School 1990 Using a classifier system to simulate a Turing machine Reine Hilton The University of Montana Follow this and additional works at: http://scholarworks.umt.edu/etd Recommended Citation Hilton, Reine, "Using a classifier system to simulate a Turing machine" (1990). Theses, Dissertations, Professional Papers. Paper 8149. This Thesis is brought to you for free and open access by the Graduate School at ScholarWorks at University of Montana. It has been accepted for inclusion in Theses, Dissertations, Professional Papers by an authorized administrator of ScholarWorks at University of Montana. For more information, please contact [email protected]. I Maureen and Mike MANSFIELD LIBRARY Copying allowed as provided under provisions of the Fair Use Section of the U.S. COPYRIGHT LAW, 1976. Any copying for commercial purposes or financM gain may be undertaken only with the author’s written consent. University of Montana USING A CLASSIFIER SYSTEM TO SIMULATE A TURING MACHINE By Reine Hilton B. S., Marietta College, 1964 M. S., Rutgers University, 1966 P r e s e n t e d in partial fulfillment of the re q u irem en ts for the d e g re e of Master of S cience University of Montana 1990 Approved by Chairman, Board of Examiners ►ean, Graduate SchotJT Date UMI Number: EP38950 All rights reserved INFORMATION TO ALL USERS The quality of this reproduction is dependent upon the quality of the copy submitted. In the unlikely event that the author did not send a com plete m anuscript and there are missing pages, th e se will be noted. Also, if material had to be removed, a note will indicate the deletion. UMT O is»attation Publishing UMI EP38950 Published by ProQ uest LLC (2013). Copyright in the Dissertation held by the Author. Microform Edition © ProQ uest LLC. All rights reserved. This work is protected against unauthorized copying under Title 17, United S tates C ode Proj(^^st ProQ uest LLC. 789 E ast Eisenhower Parkway P.O. Box 1346 Ann Arbor, Ml 4 8 1 0 6 - 1346 Hilton, Reine, M.S., November, 1990 Science Computer Using A Classifier System To Simulate A Turing Machine(51 pp.) Director; Aiden H. Wright [ /''} I c u ( /i/w O n e of th e m ost important m odels o t computation is th e Turing m achine. This model forms the b a s i s for th e formal definition of an algorithm - an y co m p u tatio n th a t c a n b e d e s c r i b e d a s an algorithm c a n b e performed by a Turing machine, an d vice versa. A Turin g m a c h i n e c a n b e d e s i g n e d to p e r fo rm c o m p l i c a t e d co m p u tation s. Unrestricted g ra m m a r s a n d p - r e c u r s i v e functions a r e two additional models of computation that have b e e n shown to have the s a m e computational powers a s a Turing machine. A classifier s y ste m is a special form of a production system , a ru le -b a s e d s y ste m w h e r e a working memory is m a tc h e d a g a in s t a se t of rules. O n e of the m atched rules Is ch o s e n to fire resulting in the working memory to be c h a n g ed . The classifier s y s te m also u s e s with a working memory and a s e t of rules. In this c a s e , all m atched rules fire, resulting in a new working memory. Both s y s te m s can be u s e d to perform calculations. The goal of this pap er is to show that the computational powers of a classifier system are the s a m e a s th o s e of a Turing machine. This is d o n e by showing that the s e t of u - r e c u r s i v e fu n c tio n s a n d a classifier s y s te m a r e computationally equivalent. 11 Table of Contents A b s t r a c t ........................................ ............................................................................i i Table of C o n te n ts ...................................................................................................i i i List Of Figures.............................................................................................................. i v A c k n o w l e d g m e n t s ..................................................................................................v 1. Introduction....................................................................................................... 1 2. Abstract Models Of Computation........................................................................ 4 2.1 In tro du ction..........................................................................................4 2.2 Turing Machines........................................................................................4 2.3 G r a m m a r s ...............................................................................................6 2.4 u-recursive F u n c tio n s ......................................................................7 2.5 Equivalence Of The Three Models....................................................... 1 0 3. Classifier S y s t e m ........................................................................................... 1 2 3.1. Introduction........................................................................................ 1 2 3.2. Production S y s t e m ...........................................................................12 3.3. Holland's Classifier S y s t e m ........................................................ 13 3.4. Modified Classifier S y s t e m ......................................................... 1 8 4. Simulation Of A Turing Machine By A Classifier S y s te m .......................2 0 4.1. Introduction........................................................................................ 2 0 4.2. T h e o r e m ................................................................................................ 2 0 4.3. M essag e Length and Representation.......................................... 2 0 4.4. Types of r u l e s .....................................................................................2 3 4.5. Initial functions.........................................................................................2 4 4.5.1. Zero function............................................................................. 2 4 4.5.2. Projection function...................................................................2 5 4.5.3. Successor function.................................................................. 2 5 4.6. C o m p osition ....................................................................................... 2 6 4.7. Examples.................................................................................................. 2 6 4.8. Primitive re c u rs io n ......................................................................... 2 9 4.8.1. E x a m p le .................................................................................3 3 4.9. Unbounded Minimalization ofRegular Fun ctio n s................... 3 6 4.10. O perations on Non-Initial F u n c tio n s ......................................3 8 4.11. S u m m a r y ............................................................................................ 4 7 5. C o n clu sio n......................................................................................................... 4 8 References................................................................................................................... 5 0 111 List Of Figures Figure Figure Figure Figure 4-1: P arse Tree of the Function m u l t .................................................. 41 4-2: Graphical Representation ofComposition ............................ 44 4-3: Graphical Representation of Primitive Recursion ........ 45 4-4: Graphical Representation of Unbounded Minimalization.................................................................................. 46 IV A ckn ow led gm en ts I would like to thank the following: My advisor, Dr. Alden Wright for his help an d inspiration. The other m e m b e rs of my committee, Dr. William Ballard and Dr. Ronald Wilson, for their guidance. T h e University of Montana C om puter S c ie n c e D ep artm en t and faculty m e m b e rs for their academ ic, an d personal support. My family for their patience. Chapter 1 In tro d u ctio n Turing m achines form m uch of the basis for th e o re tic a l c o m p u te r s c ie n c e . They c a n b e d e s i g n e d to perform com plicated c o m p u tatio n s. In stea d of thinking of t h e s e c o m p u ta tio n s a s being p e rfo rm e d by a m a c h in e , one can can think of th em as th e manipulation of strings by g ra m m a r s or a s th e com putation of u re cu rsiv e functions defined on th e natural n u m b e rs . approaches have been s h ow n to b e All of t h e s e com putationally eq uivalent. (Lewis an d Papadimitriou, 1981) A classifier system (Holland, 1986) is another m odel of computation. The p u rp o s e of this p a p e r is to show that a classifier sy stem h a s the s a m e computational power a s a Turing Machine. A classifier s y s t e m can b e written as an algorithmic language. If something can be e x p r e s s e d a s an algorithm, then it can be computed by a Turing machine. This p ap er will show that given any y - r e c u r s i v e function, it can be co m p u te d by a classifier s y stem . S ince Turing m a c h in e s and u - re c u rs iv e functions are computationally equivalent, a classifier s y s t e m will h av e the s a m e com putational po w er a s a Turing machine. The u -re c u rs iv e functions a r e defined on the natural num bers. T he idea is that th e re a r e s o m e very simple functions called the initial functions that a r e c o n s i d e r e d to b e c o m p u ta b le . O n e such function is the s u c c e s s o r function. We c a n e x p a n d the co m p u table functions by combining t h e s e simple functions in certain w a y s such 1 a s by composition. T h e s e new functions a r e also c o n s id e r e d to be com putable, since they c a n b e obtained from th e initial functions by simple combinations. In this m an n er the s e t of co m p utab le functions is built, giving us the s e t of u - r e c u r s i v e functions, which are the o n e s that h a v e b ee n shown to be equivalent to the computation by Turing m achines. Production sy s tem s (Davis an d King, 1977) hav e b e e n u sed for e x p e rt s y s t e m s a n d a s psychological models. A production s y s te m c o n s is ts of production rules called productions, a working memory, a n d a control structure consisting of a simple loop. The productions a r e condition-action constructs. T h o s e productions w h o s e condition part m a tc h e s patterns in the working memory are said to be enabled. The control structure picks o n e of the e n a b le d rules for execution. The firing of this rule c a u s e s the working memory to b e modified. The loop then re p e a ts until there are no more m a tc h e s betw een the rules an d working memory. A classifier sy stem is similar to a production s y s te m . It also consists of rules m essage called classifiers, a working m em ory called list, a n d a control structure. T he classifier s y s t e m a also works by a simple loop w h ere the condition part of the classifiers are m atched a g a in s t the m e s s a g e list. In this c a s e , however, every match c a u s e s a m e s s a g e to b e sen t to a new m e s s a g e list. This new m essage list now becom es th e working m em ory and the loop continues. The m e ssa g e list of th e classifier s y s te m c o n s i s t s of fixed length strings, called m e s s a g e s , over a fixed alphabet . The m e s s a g e list itself Is unbounded. The p - r e c u r s i v e functions h a v e th e natural n um bers a s their domain an d range. There is no upper bound on the size of the natural numbers. In order to re p resen t a natural num ber n by m e s s a g e s of fixed length, a m e s s a g e will be re p eated n times. The p - r e c u r s i v e fu n c tio n s m o d els of com pu tation . and th e In this p a p e r c la s s i f i e r system are I will s h o w th at a Turing m achine c a n b e simulated by a particular type of classifier system . To do this I will show that given any y -recursive function it c a n be c o m p u te d by the classifier s y s t e m p r e s e n t e d . I will p r e s e n t th e rules th at a r e n e c e s s a r y to c o m p u te th e initial functions a n d will also sh o w how to construct the rules for the combinations of t h e s e fun ction s recursive to produce functions th e and y -recursive T uring fun ctio n s. m achines Since have the the y- sam e com putational powers, this will show that a classifier s y s te m an d a Turing m achine are also equivalent in their computational power. Chapter 2 Abstract Models Of Computation 2.1 introduction There are m any m o d e ls of c om p utatio n. This c h a p t e r will desc rib e th ree of them: 1. Turing Machines 2. Grammars 3. li-re c u rs iv e functions. These three m o d e ls have been sh o w n to be c o m p u ta tio n a lly e q u iv a le n t. 2.2 Turing Machines This section will describ e a Turing Machine both generally an d formally in re fere n ce to functions. A Turing m achine c o n s is ts of a finite control unit, a tap e, a n d a h e a d that c a n be u s e d to read symbols from the tap e or to ch a ng e the symbols on the tape. At each step, the symbol at the h e a d is read from the ta p e and, according to the current state of the finite control unit, the symbol is c h a n g e d or the h e a d is moved o n e s q u a r e to the left or to the right. The control unit Is also put into a new state. The ta p e is bounded to th e left, but is infinite in th e direction to th e right. T he input to t h e Turing m achine is inscribed on the left end of the ta p e with the rest of the t a p e containing the blank symbol #. A special sta te , h, called the h alt s t a t e signals the e n d of the computation. For more information a b ou t Turing m achines s e e Lewis an d Papadimitriou, 1981. A Turing m achine, M = (K, Z, & , s), thus, co nsists of a set of s t a t e s K, an a l p h a b e t Z consisting of the s e t of s y m b ols that are allowable on th e t a p e including th e blank symbol #, a transition function ^ th a t d e s c r i b e s th e action a n d th e next s t a t e of the m achine depending on the current state an d th e symbol at the head, an d a special state, s, called the start state. The Turing m ach in e b eg in s execution with the initial input on th e left e n d of th e ta p e a n d the finite control unit in the start state. A c o n f i g u r a t i o n of the Turing m achine sho w s th e s ta tu s of the finite control unit, the location of th e h e a d , an d th e t a p e 's inscription at that particular m om en t, r e p r e s e n t e d a s a 4-tuple. T he first state, followed by the t a p e ’s inscription to the entry is th e current left of the h ea d , then the ta p e symbol at the head, an d finally the t a p e 's inscription to the right of the head. If th e t a p e ’s inscription is empty, it is d e n o te d by the em pty string e. If one c o n fig u r a tio n produces another configuration a s the result of a single move then w e s a y that the first configuration y ie ld s th e s e c o n d configuration in one step. If a configuration s tep s, then p r o d u c e s th e configuration Cg in zero or more is said to yield Cg This is denoted by |-* Cg A Turing m achine can b e thought of a s computing functions. If Z q an d Z^ are alp h ab ets not containing the blank symbol #, and f is a function from Z q* to Z / , then the Turing machine M = (K, Z^ 6 , s) is said to co m p u te f if Z q and Z., a re s u b s e t s of Z q*, there is a u = f(w) in Z^* such that (s, w, #, e) I-* (h, u, #. e). Z a n d for every w in This s a y s that if M is sta rte d with w on its t a p e then it will eventually halt leaving u on the tape. If such a Turing machine M exists, then f is said to be T u r i n g - c o m p u t a b l e 2.3 G ram m ars Every Turing machine can be simulated by a grammar, G = (V, Z, R, S). A g r a m m a r alphabet called th e co n s is ts of an a lp h a b e t V, a s u b s e t Z of the term inal s y m b o l s , a s e t R of r u l e s th at o p e r a t e on th e strings of the g ra m m ar to produce different strings in th e g ra m m a r by replacing a substring a s s o c i a te d with th e lefthand side of a rule by the corresponding right-hand side of that rule, and an e lem en t S of the alp hab et called the s t a r t not a term inal s y m b o l that is symbol. Given a string u in th e gram m ar, if the s u c c e s s i v e applications of rules produce th e string v then this is denoted by u =» * v. We can talk about functions being computed by grammars. The function f is said to be g r a m m a t i c a l l y c o m p u t a b l e if and only if th e re is a g ra m m a r G = (V, Z, R, S), s u b s e t s Z q and Z^ of Z n o t containing #, and strings x, y. x \ y* in V* such that for any w in Z q* and u in Z / f(w) = u if a n d only if xwy * x'uy'. That is, g ra m m ar G com pu tes the function f if there are two pairs of strings in the alphabet V such that from any w in Z q* surrounded by th e first pair of strings, the g ra m m a r will yield a string consisting of the value of f(w) surrounded by the se c o n d pair of strings. Note th at f is defined for strings in an These definitions c a n arbitrary alp h ab e t. b e applied to functions from N to N , the natural num bers, by using s o m e fixed symbol I that is not the blank symbol an d by representing the natural num ber n by the string I" Then the function f : N —» N is said to be grammatically computable by f( l if the Turing computable or function f : { ! } * —> { I } * defined Turing c o m p u ta b le or grammatically com putable, respectively. It can b e shown that every Turing-computable function from strings to strings or from num bers to num bers is grammatically com putable and vice versa. 2.4 u-recursive Functions There are certain sim ple functions defined on th e natural num bers that can be regarded a s computable. T h e s e simple functions are ca lle d fu nction s the initial functions. by com position and We can primitive c o m b in e recursion to these initial form other functions called the primitive recursive functions that will also be com putable. Then by a method called unboun d ed minimalization on regular functions, w e can obtain the s e t of functions called the u re cu rsiv e functions. The rest of this section will lead up to the definition of a u recursive function. to N A function is k - p l a c e if it is a function from for s o m e k > 0. The in i ti a l f u n c t i o n s c o n s is t of three t y p es of functions that a re c o n sid ered to be com putable. They are th e following: 1) th at The 0-place z e r o f u n c t i o n C is a function from to N such 8 C( ) = 0. 2) The p r o j e c t i o n f u n c t i o n s are k-place functions where k > 1 and 1 < I < k such that 7cj (n ^ , ^2* • • • #n^) ~ n j We will deno te the the s e q u e n c e n^, ng, . . . .n,^ by n. 3} The s u c c e s s o r f u n c t i o n a is a 1-place function su ch that a(n) = n + 1 These initial functions can be co m b in e d by th e two following m eth o d s : 1) If t > 0, k > 0, g is an t-place function and h , , . . . , h, are kplace functions, then we can define f to be the k-place function such that for every h in f(ïD = g(hi(r$ ht(n)). Then f is said to be obtained from g, h^ h,by c o m p o s i t i o n . 2) If k > 0, g is a k-place function, a n d h is a (k + 2)-place function, then we can define f to b e the (k + 1 )-place function such that for every n e Nk f(r\0) = g(h) and for every he and m e N, f ( h m + 1) = h(n, m, f(r\ m)). Then f is said to b e obtained from g and h by p r i m i ti v e recursion. A function that is either an initial function or c a n be obtained by the initial functions by applying s o m e s e q u e n c e of composition a n d primitive recursion is said to be p r i m i t i v e The following are som e exam ples functions (Lewis an d Papadimitriou, 1981). of recursive. primitive re c u rs iv e 1) The function recursive by the a. N —» N defined by o^(n) = n + 2 is primitive u se of composition. Here k = t = 1 and g = h^ = Therefore, o^(n) = g(h^(n)) = a(a(n)). 2) The function Og : —►N defined by Og(n^, ng, n^) = n^ + 1 is primitive recursive by composition since O g (n i, ng, n^) = a ( 7c^(n^, ng, Ha))3) The function plus(n^, ng) « n^ + ng is primitive recursive since it is obtained from g = jcj and h * 0 3 by primitive recursion. plus(n, 0) = 7cJ(n) plus(n, m 4 - 1) = Og(n, m, plus(n, m)) A nother slig h tly more multiplication function, mult : T he function co m p lica te d ex a m p le is the —► N, defined by mult(n, m) = nm. mult is ob tain ed from g = Kq a n d h by primitive recursion, w h ere h is defined by composition of plus, an d 7t^ a n d 7c|. T h e function Kq is th e 1-place c o n s t a n t function w h o s e value is always zero. This gives th e following definition: mult(n, 0) = Ko(n) mult(n, m + 1) = h(n, m, mult(n, m)) w here Ko(n) = CO h(x, y, z) - plus(jt^(x, y, z), «^(x, y, z)). In o ther words, mult(n, 0) = 0 mult(n, m + 1) = n + mult(n, m). In order to define the p - r e c u r s i v e fu n c tio n s , a few m ore definitions are needed. If k > 0 and g is a (k + 1)-place function, then 10 the u n b o u n d e d m inim alization of g is the k-place function f defined such that for any he r f(rv = the s m a l l e s t m such that g ( n , m ) = 0 if s u c h J an m e x i s t s ; \ < 0 o therwi se This definition a s s u r e s that f is defined everywhere. The function f is then written a s = |im [g(n m) = 0]. The function g Is said to be r e g u l a r if and only if for every ne there exists an m such that g(r\ m) = 0. A function is said to o b ta in e d from be y - r e c u r s iv e th e initial functions C, if a n d only if it c a n be a n d o by the following o p e r a t io n s : c o m p o s i t io n ; primitive recu rsion ; u nb o u n d ed minimalization of regular functions. 2.5 Equivalence Of The Three Models It c a n be shown that every grammatically com putable function from strings to strings or from n um bers to n um b ers is u - r e c u r s i v e . Then it c a n be show n that every u - r e c u r s i v e com putable. T h e r e fo re there are three computability for functions defined on N: 1) Turing machines 2) gramm ars 3) u - r e c u r s i v e functions. function e q u iv a le n t is Turing- definitions of 11 Since th e y - r e c u r s i v e functions a re exactly th e functions that are Turing-computable (Lewis an d Papadimitriou, 1981, C h a p te r 5), we may u s e this equivalence of Turing m achines to show that a Turing m achine c a n be simulated by the classifier system. Chapter 3 Classifier System 3.1. Introduction S ince a classifier system is similar to a production system , I will first d e s c r i b e section will what discuss a production H o lland 's system c la s s ifie r is. system . The following Then I will d escrib e the classifier system used in this paper. 3.2. Production System A classifier s y s t e m is similar to the r u le - b a s e d production s y s te m s (Davis and King, 1977) u sed in expert system s. A production sy stem con sists of a s e t of production rules, a working memory, and a recognize-act p ro d u ctio n control cycle (Luger r u l e , or p r o d u c t i o n , and consists S tu b b le fie ld ,1989). A of a condition-action pair. The condition part of th e rule Is a collection of symbols that d e te r m in e s w hen that rule may b e applied to the situation being considered. T he action part d e f in e s execution of the rule. The w o r k i n g th e result o b tain ed by the m e m o r y contains a description of th e current s t a t e of the world for the particular problem. This description is in the form of a collection of symbols called patterns. The actions of production rules are specifically d e s ig n e d to alter the contents control of working m em ory. s tru ctu re for th e The production reco g n lze-act s y s te m . Working c y c l e is the m em ory is initialized to th e p a tte rn s th a t r e p r e s e n t a description of th e start of the problem. The patterns in working memory are m atched against the conditions of the production rules. This prod uces a s u b s e t of the 12 13 productions, called th e c o n f l i c t s e t , whose co nd itio ns m atch th e containing t h o s e patterns in working productions m em ory. The productions in the conflict s e t are said to be e n a b l e d . O n e of the p ro d u c tio n s in th e conflict s e t reso lu tio n strateg y . The is th en selected production thus by a c o n flict selected is fired, m ean in g th at th e action part of that rule Is e x e c u te d . This may result in the co n tents of working memory being ch a n g ed . The control cycle starts over again using th e modified working memory. When no rule c a n be found w h o se conditions are m atched by the con ten ts of working memory, the p ro c e ss term inates . 3.3. Holland’s Classifier S ystem A classifier sy stem is a rule-based s y stem w here the working mem ory is r e p r e s e n t e d by fixed length m e s s a g e s . rules a re called c l a s s i f i e r s . definition of a c la s s ifie r T h e production Since I am not a w a re of a formal system , I will present th e informal definition u s e d by J o h n H. Holland (Holland, 1986), a n d will then d i s c u s s w h ere my system differs from Holland's classifier system . In general, the execution of a classifier sy stem con sists of a sim p le loop. d e te r m in in g The if cla s sifie rs their access c o n d itio n s are th e c u r re n t s a tis fie d . If m essage a list, c la s s ifie r 's conditions a r e satisfied, then that classifier b e c o m e s active and it p ro d u c es a new m e s s a g e which is a d d e d to a new m e s s a g e list. All active classifiers fire at th e s a m e time. After all active classifiers h a v e fired, the new m e s s a g e list b e c o m e s the current m e s s a g e list, a n d th e loop s ta rts over again. T he satisfaction of a classifier's co n d itio n is determ ined by a s im p le m atch in g o p e r a t io n . All 14 input/output is through m e s s a g e s to the m e s s a g e list. list is global in nature» th u s allowing for This m e s s a g e tag g in g and similar te c h n i q u e s that ca n b e u sed to couple classifiers a n d to force a pred eterm in ed order of execution. A m e s s a g e is a fixed length string of length k over an fixed alph abe t. The a l p h a b e t is usually taken to be th e s e t {0, 1}. The m e s s a g e s a r e kept on a m e s s a g e list which can be unbounded. The rules act on t h e s e m e s s a g e s producing a new m e s s a g e list. T h e rules or c l a s s i f i e r s are con dition -actio n pairs. The condition consists of a string of length k over the alphabet {0, 1, #}. For a c la s s ifie r to become active, the condition p art of th e classifier m ust match a m e s s a g e on the m e s s a g e list. A match is obtained if each 0 and 1 in the condition m atch es the corresponding bit in the m e s s a g e exactly. The symbol # in the condition can match either a 0 or a 1. An active classifier produces a m e s s a g e that is put on a new m e s s a g e list. The action part of the classifier is also specified a s a string of length k over the alphabet {0, 1, #}. Here the # h a s a different meaning than the # in the condition part. Here it is a p a s s - through symbol. W henever a # occurs in the action part, the c o rresp o n d in g bit in th e m e s s a g e satisfying th e condition p a s s e d through to the new m e s s a g e that is part is produced. Consider the following example. S u p p o s e k, the fixed length of e a c h m e s s a g e , is taken to be 3. A classifier with a condition of #00 a n d an action of 11# will match either the m e s s a g e 000 or the m e s s a g e 100 and in either c a s e will produce the m e s s a g e 110. The notation #00 —* 11# is used to specify this classifier. 15 A classifier can be generalized to allow for a n arbitrary n u m b e r of conditions. In this c a s e , e a c h condition is a string of length k over the alphabet {0, 1, #}. The conditions are s e p a ra te d by c o m m as . For the classifier to b e c o m e active, e a c h of th e conditions must be m atch ed by s o m e m e s s a g e on the m e s s a g e list. The action part of th e classifier is still specified by a single string of length k over the symbols {0, 1, #}. The # symbol co rre sp o n d s to the bit in th e m e s s a g e that satisfies the first condition of the classifier. C onsider the above example, e x p a n d e d for multiple conditions. S u p p o s e the classifier now is: 101 , #00 11#. For this classifier to b e c o m e active, the m e s s a g e list will h ave to contain the m e s s a g e 101 and either the m e s s a g e 000 or the m e s s a g e 100. In either c a s e the result will be the m e s s a g e 111. The # in the s e c o n d condition can match either a 0 or a 1. The # in the action will match the s e c o n d 1 in the first condition. The u se of multiple conditions allows for com pound conditions to be re p re s e n te d . The AND exp ressio n is obtained by the u se of multiple conditions. The OR condition can be obtained by the u se of multiple c lassifiers. conditions For e x a m p le , to express th a t if both the a n d Mg are satisfied then the result is M, w e u s e the classifier: M l, Mg — * M. If w e want either M^ or Mg to produce the m e s s a g e M, then we will n e e d the two classifiers: M^ —►M Mg —> M. 16 Holland extends the notation by allowing s trin g s in the condition to b e prefixed by a minus sign. This signifies that the condition is not satisfied by any m e s s a g e on the m e s s a g e list. For exam ple, the condition following c la s s ifie r; an d not Mg c a n b e o b ta in e d by the M l, -Mg —►M. For this classifier to b e c o m e active, the m e s s a g e list would have to contain the m e s s a g e M^, and no m e s s a g e of the form Mg. One, many, or time. S in c e m essage each all the classifiers can be active at the active list, th e r e classifiers fire. T h e classifier produces is no conflict resolution m ore a m essage same on the problem . All active active classifiers th e r e are, the more m e s s a g e s there will be on the m e s s a g e list. E x p a n d in g the above exam ple a g a in by ad d in g another classifier, w e can obtain the following classifiers: 101. #00 1#0 11# 000. If th e m e s s a g e list contained the following m e s s a g e s : 1 0 1 , 100 th en both classifiers b e c o m e active an d fire producing th e new m e s s a g e list: 111, 000. If th e original m e s s a g e list were: 1 0 1 , 100 , 000 th e n th e first classifier would fire twice, o n c e for e a c h m atch , and th e second classifier following new m e s s a g e list: will fire o n c e , possible producing th e 17 11 1 , 11 1 , 0 0 0 . Using th e above definitions, Holland d e f in e s the classifier s y s te m a s follows: "A classifier sy stem consists of a list of classifiers {C^, C 2 , - . . ,Cp}, a m e s s a g e list, an input interface, The and an output interface. basic cycle of this system p ro c eeds a s follows: 1. Place all m e s s a g e s from the input Interface on the current m essage list. 2. C om pare all m e s s a g e s to all conditions and record all matches. 3. For each match gen erate a m e s s a g e for the new m e s s a g e list. 4. Replace the current m e s s a g e list by the new m e s s a g e list. 5. P r o c e s s the new m e s s a g e list through the output interface to p ro d u c e system output. 6. Return to step 1." Therefore, to define a classifier system , the input m e s s a g e s and the classifiers. c o r r e s p o n d in g ac tio ns, Including have to both be the defined. conditions R ec o d in g s , and th a t th e is, changing the prefix of an input m e s s a g e by an active classifier while the rest of the mes^&ge is left unchanged, and using # in appropriate p la c e s c a n re d u c e th e n u m b er of classifiers that a s y s te m n e e d s . Considering the above example again, the u s e of the # symbol in the classifier 1#0 000 elim ina tes th e n e e d for the following two classifiers to r e p r e s e n t w h a t this o n e classifier re p resen ts: 18 100 000 -► 110 000. 3.4. Modified Classifier System T he system th a t I use is a modified version of Holland's classifier system . It c o n s is ts of a m e s s a g e list, classifiers, an d an inference en g in e or control structure. The m e s s a g e list, which can b e unbounded, contains fixed length m e s s a g e s over the alph abet {0, 1}. T h e classifiers c o n s is t of a condition several c o n d itio n s, a lon g with an action part, which c a n part, the two h av e being s e p a r a t e d by th e symbol —» . The classifiers are over the alphabet {0, 1, #}. T h e inference e n g in e is a simple loop. For multiple conditions w h ere there is a # symbol in the action part, I let the # c o r re s p o n d to the m e s s a g e that m a t c h e s the last condition in the condition list (s ee example below). For the rules that I produce, this allows the first condition to be th e m ost g e n e ra l condition, thus s e p a ra tin g the classifiers into g ro u p s by the first condition of the condition list. In Holland's m essage p ro d u c e d for e a c h classifier s y s te m , th e r e Is o n e new match b e tw e e n a classifier a n d the m e s s a g e list. In the classifier system that I use, there will b e three ty p e s of classifiers which will pro d u c e new m e s s a g e s in different ways. T h e s e types of classifiers are explained in more detail in the next section. The classifiers in my sy stem all have conditions that m u st match the m e s s a g e list in order for them to b e c o m e active. That is, my sy stem d o e s not u s e the minus sign to signal when a match is not present. Matches are m ad e only when a m e s s a g e on the m e s s a g e list is present. Considering the last example again, the classifiers are: 19 101 , #00 1#0 11# 000. If th e m e s s a g e list was: 101 , 100 , 000 th en t h e first classifier would fire twice, o n c e for e a c h possible m atch, a n d th e s e c o n d classifier would fire o n ce , producing the following new m e s s a g e list: 110 , 110 , 0 0 0 . Note that the # in the action part of the first classifier co rresp o n d s to th e s e c o n d 0 in the last condition of the condition part. Holland s t a t e s that the recodings allow th e s y s te m to carry out arbitrary computations. By this he m e a n s that any function that can take a m e s s a g e a s input an d produce a m e s s a g e a s output can b e com puted by a classifier system. This d o e s not m ean that the classifier sy stem can co m p u te a function in the Turing com putable sense. Turing c o m p u ta b le functions a r e defin ed o v er an infinite s p a c e su ch a s the s e t of natural num bers or the s e t of all strings over an alphabet, w h e r e a s a function from m e s s a g e s to m e s s a g e s Is ov er a finite d o m ain. This p a p e r will show th a t th e classifier system can compute a function in the Turing computable s e n s e . When a function is Turing computable, a Turing machine exists that can be u s e d to com pute f. This Turing machine h a s an unbounded random a c c e s s memory since the ta p e is unbounded. The classifier system d o e s not have a unbounded random a c c e s s memory. But what it d o e s hav e is an unbounded m e s s a g e list. I will show how this unbounded fixed-length memory list can be u sed a s an unbounded random a c c e s s mem ory. Chapter 4 Simulation Of A Turing Machine By A Classifier System 4.1. Introduction This c h a p te r co n tain s th e proof that a classifier sy stem h as th e s a m e com p u tatio n al p ow er a s a Turing m ach in e. The proof p ro c e e d s by showing that any u -recu rsive function can be com puted by a classifier system . ca n be Recall that a function is p -recursive if it o b tain ed from th e initial functions a n d o by th e application of th e following operations: composition; primitive recursion; unbounded minimalization to regular functions. To accomplish this, it is n e c e s s a ry to show how the initial functions and the above operations can be represented by a classifier system. 4.2. Theorem Given a p - r e c u r s i v e function, f, th e re is a classifier sy stem which c o m p u t e s f. The p re c is e definition of th e classifier s y s te m will be given below. 4.3. M e s s a g e Length and Representation W e may a s s u m e the given p-recursive function f is a k - p l a c e function; I.e., f : —» N for s o m e k > 0. The a l p h a b e t for the classifiers c o n s is ts of the s e t { 0, 1, # }. To re p re s e n t an input n u m b e r to th e function f, unary notation will b e u s e d . S in ce the 20 21 m e s s a g e length is fixed and an integer can b e arbitrarily large, the integer m will not b e re p re s e n te d a s an input m e s s a g e with m Vs but will b e represented a s m input m e s s a g e s each having a value of 1. But f will have k input values, one for each place. It Is n ec essary to distinguish b e tw e e n th e different input values. To do this the input m e s s a g e will be divided into th ree fields. The first field will c o n s is t of a c o d e referring to the current point or s t a g e of the computation of the function f. The sec o n d field is a s e q u e n c e number referring to th e place in the s e q u e n c e n th at the digit refers to. Considering f to be a k-place function, its input, n, s t a n d s for the sequence n.,, ng n,^. The s e q u e n c e number will have at least k digits, o n e for e a c h place. If the input value being con sid ered is n, then th e co rresponding s e q u e n c e num ber will hav e a 1 in th e i^h position or p lace of the s e c o n d field a n d O’s e lsew h ere. The third field is th e actual digit or bit for that s e q u e n c e . The num ber 0 will b e re p re s e n te d by a 0 in the bit position of the input m e s s a g e . The number m will be represented by m input m e s s a g e s , each having a 1 in the bit position. position will represent either a 0 A # in the bit oral. Given a function f that is -recursive, we know that it c a n be o b ta in e d from the initial functions by using composition, primitive recursion, an d u n b o u n d e d minimalization of regular functions. The function f can therefore be written a s a s e q u e n c e of functions that will be applied in order to the input s e q u e n c e Ti We can think of the function f then a s the s e q u e n c e F^p 2 of th e initial functions or o n e of --. where each F|will be one th e o p e ra tio n s allowed on the initial or su bsequently obtained functions. To com pute e a c h Fj by the 22 classifier s y s te m will take a certain num ber of s ta g e s . The num ber of all t h e s e s ta g e s , re p re se n te d a s a binary number, will determine the maximum size of the co de field of the input m e s s a g e . Each of the F j 's is a k-place function for s o m e k. The maximum of all the k*s, along with t h e ty p e of th e o p eratio n each F j represents, will d eterm in e th e length of the s e q u e n c e field in the m e s s a g e . The bit position will be of length 1 . As an exam ple, th e num ber 2 in N with c o d e r e p r e s e n t e d by 1 would be input m e s s a g e s of th e following form assum in g 2 that w e have a m e s s a g e length of 3: 1 and the number 1 1 with the s a m e co d e would be represented by: 0 1 1 0 . Here the first digit re p re s e n ts the code, the s e c o n d digit re p re s e n ts th e s e q u e n c e n u m b er an d the third digit r e p r e s e n t s th e bit. The s e q u e n c e (2, 0) in with co de 2, assuming a m e s s a g e length of 5, would be represented by 1 0 2 input m e s s a g e s of the form: 1 0 1 and o n e input m e s s a g e of the form: 1 0 0 1 0 w h e re the first two digits r e p re s e n t the co de, the next two digits r e p r e s e n t the s e q u e n c e num ber an d the last digit is th e bit. If the m e s s a g e length w ere determined to be 8 , with a co d e length of 3, a s e q u e n c e length of 4 meaning a maximum of a 4-place function, and th e bit position, then the m e s s a g e 0 10 0 0 10 1 23 would refer to a c o d e of 2 with a exactly 7 of t h e s e 1 in the third place. If there were input m e s s a g e s , then this would refer to the num ber 7 in the third place. To m a k e 3-tuple w h e r e th e notation easier, I will re p resen t a m e s s a g e a s a th e first n u m b er will s e c o n d num ber will be from place function, 1 be th e c o d e in decimal, the to k representing the ith place of a k- and the third number will be the digit or bit. A # in the s e q u e n c e position will re p resen t all positions, and a # in the bit position will b e either a 0 or a 1. In the last example, the seven m essages 0 10 e a ch containing a co d e 0 0 10 2 1, and indicating a 1 in the third position, will b e replaced by the 3-tuple: 2 3 7. 4.4. Types of rules There are three types of rules in the classifier system. A) A rule of type A fires only once no matter how many m e s s a g e s it m atch es. An exam ple of this type of rule is the rule for the zerofunction. Here we want to c r e a t e only one m e s s a g e with a 0 bit p o s itio n . B) A rule of type B fires once for any match. The identity rule is an example. In this instance, we want to transfer all input m e s s a g e s to the output so that th e s e m e s s a g e s c a n be u s e d again for the next stage. C) A rule of type C fires only on ce and u s e s up the input that c a u s e d that rule to fire. T h e s e rules h av e a priority so that if a 24 match exists, the rule will fire before any other rule can fire. Note that by stating that the rule u s e s up the input, w e m ean that the input m e s s a g e s u s e d to fire this rule ca n n o t be u s e d to match the condition of any other rule during this stage. 4.5. Initial functions I will now d esc rib e the rules that will b e u s e d to e x e cu te the initial fu n c tio n s . exam ples will For simplicity, a lw a y s lea v e the their ru les re s u lts presented in th e first here as p la c e or position. It is e a s y to modify such a rule so that the result is left in any specified place by changing the s e q u e n c e number from specified place. R e m e m b e r that the # symbol w hen 1 to the u s e d in the classifier h a s two m eanings. If the # a p p e a r s in the condition of a classifier, then it m atches either a 0 or a 1 in the input m e s s a g e . If it appears in the actio n , it is an in s t r u m e n t to co p y th e corresponding position in the last condition of the condition part of th e classifier. 4.5.1. Zero function The initial zero function C with a c o d e of C can be represented by the following rule: C # # c+T 1 0 : type A This s t a t e s that a m e s s a g e with co d e C an d any match of s e q u e n c e n um ber a n d bit will produce a m e s s a g e of c o d e C + 1 with a 0 in the 1st position. This is an exam ple of a rule of type A; th e rule fires only once. 25 4.5.2. Projection function T h e initial projection function ti*! c a n be re p r e s e n te d by the following rule of type B: C i* —» C+ 1 1 » ; type B where in the condition we h av e a m e s s a g e with cod e C, a 1 in the ith s e q u e n c e place an d either a 0 or 1 in the bit position. It produces a m e s s a g e with a C + 1 place a n d either a match. 0 in the co d e position, a or 1 1 in the first s e q u e n c e in the bit position depending on the original Recall that we are as s u m in g h ere that the result of the projection function operation is to be left in th e first s e q u e n c e position. This rule fires for e a c h possible match. 4.5.3. S u c c e s s o r function The following initial s u c c e s s o r function a can be r e p r e s e n t e d by the rules; C # # C 1 1 —♦ c+1 1 1 : type A C+1 1 1 : type B. The first rule will fire o n c e for any match a n d m e s s a g e with a 1 p ro d u c e a new in the bit position. The se c o n d rule will fire for all m a tc h e s . This s e c o n d rule is basically an identity rule. For e a c h m e s s a g e with a 1 in the bit position, it copies that m e s s a g e with a new code. This rule is an example of recoding, where just the co d e of th e m e s s a g e unchanged. has changed an d th e rest of th e m e s s a g e is left 26 4.6. Composition Recall the definition o f composition. Given t > 0 , k> 0 ,g at- place function an d h^, . . . , h| k-place functions, we define f to be the k-place function such that for every nin = 9 (hi(rt, . . . . h^(n)). As a s e q u e n c e of functions, composition can be written a s C (g,h^,h 2 , . . . ,h|). Note that in executing composition, the k-place functions h; are co m p u ted before the t-place g function. We can then define the rules for composition. For now, let us a s s u m e that all of the functions a r e initial functions, so that each function will take only one stage to execute. The first s t a g e co n s is ts of the rules to perform e a c h of the h /s. All will have the sam e code, o u tp u t m eaning that they can m essage from all fire sim ultaneously. hj will hav e the c o d e for g followed by a s e q u e n c e num ber of all zeros except for a sequence The 1 in the ith position of the n u m b e r followed by th e value in th e bit position. The s e c o n d s t a g e will consist of the rules for th e execution of g. The length of the s e q u e n c e field will be the maximum of k an d t. The length of the c o d e field will, in general, d e p e n d on the functions g, h , , . . . , h|. Since for now we are only considering initial functions, the length of the c o d e field will be two. After considering the coding of the primitive recursion an d un bo u n d ed minimalization to regular functions o p e ra tio n s we will return to th e q uestio n of coding of t h e s e operations w hen the functions a r e not initial functions. 4.7. Examples As an example, consider the function : N —> N defined by 27 o 2 (n) = a(a(n)) = n + 2 . Here both k a n d t in th e definition of composition are 1, so that the size of the s e q u e n c e num ber is 1. To determine the size of the code, we note that only two functions are n e e d e d , e a c h being an function. Therefore the maximum size of the c o d e is the function write the initial . Considering 2 a s a s e q u e n c e F; of functions a n d operations, we can a s the s e q u e n c e C(o, a) where C will signify composition of fu n c tio n s in sid e the corresp o n d to g in the argum ents parentheses. The first argum ent will definition of composition and the rest of the th e functions h^ to h^. In this c a s e there is only one h fu n c tio n . The rules for the function 0 # # —► 0 1 1 1 « 1 1 are: 1 ; type A, rule for first a —» 1 1 1 : type B, rule for first o # 2 1 1 : type A, rule for second a 1 2 1 1 : type B, rule for second a 1 1 w here the first digit co rresp o n d s to the code, the se c o n d digit is the s e q u e n c e number and the third digit is the bit. If the input to then the input m e s s a g e would be: 0 1 0 an d the firing of the rules for the first stag e would be: 0 « « —> 1 1 1 an d for the sec o n d stage: 1 « « 2 1 1 1 1 1 2 1 1 resulting in two m e s s a g e s of the form: is 0 28 2 1 1 corresponding to th e number 2. If the input value w ere 2, then the input would consist of two m e s s a g e s of the form: 0 1 1 and the firing of the rules for the first s ta g e would be: 0 « « 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 and for the sec o n d stage: 1 « 1 1 1 -> 2 1 1 1 1 1 - > 2 1 1 1 1 « - 1 > - 2 1 > 2 1 1 1 resulting in four m e s s a g e s of the form: 2 1 1 corresponding to the number 4. As another example, consider the function og : by 0 3 —* N defin ed (n^, n 2 , n^) = a ( 7ig (n^, n 2 , ng)) = ng + 1. The rules for this function are: 0 3 « —> 1 1 « —> 1 1 1 —> 1 « ; type B, rule 2 1 1 : type A. rule for a 2 1 1 . 1 for : type B, rule for a Each m e s s a g e co n sis ts of six bits, the first two corresponding to the code, the next th ree corresponding to the s e q u e n c e number, and th e last o n e co rresp on ding to th e bit. H ere again t h e r e a re two 29 initial functions that n ee d to be com puted, resulting in a maximum c o d e of 2. We can write the function 0 3 a s th e s e q u e n c e function a Is 4.8. 1 C ( a , 7Cg). The function is 3 -p lac e a n d the -place, producing a s e q u e n c e size of 3. Primitive recursion T he definition for primitive recursion is: if k > 0 ,g is a k- place function, and h is a (k + 2)-pIace function, then we can define a (k + 1 )-place function f such that for every he f(nO) = g(h) and for every he and m e N, f(r\ m + 1 ) = h(n, m, f(r% m)). This is an inductive definition. The function f so defined can be written R(g, h). To com pute f(l\ m + 1), we first have to with m = 0. Then h(r\ h(h, 1 1 , g(rj) compute g M , starting must be computed, followed by h(n, 2, , g(r))), an d so on. Thus, for a fixed T\ to com pute the value of f at m + 1 we u s e the previously co m p u ted value of f at m. This continues until we have reach ed the desired value of m + 1. At first glance, it would s e e m that in order to tell that the value m + been reached, com putation, we would violating th e need m + r e q u ir e m e n t 1 code th a t num bers all 1 has for th e m essages for computing a given function be of a fixed length. But a s you shall see, we c a n r e u s e the c o d e num bers. T he problem a r is e s in trying to figure out how to test for equality using the rules. It is n e c e s s a ry to know when the desired value of m + 1 h a s been reached. Instead of 30 testing for equality, w e define s o m e rules for d e c re m e n tin g the value of a natural num ber an d then testing for zero. Testing for zero is e a s y sin ce the relevant m e s s a g e will co nsist of a in the bit 0 p o s itio n . The first s t a g e of computing primitive recursion will con sist of saving the value of m in the k + 3 position, i.e. for every m e s s a g e with a 1 m essage in th e k + 1 s e q u e n c e position, w e will p ro d uce a with th e s a m e bit position but with new a 1 in the k + 3 s e q u e n c e position. Even though the function is (k + 2)-place, an extra p lace is n e e d e d to s a v e the value of m. Therefore, th e s e q u e n c e num ber h as to allow for k + 3 places. For the computation, the value at th e k + 1 s e q u e n c e position must start at s e q u e n c e position w e produce a new m e s s a g e 0 . S o in th e k with a 0 + 1 in the bit position. All other m e s s a g e s get p a s s e d through to the next sta g e by using th e identity function. Assuming that w e start with a c o d e of 0, the rules for the first s t a g e will have the form: 0 k+1 « 1 k+3 « : type B, rule to copy m to position k + 3 0 « « 1 k+1 0 ; type A, rulefires rule toenter 0 only o n c e in k + 1 position 31 i 0 « i 1 « for i s 1 to k, k + 2 ; type B rule to copy all m e s s a g e s except those for s e q u e n c e position k and k + 3 + 1 T he s e c o n d s t a g e will co n s is t of the rules to perform th e function g, putting the result in s e q u e n c e position k + 2. It will also copy all of th e input v alu es using the identity rules ex cep t for any input in s e q u e n c e number k + 2. Assuming that the computation of g ta k e s only on e s tag e, the rules will go from co d e 1 to c o d e 2. The rules would look like: 1 {rules for g} —> 1 I « 1 k+3 « The third 2 k+ 2 2 I —* 2 k+3 {result of applying g} « for i = 1 to k + 1 * ; type B, identity rule s t a g e is to te s t if the value of m sto red in the s e q u e n c e position k + 3 is equal to zero. If it is equal to zero, we then want to p a s s the value stored in the k + s e q u e n c e position on 2 a s the result of the primitive recursive operation. If the value is not zero, w e then n ee d to apply the function h to the Input m e s s a g e s with the result stored in s e q u e n c e position k + 2 . Also all input b e s id e s the previous value stored in s e q u e n c e position k + 2 must be p a s s e d through to the output. The rules for testing for zero will have the following form: 2 k+3 0 , 2 k+2 « —► 6 1 « : type B, rule if m = 0, first condition is m = 0 , 32 s e c o n d condition is s e q u e n c e position k + 2. At this point we are do n e with primitive recursion 2 k+3 1 ,2 i # -» 3 fo r i = 1 i » to k + 1, k + 3 ; type B, rule if m 0, identity on all input but s e q u e n c e position k + 2 k+3 1 , 2 {rules for function h} —► 3 k+2 Note th a t th e first condition of each (m e s s a g e for result} classifier classifiers into two groups, th o se for when m = 0. The # in corresponding 2 th e action digit in p art of the second the 0 the and th o se for m clas s ifie r condition separates of re fe rs th e to ^ th e classifier. R e m e m b e r w e a r e assum ing at this point that all of th e functions are initial functions. Therefore, the computation for h ta k e s only one stage. The fourth s t a g e will apply the s u c c e s s o r function o to the s e q u e n c e position k + 1 , an d p a s s the input through for all other s e q u e n c e positions. 3 » * —^ 4 k+ 1 1 ;type A, s u c c e s s o r function 3 k+ 1 1 —> 4 k+ 1 1 ;type B, s u c c e s s o r function 3 i « 4 I « for i = 1 to k, k + 2, k + 3 : type B, identity function The fifth s t a g e will be the first part of the decrem en tatio n of the s e q u e n c e position k + 3 plus the p a s s through of all other input values. The rules for s e q u e n c e position k + 3 will have the form: 4 k+3 1 —> 5 k+3 0 33 : type C that fires only once and u s e s up its input m e s s a g e . This is a priority rule. It c h a n g e s one of the 4 « bits to a 1 # —» 5 0 « bit « ; type B, all other input values are p a s s e d through The sixth s t a g e will be the s e c o n d part of the decrementation of th e s e q u e n c e position k + 3 plus the p a s s through of all other input values. From either this s t a g e we want to return to s t a g e 3 where we have a zero value at s e q u e n c e position k + 3 or we apply the function h. Therefore the output c o d e from t h e s e rules will be the s a m e a s the c o d e for s t a g e 3. Using the co d e values given, this is co d e 2 . The rules for s e q u e n c e position k + 3 5 k+3 0 ,5 k+3 1 -+ 2 will have the form: k+3 1 ; type C that fires only once and u s e s up its input m e s s a g e s . This is a priority rule. If there is both a 0 bit and a1 bit in position k+3, it essentially c o n s u m e s the 5 # # —^ 2 « 0 bit « : type B, all other input values are p a s s e d through At this point we are back at the third stag e of the computation of f w here we te s t to s e e if the computation of f is com plete or if we have to compute h again. 4.8.1. Example As an exam ple of primitive recursion, consider the function plus(n.|, ^ 2 This function is defined by: ) = n^ + n 2 - 34 p!us(n, 0 ) —9 (n) —ît^(n) = n plus(n, m + 1) = Gg(n, m, plus(n, m)) = o(TCg(n, m, plus(n, m))) To com pute this function, each m e s s a g e will have a length of 8 , with the first th re e positions for the code, the next four positions for the s e q u e n c e num ber an d the eighth position for the bit. As mentioned before, even though the maximum place value for the functions is 3, w e n ee d an extra place to sa v e the value of m. Therefore, the size of the s e q u e n c e num ber is 4. The function plus can be written a s the s e q u e n c e R(%^, C(o, tc|)) where R re p r e s e n ts primitive recursion. The rules for this function are: Stage 1 : 0 to sa v e the original value of m 2 « —► 1 4 » ; copy m at s e q u e n c e position 2 to seq u e n c e position 4 0 1 « 1 1 « ; copy input n 0 S tag e 2 1 « # 1 2 0 ; zero function to s e q u e n c e position perform g = : 1 # 2 2 3 « ; rule to perform function g, output to s e q u e n c e position 3, projection function 1 I # 2 i « for i = 1. 2. 4 ; identity rule to p a s s input through except s e q u e n c e position 3 35 S ta g e 3: if do ne output result else com pute 2 4 0 , 2 3 * ^ 6 0 3 1 * : m = 0 so return result 2 4 1 , 2 I * -> 3 : m I * for I = 1, 2. 4 0, identity except for s e q u e n c e position 3 2 4 1 2 4 , 2 3 1 ^ 3 3 1 1 , 2 * * - > 3 3 ; rules for S tag e 4; 3 0 3 1 , result in s e q u e n c e position 3 increment m 2 3 « 1 4 2 1 « —, 4 2 1 ; rules for a on s e q u e n c e position 2 3 i * -» 4 i * f o r i = 1, 3, 4 ; p a s s through input except s e q u e n c e position S tage 5: 4 4 2 first part to d e c re m e n t s a v e d m 4 1 5 4 0 # : priority rule of type C. s e q u e n c e position 4 « ^ 5 « tt ; p a s s through all other input, identity function S tage 6 : secon d part to decrem ent saved m 5 4 0 , 5 4 1 - » 2 4 1 ; priority rule of type C, s e q u e n c e position 4 5 « # 2 * * : identity on all other input 36 ; Note that the output cod e at this stag e is the s a m e a s the input code for S tag e 3. 4.9. Unbounded Minimalization of Regular Functions The final operation to be performed by our classifier system is unbounded o p e r a tio n minimalization of regular functions. The rules for this are similar to th e rules for primitive recursion, but simpler s in c e th e re is no decrem entation, rather just the testing of the result for zero. R e c a ll the d e finitio n minimalization. If k > 0 an d g is a (k + unbounded 1 of unbounded )-place function, then the minimalization of g is the k-place function f defined such that for any He f(T) = pm[g(r\ m) = 0 ]. For f to be u-recursive, g must be regular. This g u a r a n t e e s that f is defined everywhere. The un b ou nd ed minimalization of g is deno ted u(g). For unbounded minimalization, we have to start at m = 0. After ea ch computation, the value of g(f\ m) h as to s av e d so that it can be te s te d ag a in s t 0. S e q u e n c e position k + 2 will be used to s a v e the result of the computation of g(r% m). Even though g is a (k + 1)-place function, an extra s e q u e n c e position will be needed . The first s t a g e for the rules for u n b o un ded minimalization of regular functions consists of creating a + 1 in the s e q u e n c e position k 0 by the application of the zero-function. We therefore have the ru le s : 0 « « —♦ 1 k+ 1 0 : 0 at position k + 1 : type A, rule fires only once 37 0 The « # —► 1 second « stage # ; type B, copy input consists of the rules to perform the functio g with th e result sto red in s e q u e n c e position k + 2 an d also the identity, s o th at th e input is p a s s e d through e x c ep t for s e q u e n c e position k + 2. Assuming that we can com pute g in o n e stag e, we have th e following rules: 1 {rules for g) —» 2 1 —+ 2 I • {result of applying g} I « for i = 1 to k + 1 ; type B The third s ta g e consists of reducing the result of the operation g to a single m e s s a g e . This is do ne by executing the following rule exactly once. 2 k + 2 * —» 3 k + 2 » ; type A Also in this s t a g e is an application of the identity function to copy all input ex c ep t for that at position k + 2, resulting in the following rule: 2 The I » —» 3 fourth s t a g e minimalization of regular i « e ith e r for i = 1 to k + 1 ;type B exits th e rules for unbounded functions with the output being the value of m stored in the s e q u e n c e position k + 1, or it increments the value of m stored in position k + 1 and p a s s e s through the input both with the co d e used for the application of the function g. The rules for this s t a g e will h av e th e form: 3 k + 2 0, 3 k+ 1 ; type B, rule to output the value of m 3 k + 2 1, 3 I « - ♦ ! I « for i = 1 to k : type B, rule to p a s s through input, identity function 38 3 k + 2 1, 3 k + 1 1-^1 ; type B, rule for 3 k + 2 1, a k+1 1 on s e q u e n c e position k + 3 » * - » 1 k + 1 1 ; type A, rule for a on s e q u e n c e position k + These 1 last three rules output the s a m e co d e used in s t a g e 2 1 so that the operation g can be performed again. 4.10. O perations on Non-Initial Functions As m entioned operations of before, com position, the above prim itive rules recursion, concerning and the unbounded minimalization on regular functions were applied only to the initial functions so that each operation could be performed in one stage. If the functions are not the initial functions, then we have to take into account that intermediate results have compute the final result of the function. to be saved in order to This can be accomplished by expanding the message length. If it is established that the sequence part of the message is of length k, then it is possible that we will have to make that part of the message be of length pk, for some p, where theextra p-1 groups of bits of length k are used as temporary storage to hold the computation of the intermediate results. How to compute the value of p will be shown later. As an example, consider the multiplication function, mult : —►N defined by mult(n, m) = nm. It is obtained from g = Ç and h by primitive recursion, w here h is defined by composition of plus with Tc^andTCg. This gives the following definition: mult(n, 0 ) = Ç() mult(n, m + 1 ) = h(n, m, mult(n, m)) 39 w here h(x, y, z) - plus(jt®(x, y, z). n^tx, y, z)). The function plus(n^, ng) = n^ + ng is primitive recursive obtained from g = and h = plus(n, 0 0 3 r\2 , by primitive recursion: ) = %j(n) plus(n, m + The function Og(n^, 0 3 1 ) = 0 3 (n, m, plus(n, m)). n^) = n^ + 1 is defined by composition: ( 0 ^, ^ 2 » ng) = o(7Cg(n^, 0 2 » ng)) First let us consider how this will be functions. The since it is function written a s a s e q u e n c e mult(n, m) -R (Ç , C(plus, . of = R(Ç, h) %3)) = R ( C , C ( R ( j t J . 0 3 ) , Jt®. 7t®)) - R(C, C ( R ( j t ’ , C ( a , J t | ) ) , To m a k e th e exa m p le e a s ie r to follow, I will show how to c o m p u te mult(n,1). For notation an d simplicity, instead of using the m e s s a g e length a n d the s c h e m e of notation given previously, I will u s e only the s e q u e n c e part of the m e s s a g e length with a decimal number in each place showing the value for e a ch place of the k-place function. Mult is a com pute 2 primitive -place function but h is a 3-place function. To recursio n , we need an e x tra p la c e for the tem porary s to rag e of the value m. Therefore, to start with, 4 places will b e n e e d e d . The input to the function will be n the first input, 1 1 - - where n is the se c o n d input, and the third and fourth place for now are empty. The first sta g e is to move the value of m, which is 1 , to the k+2 or 4th position and to put a 0 in the 2nd position. This gives the s e q u e n c e n 0 - 1 . The seco nd s ta g e is the computation of g, the zero initial function, producing the s e q u e n c e n 0 0 1. R em em ber 40 that th e result of the function is put in the 3rd position. Since the value of m in the 4th position is not 0, h is now applied to this result. The function h is a primitive recursive function. It is going to require that s o m e intermediate results be s a v e d in order to obtain the final value of h. If th e s e intermediate results are s a v e d in the 4 sequence p o sitio n s alre a d y used, th en we will not be ab le to distinguish b e tw e e n the original input v alu es a n d th e intermediate re su lts. The solution is to expand th e m essage length. In the example, we will need 4 more places, making the s e q u e n c e length The input to h is n 0 . The new s e q u e n c e will look like n 0 0 1 n 8 . 0 The function h now will be applied to the last four s e q u e n c e values, passin g the first four s e q u e n c e items through. Since h is a primitive recursive function, the value of m h as to be sav ed and replaced by 0 , giving the s e q u e n c e n 0 0 1 n O - 0 . Then plus can be applied with the result being n 0 0 1 n O n O . Since the value of m for the function h is 0, the result, which is in th e 7th s e q u e n c e position, is put In the third sequence place, th e p lace reserved function h. The s e q u e n c e now looks like n 0 n for th e 1 result of the n O n O . At this point only the first four s e q u e n c e positions are relevant. The next sta g e is to d e c re m e n t the value of m in the 4th s e q u e n c e position. Now the value of m is 0 and the computation is complete. The result, n, is in the 3rd s e q u e n c e position. T he c o m p u tatio n of mult(n, 1 ) w a s ra th e r simple since the com putation of plus u s e d just th e first s te p in primitive recursion an d this s te p w a s an initial function. If we had com puted mult(n, m) w here m w a s gre ater than 1 , the plus operation would not have been so simple an d the m e s s a g e length would have had to be expanded 41 again to accom m odate the interm ediate results of th e plus o p e r a t io n . Having s e e n how to ex p re ss a given u-recursive function a s a sequence of th e o p e ra tio n s composition, primitive recursion, and u n b o u n d e d minimalization of regular functions applied only to the initial functions, we c a n convert this s e q u e n c e of functions into a p a r s e tree. The p a r s e tree for the function mult would look like muJt ; Figure 4-1: P a r s e Tree of the Function mult. The initial projection function tc.Ms represented a s 7c(i,j) in the ab o v e p a r s e tree, meaning the ith place of an j-place function. As we go dow n each b ra n c h of th e tree , it will tell us how many in term ed iate results will be n e e d e d to c o m p u te o n e of th e n o n initial functions. The depth of the tree gives the num ber of groups of s e q u e n c e num bers that will be n ee d ed, or the value of p mentioned 42 previously. For th e co m p u tation of mu!t(n,m), we first have to c o m p u te primitive recursion which would take o n e ex tra group of s e q u e n c e numbers. The result of the first operation or Ç w as put back into th e first group and did not n ee d an extra group of s e q u e n c e n u m b e rs s in ce Ç is an initial function. The next step is composition. The length of the s e q u e n c e field h a s to b e increased to perform the composition. Since all of th e h / s a r e primitive recursive, they can all be com puted at once a s shown earlier. In general this will not be the c a s e . Therefore, the length of the s e q u e n c e field of the m e s s a g e would hav e to b e increased in order to perform the composition so th at e a c h hj c a n be perform ed individually with th e sam e input values. After e a ch of the h /s h a s bee n computed, the results are in the sec o n d group. Then we need to increase the the number of groups of s e q u e n c e n u m b e rs again to perform the primitive recursion for the function g of the composition. In the c a s e of mult(n,1), the only primitive recursive step n e e d e d w a s the first one, to perform the operation which c a n be d o n e in on e step. In general, after the first step operation of 0 3 th e primitive re cu rsio n , th e second part or the would co m e next. This is a composition which requires the length of th e s e q u e n c e field to be increased again. The original length k of the s e q u e n c e field is modified to pk, where p is the depth of the p a rse tree. Using this scheme we can com pute com position, primitive recursion, a n d u n b o u n d e d minimalization on regular functions. For composition, not all of the functions will necessarily tak e the s a m e n u m b e r of s t a g e s . Therefore, using the e x p a n d e d m e s s a g e length, w h e r e th e s e q u e n c e field of the m e s s a g e h a s b e e n incre ased to 43 handle intermediate results, o n e function can be com puted at a time. We can look at f(r) = g(hi(rj), . . . , this graphically. - Consider the general function C fg.hiJhg, . . . ,h^). Let k be the maximum of length of h and t. The s e q u e n c e field of the m e s s a g e is expanded to at least 2k. Each function, hj, then o p erates on the second k bits, putting its result in the ith position of the first k bits. When all the hj’s hav e b e e n computed, the function g can then be computed. This can b e shown graphically a s follows where hj is represented a s h(i): 44 k id H The input to the function is copied to the second group so that each h function can be computed separately without destroying the input. I r h(1). id It I 11 i I ■r h(2 ). 11 l i id / h(t) 1/ 1 id Each h(i) function executes separately with the result being placed in the first group. The results are passed to the next stage using the identity function. The input in the second group is also passed on. The first group now has the results of computing all the h’s. These results are passed to the second group incase g is not an initial function. The result of g is placed in the first group. Figure 4-2: Graphical Representation of Composition 45 For primitive recursion, we have f(f) = R(g, h) and this can be shown graphically a s follows: k+3 L __________ L ^ ^ Copy the input to the second group Compute g putting the result in the k+ 2 position Copy input to second group Compute h putting the result in the k+ 2 position i id /i / I The final result in the k+ 2 position is returned Figure 4-3: Graphical Representation of Primitive Recursion 46 For th e u n b o u n d ed minimalization to regular functions, f(h) = U(g). Graphically, this will look like th e following: I k+ 2 , copy input to second ^ ^ group id id I " ^ I ^ ^ ^ I ^ ^ TT-----------------------------" T n If If II ^ jJ Compute g storing the result in k+2 position Copy Input to second group ZzU Compute g storing the _^ * result in k+ 2 position / If V 1 id J I I id If If II J g ' Compute g storing the result in k+ 2 position When the result of g is 0 , the value in the k+ 1 position is returned Figure 4-4: Graphical Representation of Unbounded Minimalization. 47 It h a s been shown that by expanding the m e s s a g e length, all u recursive functions can be com puted by the classifier system. Given a u - r e c u r s i v e function, we know th at it is a s e q u e n c e of initial f u n c ti o n s com bined unbounded possible necessary by c o m p o s itio n , minimalization to determ ine to com pute of re g u la r how m any the function primitive functions. in te rm e d ia te and re c u rsio n , Therefore, resu lts whether these and it is will be results overlap. From this, the maximum m e s s a g e length can be determined. The function n e e d s to be able to be computed for all possible input values, an d the m e s s a g e length h as to be fixed. The m e s s a g e length then is s e t to be the maximum that might be n ee d e d to compute the function for any of th e possible input values. 4.11. Sum mary S ince it h a s b e e n shown that th e initial functions an d the allowable o perations c a n all be com puted by rules in the classifier s y ste m , the th eorem h a s b ee n proven. Each function will have its own m e s s a g e length d e p e n d e n t on its composite functions and their a s s o c i a t e d operations. This m e s s a g e length is in d epen dent of the input values. Chapter 5 Conclusion T he goal of this p a p e r w a s to s h o w that a classifier sy stem h a s the computational power of a Turing machine. To do this, I have u s e d t h e functional a p p ro a c h to computability. Thus, I start with a given arbitrary u - r e c u r s i v e f u n c ti o n s that co m b in a tio n s com prise used function. the to obtain known. With this knowledge, system with a fixed This means y -recursive th a t th e f u n c ti o n this y - r e c u r s i v e function initial and the are als o it is p o ssible to d efin e a classifier m essage length th a t com putes the given function. In my classifier system , I hav e u s e d t h re e different ty p es of rules. Holland u s e d only on e type of rule. W h e n ev er a match w as m ade, Holland's rules fired. Using t h e s e assu m p tio n s, I hav e shown that given a y -recursive function, that function can b e c o m p u te d by the classifier s y stem . Since th e given function is an arbitrary y recursive function, all y -recursive functions can be c o m p u te d by the classifier sy stem . Each function will h a v e its own m e s s a g e length an d its own s e t of rules. Future re se a rc h can be d o n e by investigating th e possibility of using le s s then th ree ty pes of rules in the classifier system . This might be com bined with the u s e of the not operator (-) that Holland u s e s . This op erato r signifies th a t th e condition is not satisfied by any m e s s a g e on the m e s s a g e list. Using this notation might make s o m e of the classifiers e a s ie r to write and understand. 48 49 The o p e r a tio n s perm itted were for re g u la r functions. This p r o c e s s c a n also be ex p a n d e d to s e e if it holds for partial recursive fun ction s. A partial co ntained in function is one whose d o m ain is properly a s o p p o s e d to a function w h o se domain is N^. The input th en would h a v e to b e restricted to only that part of the domain for which the function in question is defined. 50 R eferen ces Brookshear, J. Glenn, Theory of Computation, Formal Languages, Automata, a n d Complexity. The Benjamin/Cummings Publishing Company, Inc., Redwood City, California, 1989. Davis, Randall and Systems", King, Machine Donald, Editors, Jonathan, **An Overview Intelligence 8 , of Production Elcock, E. W. an d Michie, Halsted Press, New York, 1977. Holland, J oh n H., "Escaping Brittleness: The Possibilities of G eneralP u rp o s e Learning Systems", Algorithms Machine Approach, Volume II, Applied to Parallel R ule-B ased Learning An Artificial Michalski, R yszard S., Carbonell, J a i m e G. and Mitchell, Tom M., Editors, Morgan Kaufmann Inc., Los Altos, California, Lewis, Harry Theory of R. and Intelligence Publishers, 1986. Papadimitriou, Christos H., Elements of the Computation, Prentice-Hall, Inc., Englewood Cliffs, New J e rs e y , 1981. Luger, G e o r g e F. an d Stubblefield, William A., Artificial Intelligence and the Design of Expert System s, The Benjamin/Cummings Publishing Company, Inc., Redwood City, California, 1989. 51 Minsky, Marvin L., Computation Finite an d Infinite Machines, Prentice-Hall. Inc., Englewood Cliffs, New J e r s e y , 1967.
© Copyright 2024 Paperzz