MODULAR SELF-PROGRAMMER

Abstract: A self-programming technique includes receiving a sequence of input signals (40) and comparing (60) each input signal with an expectation signal (70). A sequence of output signals is generated (50) from the input signals and at least part of the output signal sequence is stored (80) when the expectation signal (70) compares favorably with the input signal. Modular units (10) performing this technique may be connected as a master with one or more servants. The master provides the expectation signals for the servants as its output and receives their signals indicating their comparison outcomes as its input. Within each programmer a random number may be generated as an output when the input signal received is not expected and has not previously been stored as an input preceding an output signal. The random number output provides trial and error capabilities.

Description: MDDULAR SELF-PROQIANMER Background of the Invention The present invention relates to a machine which programs its own operation. More specifically, the invention relates to a self-programmer which can be joined as a modular unit to other self-programmers, to provide a more complex self-programmer. As programmable machines, typically built around microprocessors, have become more common, ' the task of programming them has become an increasingly significant factor in their production. Some recent studies recognize that i is possible, in principle, to provide a machine which is self-programming. Some proposals approach the problem from the point of view of a specific programming task, such as the movement of a robot. It would be advantageous to have a more generally useful self-programmer capable of approaching a wide variety of programming tasks, with minimal modification. It would further be advantageous to have a modular self-programmer capable of being combined with other identical modules to for a more complex self-programmer. Summary of the Invention The present invention provides a generalized self-programmer which may be provided in modular form, with modules capable of being combined to form a more complex self-programmer. A self-programmer, according to the present invention, includes an input means which receives input signals. Expectation means provides an expectation signal indicating at least one of the possible input signals, and the expectation signal is compared with the input signal by comparing means. If the input signal is indicated by the expectation signal, the comparing means provides a comparison signal. Generating means receives the input signals and provides output signals in response, and the comparison signal causes at least part of the output signals to be stored in program storing means. A method of self-programming, according to the invention, similarly includes providing an expectation signal, receiving a sequence of input signals, and comparing the input signals with the expectation signal. If the expectation signal indicates a received input signal, a comparison signal is provided. Meanwhile, a sequence of output signals is generated in response to the input signals, and the comparison signal causes data corresponding to at least part of the output signal sequence to be stored. Each output signal may be stored with a preceding input signal and an expected input signal as a step in a series. If the expected input signal indicates the input signal received after the output signal is provided, th the next step in the series is applied. If not, the expected input signal m be modified, and a further test may be performed to determine whether the input signal received is one of the preceding input signals, which may be u to begin a new sequence. When appropriate, a random output signal may be provided to provide trial and error self-programming. In a modular self-programmer, according to the invention, a master programmer is connected to one or more servant programmers. The outputs fr the master serve as the expectation signals for the servants. The comparis signals from the servants, on the other hand, serve as input signals for th master. The servants are thus controlled by the master. These and other objects, features and advantages of the invention will become more fully apparent from the following description together with the drawings and the appended claims. Brief Description of the Drawings Fig.l is a block diagram showing the relation between a self-programmer and its environment. Fig.2 is a block diagram showing the major functional components of a self-programmer, according to the present invention. Fig.3 is a schematic digital circuit which forms one embodiment of the self-programmer of Fig.2. Fig. is a schematic digital circuit forming another embodiment of the self-programmer of Fig.2. Fig.5 is a self-programming flow chart for the circuit of Fig.4. Fig.6 is a schematic drawing of data entry modification. Fig.7 is a schematic circuit diagram of a modular self-programmer according to the invention. I I "5" Detailed Description of the Preferred Embodiments I. Basic Embodiment The basic embodiment of a self-programmer according to the present invention can be understood from Figs.l and 2. Fig.l shows a self-program in its environment, while Fig.2 shows the inner functional components of a self-programmer according to the invention. Self-programmer 10 interacts with system 20 by providing outputs and receiving inputs. Although system 20 is shown as a discrete component, it need not be a single component, but could be any environment with which self-programmer 10 could interact. In order for self-programmer 10 to oper effectively, however, there must be a relationship between the outputs provided to system 10 and the inputs received from it. This relationship i shown in phantom in Fig.l as phantom program 30, and may be thought of as program which, if executed by self-programmer 10, would result in a desire input or series of inputs from system 20. The present invention is based in part on the discovery that a combination of components, as shown in Fig.2, will provide a self-programm 10 as described above. Input means 40 receives a sequence of input signal from system 20 and provides them to generating means 50 and comparing mea 60. Expectation means 70 provides an expectation signal, indicating at le one of the possible input signals. Comparing means 60 compares the expectation signal with the input signals, and provides a comparison signa whem the input signal is one of those indicated by the expectation signal. Meanwhile, the generating means 50 is generating a sequence of output sign in response to the input signals. When the comparison signal is provided, least part of this sequence of output signals is stored by program storage means 80. As a result of the combination of Fig.2, a sequence of outputs will be stored, which succeeded in producing an input signal indicated by the expectation signal from expectation means 70. This result provides one basic type of self-programming. Fig.3 illustrates a simple digital circuit 100, including the basic functional components of Fig.2. Input latch 104 receives the input signals which, in this simple case, are the outputs. Inverter 105, which may include a delay, inverts the input signal to provide the output signal. AND gates 106a and 106b also receive the input signal and, when it is the same as the value stored in goal latch 107, provides a comparison signal through OR gates 106c and AND gate 106d to flip-flop 108, which serves to store the output signal which produced the desired input signal. As long as no comparison signal is provided, the AND gate 106d will be off, holding flip-flop 108 stable, but when the comparison signal occurs, AND gate 106d will temporarily be on, clocking flip-flop 108 to store the output from inverter 105. Inverter 109a and delay element 109b will then turn off AND gate 106d, to complete the storing process. In the simple single-bit example of Fig.3 the system is a direct connection of output to input. The present invention is applicable, however, to far more complicated systems and can be used to provide self-programmers which interact with such systems to produce desired results. Furthermore, although the simple self-programmer 100 of Fig.3 is digital, the present invention would be equally applicable to analog embodiments, except that the output of comparing means 60, as in Fig.2, must be a digital value, indicating that the input signal received fits within the goal defined by the expectation signal. The preferred embodiments described below, however, are digital except as otherwise noted. II. A detailed embodiment Fig.4 shows a more detailed embodiment of a self-programmer 110 centered around a microprocessor or other appropriate central processing unit (CPU) 120. Fig.5 is a flow chart of a program which CPU 120 could execute to provide a self-programmer according to the present invention. As shown in Fig.4, CPU 120 receives inputs from and provides outputs to a system through system input/output buffer 140, which may be a conventional input/output device serving CPU 120. Input/output buffer 140 may be connected to any appropriate input and output devices, whether mechanical, electrical, or other, provided that the relationship between the outputs and the inputs is within the ability of self-programmer 110 to discover. CPU 120 is also connected to goal input 160, from which it receives inputs, indicating the inputs from buffer 140 which are expected. Goal input 160 may be a passive input or may be an inter-active input. CPU 120 is also connected to memory 180, which is shown as an addressable memory space. If CPU 120 is a microprocessor, operating program 182 will typically be stored in a IROM, and will follow a flow chart like that in Fig.5, discussed below. Registers 184 are provided for temporary storage of values such as the goal, the input, the output, or a random number. Output stack 186 is a memory which stores the outputs provided to the system in sequence, together with other appropriate data, such as the input expected in response to each output. RAM 188 stores the data used by CPU 120 in generating outputs, and hard memory 190 may also be provided, such as a disk drive, for storing a large quantity of such data. In general, such data will be referred to herein as experience and the experience in RAM may be thought of as the relevant experience, while the contents of output stack 186 may be thought of as current experience. Fig.5 shows how CPU 120 may operate in self-programmer 110. The flow chart of Fig.5 is merely illustrative of a sequence which provides the functions shown in Fig.2. Many other sequences could be developed, which would result in self-programming of the type shown in Fig.2. The sequence of Fig.5 is relatively straightforward, however, yet versatile. In step 202, CPU 120 initializes, taking whatever steps are necessary to begin execution of the operating program 182. This may involve setting an instruction register which is used to address operating program 182. Also registers 184 may be initially set to appropriate values, and output stack 186 may similarly be cleared. When initializing is complete, CPU 120 proceeds to read the input from goal input in step 204, storing the goal in the goal register. Rather than being a single value, the goal could be a sequence of goals, so that a goal stack or other sequential memory could be provided for storage of the goal sequence. Each goal, however, would require a similar sequence of subsequent steps until met, after which the next goal would be sought. In step 206, the inputs from the system are read from buffer 140, and stored in the input buffer. This step corresponds to input means 40 in Fig.l, and could include any appropriate processing of input data to make it amenable to storage. If self-programmer 110 includes hard memory 180, experience from hard memory 190 may be loaded into RAM 188 during one of steps 202, 204 or 206. If experience is limited, it may all be loaded into RAM 188 during initialization. If experience is greater, but manageable for a specific goal, it may be loaded after the goal is read in step 204. If even greater, it may be loaded for a specific input after the input is read in step 204. When the goal and input have both been read, they are compared in step 208. This step corresponds to the comparing means 60 of Fig.2. The comparison may be a bit by bit comparison or any other comparison which produces an affirmative outcome only when the input is one of the inputs indicated by the goal. Numerous comparison techniques are possible, of course, and the particular comparison technique used could be an algorithm suited to the specific input data. If the input is two-dimensional, techniques such as edge detection and the like may be useful. If the input is one of those indicated by the goal, CPU 120 will proceed to store the sequence in the output stack 186 in hard memory 190, in step 210, adding it to the stored body of experience. Step 210 corresponds to program storing means 80 in Fig.2. The manner in which this experience is stored will depend somewhat on how it is to be retrieved for loading into RAM 188. For example, each data entry may include three fields, one for the output itself, a second for the input which preceded it, and a third for the resulting input. At the time of storage, a directory may be generated indicating the start of a sequence of data entries which attained a specified goal. Another directory may be generated for assessing each separate data entry according to the second field, but also indicating the starting address of the sequence in which that input appears. In this way, selected data entry sequences may be loaded into RAM 188, based on the goal attained or on a particular input. The contents of the output stack 186 must include all information to be stored during step 210. .. Although any suitable storage format could be used, it is presently preferred that the steps of a successful sequence be stored in sequence so that the entire sequence may be treated as a block. It may be preceded by a header, indicating the number of steps and including a directory of preceding inputs in the second field. Each data entry within the sequence may include an indication of its number in the sequence if the sequence is not stored in a contiguous block of address space. When storage is completed, the program of Fig.4 ends at step 212. As noted above, however, the goal may be a sequence of inputs. In which case, step 212 may include returning to step 204 to read and store the next goal. If, on the other hand, step 208 results in a negative outcome, CPU 120 proceeds to generate the output by a sequence of steps which correspond to the generating means of Fig.2. The first of these steps in the particular embodiment of Fig.5 is to compare the input with an expected input, indicating at least one of the possible inputs in step 214. As noted above, this • expected input could be stored with the output from which it results, as a part of a sequence which once led successfully to a particular goal. Therefore, the expected input may be retrieved along with the output and may be stored in an appropriate one of registers 184, pending the reading of the input in step 206 and the comparison in step 214. If the comparison in step 214 shows that the input is one of the inputs indicated by the expected input, then CPU 120 proceeds to the next step in the sequence of steps, by loading the output register, in step 216. Then in step 218, the output is applied to the system through buffer 140 and stored in the output stack 186. This storing process cannot be completed, of course, until the resulting input is received in step 206, and may then be stored as the expected input following the output as well as the preceding input for the next outputs. If the comparison in step 214, on the other hand, shows that the input is not expected, CPU 120 may proceed to another test to determine whether the resulting input may be treated as part of a new sequence, in step 220. This may be done by examining the preceding input directory to determine whether the input appears as a preceding input for an output step in a sequence which once led successfully to the goal sought. If so, that output step is loaded to the output register in step 222, and CPU 120 proceeds to step 218 as above. If step 220 indicates, on the other hand, that no such new sequence is in experience, CPU 120 proceeds to generate a random number and to load the random number into the output register, in step 224. Once again, CPU 120 will then proceed to step 218. This random number capability enables self-programmer 110 to perform trial and error programming when faced with a new situation or, by a suitable modification of step 220, with a repeated failure to progress toward the goal from a specific input. If a random number has been provided as an input, step 218 should also include storing the preceding input in output stack 186. Then, in the next occurrence of step 206, the next input should also be stored as the expected input corresponding to the random number output in output stack 186. The expected input should not, however, be compared in step 214, which should be skipped, proceeding instead to step 220. Step 220, in addition to a test, may include a suitable modification of an expected input which failed to compare with the received input in step 214. Fig.6 illustrates one technique by which this could be done. The first line of Fig.6 shows an example of an input received by CPU 120 in response to the output shown within a data entry on the second line of Fig.6. The data entry also includes a preceding input and an expected input. The expected input, as shown, has a series of locations, each of which may take any of three values, "0" and M l" indicating binary zero and one received and "X" indicating that either zero or one may be received. Since the input in the first line differs from the expected input at the second bit, the second bit of the expected input is modified to an "X", as shown in the third line of Fig.6. In this manner, the expected input will gradually indicate a larger group of possible inputs which may occur in response to the output, increasing the likelihood that the comparison in step 214 will have an affirmative outcome, causing the next step of the sequence to be attempted. Although the embodiment of Figs.4 and 5 is presently preferred because it may easily be implemented with current technology, we turn now to additional embodiments which promise further improvement in self-programming. III. Modular Embodiment Fig. 7 shows a modular embodiment made possible by the present invention. Modular self-programmer 300 includes master self-programmer 310 and servant self-programmers 320 and 330. Rather than providing outputs directly to and receiving inputs directly from the system, master 310 provides outputs from terminals 0 to the goal inputs G of servants 320 and 330 and receives inputs at terminals I from servants 320 and 330, indicating the occurrence of a comparison signal. In other words, when a goal specified by master 310 is attained by a servant 320 or 330, that servant provides its comparison signal to master 310, as an input. In this manner, master 310 could control,one or more servant self-programmers and master 310 may in turn receive its goals through a goal input G. Each self-programmer of Fig.7 is shown simply as a box, but the internal structure includes the functional components of Fig.2. These cαπponents could be provided by a CPU-based embodiment like Fig.4 or by any other appropriate embodiment of the invention. IV. Miscellaneous Although the embodiment of Fig.4 has a single CPU 120 performing both the functions of generating means 50 and comparing means 60 in Fig.2, those functions could be performed by parallel CPUs, or by parallel analog processors, if appropriate. The entire circuit of Fig.4 could be provided as a single digital VLSI circuit. Fig.6 illustrates how an expected state may be defined to include unspecified locations which may take either of two values. Similarly, the goal may be defined with some unspecified locations, so that any of several inputs will result in success. In this manner, it may be possible to accumulate experience from which fully specified goals may be more easily attained. The steps of the flow chart in Fig.5 are relatively simple, and each could easily be implemented with familiar programming techniques in a straightforward manner. A wide variety of algorithms could be used to increase efficiency or effectiveness, however, all within the skill of the art. The comparison algorithms, for example, could be designed to bring out the significant distinguishing features of the input data. Also, the output generating algorithms could be designed to cause the self-programmer to wait for an input after each output by providing null outputs for a given period, for example. The present invention may have many applications. The motions of a robot may be self-programmed according to the invention. Speech recognition and synthesis could similarly be self-programmed. Numerous other possible applications could easily be identified. Although the present invention has been disclosed in connection with a plurality of embodiments thereof, many other variations will now be apparent to those of ordinary skill in the art. Therefore, the invention is not limited by the disclosed embodiments, but only by the appended claims.

