JPS62257532A - System for implementing optimization of subroutine - Google Patents
System for implementing optimization of subroutineInfo
- Publication number
- JPS62257532A JPS62257532A JP10087886A JP10087886A JPS62257532A JP S62257532 A JPS62257532 A JP S62257532A JP 10087886 A JP10087886 A JP 10087886A JP 10087886 A JP10087886 A JP 10087886A JP S62257532 A JPS62257532 A JP S62257532A
- Authority
- JP
- Japan
- Prior art keywords
- subroutine
- conditions
- condition
- parent
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000005457 optimization Methods 0.000 title description 18
- 238000000034 method Methods 0.000 claims abstract description 19
- 230000008676 import Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Landscapes
- Executing Machine-Instructions (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は共通処理をサブルーチン化する方式に関し、特
にサブルーチンの最適化と、1つのサブ/l/ −チン
力’) W aの最適化されたサブルーチンの生成とを
実現するサブルーチン生成方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for converting common processing into subroutines, and in particular to optimization of subroutines and optimization of one subroutine (W a ). The present invention relates to a subroutine generation method that realizes the generation of subroutines.
従来、共通処理をサブルーチン化する方式としては、考
えられる条件毎に1つのサブルーチンを作成しておく方
式と、共通処理内で考えられるすべての条件下での処理
を含んだ1つのサブルーチンを作成する方式とがある。Conventionally, the methods for converting common processing into subroutines include creating one subroutine for each possible condition, and creating one subroutine that includes processing under all possible conditions within the common processing. There is a method.
上述した従来の方式の中で、与えられた条件毎に1つの
サブルーチンを作成する方式においては。Among the conventional methods described above, one method creates one subroutine for each given condition.
共通処理内で与えられる条件が増加すると共にその条件
を満足するようなサブルーチンを作成しなければならな
いため、各サブルーチン内の大部分の処理は同じである
のに、僅かな処理の違いにより新たなサブルーチンを作
成しなければならないといった欠点や、共通処理の変更
時に、影響を受けるすべてのサブルーチンをその都度修
正しなければならないといった欠点があった。As the conditions given within a common process increase, it is necessary to create a subroutine that satisfies the conditions, so even though most of the processes within each subroutine are the same, slight differences in processing may result in new There are drawbacks such as the need to create subroutines and the need to modify all affected subroutines each time a common process is changed.
また、共通処理内で考えられるすべての条件を満足する
ようなサブルーチンを作成する方式においては、与えら
れる条件によっては全く不必要な処理が存在してしまう
事になり、サブルーチンの規模が大きくなり、処理速度
が低下するといった欠点があった。In addition, in the method of creating a subroutine that satisfies all possible conditions within a common process, depending on the given conditions, there may be completely unnecessary processes, which increases the scale of the subroutine. The disadvantage was that the processing speed decreased.
本発明のサブルーチン最適化生成システムは。 The subroutine optimization generation system of the present invention is as follows.
生成するサブルーチン名と、そのサブルーチンを生成す
るための条件とをあらかじめ定められた形式でサブルー
チン情報記憶領域に記憶させるサブルーチン情報記憶手
段と、共通処理内で考えられるすべての条件下での処理
を含み、その処理を条件によりいくつかの処理部分に分
け、与えられる条件により各処理部分を生成するか否か
判定できるように作成されている母体サブルーチンと、
サブルーチン情報記憶領域に記憶されているサブルーチ
ン名により、対応する母体サブルーチンを求め、サブル
ーチン情報記憶領域に記憶されている条件を基に、母体
サブルーチン中の条件毎に分割されている処理部分を生
成するか否かを判定し。A subroutine information storage means for storing a subroutine name to be generated and conditions for generating the subroutine in a predetermined format in a subroutine information storage area, and processing under all conceivable conditions within the common processing. , a parent subroutine that is created so that the process can be divided into several processing parts according to conditions, and it can be determined whether or not to generate each processing part according to the given conditions;
Based on the subroutine name stored in the subroutine information storage area, find the corresponding parent subroutine, and generate processing parts divided for each condition in the parent subroutine based on the conditions stored in the subroutine information storage area. Determine whether or not.
目的とする処理を与えられた条件下で行うのに最低限必
要となる処理部分だけから成る最適化されたサブルーチ
ンを母体サブルーチンから生成するサブルーチン生成手
段とを有している。The subroutine generating means generates from a base subroutine an optimized subroutine consisting of only the minimum necessary processing parts to perform a target process under given conditions.
以下9本発明の実施例について図面を参照して説明する
。Hereinafter, nine embodiments of the present invention will be described with reference to the drawings.
第1図は本発明のサブルーチン最適化生成システムの一
実施例の構成図である。本実施例は、生成するサブルー
チンの情報がすべてサブルーチン情報記憶領域4に記憶
されたか否かによシサブルーチン情報記憶手段2を続行
するか終了するかを判定する終了判定1と、生成するサ
ブルーチン名と、そのサブルーチンを生成する条件とを
サブルーチン情報記憶領域4に記憶させるサブルーチン
情報記憶手段2と、サブルーチン情報記憶領域4に記憶
されているサブルーチン名により、対応する母体サブル
ーチン5を求め、その母体サブルーチン5にあらかじめ
設定されている条件と、サブルーチン情報記憶領域4に
記憶されている条件とを比較し1条件が一致している処
理部分だけを母体サブルーチン5から取り出し、与えら
れた条件下で目的とする処理を行うために最低限必要と
なる処理部分だけから成る最適化サブルーチン6を生成
するサブルーチン生成手段3とから構成されている。FIG. 1 is a block diagram of an embodiment of the subroutine optimization generation system of the present invention. This embodiment includes a termination determination 1 for determining whether to continue or terminate the subroutine information storage means 2 based on whether all information of the subroutine to be generated has been stored in the subroutine information storage area 4, and a name of the subroutine to be generated. and the conditions for generating the subroutine in the subroutine information storage area 4, and the subroutine name stored in the subroutine information storage area 4 to find the corresponding parent subroutine 5 and select the parent subroutine. Compare the conditions preset in 5 and the conditions stored in the subroutine information storage area 4, extract only the processing part that matches the 1 condition from the base subroutine 5, and execute the process that meets the purpose under the given conditions. and a subroutine generation means 3 for generating an optimization subroutine 6 consisting of only the minimum necessary processing parts to carry out the processing to be performed.
なお9図中の「→」は制御の流れを示し、 「巨)jは
データの流れを示す。Note that "→" in Figure 9 indicates the flow of control, and "j" indicates the flow of data.
第2図、第3図はそれぞれサブルーチン情報記憶手段2
.サブルーチン生成手段3の構成を示す流れ図である。2 and 3 show subroutine information storage means 2, respectively.
.. 3 is a flowchart showing the configuration of subroutine generation means 3. FIG.
サブルーチン情報記憶手段2について第2図を参照しつ
つ説明する。The subroutine information storage means 2 will be explained with reference to FIG.
このサブルーチン情報記憶手段2は、目的とする処理に
より、対応する母体サブルーチン名を求めるサブルーチ
ン選択7と、サブルーチン選択7により選択された母体
サブルーチン名をサブルーチン情報記憶領域4中のサブ
ルーチン名記憶領域10に記憶させるサブルーチン名記
憶8と、サブルーチンを生成するための条件となるサブ
ルーチンの使用目的、使用環境などの情報をサブルーチ
ン情報記憶領域4中のサブルーチン生成条件記憶領域】
1に記憶させるサブルーチン生成条件記憶9とから構成
されている。This subroutine information storage means 2 performs a subroutine selection 7 for obtaining a corresponding parent subroutine name and stores the parent subroutine name selected by the subroutine selection 7 in a subroutine name storage area 10 in a subroutine information storage area 4 through targeted processing. A subroutine name storage 8 to be stored, and a subroutine generation condition storage area in the subroutine information storage area 4 that stores information such as the purpose of use of the subroutine and the usage environment, which are the conditions for generating a subroutine.]
1 and a subroutine generation condition memory 9 stored in the subroutine generation condition memory 9.
サブルーチン選択7は処理要件を満足するサブルーチン
を作成するための母体サブルーチン名として「A」を選
択し、サブルーチン名記憶8はこの母体サブルーチン名
「A」をサブルーチン名記憶領域10に記憶させる。サ
ブルーチン生成条件記憶9は母体サブルーチン「A」か
ら目的とする処理を行うためのサブルーチンを生成する
条件として「条件1」 、「条件3」をサブルーチン生
成条件記憶領域11に記憶させる。このようにして目的
とする処理を行うためのサブルーチンは、母体サブルー
チン名「A」から、「条件1」 、「条件3」に一致す
る処理部分を取り出す事により生成できるようになる。The subroutine selection 7 selects "A" as the parent subroutine name for creating a subroutine that satisfies the processing requirements, and the subroutine name storage 8 stores this parent subroutine name "A" in the subroutine name storage area 10. The subroutine generation condition storage 9 stores ``condition 1'' and ``condition 3'' in the subroutine generation condition storage area 11 as conditions for generating a subroutine for performing a target process from the parent subroutine ``A''. In this manner, a subroutine for performing the desired processing can be generated by extracting the processing portion matching "condition 1" and "condition 3" from the parent subroutine name "A".
また、このサブルーチン情報記憶手段2を何度も実行す
る事によりサブルーチン名の追加1条件の追加を容易に
行う事ができる。Further, by executing this subroutine information storage means 2 many times, addition of a subroutine name and one condition can be easily performed.
サブルーチン生成手段3について第3図を参照しつつ説
明する。The subroutine generating means 3 will be explained with reference to FIG.
このサブルーチン生成手段3は、サブルーチン情報記憶
領域4中のサブルーチン名記憶領域10に記憶されてい
る母体サブルーチン名と、サブルーチン生成条件記憶領
域11に記憶されている生成条件とを取り込むためのサ
ブルーチン生成情報取り込み12と、サブルーチン生成
情報取り込み12によって取り込まれた母体サブルーチ
ン名に対応する母体サブルーチン5から、生成条件に一
致する処理部分をすべて生成したか否かによシ最適化サ
ブルーチンの生成処理を続行するか終了するかをtfl
定する終了判定13と、サブルーチン生成情報取り込み
12によシ取り込まれた母体サブルーチン名に対応する
母体サブルーチン5から条件毎に区切られた1つの処理
部分を取り込む母体サブルーチン取り込み14と、母体
サブルーチンにより取り込まれた処理部分に対してあら
かじめ設定されている条件と、サブルーチン生成情報取
り込み12によりサブルーチン生成条件記憶領域11か
ら取り込まれた条件とを比較し9条件が一致するか否か
により現在取り込まれている処理部分を最適化サブルー
チン6の一部として生成するか、生成しないかを判定す
る生成条件判定15と。This subroutine generation means 3 generates subroutine generation information for importing a parent subroutine name stored in a subroutine name storage area 10 in a subroutine information storage area 4 and generation conditions stored in a subroutine generation condition storage area 11. From the parent subroutine 5 corresponding to the parent subroutine name imported by import 12 and subroutine generation information import 12, the generation process of the optimized subroutine is continued depending on whether all processing parts matching the generation conditions have been generated. tfl
a termination judgment 13 for determining the subroutine generation information, a parent subroutine import 14 for importing one processing part divided for each condition from the parent subroutine 5 corresponding to the parent subroutine name imported by the subroutine generation information import 12; The conditions set in advance for the processed processing part are compared with the conditions imported from the subroutine generation condition storage area 11 by the subroutine generation information import 12, and depending on whether or not the 9 conditions match, the conditions that are currently imported are compared. A generation condition determination 15 determines whether the processing portion is generated as part of the optimization subroutine 6 or not.
生成条件判定15によシ条件が一致すると判定された母
体サブルーチン5中の処理部分を最適化サブルーチン6
の一部として生成する最適化サブルーチン生成16とか
ら構成されている。A subroutine 6 optimizes the processing part in the parent subroutine 5 that is determined to match the generation condition according to the generation condition determination 15.
The optimization subroutine generation 16 is generated as part of the optimization subroutine generation 16.
サブルーチン生成情報取り込み12は、サブルーチン名
記憶領域10から母体サブルーチン名として「A」を、
サブルーチン生成条件記憶領域11から、最適化サブル
ーチンを生成するための条件として「条件1」 、「条
件3」を取り込む。母体サブルーチン取り込み14はサ
ブルーチン生成情報取り込み12により取り込まれた母
体サブルーチン名「A」によシ対応する母体サブルーチ
ンAを求め、その中から条件毎に区切られた1つの処理
部分として「条件1処理部分」を取υ込む。The subroutine generation information import 12 imports "A" as the parent subroutine name from the subroutine name storage area 10.
``Condition 1'' and ``Condition 3'' are imported from the subroutine generation condition storage area 11 as conditions for generating an optimized subroutine. The parent subroutine import 14 obtains the parent subroutine A corresponding to the parent subroutine name "A" imported by the subroutine generation information import 12, and extracts the "condition 1 processing part" as one processing part separated for each condition. ”.
「条件1処理部分」は「条件1」が成立する場合にのみ
生成される処理部分である。生成条件判定15はサブル
ーチン生成情報取り込み12によって取り込まれた「条
件1」 、「条件3」と「条件1処理部分」の条件とを
比較する。「条件1処理部分」は「条件1」が成立する
場合に生成される処理部分であるため、生成条件判定1
5により条件は「一致」と判定され、最適化サブルーチ
ン生成16により最適化サブルーチンへの一部として生
成される。The "condition 1 processing part" is a processing part that is generated only when "condition 1" is satisfied. The generation condition determination 15 compares "condition 1" and "condition 3" imported by the subroutine generation information import 12 with the conditions of the "condition 1 processing part". "Condition 1 processing part" is a processing part that is generated when "Condition 1" is satisfied, so generation condition judgment 1
5, the condition is determined to be a "match", and is generated as part of the optimization subroutine by optimization subroutine generation 16.
終了判定13は母体サブルーチンA中のすべての処理部
分に対し生成条件の判定が終了していないため、「続行
」と判定する。母体サブルーチン取り込み14は母体サ
ブルーチンAから次の処理部分として「条件2処理部分
」を取り込む。「条件2処理部分」は「条件2」が成立
する場合にのみ生成される処理部分である。生成条件判
定15はサブルーチン生成情報取り込み12によって取
り込まれた「条件1」 、「条件3」と「条件2処理部
分」の条件とを比較する。「条件2処理部分」は「条件
2」が成立する場合にのみ生成される処理部分であるた
め、生成条件判定15により条件は「不一致」と判定さ
れ、最適化サブルーチンへの一部としては生成されない
。母体サブルーチンA中の「条件3処理部分」に対して
は「条件1処理部分」と同様にして生成条件判定15に
より「一致」と判定され、最適化サブルーチン生成16
により最適化サブルーチンAの一部として生成される。In the end determination 13, since determination of generation conditions for all processing parts in the parent subroutine A has not been completed, it is determined to "continue". The parent subroutine import 14 imports the "condition 2 processing part" from the parent subroutine A as the next processing part. The "condition 2 processing part" is a processing part that is generated only when "condition 2" is satisfied. The generation condition determination 15 compares "condition 1" and "condition 3" imported by the subroutine generation information import 12 with the conditions of the "condition 2 processing part". Since the "condition 2 processing part" is a processing part that is generated only when "condition 2" is satisfied, the condition is determined to be "unmatched" by the generation condition judgment 15, and it is not generated as part of the optimization subroutine. Not done. The "condition 3 processing part" in the parent subroutine A is determined to "match" by the generation condition judgment 15 in the same way as the "condition 1 processing part", and the optimization subroutine generation 16
is generated as part of optimization subroutine A.
母体サブルーチンA中の「条件n処理部分」に対して母
体サブルーチン取り込み14.生成条件判定15より「
一致」と判定された場合には最適化サブルーチン生成1
6が適用された後、終了判定13により「終了」と判定
され、サブルーチン生成手段3は終了する。この結果、
母体サブルーチンA中の「条件1処理部分」および「条
件3処理部分」だけから成る最適化サブルーチンAが生
成される。Importing the parent subroutine for the "condition n processing part" in the parent subroutine A14. From generation condition judgment 15, “
If it is determined that there is a match, optimization subroutine generation 1 is performed.
6 is applied, the end determination 13 determines "end", and the subroutine generating means 3 ends. As a result,
An optimization subroutine A consisting only of the "condition 1 processing part" and the "condition 3 processing part" in the parent subroutine A is generated.
以上説明したように9本発明は、簡単な条件を与える事
により、1つの母体サブルーチンから複数の最適化され
たサブルーチンを生成する事ができるため1条件毎にサ
ブルーチンを作成する必要がなく、サブルーチンの作成
に要する時間が大幅に短縮できると共に、大部分が同じ
処理になっているサブルーチンを複数持つ必要がないた
め、サブルーチンの管理が容易にできるという効果があ
る。また、処理の変更に伴いサブルーチンの修正が必要
となった場合にも、母体サブルーチンだけを修正するだ
けで、その母体サブルーチンから生成されるすべてのサ
ブルーチンに修正結果が反映されるため、修正に要する
時間はすべての条件を満足するように作成された1つの
サブルーチンな葬
修正する時間と同程度で済むのに対し、その母メサブル
ーチンからは最も効率の良い、最適化されたサブルーチ
ンを生成できるという効果がある。As explained above, the present invention can generate multiple optimized subroutines from one parent subroutine by giving simple conditions, so there is no need to create a subroutine for each condition, and the subroutine This method has the effect of significantly shortening the time required to create a subroutine, and also makes it easier to manage subroutines because there is no need to have multiple subroutines that mostly perform the same processing. In addition, even if it becomes necessary to modify a subroutine due to a change in processing, you only need to modify the parent subroutine and the modification results will be reflected in all subroutines generated from that parent subroutine. It takes about the same amount of time to modify a single subroutine created to satisfy all conditions, but it is possible to generate the most efficient and optimized subroutine from its mother subroutine. effective.
第1図は本発明のサブルーチンの最適化生成システムの
一実施例を示す構成図、第2図は第1図中のサブルーチ
ン情報記憶手段2の構成を示す流れ図、第3図は第1図
中のサブルーチン生成手段3の構成を示す流れ図である
。
1・・・終了判定、2・・・サブルーチン情報記憶手段
。
3・・・サブルーチン生成手段、4・・・サブルーチン
情報記憶領域、5・・・母体サブルーチン、6・・・最
適化サブルーチン。
第1図
第2図FIG. 1 is a block diagram showing an embodiment of the subroutine optimization generation system of the present invention, FIG. 2 is a flowchart showing the structure of the subroutine information storage means 2 in FIG. 1, and FIG. 3 is a flowchart showing the configuration of subroutine generation means 3 of FIG. 1... End determination, 2... Subroutine information storage means. 3... Subroutine generation means, 4... Subroutine information storage area, 5... Base subroutine, 6... Optimization subroutine. Figure 1 Figure 2
Claims (1)
成するための条件とをあらかじめ定められた形式でサー
ブルーチン情報記憶領域に記憶させるサブルーチン情報
記憶手段と、共通処理内で考えられるすべての条件下で
の処理を含み、その処理を条件によりいくつかの処理部
分に分け、与えられる条件により各処理部分を生成する
か否か判定できるように作成されている母体サブルーチ
ンと、前記サブルーチン情報記憶領域に記憶されている
サブルーチン名により対応する母体サブルーチンを求め
、前記サブルーチン情報記憶領域に記憶されている条件
を基に、当該母体サブルーチン中の条件毎に分割されて
いる処理部分を生成するか否かを判定し、目的とする処
理を与えられた条件下で行うのに最低限必要となる処理
部分だけから成る最適化されたサブルーチンを母体サブ
ルーチンから生成するサブルーチン生成手段とを有する
サブルーチン最適化生成システム。1. Subroutine information storage means that stores the subroutine name to be generated and the conditions for generating the subroutine in a predetermined format in a subroutine information storage area, and A parent subroutine that includes processing, is created in such a way that the processing is divided into several processing parts according to conditions, and can determine whether or not to generate each processing part according to given conditions, and a parent subroutine that is stored in the subroutine information storage area. A corresponding parent subroutine is found based on the subroutine name, and based on the conditions stored in the subroutine information storage area, it is determined whether or not to generate processing parts divided for each condition in the parent subroutine. , a subroutine generation means for generating an optimized subroutine consisting of only the minimum necessary processing parts to perform a target process under given conditions from a parent subroutine.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10087886A JPS62257532A (en) | 1986-05-02 | 1986-05-02 | System for implementing optimization of subroutine |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10087886A JPS62257532A (en) | 1986-05-02 | 1986-05-02 | System for implementing optimization of subroutine |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPS62257532A true JPS62257532A (en) | 1987-11-10 |
Family
ID=14285582
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10087886A Pending JPS62257532A (en) | 1986-05-02 | 1986-05-02 | System for implementing optimization of subroutine |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS62257532A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010108213A (en) * | 2008-10-30 | 2010-05-13 | Nec Electronics Corp | Program conversion method and program conversion device |
-
1986
- 1986-05-02 JP JP10087886A patent/JPS62257532A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010108213A (en) * | 2008-10-30 | 2010-05-13 | Nec Electronics Corp | Program conversion method and program conversion device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20080300865A1 (en) | Method, system, and apparatus for natural language mixed-initiative dialogue processing | |
| DK1175661T3 (en) | Computer method and apparatus for producing visible graphics using graph algebra | |
| JP2019091408A (en) | Searching method and system based on multi-round inputs, and terminal device | |
| JPH11250112A (en) | Hardware synthesizing method, hardware synthesizing apparatus, and recording medium recording hardware synthesizing program | |
| DE69333762T2 (en) | Voice recognition system | |
| JPS62257532A (en) | System for implementing optimization of subroutine | |
| US6291757B1 (en) | Apparatus and method for processing music data | |
| US12175242B2 (en) | Decision tree node instruction unification for parallel processing | |
| JP3637606B2 (en) | Data processing device | |
| JPH04220768A (en) | Text conversion method | |
| JPH0981173A (en) | Speech rule synthesis method and apparatus | |
| JPS61148497A (en) | Standard pattern generator | |
| CN117687398A (en) | Target cleaning area generation method, device, equipment and storage medium | |
| CN121213690A (en) | Poster generation methods, devices, electronic equipment, storage media, and computer program products | |
| JPS6027941A (en) | Identifier generation system | |
| JPH04241672A (en) | Character string retrieving system | |
| JPH083819B2 (en) | Logic circuit manufacturing system | |
| JPH06119263A (en) | Processing function calling system | |
| JPH0332111B2 (en) | ||
| JPH04273572A (en) | Input option recognition system | |
| JPH0324629A (en) | Method for controlling task | |
| JPH05101099A (en) | Machine translation device | |
| JPH05313899A (en) | Knowledge processing system | |
| JPH0887418A (en) | Program convesion system | |
| JPH01159733A (en) | Source program generation processing system in precompiler |