Abstract:
The system providing a guidance for the command entry to an interactive computer recognizes the hierarchical rank of productions and displays command explanatory messages below the rank of production to which the command in need of explanation belongs. Displaying commands of one or two ranks relieves the operator from the annoyance of useless display reading.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to the improvement of a help message output method for assisting the user&#39;s interactive operation with a computer by using the computer&#39;s internal data, specifically productions and messages which will be described below. 
     A method of providing a help message in response to the request of a computer user generally issues a help message by specifying a command name intended for help in the operand of the help command, as in a help function for commands in a time sharing system (TSS). This method displays all help messages at once for items needing help. The above-mentioned method provides information needed by the user, but also provides unneedful information at the same time. 
     SUMMARY OF THE INVENTION 
     An object of this invention is to provide a help message output system which does not oblige the user to read all help messages for the acquisition of necessary information. 
     Another object of this invention is to solve the foregoing problem of the conventional method and provide a system capable of offering help messages which are easily recognizable by the user. 
     A further object of this invention is to provide a help message output method which is intended to guarantee an appropriate amount of operational instructions in a complex interactive processing system. 
     The above objectives of this invention are attained by the hierarchical assistance method for an interactive computer system which receives an input from a terminal and implements a process based on the input, wherein the assistance method features to display a table of syntactic elements, which can be entered, in order from the highest ranking production by utilizing productions which have been defined hierarchically using syntactic element strings and their relations, and issues a detailed help message for each item using the messages defined in the above-mentioned productions in prompting the operator to select an input item. By deleting productions which are not essential for the assistance in the above-mentioned productions, help messages at a plurality of stages can be output at a time. 
     By utilizing the productions defined at multiple stages using the syntactic element strings and their relations to display a table of syntactic elements, which can be entered, in order from the highest ranking production, it is also possible to output in batch all help messages following the syntactic element specified by the operator. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1A and 1B are flowcharts showing the procedure of the hierarchical assistance method embodying the present invention; 
     FIG. 2 is a diagram showing the overall system to which this invention is applied; 
     FIG. 3 is a diagram showing an example of the appendage of help messages to productions; 
     FIG. 4 is a diagram showing the result of execution of the hierarchical assistance by the example of FIG. 3; 
     FIG. 5 is a diagram showing an example of addition of productions which are unnecessary for the assistance; and 
     FIG. 6 is a diagram showing the result of execution of the hierarchical assistance by the example of FIG. 5. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Syntax analysis, productions, terminal symbols and non-terminal symbols are described in the publication A.V. Aho et al., Principles of Compiler Design, pp. 82-85, 125-144, Addison-Wesley, 1977. 
     As a method of describing the interactive procedure, the following method of formal definition of grammar is used. The alphabet is assumed to be a non-empty finite set, and its elements are called &#34;symbols&#34;. An arbitrary number of strings of symbols which belong to one alphabet are called &#34;strings&#34;. 
     Descriptions of syntax rules are called &#34;productions&#34;, and they are described as follows. 
     
         U→X                                                 (1) 
    
     where U represents a symbol and X represents a string. U is called the left side of production and X is called the right side of production. This production reads &#34;symbol U consists of string X&#34;. 
     When a set of productions is called P, symbols appearing on the left side of productions are called non-terminal symbols (V N ) and symbols appearing only on the right side of productions are called terminal symbols (V T ), then grammar G is defined, with S being a start symbol (SεV N ), as follows. 
     
         G={P,S,V.sub.N,V.sub.T }                                   (2) 
    
     The grammar G will be written as follows. 
     
         G(P,S,V.sub.N,V.sub.T)                                     (3) 
    
     Here, HELP(A) is introduced. 
     
         HELP(A)={a|A→a,AεV.sub.N,aεV*}(4) 
    
     where the symbol * means the closure. 
     The productions are assumed to be defined as follows. ##EQU1## 
     In the input induction state Z→X·A Y, where the symbol · means the state for inputting A, when the user requests assistance (asks the system for help), the above HELP(A) is displayed as a help message. We call this method to be a hierarchical assistance method. 
     In the above-mentioned hierarchical assistance method, help messages are produced simply from productions. Accordingly, all symbols in productions are objects of assistance, however, in productions, there are symbols which have been introduced solely for making the syntax analysis possible and help for these symbols are meaningless for the user. 
     Non-terminal symbols V N  are classified into symbols for which the system automatically executes the hierarchical assistance and symbols which terminate the hierarchical assistance. We call the former &#34;implicit non-terminal symbols (V IN )&#34; and the latter &#34;explicit non-terminal symbols (V EN )&#34;. 
     
         V.sub.N =V.sub.IN ∪V.sub.EN 
    
     where 
     
         V.sub.IN ∩V.sub.EN =φ 
    
     Namely, in executing HELP(A) in the above input induction state, HELP(X) is also implemented automatically for a symbol X which meets the following conditions. 
     
         {X|A→a X b, XεV.sub.IN,a,bεV*} 
    
     Accordingly, the inventive assistance method is useful for the command input, data input and program input prompt in an interactive computer system as shown in FIG. 2. It is also applicable to the input prompt in application programs such as a cash dispenser in a bank online system or to the help function in programming systems. 
     It is assumed that a help message is defined as follows. Namely, a non-terminal symbol name or terminal symbol name used for describing a production is put on the left side, and the message main body enclosed by quotation marks is put on the right side. 
     The procedure of the hierarchical assistance method using the above definition will be explained using FIGS. 1A and 1B. 
     From step 1 to step 14 is the main body of this procedure, and from step 15 to step 20 is a subsidiary procedure called by the main body. 
     Step 1 substitutes a symbol which is currently in attention into variable Symbol. 
     Step 2 outputs the help message defined for the Symbol. 
     Step 3 checks whether Symbol is a non-terminal symbol. The flow terminates when it is a non-terminal symbol, or if it is not a non-terminal symbol, the sequence proceeds to step 4. 
     Step 4 substitutes the number of productions, having their left side being Symbol, into variable Rule NO. 
     Step 5 sets counter i to &#34;0&#34;. 
     Step 6 checks whether the counter i and Rule NO. are equal. The sequence terminates if they are equal, otherwise the sequence proceeds to step 7. 
     Step 7 increments the counter i by &#34;1&#34;. 
     Step 8 substitutes the number of symbols existing on the right side of the i-th production into variable Elem NO. 
     Step 9 sets counter j to &#34;0&#34;. 
     Step 10 checks whether the counter j and Elem NO. are equal. If they are equal, the sequence returns to step 6, otherwise the sequence proceeds to step 11. 
     Step 11 increments the counter j by &#34;1&#34;. 
     Step 12 checks whether the j-th symbol is an implicit non-terminal symbol. If it is so, the sequence proceeds to step 13, otherwise the sequence proceeds to step 14. 
     Step 13 executes the subsidiary procedure &#34;assistance of implicit non-terminal symbol&#34; using the j-th symbol as an argument, and the sequence returns to step 10. 
     Step 14 outputs the help message defined for the j-th symbol, and the sequence returns to step 10. 
     The subsidiary procedure &#34;assistance of implicit non-terminal symbol&#34; implements the following process. The symbol number in step 13 corresponds to the symbol in step 15. 
     Step 15 substitutes a symbol which is currently in attention into variable Symbol. 
     Step 16 substitutes the number of productions, with their left side being Symbol, into variable Rule NO. 
     Step 17 sets counter k to &#34;0&#34;. 
     Step 18 checks whether the counter k and Rule NO. are equal. If they are equal, the sequence returns, otherwise it proceeds to step 19. 
     Step 19 increments the counter k by &#34;1&#34;. 
     Step 20 outputs the help message defined for the k-th symbol, and the sequence returns to step 18. 
     The hierarchical assistance method will be explained using a specific example of definition of production. 
     FIG. 3 shows the example of definition of production with help messages appended thereto. Assuming S to be a start symbol, this is relevant to the case of help request in a state of 
     S→ . . . &lt;statement&gt; . . . 
     Steps 1 through 9 at the right end are the definition of production. Steps 10 through 14 define messages for individual symbols. 
     FIG. 4 shows an example of a help message output for the production of FIG. 3 with the symbol currently in attention being the &lt;statement&gt;. 
     Steps 1 through 3 in FIG. 4 are the help messages defined in step 10 in FIG. 3 and outputted in step 2  in FIG. 1, and steps 4 through 7 in FIG. 4 are the help messages defined in steps 11 through 14 in FIG. 3 and outputted in step 12 in FIG. 1. 
     The foregoing embodiment outputs only necessary information as help messages, preventing the user to read the whole lengthy message up to the end, as in conventional systems. 
     Generally, in defining production, non-terminal symbols unneedful for the assistance are often introduced in consideration of the easiness of reading and writing productions and in consideration of the possibility of syntax analysis. In such a case, the use of the foregoing hierarchical assistance method compels the user to have a useless assistance in acquiring necessary information. On this account, such symbols are treated as non-terminal symbols and a hierarchical assistance further lower by one rank is executed automatically. An example of this case will be explained using FIGS. 5 and 6. 
     Steps 1 through 6 in FIG. 5 define productions, and steps 7 through 14 define help messages for individual symbols. $n (n=1, 2, . . . ) appearing on the left side of steps 10 through 14 are to identify productions having the same non-terminal symbols on the left side. It is assumed here that non-terminal symbols &lt;expression&gt; and &lt;id&gt; are declared to be implicit non-terminal symbols. 
     FIG. 6 shows an example of a help message output for the productions of FIG. 5, with the symbol currently in attention being &lt;assign&gt;. Steps 1 through 3 in FIG. 6 are the help message defined in step 7 of FIG. 5 and outputted in step 2 in FIG. 1. 
     Steps 4 and 5 in FIG. 6 are the help message defined in step 8 in FIG. 5 and outputted in step 2 in FIG. 1. Steps 6 through 8 are the help messages defined in step 9 in FIG. 5 and outputted in step 2 in FIG. 1. Steps 9 through 13 are the help messages defined in steps 10 through 14 in FIG. 5 and outputted in the loop of steps 18 through 20 in FIG. 1. Thus, the message of FIG. 6 has more information than that of FIG. 4 with regard to the symbols in the productions in correspondence to the additional one rank.