Claims: I CLAIM: 1. A self-programmer, comprising: input means for receiving a sequence of input signals, each input signal being one of a.plurality of possible input signals; expectation means for providing an expectation signal indicating at least one of the possible input signals; comparing means for comparing the input signals with the expectation signal and for providing a comparison signal when an input signal is received which is indicated by the expectation signal; generating means for providing a sequence of output signals in response to the input signals; and program storing means for storing data corresponding to at least part of the sequence of output signals in response to the comparison signal. 2. The self-programmer of Claim 1 in which the expectation means comprises goal input means for receiving the expectation signal. 3. The self-programmer of Claim 1 in which the program storing means comprises means for storing expected input data corresponding to an output signal in response to the comparison signal, the expected input data indicating at least one of the possible input signals, the generating means comprising expected signal comparing means for comparing an input signal received by the input means after that output signal is provided by the generating means with the expected input data corresponding to that output signal and for providing a signal indicating whether the input signal received is indicated by the expected input data. 4. The self-programmer of Claim 3 in which the program storing means further comprises means for storing preceding input data corresponding to an output signal in response to the comparison signal, the preceding input data indicating an input signal which preceded that output signal, the generating means further comprising means for testing whether an input signal received by the input means is stored by the preceding input data storing means when the signal from the expected signal comparing means indicated the input signal received is not indicated. 5. The self-programmer of Claim 4 in which the generating means further comprises random number means for generating a random number as an output signal when the received input signal is not stored by the preceding input data storing means. 6. The self-programmer of Claim 3 further comprising means for modifying the corresponding expected input data when the input signal received after an output signal is not indicated by the corresponding expected input data. 7. The self-programmer of Claim 3 in which the generating means further comprises random number generating means for generating a random number as an output signal when the input signal received is not indicated by the expected input data. 8. The self-programmer of Claim 3 in which the program storing means stores the data corresponding to the sequence in a series of steps, each step including an output signal, the generating means further comprising means for providing the data corresponding to the output signal of the next steps in the series when an input signal received after the output signal of the previous step in the series is indicated by expected input data corresponding to the output signal of the previous step. 9. A modular self-programmer comprising a master programmer and at least one servant programmer, the master and servant programmers each comprising the self-programmer of Claim 1; the master programmer and each servant programmer being connected so that an output signal from the master programmer is the expectation signal for the servant programmer and the comparison signal from the servant programmer is the input signal received by the input means of the master programmer. 10. A method of self-programming comprising: providing an expectation signal indicating at least one of a plurality of possible input signals which may be received; receiving a sequence of the input signals; comparing the input signals with the expectation signal and providing a comparison signal when an input signal is received which is indicated by the expectation signal; generating a sequence of output signals in response to the input signals; and storing data corresponding to at least part of the sequence of output signals when the comparison signal occurs. 11. The method of Claim 10 in which the step of providng the expectation signal comprises receiving the expectation signal. 12. The method of Claim 10 in which the step of generating the sequence of output signals comprises storing the output signals, in sequence,ιthe step of storing the corresponding data comprising storing at least part of the sequence of stored ouput signals. 13. The method of Claim 12, further comprising storing expected input data corresponding to an output signal and indicating at least one of the possible input signals, the generating step comprising comparing an input signal received after an output signal with the expected input data corresponding to that output signal to determine whether the input signal received is indicated by the expected input data. 14. The method of Claim 13 further comprising storing preceding input data corresponding to an output signal and indicating an input signal which preceded that output signal, the generating step further comprising testing whether the input signal received is stored as preceding input data when the expected signal does not indicate the input signal received. 15. The method of Claim 14 in which the generating step further comprises generating a random nunber as an output signal when the input signal received has not been stored as a preceding input signal. 16. The method of Claim 13 in which the generating step further comprises generating a random number as an output signal when the input signal received is not indicated by the expected input data. 17. The method of Claim 13 further comprising modifying the corresponding expected input data when the input signal received after an output signal is not indicated by the corresponding expected input data. I -19- 18. The method of Claim 13 in which the generating step further comprises providing a next step in a stored series of steps, each including an output signal, when an input signal received after a previous step in the series is indicated by the expected input data corresponding to that output signal.

Inventors: BERAN JAMES T, BERAN, JAMES, T.
Applicants: BERAN JAMES T, BERAN, JAMES, T.
Application year: 1986
Main classification: G06F7
IPC codes: G05B19, G06F1, G06F7, G06F15