Intermediate-language generation device, method for generating intermediate-language, and program
The intermediate language generation device optimizes program execution by executing partial processes to determine conditions for subsequent processes, enhancing efficiency and reducing unnecessary computations.
Patent Information
- Application Number
- JP2024070379
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2025-11-06
AI Technical Summary
Existing methods for generating intermediate language for computer program code are inefficient when dealing with tables having duplicate column names, leading to incomplete or suboptimal execution of intermediate language for subsequent processes.
An intermediate language generation device and method that executes a part of the process to determine execution conditions, generates an intermediate language for subsequent processes based on the results, and optimizes the entire program by adding the intermediate language for subsequent processes to the part of the process.
This approach allows for more efficient generation and execution of intermediate language by executing partial processes, reducing unnecessary computations and optimizing the entire program, thereby improving processing efficiency.
Smart Images

Figure 2025166387000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to an intermediate language generation device, an intermediate language generation method, and a program. [Background technology]
[0002] Patent Document 1 discloses a method for generating an intermediate language (also called an intermediate representation (IR)) for computer program code. In a processing method in which an intermediate language is generated when a program is executed and the generated intermediate language is executed, when an attempt is made to generate an intermediate language for a series of processes, it may be necessary to execute the intermediate language for part of the series of processes in order to generate the intermediate language for the subsequent processes, or it may be impossible to generate an efficient intermediate language.
[0003] For example, there is a command to read one column from a table (project_column command) and a command to read multiple columns (project_table command). Furthermore, an error occurs when the project_column command is issued for a table that has multiple columns with the same name. Consider a function or method that reads data from a specified column in a specified table by specifying the table and column name from a user program. For example, if this function is written to issue the project_table command if the target table has multiple columns with the same name, and the project_column command if there is only one column name, it will be possible to read the data of the specified column from the target table without generating an error, whether the table has multiple columns with the same name or only one. Consider the following user program that calls this function:
[0004] (User program 1) tbl = read_csv(“data.csv”) sorted = sort_table(tbl, key=“A”) result = project(tbl, “B”)
[0005] The first line of User Program 1 means to read the file data.csv and set the tabular data that has been read into the tbl object. The second line means to sort the read data by column A. The third line means to read column B from the read table. project(tbl, "B") is the function mentioned above. The intermediate language generated from User Program 1 is as follows:
[0006] (Intermediate language of user program 1) %1 = read_csv(“data.csv”) %2 = sort_table(%1,“A”) %3 = project_column(%2,“B”)
[0007] The generated intermediate language is not executed immediately upon generation, but is executed when the need arises (define-by-run method). This method of executing the intermediate language is also called deferred execution. Here, assuming there are no duplicate columns in the table, only columns A and B will be handled, so an intermediate language optimized to read only columns A and B can be generated as follows:
[0008] (Example of optimized intermediate language for user program 1) %1 = read_csv(“data.csv”) %2 = project_table(%1, [“A”, “B”]) %3 = sort_table(%2, "A") %4 = project_column(%3, “B”)
[0009] But in reality, you don't know if the table has duplicate columns, so %1 = read_csv(“data.csv”) %2 = sort_table(%1,“A”) is executed to check whether column B is duplicated in the read table, and the following will be generated depending on the result of the check. %3 = project_column(%2,“B”)
[0010] As a result, columns other than columns A and B must also be sorted, which reduces the efficiency of User Program 1 compared to "(Example of optimized intermediate language for User Program 1)." This is an example of the above-mentioned situation where "if the intermediate language is not executed for part of a series of processes, it is not possible to generate the intermediate language for the subsequent processes, or it is not possible to generate an efficient intermediate language." [Prior art documents] [Patent documents]
[0011] [Patent Document 1] Japanese Patent Application Laid-Open No. 2010-225162 Summary of the Invention [Problem to be solved by the invention]
[0012] One of the objects is to provide a method for executing an intermediate language for a part of a series of processes and generating an intermediate language for subsequent processes based on the results. [Means for solving the problem]
[0013] According to one aspect of the present disclosure, an intermediate language generation device includes: a means for generating an intermediate language for a part of a process described in a program to be executed, and executing the generated intermediate language; and a means for generating an intermediate language for a subsequent process of the part of the process based on the execution result of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language for the subsequent process to the intermediate language for the part of the process.
[0014] According to one aspect of the present disclosure, an intermediate language generation method generates an intermediate language for a process described in a program to be executed by generating an intermediate language for a portion of the process, executing the generated intermediate language, and based on the execution result of the portion of the intermediate language, generating an intermediate language for a subsequent process of the portion of the process in the process, and generating an intermediate language corresponding to the entire program by adding the intermediate language for the subsequent process to the portion of the intermediate language.
[0015] According to one aspect of the present disclosure, a program is provided that, when generating an intermediate language for a process described in a program to be executed, causes a computer to generate an intermediate language for a part of the process and execute the generated part of the intermediate language; Based on the execution result of the part of the intermediate language, an intermediate language for a subsequent process of the part of the process in the process is generated, and an intermediate language corresponding to the entire program is generated by adding the intermediate language of the subsequent process to the part of the intermediate language. [Effects of the Invention]
[0016] According to the present disclosure, it is possible to execute an intermediate language for part of a series of processes, and then generate an intermediate language for subsequent processes based on the results of the execution. [Brief explanation of the drawings]
[0017] [Figure 1] FIG. 1 illustrates an example of an intermediate language generation device according to an embodiment. [Figure 2] 3A and 3B are diagrams illustrating an outline of an intermediate language generation process and an execution process according to an embodiment. [Figure 3] FIG. 2 is a diagram illustrating an example of a configuration of a front end according to an embodiment. [Figure 4] FIG. 2 is a first diagram showing an example of a table used for generating an intermediate language according to the embodiment. [Figure 5] FIG. 10 is a second diagram showing an example of a table used in intermediate language generation according to the embodiment. [Figure 6]FIG. 10 is a third diagram showing an example of a table used in intermediate language generation according to the embodiment. [Figure 7] FIG. 4 is a fourth diagram showing an example of a table used in intermediate language generation according to the embodiment. [Figure 8] FIG. 5 is a fifth diagram showing an example of a table used in intermediate language generation according to the embodiment. [Figure 9] 10 is a flowchart illustrating an example of an intermediate language generation process according to the embodiment. [Figure 10] FIG. 10 is a first diagram illustrating the effect of the intermediate language generation process according to the embodiment. [Figure 11] FIG. 10 is a second diagram illustrating the effect of the intermediate language generation process according to the embodiment. [Figure 12] FIG. 10 is a diagram illustrating another example of an intermediate language generation device according to the embodiment. [Figure 13] 10 is a flowchart illustrating an example of an operation of the intermediate language generation device according to the embodiment. [Figure 14] FIG. 1 is a diagram illustrating an example of a hardware configuration of an intermediate language generation device according to an embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0018] Hereinafter, an intermediate language generation process according to each embodiment of the present disclosure will be described with reference to the drawings. In the drawings used in the following description, the description of parts that are not related to the present disclosure may be omitted or not shown. The same or equivalent parts in all drawings will be assigned the same reference numerals, and common descriptions may be omitted.
[0019] <Embodiment> (System Configuration) FIG. 1 is a diagram showing an example of an intermediate language generation device 10 according to an embodiment. The intermediate language generation device 10 includes a program acquisition unit 11, a front-end unit 12, a middleware unit 13, and a back-end unit 14. The program acquisition unit 11 acquires a program to be executed (user program). The front-end unit 12 generates an intermediate language for the user program acquired by the program acquisition unit 11. As will be described later, the front-end unit 12 generates an intermediate language from the user program, while optimizing it as necessary, to generate an intermediate language for the entire user program. The middleware unit 13 optimizes the intermediate language of the entire user program generated by the front-end unit 12 . The back-end unit 14 executes the intermediate language optimized by the middleware unit 13 .
[0020] FIG. 2 shows an outline of the process of generating and executing an intermediate language by the intermediate language generation device 10. (S1) The program acquisition unit 11 acquires a program (for example, the following user program 0) and passes it to the front-end unit 12.
[0021] (User program 0) d = mat_mul(a, b) e = mat_mul(a, c) f = mat_add(d, e) print(mat_eval(f))
[0022] Here, mat_mul, mat_add, and mat_eval are functions included in the library that uses the intermediate language. mat_mul is a library function that generates an intermediate language that performs the multiplication of arguments. mat_mul(a, b) generates an intermediate language that performs a × b (it only generates the intermediate language and does not perform the a × b operation). mat_add is a library function that generates an intermediate language that performs the addition of arguments. mat_add(d, e) generates an intermediate language that performs d + e (it only generates the intermediate language and does not perform the d + e operation). mat_eval is a function that instructs the execution of the generated intermediate language. When mat_eval(f) is called, the intermediate language that calculates f is executed (deferred execution). The d + e operation is performed at this time. The intermediate language for calculating d and e, which are necessary for the f operation, is also executed, and a × b and a × c are performed.
[0023] (S2) The front-end unit 12 generates an intermediate language. The front-end unit 12 outputs the generated intermediate language to the middleware unit 13. (Example of the generated intermediate language for user program 0) %d = mul(%a, %b) %e = mul(%a, %c) %f = add(%d, %e)
[0024] (S3) The middleware unit 13 optimizes the intermediate language. In this example, a×b+a×c can also be written as a×(b+c), and since a×(b+c) requires less computation, the middleware unit 13 optimizes the intermediate language, for example, as follows. The middleware unit 13 outputs the optimized intermediate language to the backend unit 14. (Example of optimized intermediate language) %d = add(%b, %c) %f = mul(%a, %d)
[0025] (S4) The back-end unit 14 executes the intermediate language. The back-end unit 14 executes mat_eval(f). At this time, the intermediate language generated up to the previous stage is executed (delayed execution). Because it is abstracted by the intermediate language, the user program can be executed on various platforms such as a CPU and a GPU without changing the user program.
[0026] Next, we will explain the configuration of the front-end unit 12, which makes it possible to generate an intermediate language for the entire series of processes even when the execution result of part of the intermediate language (whether there are multiple columns with the same name) affects the generation of the intermediate language for the subsequent process, as in the example of reading column data from the table mentioned above.
[0027] FIG. 3 is a diagram showing an example of the configuration of the front end unit 12. As shown in FIG. The front-end unit 12 includes an IR generation unit 121, a partial execution unit 122, a metadata recording unit 123, and a command recording unit .
[0028] The IR generation unit 121 generates an intermediate language. The IR generation unit 121 not only converts the user program acquired by the program acquisition unit 11 into an intermediate language, but also generates an intermediate language for subsequent processing by using the execution results of part of the intermediate language in cooperation with the partial execution unit 122 and the metadata recording unit 123. More specifically, in order to generate an intermediate language for the entire series of processing, the IR generation unit 121 has functions such as determining whether execution of part of the intermediate language is necessary, determining under what conditions the intermediate language should be executed if necessary, generating the part of the intermediate language necessary for subsequent processing, instructing the partial execution unit 122 to execute the part of the intermediate language, and generating the intermediate language for subsequent processing by using the execution results of the partial execution unit 122.
[0029] The partial execution unit 122 executes a portion of the intermediate language generated by the IR generation unit 121, and records the result in the metadata recording unit 123. The execution result of the portion of the intermediate language is called metadata. The metadata recording unit 123 stores the execution results (metadata) of the intermediate language executed by the partial execution unit 122. The command recording unit 124 stores the intermediate language generated by the IR generating unit 121 using the metadata. The intermediate language stored in the command recording unit 124 is passed to the middleware unit 13.
[0030] Next, an example will be described in which the front-end unit 12 having the configuration illustrated in FIG. 3 generates an intermediate language using metadata.
[0031] (Example 1) As Example 1, we will again use User Program 1. Figure 4 shows an example of a table contained in data.csv, which is the target of reading. (User program 1) tbl = read_csv(“data.csv”) sorted = sort_table(tbl, key=“A”) result = project(tbl,“B”)
[0032] The IR generation unit 121 reads the user program 1 and determines that in order to generate the intermediate language of project(tbl, "B"), it is necessary to know whether the table tbl has multiple B columns. The IR generation unit 121 extracts the processing required for this determination and generates the intermediate language of the extracted processing (partial intermediate language). The IR generation unit 121 also analyzes that it is sufficient to read only the first row (the row of column names) in the generated partial intermediate language. The IR generation unit 121 passes the generated partial intermediate language to the partial execution unit 122 and instructs it to execute it. (Some examples of intermediate languages) %1 = read_csv(“data.csv”) %2 = sort_table(%1, "A")
[0033] The partial execution unit 122 executes the intermediate language. The partial execution unit 122 reads only the column names (first row) using read_csv and sorts the read column names using sort_table. This executes the process of reading the column names of table 41 in FIG. 4 and sorting by column A. The execution result (metadata) is shown below. %1 column names: ["A", "B", "C", "D"] # Read only the first row %2 column names: [“A”, “B”, “C”, “D”] # same as sort_table input
[0034] The metadata recording unit 123 stores the metadata of the execution results. In this example, the metadata is the column names A to D of the table.
[0035] The IR generation unit 121 obtains metadata from the metadata recording unit 123 and generates an intermediate language for subsequent processing. As a result of partial execution, it is found that there are no duplicate column names, so the IR generation unit 121 can select the project_column command for project(tbl, "B"). An example of the generated intermediate language is shown below. The execution result of this intermediate language is shown in Table 42 in Figure 4.
[0036] (Example of intermediate language) %1 = read_csv(“data.csv”) %2 = sort_table(%1, "A") %3 = project_column(%2,“B”)
[0037] (Example 2) As Example 2, consider the following User Program 2. (User program 2) tbl = read_csv(“data.csv”) sorted = sort_table(tbl, key=“A”) result = tbl.B
[0038] tbl.B is a function that extracts column B if B is a column name, and extracts attribute B of the tbl object if B is not a column name. Assume also that the intermediate language includes a project_column command to extract column B and a getattr command to extract an attribute. Because the IR generator 121 does not know whether column B exists in the table, it cannot generate the entire user program 3 as an intermediate language. Therefore, the IR generator 121 instructs the partial execution unit 122 to execute a partial execution. If the table to be processed is similar to table 41 shown in FIG. 4, the intermediate language to be partially executed and the execution results are similar to those described in Example 1. In this example, the metadata is the column names of the table. The IR generator 121 recognizes that column B exists in the table from the metadata (column names) obtained by executing the partial intermediate language, selects the project_column command for the library function tbl.B, and generates the intermediate language for the entire user program 3. The generated intermediate language is similar to that of Example 1.
[0039] (Example 3) As Example 3, consider the following User Program 3. (User Program 3) tbl = read_csv(“data.csv”) sorted = sort_table(tbl, key=“A”) tmp = unique(tbl, key=“A”) result = tmp["B"]
[0040] unique is a function that deletes rows with duplicate data in a column specified by an argument. tmp["B"] is a function that returns the data of column B. If table 51 shown in FIG. 5 is the table to be processed, there are two rows with the data 0 in column A. Therefore, when unique(tbl, key="A") is executed, the subsequent rows are deleted, resulting in table 52. For example, if there are no rows with duplicate data in column A, there is no need to execute unique(tbl, key="A"). In this case, the amount of calculation can be reduced (optimization) by generating an intermediate language that does not execute unique(tbl, key="A"). To check whether duplicate rows exist in column A, the IR generation unit 121 generates a portion of the intermediate language and instructs the partial execution unit 122 to execute the generated intermediate language. (Some examples of intermediate languages) %1 = read_csv(“data.csv”) %2 = sort_table(%1, "A")
[0041] The partial execution unit 122 executes the intermediate language described above. It reads table 51 in FIG. 5 and performs a uniqueness test to check, for example, whether there are duplicate rows in each column. The result of the uniqueness test is metadata. In the case of table 51 in FIG. 5, there are duplicate rows in column A and no duplicate rows in column B. Therefore, the result of the uniqueness test is that there are duplicate rows in column A (True) and there are no duplicate rows in column B (False). The result of the uniqueness test is shown in table 61 in FIG. 6. Table 61 is recorded in the metadata recording unit 123. From this result, the IR generation unit 121 generates an intermediate language for the entire user program 4 by executing tmp = unique(tbl, key="A").
[0042] (Example 4) As Example 4, consider the following User Program 4. (User Program 4) tbl = read_csv(“data.csv”) sorted = sort_table(tbl, key=“A”) tmp = dropna(tbl, key=“A”) result = tmp["B"]
[0043] dropna is a function that deletes invalid (Null) data from the column specified by the argument. If table 71 shown in FIG. 7 is the table to be processed, there is a row where column A is Null. Therefore, when dropna(tbl, key="A") is executed, the Null row is deleted and table 72 is obtained. Since the IR generation unit 121 does not know whether or not there are invalid values in column A of the table, it instructs the partial execution unit 122 to execute a portion of the intermediate language. The partial execution unit 122 executes a portion of the intermediate language. The partial execution unit 122 reads all data with read_csv and calculates the number of invalid values in each column. The number of invalid values is metadata. The partial execution unit 122 executes sort_table. Since the number of invalid values does not change with sort_table, the number of invalid values in the result of sort_table is made the same. The IR generation unit 121 references the metadata (the number of invalid values in each column) and generates an intermediate language with the dropna command if column A has invalid values; otherwise, it generates an intermediate language without the dropna command.
[0044] (Example 5) As Example 5, the following User Program 5 will be taken up. (User Program 5) tbl1 = read_csv(“data1.csv”) tbl2 = read_csv(“data2.csv”) tbl = join(%tbl0, %tbl1, “A”) result = project(tbl,“B”)
[0045] The join function joins tables using the column specified by the argument as a key. If the tables 81 and 82 shown in Figure 8 are the tables to be processed, the table after the join will look like table 83. The IR generation unit 121 does not know whether there are multiple instances of column B in the table after the join, so it instructs the partial execution unit 122 to execute part of the intermediate language. The partial execution unit 122 executes part of the intermediate language. The partial execution unit 122 reads the first rows (column names) of data1.csv and data2.csv, and joins the column names using column A as a key. In this example, the column names are metadata. The IR generation unit 121 references the metadata (column names), and since there are no multiple instances of column B, it selects the project_column command for the library function project(tbl, "B") and generates the intermediate language for the entire user program 5.
[0046] In the above user program, an example was given in which the results of reading data from a table are used as metadata, and an intermediate language for a subsequent process is generated in accordance with the metadata, but reading the table is not essential. For example, the intermediate language generation method of this embodiment can also be applied to a case in which a user program is configured to branch to execute either process B or process C depending on the result of process A. In this example, the IR generation unit 121 generates the intermediate language for process A, and the partial execution unit 122 executes this intermediate language. The IR generation unit 121 generates the intermediate language for process B or process C in accordance with the processing result of the intermediate language for process A.
[0047] (operation) Next, the flow of the intermediate language generation process will be described with reference to FIG. FIG. 9 is a flowchart illustrating an example of an intermediate language generation process according to the embodiment. The IR generation unit 121 analyzes the program to be executed (step S11). The IR generation unit 121 analyzes whether it is impossible to generate an intermediate language for subsequent processing or whether it is impossible to generate an efficient intermediate language unless the intermediate language is executed for part of a series of processing described in the program to be executed. If partial execution of part of the processing is necessary, the IR generation unit 121 generates an intermediate language for that part of the processing and, as necessary, calculates execution conditions for the generated intermediate language (for example, reading only the first row (column name)).
[0048] If the analysis result indicates that partial execution is not necessary (step S12; No), the process proceeds to step S16. If partial execution is necessary (step S12; Yes), the IR generation unit 121 outputs the generated intermediate language and execution conditions to the partial execution unit 122 and instructs the partial execution unit 122 to partially execute the generated intermediate language (step S13). The partial execution unit 122 executes the part of the intermediate language acquired from the IR generation unit 121 under the execution conditions acquired from the IR generation unit 121. The partial execution unit 122 records the execution result as metadata in the metadata recording unit 123 and updates the metadata (step S14). Next, the IR generation unit 121 reads metadata from the metadata recording unit 123 (step S15). The IR generation unit 121 generates an intermediate language for the subsequent processing according to the read metadata (step S16). The IR generation unit 121 determines whether the intermediate language conversion of the program to be executed has been completed (step S17). If the intermediate language has been generated for all processes described in the program to be executed, it is determined that the program is complete; otherwise, it is determined that the program is not complete.
[0049] If it is determined that the process is complete (step S17; Yes), the IR generation unit 121 generates an intermediate language for the entire program to be executed by adding the intermediate language for the subsequent process to the part of the intermediate language generated earlier, and records the generated intermediate language in the command recording unit 124. The front-end unit 12 outputs the intermediate language recorded in the command recording unit 124 to the middleware unit 13, and ends the process of FIG. 9. The intermediate language is optimized by the middleware unit 13, and then executed by the back-end unit 14 when mat_eval is executed. If it is determined that the process is not complete (step S17; No), the process returns to step S11, and the process from step S11 is repeated and executed for the processes for which the intermediate language has not been generated.
[0050] (effect) As described above, according to this embodiment, the intermediate language of a part of a series of processes described in a program to be executed is executed, and an intermediate language for subsequent processes is generated based on the resulting metadata. This allows for more efficient generation of an intermediate language compared to a general processing method in which the front-end unit 12 executes the generated intermediate language while the back-end unit 14 is generating the intermediate language for a series of processes, and then the front-end unit 12 generates the intermediate language for the remaining processes and the back-end unit 14 executes the intermediate language. For example, as shown in FIG. 10, in this embodiment, the intermediate language for the entire series of processes is generated by executing partial processes, and finally the back-end unit 14 executes the intermediate language for the entire series of processes. This allows the middleware unit 13 to perform optimization throughout the entire process. Furthermore, as shown in FIG. 11, according to this embodiment, the intermediate language can be generated by excluding unnecessary processes by executing partial processes (e.g., unique(tbl, key="A") in Example 3), thereby reducing the amount of processing.
[0051] <Other embodiments> FIG. 12 is a diagram illustrating another example of the intermediate language generation device according to the embodiment. The intermediate language generation device 800 includes a partial execution means 801 and a generation means 802 . When generating an intermediate language for a process described in a program to be executed, the partial execution means 801 generates an intermediate language for a part of the process and executes the generated intermediate language for the part. The generation means 802 generates an intermediate language for a subsequent process of a part of the process in the process based on the execution result of the part of the intermediate language. Furthermore, the generation means 802 generates an intermediate language corresponding to the entire program to be executed by adding the intermediate language for the subsequent process to the part of the intermediate language. The intermediate language corresponding to the entire program does not mean generating an intermediate language for all instructions written in the program, but rather determining whether or not each instruction written in the program needs to be executed and generating an intermediate language for all instructions that need to be executed. The IR generation unit 121 and the partial execution unit 122 are an example of the partial execution means 801 . The IR generating unit 121 is an example of the generating means 802 .
[0052] FIG. 13 is a flowchart showing an example of the operation of the intermediate language generation device according to the embodiment. When generating an intermediate language for a process described in a program to be executed, the partial execution means 801 generates an intermediate language for a portion of the process and executes the generated intermediate language (step S801). Next, the generation means 802 generates an intermediate language for a subsequent process of the portion of the process in the process based on the execution result of the portion of the intermediate language (step S802). Next, the generation means 802 adds the intermediate language for the subsequent process to the end of the portion of the intermediate language, thereby generating an intermediate language corresponding to the entire program to be executed (step S803).
[0053] FIG. 14 is a diagram illustrating an example of a hardware configuration of the intermediate language generation device according to the embodiment. The computer 900 includes a CPU 901, a main memory device 902, an auxiliary memory device 903, an input / output interface 904, and a communication interface 905. The above-described intermediate language generation devices 10, 800 are implemented in the computer 900. The above-described functions are stored in the auxiliary memory device 903 in the form of a program. The CPU 901 reads the program from the auxiliary memory device 903, loads it into the main memory device 902, and executes the above-described processing in accordance with the program. The CPU 901 also allocates a storage area in the main memory device 902 in accordance with the program. The CPU 901 also allocates a storage area in the auxiliary memory device 903 for storing data being processed in accordance with the program.
[0054] A program for implementing all or part of the functions of the intermediate language generation device 10, 800 may be recorded on a computer-readable recording medium, and the program may be loaded into a computer system and executed to perform processing by each functional unit. The term "computer system" as used herein includes hardware such as an OS and peripheral devices. Furthermore, if a WWW system is used, the term "computer system" also includes the homepage provision environment (or display environment). Furthermore, the term "computer-readable recording medium" refers to portable media such as CDs, DVDs, and USBs, as well as storage devices such as hard disks built into the computer system. Furthermore, if the program is distributed to the computer 900 via a communication line, the computer 900 that receives the program may load the program into the main storage device 902 and execute the above-described processing. Furthermore, the program may be for implementing part of the above-described functions, or may be capable of implementing the above-described functions in combination with a program already stored in the computer system.
[0055] Although one embodiment of the present disclosure has been described in detail above with reference to the drawings, the specific configuration is not limited to the above, and various design modifications are possible within the scope of the gist of the present invention. Furthermore, one aspect of the present disclosure may be modified in various ways within the scope of the claims, and embodiments obtained by appropriately combining the technical means disclosed in different embodiments are also included in the technical scope of the present disclosure. Furthermore, configurations in which elements described in the above embodiments and variations are substituted with elements that achieve the same effect are also included. Furthermore, each embodiment may be combined with other embodiments as appropriate.
[0056] Some or all of the above embodiments can be described as, but are not limited to, the following supplementary notes.
[0057] (Appendix 1) This intermediate language generation device comprises: a means for generating an intermediate language for a part of a process described in a program to be executed, and executing the generated intermediate language; and a means for generating an intermediate language for a subsequent process of the part of the process based on the execution result of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language for the subsequent process to the intermediate language for the part of the process.
[0058] (Appendix 2) The generating means is an intermediate language generation device according to appendix (1), which determines an instruction for the subsequent processing based on the execution result of the part of the intermediate language, and generates an intermediate language for the determined instruction.
[0059] (Appendix 3) The generating means is an intermediate language generation device described in any of appendices (1) to (2), which determines whether or not it is necessary to execute instructions included in the subsequent processing based on the execution result of the part of the intermediate language, and if it is not necessary, generates an intermediate language for the subsequent processing excluding the instructions.
[0060] (Appendix 4) The intermediate language generation device according to any one of appendices (1) to (3) is configured such that the means for executing the part of the intermediate language executes the part of the intermediate language that calculates column names of data in a table format.
[0061] (Appendix 5) The means for executing the part of the intermediate language is an intermediate language generation device described in any of Appendices (1) to (4), which executes the part of the intermediate language to calculate whether or not there are duplicate column names in the column names of tabular data.
[0062] (Appendix 6) The means for executing the part of the intermediate language is an intermediate language generation device described in any of appendices (1) to (5), which executes the part of the intermediate language to calculate whether or not an invalid value exists in the column name of tabular data.
[0063] (Appendix 7) The means for executing the part of the intermediate language is an intermediate language generation device described in any of Appendices (1) to (5), which executes the part of the intermediate language to calculate whether a specified column name exists in the column names of tabular data.
[0064] (Appendix 8) The intermediate language generation device according to any one of appendices (1) to (7) is characterized in that the means for executing the part of the intermediate language executes the part of the intermediate language to calculate whether or not there are duplicate column names in the column names of the tabular data, and the generating means, if there are duplicate column names in the column names of the tabular data, generates an intermediate language of an instruction to acquire data for all specified column names even if the column names are duplicated as the intermediate language of the subsequent processing, and if there are no duplicate column names in the tabular data, generates an intermediate language of an instruction to acquire data for specified column names as the intermediate language of the subsequent processing.
[0065] (Appendix 9) When generating an intermediate language for a process described in a program to be executed, an intermediate language for a part of the process is generated, and the generated part of the intermediate language is executed; This is an intermediate language generation method that generates an intermediate language for a subsequent process of a part of the process in the process based on the execution result of the part of the intermediate language, and generates an intermediate language corresponding to the entire program by adding the intermediate language of the subsequent process to the part of the intermediate language.
[0066] (Appendix 10) In generating an intermediate language for a process described in a program to be executed in a computer, the intermediate language for a part of the process is generated, and the generated part of the intermediate language is executed; This is a program that executes a process of generating an intermediate language for a subsequent process of a part of the process in the process based on the execution result of the part of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language of the subsequent process to the part of the intermediate language. [Explanation of symbols]
[0067] 10. Intermediate language generator 11. Program Acquisition Department 12 Front end 121 IR generation unit 122...Partial execution unit 123 Metadata Recording Section 124 Command recorder 13. Middleware Department 14 Back-end section 800 Intermediate language generator 801...Partial execution means 802...Generation means 900···Computer 901 CPU 902...Main memory 903...Auxiliary storage device 904 Input / Output Interface 905···Communication Interface
Claims
1. a means for generating an intermediate language for a part of a process described in a program to be executed, and for executing the generated part of the intermediate language; a means for generating an intermediate language for a subsequent process of the part of the process in the process based on the execution result of the part of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language of the subsequent process to the part of the intermediate language; An intermediate language generation device comprising:
2. the generating means determines an instruction for the subsequent process based on the execution result of the part of the intermediate language, and generates an intermediate language for the determined instruction. The intermediate language generation device according to claim 1 .
3. the generating means determines whether or not execution of an instruction included in the subsequent process is necessary based on the execution result of the part of the intermediate language, and if execution is not necessary, generates an intermediate language for the subsequent process excluding the instruction.
3. The intermediate language generation device according to claim 1.
4. the means for executing the part of intermediate languages executes an intermediate language for calculating column names of tabular data.
3. The intermediate language generation device according to claim 1.
5. the means for executing the part of intermediate languages executes an intermediate language for calculating whether or not duplicate column names exist in the column names of the tabular data.
3. The intermediate language generation device according to claim 1.
6. the means for executing the part of intermediate languages executes an intermediate language for calculating whether or not an invalid value exists in a column name of the tabular data.
3. The intermediate language generation device according to claim 1.
7. the means for executing the part of intermediate languages executes an intermediate language for calculating whether a specified column name exists in the column names of the tabular data.
3. The intermediate language generation device according to claim 1.
8. the means for executing the part of the intermediate language executes the part of the intermediate language to calculate whether or not there are duplicate column names in the column names of the tabular data; the generating means generates, when there is a duplicate column name in the tabular data, an intermediate language of a command for acquiring data of all specified column names even if the column names are duplicated, as the intermediate language of the subsequent processing, and when there is no duplicate column name in the tabular data, generates, when there is no duplicate column name, an intermediate language of a command for acquiring data of the specified column names, as the intermediate language of the subsequent processing; The intermediate language generation device according to claim 1 .
9. When generating an intermediate language for a process described in a program to be executed, an intermediate language for a part of the process is generated, and the generated part of the intermediate language is executed; generating an intermediate language for a subsequent process of the part of the process in the process based on the execution result of the part of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language of the subsequent process to the part of the intermediate language; Intermediate language generation method.
10. On the computer, When generating an intermediate language for a process described in a program to be executed, an intermediate language for a part of the process is generated, and the generated part of the intermediate language is executed; a process of generating an intermediate language for a subsequent process of a part of the process in the process based on the execution result of the part of the intermediate language, and generating an intermediate language corresponding to the entire program by adding the intermediate language of the subsequent process to the part of the intermediate language; A program that executes the following.
Citation Information
Patent Citations
Program code conversion method
JP2010225162A