JPH06214764A - Influence analysis device by correction of program - Google Patents

Influence analysis device by correction of program

Info

Publication number
JPH06214764A
JPH06214764A JP4294610A JP29461092A JPH06214764A JP H06214764 A JPH06214764 A JP H06214764A JP 4294610 A JP4294610 A JP 4294610A JP 29461092 A JP29461092 A JP 29461092A JP H06214764 A JPH06214764 A JP H06214764A
Authority
JP
Japan
Prior art keywords
calculation
variable
executed
route
program
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.)
Granted
Application number
JP4294610A
Other languages
Japanese (ja)
Other versions
JP2634011B2 (en
Inventor
Kuniaki Naoi
邦彰 直井
Naohisa Takahashi
直久 高橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP4294610A priority Critical patent/JP2634011B2/en
Publication of JPH06214764A publication Critical patent/JPH06214764A/en
Application granted granted Critical
Publication of JP2634011B2 publication Critical patent/JP2634011B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

PURPOSE:To provide an influence analysis device by means of the correction of a program which can precisely recognize a dependent relation between variables without judging that influence is given even if it is not actually given. CONSTITUTION:A calculation route restriction means 15 detecting a calculation route not executed is provided. The calculation route restriction means 15 preserves a restriction condition with respect to the variable deciding the truth or false of a logical expression in a condition sentence when a system passes through the condition sentence bringing branch, monitors the presence or absence of the change of the value of a variable in a section to the condition sentence which appears later in the calculation route, inspects the restriction condition of the condition sentence which appears later and sequentially judges that some of branches of the condition sentence appearing later is not executed by following the calculation route when the restriction condition of the later condition sentence can uniquely be decided.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はプログラムに施した修正
の影響を分析する影響分析装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an influence analysis device for analyzing the influence of a modification made on a program.

【0002】[0002]

【従来の技術】あるコンピュータプログラムに修正を施
した場合、修正後のプログラムにおける各ステートメン
ト(文)に出現する変数の中には、修正を施したことに
よる影響が及ぶものがある。例えばあるステートメント
で「a:=1」となっていたところを「a:=5」と修正すれば、こ
のステートメントよりあとで実行されるステートメント
中に「d:=a」とあったとき、変数dにはプログラム修正の
影響が及ぶ。ここで、修正前とは異なるステートメント
の系列による値が定められるものを、修正による影響が
及ぶものと定義する。
2. Description of the Related Art When a computer program is modified, some variables appearing in each statement in the modified program are affected by the modification. For example, if you modify the place where "a: = 1" in a certain statement to "a: = 5", when the statement that is executed after this statement says "d: = a", the variable The influence of the program modification affects d. Here, a value that is determined by a series of statements that is different from that before correction is defined as one that is affected by the correction.

【0003】従来より、プログラムに施した修正による
このような影響を分析する技術として、計算経路検出手
段と影響分析手段とを用いたものがある。図1は、従来
より使用されている、プログラムの修正による影響を分
析する装置(影響分析装置)の構成を示すブロック図で
ある。この影響分析装置50は、分析対象のプログラム
を格納する分析対象プログラム保持装置51に接続され
るものであって、プログラムの実行順序を検出する計算
経路検出手段52と、修正による影響を分析する影響分
析手段53と、全体の動作を制御する制御手段54とで
構成されている。
Conventionally, as a technique for analyzing such an influence due to a modification applied to a program, there is one using a calculation path detecting means and an influence analyzing means. FIG. 1 is a block diagram showing the configuration of an apparatus (impact analysis apparatus) that has been used conventionally and analyzes the effect of modifying a program. The influence analysis device 50 is connected to an analysis target program holding device 51 that stores a program to be analyzed, and has a calculation path detection unit 52 that detects the execution order of the programs and an influence that analyzes the influence of the correction. It is composed of an analysis means 53 and a control means 54 for controlling the whole operation.

【0004】まず、用語の定義を以下に示す。 ・プログラムの計算経路 手続き型言語のプログラムにおいて、構文情報に従い実
行順序をたどることにより得られる文の系列を、プログ
ラムの計算経路と定義する。図2は、条件文を含むプロ
グラムの一例を示すものであって、このプログラム中の
手続きcalc_1には、ST11→ST12→ST13→ST14→ST15で表
わされる計算経路が含まれている。また、Console_inお
よびConsole_outの手続きは、それぞれ入力装置からの
データに入力、出力装置へのデータの出力を行なう手続
きである。
First, the definitions of terms are shown below. -Program calculation path In a procedural language program, the sequence of statements obtained by following the execution order according to syntax information is defined as the program calculation path. FIG. 2 shows an example of a program including a conditional statement. The procedure calc_1 in this program includes a calculation path represented by ST11 → ST12 → ST13 → ST14 → ST15. Further, the Console_in and Console_out procedures are procedures for inputting data from an input device and outputting data to an output device, respectively.

【0005】なお、本明細書の記述において、"ST"+数
字で表わされるものは、ステートメントを指示するもの
である。また、例示されるプログラムは、アルゴル系の
言語であってパスカル言語に類似している。call文で手
続き(procedure)が呼ばれ、":="で代入関係が示され
ている。また、if節の終端は、"endif"ではなく"fi"で
示されている。 ・変数間の依存関係 あるステートメント中のある変数に値を定義(代入)す
るために、同一ステートメント中の別の変数または定数
の値を参照する時、定義される変数は参照される変数ま
たは定数に依存すると呼ぶ。これを、参照される変数ま
たは定数から定義される変数への参照定義依存関係があ
ると定義する。例えば、図2の手続きcal_1中のステー
トメントST13において、参照される変数qから定義され
る変数sに、参照定義依存関係がある。
In the description of this specification, what is represented by "ST" + numeral indicates a statement. The illustrated program is an Algol language and is similar to the Pascal language. A procedure is called by the call statement, and the assignment relationship is indicated by ": =". Also, the end of the if clause is indicated by "fi" instead of "endif". -Dependency between variables When the value of another variable or constant in the same statement is referenced to define (assign) a value to a variable in a statement, the defined variable is the referenced variable or constant. Call it dependent on. We define this as having a reference definition dependency from the referenced variable or variable defined from a constant. For example, in the statement ST13 in the procedure cal_1 in FIG. 2, the variable s defined from the referenced variable q has a reference definition dependency relationship.

【0006】また、あるステートメント中のある変数の
値を参照する際、ある計算経路上でそのステートメント
に先立つ別のステートメント中で、参照する値をその変
数に定義している時、参照される変数は定義された変数
に依存すると呼ぶ。これを、定義された変数から参照さ
れる変数への定義参照依存関係があると定義する。例え
ば、図2の手続きcalc_1において、ステートメントST13
において定義される変数sから、ST15において参照され
る変数sへの定義参照依存関係がある。
Further, when referring to a value of a variable in a statement, the variable to be referred to is defined when the value to be referred to is defined in another statement preceding the statement on a calculation path. Is called dependent on the variables defined. We define this as having a definition reference dependency from the defined variable to the referenced variable. For example, in the procedure calc_1 in FIG. 2, the statement ST13
There is a definition reference dependency from the variable s defined in step S15 to the variable s referenced in step ST15.

【0007】さらに、参照定義依存関係と、定義参照依
存関係と、これらを組み合わせることによって得られる
変数間の関係とを、変数間の依存関係と定義する。例え
ば、図2の手続きcalc_1において、ステートメントST
13において参照される変数qからST13において定義され
る変数sへの参照定義依存関係と、ST13において定義
される変数sからST15において参照される変数sへの定
義参照依存関係と、ST15において参照される変数sか
らST15において定義される変数uへの参照定義依存関係
と、を組み合わせることによって、ST13において参照さ
れる変数qからST15において定義される変数uへの変数
間の依存関係が得られる。 ・影響が及ぶ そして、プログラムに修正を施した場合、修正後のプロ
グラムにおける各ステートメントに出現する変数のう
ち、修正前とは異なるステートメントの系列により値が
定められる変数について、修正による影響が及ぶと定義
する。
Further, the reference definition dependency relationship, the definition reference dependency relationship, and the relationship between variables obtained by combining these are defined as the dependency relationship between variables. For example, in the procedure calc_1 in Figure 2, the statement ST
Reference definition dependency relationship from the variable q referenced in 13 to the variable s defined in ST13, definition reference dependency relationship from the variable s defined in ST13 to the variable s referenced in ST15, and referenced in ST15 By combining the reference definition dependency relation from the variable s referred to in ST15 to the variable u defined in ST15, the dependency relation between the variables from the variable q referred to in ST13 to the variable u defined in ST15 is obtained. -Affects When the program is modified, it is considered that the effect of the modification will be exerted on the variables that appear in each statement in the modified program and whose values are determined by a series of statements different from those before the modification. Define.

【0008】次に、図1に示した従来の影響分析装置5
0における計算経路検出手段52および影響分析手段5
3が果たすべき機能について、説明する。 ・計算経路検出手段52 計算経路検出手段52では、実際に実行される可能性の
ある計算経路を求める。すなわち、計算経路に条件文
(if文)が現われるたびに各分岐に対応した文の系列を
それぞれたどることにより、計算経路を求める。例えば
図2の手続きcalc_1に対してこの計算経路検出手段52
を適用すると、計算経路がステートメントST11からST12
とST13とを経由してST14に到達した際、ST15とST16とへ
の計算経路をそれぞれたどる。 ・影響分析手段53 影響分析手段53では、ある修正による影響が及ぶ変数
の集合を求める。すなわち、まず、与えられた計算経路
のうち施した修正部分を経由するものを検出し、次に、
検出した各計算経路について、それぞれを実行する時に
発生する参照定義依存関係と定義参照依存関係とを求
め、最後に、求めたすべての参照定義依存関係と定義参
照依存関係とより得られる変数間の依存関係から、修正
による影響を受ける可能性のある変数の集合を求める。
例えば、図2の手続きcalc_1に対して、ステートメント
ST13の変数sに定義する値を修正した場合を考える。こ
の影響分析手段53を用いると、次に示す通り影響が及
ぶ変数の集合を求めることができる。
Next, the conventional influence analyzer 5 shown in FIG.
0 calculation path detection means 52 and influence analysis means 5
The functions that 3 should perform will be described. -Calculation route detecting means 52 The calculation route detecting means 52 obtains a calculation route which may be actually executed. That is, each time a conditional statement (if statement) appears in the calculation path, the calculation path is obtained by tracing the sequence of statements corresponding to each branch. For example, for the procedure calc_1 in FIG.
Is applied, the calculation path becomes statements ST11 to ST12.
When it reaches ST14 via ST13 and ST13, it follows the calculation route to ST15 and ST16, respectively. -Effect analysis unit 53 The influence analysis unit 53 obtains a set of variables that are affected by a certain correction. That is, first of all, the one that passes through the modified portion of the given calculation path is detected, and then
For each detected calculation path, the reference definition dependency relationship and the definition reference dependency relationship that occur when executing each are calculated, and finally, all the reference definition dependency relationships and the defined reference dependency relationships and the variables obtained from them are obtained. From the dependencies, find the set of variables that might be affected by the modification.
For example, for the procedure calc_1 in Figure 2, the statement
Consider the case where the value defined for the variable s of ST13 is modified. By using this influence analysis means 53, it is possible to obtain a set of variables that have an influence as shown below.

【0009】まず、ST13を経由する計算経路として、
「ST11→ST12→ST13→ST14→ST15」(計算経路1)と、
「ST11→ST12→ST13→ST14→ST16」(計算経路2)とを
得る。次に、参照定義依存関係と定義参照依存関係とを
得る。得られた関係の一部を以下に示すと、計算経路
1を実行する時に発生する関係としては、ST13の変数q
からST13の変数sへと、ST15の変数sからST15の変数u
へとの参照定義依存関係と、ST13の変数sからST15の変
数sへの定義参照依存関係があり、計算経路2を実行
する時に発生する関係としては、ST13の変数qからST13
の変数sへと、ST16の変数sからST16の変数vへとの参
照定義依存関係と、ST13の変数sからST16の変数sへの
定義参照依存関係がある。
First, as a calculation route passing through ST13,
"ST11 → ST12 → ST13 → ST14 → ST15" (calculation route 1),
“ST11 → ST12 → ST13 → ST14 → ST16” (calculation route 2) is obtained. Next, the reference definition dependency relationship and the definition reference dependency relationship are obtained. A part of the obtained relationship is shown below. As a relationship that occurs when executing the calculation path 1, the variable q of ST13 is used.
To the variable s of ST13, the variable s of ST15 to the variable u of ST15
There is a reference definition dependency relationship to and a definition reference dependency relationship from the variable s of ST13 to the variable s of ST15. The relationship that occurs when executing the calculation path 2 is from the variable q of ST13 to ST13.
There is a reference definition dependency between the variable s of ST16 and the variable v of ST16, and a definition reference dependency between the variable s of ST13 and the variable s of ST16.

【0010】そして、修正による影響を受ける可能性の
ある変数の集合を得る。変数間の依存関係は、両計算経
路に対する参照定義依存関係と定義参照依存関係とから
得ることができる。得られた変数間の依存関係より、ST
13で値が定義される変数sに依存する変数の集合を得
る。図2の手続きcalc_1の場合、この変数の集合は、ST
15で参照される変数sと、ST15で定義される変数uと、
ST16で参照される変数sと、ST16で定義される変数vと
からなり、これらの変数には、ST13に対する修正の影響
が及ぶ可能性がある。
Then, a set of variables that may be affected by the modification is obtained. The dependency relationship between variables can be obtained from the reference definition dependency relationship and the definition reference dependency relationship for both calculation paths. From the obtained dependency between variables, ST
Get the set of variables that depend on the variable s whose value is defined in 13. In the case of procedure calc_1 in Fig. 2, the set of this variable is ST
The variable s referred to in 15, and the variable u defined in ST15,
It consists of a variable s referenced in ST16 and a variable v defined in ST16, and these variables may be affected by the modification to ST13.

【0011】次に、このような機能を果たす計算経路検
出手段52と影響分析手段53とを実現する従来の方法
について説明する。
Next, a conventional method for realizing the calculation path detecting means 52 and the effect analyzing means 53 which fulfill such functions will be described.

【0012】(1)計算経路検出手段52の実現例 計算経路検出手段52において、新しくたどるべき計算
経路がなくなるまで、次のルールR101とR102とを繰り返
し適用することによって、実行される可能性のある計算
経路を求める。なお、startという仮想ステートメント
から最初のステートメントへの計算経路と、計算経路の
最後のステートメントからendという仮想ステートメン
トへの計算経路とを導入する。 ・直進ルール(R101) 計算経路が到達するステートメントが条件分岐をもたら
す判定文でなければ、引き続き次のステートメントまで
の計算経路をたどる。 ・分岐ルール(R102) 計算経路が到達するステートメントが条件分岐をもたら
す判定文であれば、引続き分岐に対応する両方の計算経
路をたどる。
(1) Implementation Example of Calculation Route Detection Means 52 In the calculation route detection means 52, the possibility of being executed by repeatedly applying the following rules R101 and R102 until there is no new calculation route to be traced Find a calculation path. A calculation path from the virtual statement called start to the first statement and a calculation path from the last statement of the calculation path to the virtual statement called end are introduced. -Straight rule (R101) If the statement that the calculation path reaches is not a judgment statement that causes a conditional branch, the calculation path to the next statement is continuously followed. -Branch rule (R102) If the statement that the calculation path reaches is a judgment statement that causes a conditional branch, then both calculation paths corresponding to the branch are followed.

【0013】このような計算経路検出手段52の構成例
が図3に示されている。すなわちこの計算経路検出手段
52は、入力したプログラムを保持する入力プログラム
保持手段52a、直進ルールを適用するための直進ルー
ル適用手段52b、分岐ルールを適用するための分岐ル
ール適用手段52c、すでに検出した計算経路を保持す
る検出済計算経路保持手段52d、全体の制御を行なう
計算経路分析制御手段52eとによって構成されてい
る。
FIG. 3 shows an example of the configuration of such a calculation path detecting means 52. That is, the calculation path detecting means 52 has an input program holding means 52a for holding the input program, a straight-line rule applying means 52b for applying the straight-line rule, a branch rule applying means 52c for applying the branch rule, and already detected. It is composed of the detected calculation route holding means 52d for holding the calculation route and the calculation route analysis control means 52e for controlling the whole.

【0014】ここで、図2の手続きcalc_1に対して、上
記各ルールの適用した例を示す。また、求られめた計算
経路P1011とP1012を図4に示す。なお、計算経路が経由
するステートメントの番号を、ST11の例に従って表記す
る。すると計算経路P1011は、「start→ST11→(R101)→
ST12→(R101)→ST13→(R101)→ST14→(R102)→ST15→en
d」となり、計算経路P1012は、「start→ST11→(R101)
→ST12→(R101)ST13→(R101)→ST14→(R102)→ST16→en
d」となる。ここで(R101),(R102)は、どちらのルールを
適用したかを示すものである。これら計算経路P1011,P1
012を検討すると、startから始まりST11に到達した計
算経路は、R101を適用することによってST12に到達する
ことがいえ、同様に、ST13とST14とへ到達することが
R101を適用することによっていえ、さらに、startか
ら始まり、ST11、ST12、ST13を経由してST14に到達した
計算経路は、R102を適用することによってST15とST16の
両方に到達することがいえる。
Here, an example in which each of the above rules is applied to the procedure calc_1 in FIG. 2 is shown. Further, the calculated routes P1011 and P1012 thus obtained are shown in FIG. Note that the number of statements through which the calculation path passes is described according to the example of ST11. Then, the calculation route P1011 is "start → ST11 → (R101) →
ST12 → (R101) → ST13 → (R101) → ST14 → (R102) → ST15 → en
d ”, and the calculation route P1012 is“ start → ST11 → (R101)
→ ST12 → (R101) ST13 → (R101) → ST14 → (R102) → ST16 → en
d ”. Here, (R101) and (R102) indicate which rule is applied. These calculation paths P1011, P1
Considering 012, it can be said that the calculation route starting from start and reaching ST11 can reach ST12 by applying R101, and similarly reach ST13 and ST14.
Even by applying R101, it can be said that the calculation route that starts from start and reaches ST14 via ST11, ST12, and ST13 reaches both ST15 and ST16 by applying R102.

【0015】同様に、図5に示される手続きcalc_2に対
して上記各ルールの適用した例を以下に示す。手続きca
lc_2は条件文を2つ含むものである。求めた計算経路P1
021〜P1024を図6に示す。図示されるように、計算経
路P1021は「start→ST21→(R102)→ST22→(R101)→ST24
→(R101)→ST25→(R102)→ST26→(R101)→ST27→end」
で表わされ、計算経路P1022は「start→ST21→(R102)
→ST22→(R101)→ST24→(R101)→ST25→(R102)→ST28→
(R101)→ST29→end」で表わされ、計算経路P1023は
「start→ST21→(R102)→ST23→(R101)→ST24→(R101)
→ST25→(R102)→ST26→(R101)→ST27→end」で表わさ
れ、計算経路P1024は「start→ST21→(R102)→ST23→
(R101)→ST24→(R101)→ST25→(R102)→ST28→(R101)→
ST29→end」で表わされる。
Similarly, an example in which each of the above rules is applied to the procedure calc_2 shown in FIG. 5 is shown below. Procedure ca
lc_2 contains two conditional statements. Obtained calculation path P1
021 to P1024 are shown in FIG. As shown in the figure, the calculation route P1021 is “start → ST21 → (R102) → ST22 → (R101) → ST24.
→ (R101) → ST25 → (R102) → ST26 → (R101) → ST27 → end 」
, The calculation route P1022 is "start → ST21 → (R102)
→ ST22 → (R101) → ST24 → (R101) → ST25 → (R102) → ST28 →
(R101) → ST29 → end ”, and calculation route P1023 is“ start → ST21 → (R102) → ST23 → (R101) → ST24 → (R101)
→ ST25 → (R102) → ST26 → (R101) → ST27 → end ”, and calculation path P1024 is“ start → ST21 → (R102) → ST23 →
(R101) → ST24 → (R101) → ST25 → (R102) → ST28 → (R101) →
ST29 → end ”.

【0016】(2)影響分析手段53における実現例 影響分析手段53は、図7に示されるように、以下の各
ステップS201〜S204を実行するものとして構成される。
そして影響分析手段53は、これら各ステップS201〜S2
04を順次適用することによって、ある修正部分に出現す
る変数から影響を受ける変数の集合を求める。
(2) Implementation Example of Impact Analysis Means 53 As shown in FIG. 7, the impact analysis means 53 is configured to execute the following steps S201 to S204.
Then, the influence analysis unit 53 uses these steps S201 to S2.
By sequentially applying 04, the set of variables affected by the variables appearing in a certain correction part is obtained.

【0017】ステップS201は、修正部分を経由する経路
の検出ステップであって、計算経路検出手段52を用い
て検出した計算経路の中から、着目している修正部分を
経由するものを求めるステップである。
Step S201 is a step of detecting a route passing through the correction portion, and is a step of obtaining a route passing through the correction portion of interest from the calculation routes detected by the calculation route detecting means 52. is there.

【0018】ステップS202は、ある経路に対する参照定
義依存関係および定義参照依存関係の検出ステップであ
って、S201で求めたある計算経路に対して、以下のS202
-1からS202-4までの各サブステツプを順次適用すること
により、その計算経路に対する参照定義依存関係および
定義参照依存関係を求める。
Step S202 is a step of detecting a reference definition dependency relationship and a definition reference dependency relationship with respect to a certain route, and for the certain calculation route obtained in S201, the following S202
By sequentially applying each substep from -1 to S202-4, the reference definition dependency relationship and the definition reference dependency relationship for the calculation path are obtained.

【0019】サブステップS202-1は、変数定義の行番号
検出サブステップであって、まず実行されるものであ
る。このサブステップS202-1は、着目した計算経路に対
して、その計算経路を実行する際に値が定義される変数
の名前と、その変数が出現するステートメントの番号と
を検出した後、これらを記録するものである。すなわ
ち、手続きが呼ばれたときに引数として渡される変数
や、代入文において左辺に記述されている変数が出現す
るたびに、その変数名とステートメントの番号を検出す
る。
Sub-step S202-1 is a variable-definition line number detection sub-step, which is executed first. This sub-step S202-1 detects the name of the variable whose value is defined when executing the calculation route and the number of the statement in which the variable appears for the calculation route of interest, and then determines these. To record. That is, every time a variable passed as an argument when a procedure is called or a variable described on the left side in an assignment statement appears, the variable name and statement number are detected.

【0020】サブステップS202-2は、変数参照の行番号
検出サブステップであって、サブステップS202-1の実
行後、着目した計算経路に対して、その計算経路を実行
する際に値が参照される変数または定数の名前と、その
変数または定数が出現するステートメントの番号とを検
出した後、これらを記録するものである。すなわち、手
続きから抜け出るときに引数として戻される変数や、代
入文の右辺に記述されている変数(や定数)を検出す
る。
Sub-step S202-2 is a variable-referenced line number detection sub-step. After execution of sub-step S202-1, a value is referred to when the calculation path is executed for the calculation path of interest. After detecting the name of the variable or constant to be stored and the number of the statement in which the variable or constant appears, these are recorded. That is, the variable returned as an argument when exiting the procedure or the variable (or constant) described on the right side of the assignment statement is detected.

【0021】サブステップS203-3は、参照定義依存関係
検出サブステップであって、上記の変数定義の行番号検
出ステップS202-1や変数参照の行番号検出サブステップ
S202-2の結果を用いることによって参照定義依存関係を
検出するものである。また、サブステップS202-4は、定
義参照依存関係検出サブステップであって、上記の変数
定義の行番号検出ステップS202-1や変数参照の行番号検
出サブステップS202-2の結果を用いることによ定義参照
依存関係を検出するものである。
Sub-step S203-3 is a reference definition dependency detection sub-step, which is the variable definition line number detection step S202-1 or the variable reference line number detection sub-step.
The reference definition dependency is detected by using the result of S202-2. Further, sub-step S202-4 is a definition reference dependency detection sub-step, in which the result of the variable definition line number detection step S202-1 and the variable reference line number detection sub-step S202-2 is used. It also detects well-defined reference dependencies.

【0022】ステップS203は、すべての経路に対する参
照定義依存関係および定義参照依存関係の検出ステップ
であり、ステップS201で求めたすべての計算経路に対し
てそれぞれステップS202を適用し、すべての計算経路に
対する参照定義依存関係および定義参照依存関係を検出
するものである。
Step S203 is a step of detecting reference definition dependency relations and definition reference dependency relations with respect to all the routes. Step S202 is applied to all the calculation routes obtained in step S201, and all the calculation routes are calculated. The reference definition dependency and the definition reference dependency are detected.

【0023】ステップS204は、影響波及領域検出ステッ
プであって、ステップS202,S203で求めた参照定義依存
関係および定義参照依存関係より得られる変数間の依存
関係を用いることによって、修正部分に出現する変数に
依存する変数を求めるものである。ここで求めた変数の
集合が、着目している修正部分に出現する変数から影響
を受ける変数の集合となる。
Step S204 is an influence spread area detecting step, and appears in the modified portion by using the reference definition dependency obtained in steps S202 and S203 and the dependency relationship between variables obtained from the definition reference dependency. It seeks variables that depend on variables. The set of variables obtained here is the set of variables affected by the variables appearing in the correction portion of interest.

【0024】(従来の手法による実行例−その1)次
に、図2に示した手続きcalc_1に対して影響分析手段5
3を作用させた例を説明する。ここでは、手続きcalc_1
のステートメントST13「s:=q+2」を「s:=q+3」に修正し
た時、この修正により影響が及ぶ変数の集合を求める例
を以下に示す。そして、求められた変数の集合を図8に
示す。
(Execution Example by Conventional Method-Part 1) Next, the influence analysis means 5 for the procedure calc_1 shown in FIG.
An example where 3 is applied will be described. Here, the procedure calc_1
When the statement ST13 “s: = q + 2” of is modified to “s: = q + 3”, an example of obtaining a set of variables affected by this modification is shown below. Then, the obtained set of variables is shown in FIG.

【0025】まず、修正部分を経由する経路の検出ステ
ップS201が適用される。そして、計算経路検出手段52
が検出した計算経路P1011とP1012と(図4参照)の中
で、ステートメントST13を経由するものが、図9に示す
通りP1011とP1012として求められる。続いて、ある経路
に対する参照定義依存関係および定義参照依存関係の検
出ステップS202が適用され、計算経路P1011についての
参照定義依存関係および定義参照依存関係が求められ
る。
First, the step S201 of detecting a route passing through the modified portion is applied. Then, the calculation path detecting means 52
Among the calculation paths P1011 and P1012 detected by (see FIG. 4), the ones passing through the statement ST13 are obtained as P1011 and P1012 as shown in FIG. Subsequently, the reference definition dependency relationship and the definition reference dependency relationship detection step S202 for a certain route are applied, and the reference definition dependency relationship and the definition reference dependency relationship for the calculation route P1011 are obtained.

【0026】このステップS202の実行では、まず、変数
定義の行番号検出サブステップS202-1が適用され、計算
経路P1011を経由した時に各変数に対して値が定義され
るステートメントの番号と、その変数名とが求められ
る。求めた結果を表1に示す。
In the execution of this step S202, first, the line number detection sub-step S202-1 of the variable definition is applied, and the number of the statement whose value is defined for each variable when passing through the calculation path P1011 and its Variable names and are required. The obtained results are shown in Table 1.

【0027】[0027]

【表1】 この表は、例えば、start時には変数p,q,u,vの値の
定義が行なわれ、ステートメントST11では変数uの値の
定義が行なわれると読む。なお、各変数p,q,u,v
は、手続きcalc_1を呼ぶときの引数であるで、手続きca
lc_1としては、start時に定義されたものとする。
[Table 1] It is read that, for example, the value of the variable p, q, u, v is defined at the time of start, and the value of the variable u is defined at the statement ST11. In addition, each variable p, q, u, v
Is an argument when calling the procedure calc_1.
lc_1 shall be defined at start.

【0028】続いて、変数参照の行番号検出サブステッ
プS202-2が適用され、計算経路P1011を実行した時に各
変数および各定数の値が参照されるステートメントの番
号と、その変数名とが求められる。求めた結果を表2に
示す。
Subsequently, the variable reference line number detection sub-step S202-2 is applied, and when the calculation path P1011 is executed, the number of the statement in which the value of each variable and each constant is referred to and the variable name thereof are obtained. To be Table 2 shows the obtained results.

【0029】[0029]

【表2】 本表は例えば、ステートメントST13では変数qの値の参
照が行なわれ、ST12ではある定数の値の参照が行なわれ
ると読む。
[Table 2] This table is read, for example, when the value of the variable q is referred to in the statement ST13 and the value of a certain constant is referred to in ST12.

【0030】続いて参照定義依存関係検出サブステップ
S202-3が適用される。このサブステップでは、上記サブ
ステップS202-1およびS202-2で求めた結果から、計算経
路P1011を実行した時に発生する参照定義依存関係を求
める。ここでは、表1と表2の同一行を参照すれば、参
照定義依存関係が求められる。求めた関係を表3に示
す。
Next, the reference definition dependency detection substep
S202-3 is applied. In this sub-step, the reference definition dependency that occurs when the calculation path P1011 is executed is obtained from the results obtained in the sub-steps S202-1 and S202-2. Here, by referring to the same row in Table 1 and Table 2, the reference definition dependency relationship is obtained. Table 3 shows the relationship obtained.

【0031】[0031]

【表3】 本表は、例えば、値が参照されるある定数(ここでは、
ST11が「u:=0」における"0"が定数である)からステート
メントST11で値が定義される変数uへの参照定義依存関
係があると読み、また、ST13で値が参照される変数qか
らST13で値が定義される変数sへの参照定義依存関係が
あると読む。ここで前者の場合、ST11で定義される変数
uが、値を参照するある定数に依存しており、また、後
者の場合、ST13で定義される変数sが、ST13で参照され
る変数qに依存していることが示されている。
[Table 3] This table shows, for example, certain constants (here,
ST11 reads that there is a reference definition dependency from "0" in "u: = 0" to a variable u whose value is defined in statement ST11, and a variable q whose value is referenced in ST13 Read that there is a reference definition dependency on the variable s whose value is defined in ST13. Here, in the former case, the variable u defined in ST11 depends on a certain constant that refers to a value, and in the latter case, the variable s defined in ST13 becomes the variable q referred to in ST13. It has been shown to be dependent.

【0032】次に、定義参照依存関係検出サブステップ
S202-4が適用され、計算経路P1011を実行したときに発
生する定義参照依存関係が求められる。表1と表2との
同一変数に着目することにより、定義参照依存関係を求
めることができる。求めた関係を表4に示す。
Next, the definition reference dependency detection substep
S202-4 is applied, and the definition reference dependency that occurs when the calculation path P1011 is executed is obtained. By paying attention to the same variables in Table 1 and Table 2, the definition reference dependency can be obtained. Table 4 shows the relationships obtained.

【0033】[0033]

【表4】 この表は例えば、start時に値が定義される変数pから
ステートメントST14で値が参照される変数pへの定義参
照依存関係があると読み、また、ST13で値が定義される
変数sからST15で値が参照される変数sへの定義参照依
存関係があると読む。ここで前者の場合、ST14で参照さ
れる変数pが、start時に定義される変数pに依存して
おり、また、後者の場合、ST15で参照される変数sが、
ST13で定義される変数sに依存していることが示されて
いる。以上のようにして求めた計算経路P1011に対する
変数間の依存関係が、図10に示されている。
[Table 4] This table reads, for example, that there is a definition reference dependency from the variable p whose value is defined at start to the variable p whose value is referenced in the statement ST14, and in the variable s to ST15 whose value is defined in ST13. Read that there is a definition reference dependency on the variable s whose value is referenced. Here, in the former case, the variable p referred to in ST14 depends on the variable p defined in start, and in the latter case, the variable s referred to in ST15 is
It is shown that it depends on the variable s defined in ST13. FIG. 10 shows the dependency relationship between variables with respect to the calculation path P1011 obtained as described above.

【0034】上記各サブステップS202-1〜S202-4を含む
ステップS202が全ての経路について順次実行されるよう
に、すべての経路に対する参照定義依存関係および定義
参照依存関係の検出ステップS203が適用される。ここで
は、ステップS201で求めた全ての計算経路P1011とP1012
とについて、参照定義依存関係および定義参照依存関係
を求めるために、上記で説明した計算経路P1011に対す
る処理に引き続いて、計算経路P1012についてステップS
202を適用する。計算経路P1012に対する参照定義依存関
係を表5に、定義参照依存関係を表6にそれぞれ示し、
また計算経路P1012に対する変数間の依存関係を図11
に示す。
The reference definition dependency relationship and the definition reference dependency relationship detection step S203 for all the routes are applied so that step S202 including the above-mentioned sub-steps S202-1 to S202-4 is sequentially executed for all the routes. It Here, all calculation paths P1011 and P1012 obtained in step S201 are
In order to obtain the reference definition dependency relationship and the definition reference dependency relationship with respect to and, following the processing for the calculation path P1011 described above,
Apply 202. Table 5 shows the reference definition dependency relationships and Table 6 shows the definition reference dependency relationships for the calculation path P1012.
FIG. 11 shows the dependency relationship between variables for the calculation path P1012.
Shown in.

【0035】[0035]

【表5】 [Table 5]

【0036】[0036]

【表6】 次に、ステップS203では、ステップS201で求めた計算経
路P1011とP1012との両方に対する参照定義依存関係およ
び定義参照依存関係が求められる。計算経路P1011とP10
12とに対する参照定義依存関係を得るためには、表3と
表5との和集合を得ればよい。その結果を表7に示す。
この表の読み方は表3と同じである。
[Table 6] Next, in step S203, the reference definition dependency relationship and the definition reference dependency relationship for both the calculation paths P1011 and P1012 obtained in step S201 are obtained. Computational path P1011 and P10
In order to obtain the reference definition dependency relation with respect to 12, it is sufficient to obtain the union of Table 3 and Table 5. The results are shown in Table 7.
How to read this table is the same as in Table 3.

【0037】[0037]

【表7】 同様に、計算経路P1011とP1012との両方に対する定義参
照依存関係を得るためには、表4と表6との和集合を得
ればよい。その結果を表8に示す。この表の読み方は表
4と同じある。また、以上の処理によって求められた、
計算経路P1011とP1012とを実行したときに変数間の依存
関係が、図12に示されている。
[Table 7] Similarly, in order to obtain the definition reference dependency for both the calculation paths P1011 and P1012, it is sufficient to obtain the union of Tables 4 and 6. The results are shown in Table 8. How to read this table is the same as in Table 4. Also, obtained by the above processing,
The dependency relationships between variables when the calculation paths P1011 and P1012 are executed are shown in FIG.

【0038】[0038]

【表8】 ステップS203の実行が終了したら、影響波及領域検出ス
テップS204が適用される。ここでは、ステップS203で求
めた参照定義依存関係および定義参照依存関係(表7お
よび表8参照)をもとに、ステートメントST13で定義さ
れる変数から影響を受ける変数の集合を求める。
[Table 8] When the execution of step S203 ends, the influence spread area detection step S204 is applied. Here, a set of variables affected by the variables defined in the statement ST13 is obtained based on the reference definition dependency relationship and the definition reference dependency relationship (see Table 7 and Table 8) obtained in step S203.

【0039】まず、ST13で定義される変数に依存するす
べての変数を求める。次に、求めた変数に依存するすべ
ての変数を求める。順次このように、求めた変数に依存
する変数を求め、新たに依存する変数がなくなるまで依
存する変数を求め続ける。この求める過程で用いた参照
定義依存関係と定義参照依存関係とを表9に示す。
First, all variables that depend on the variables defined in ST13 are obtained. Next, all variables that depend on the calculated variables are calculated. In this manner, the variables that depend on the determined variables are sequentially obtained, and the dependent variables are continuously obtained until there are no new dependent variables. Table 9 shows the reference definition dependency relationship and the definition reference dependency relationship used in this obtaining process.

【0040】[0040]

【表9】 これら参照定義依存関係および定義参照依存関係を用い
ることによって、ST13で定義される変数から影響を受け
る変数の集合を求め、結果を表10に示す。また上述し
たように、その結果が図8に示されている。
[Table 9] By using these reference definition dependency relationships and definition reference dependency relationships, a set of affected variables is obtained from the variables defined in ST13, and the results are shown in Table 10. As described above, the result is shown in FIG.

【0041】[0041]

【表10】 以上に示した通り、手続きcalc_1におけるステートメン
トST13を修正した際、修正による影響を受ける変数の集
合を求めることができる。
[Table 10] As described above, when the statement ST13 in the procedure calc_1 is modified, the set of variables affected by the modification can be obtained.

【0042】(従来の手法による実行例−その2)続い
て、計算経路に複数の条件文を含むプログラムに対し
て、従来技術を適用することによって影響波及領域を求
める実現例を示す。ここでは、図13に示すプログラム
における手続きcalc_3について考える。ST32「s:=u*2」
を「s:=u*4」に修正した場合、従来の技術を用いると、
この修正が影響を及ぼす変数を次のように求めることが
できる。
(Execution Example by Conventional Method—Part 2) Next, an implementation example of obtaining the influence spread area by applying the conventional technique to a program including a plurality of conditional statements in the calculation path will be described. Here, consider the procedure calc_3 in the program shown in FIG. ST32 "s: = u * 2"
When is modified to “s: = u * 4”, using conventional technology,
The variables affected by this modification can be determined as follows.

【0043】まず、計算経路検出手段52を用いて、図
14に示す4本の計算経路P1031〜P1034とを求める。そ
して、影響分析手段53のステップS201に従い、ST32を
経由する計算経路としてP1031とP1032とを求め、影響分
析手段53のステップS202およびS203に従い、P1031とP
1032とに対する参照定義依存関係および定義参照依存関
係を求める。求めた参照定義依存関係を表11に、求め
た定義参照関係を表12にそれぞれ示す。また、計算経
路P1031を実行する際の変数間の依存関係、計算経路P10
32を実行する際の変数間の依存関係が図15に示されて
いる。
First, the calculation route detecting means 52 is used to obtain four calculation routes P1031 to P1034 shown in FIG. Then, according to step S201 of the impact analysis means 53, P1031 and P1032 are obtained as calculation routes passing through ST32, and according to steps S202 and S203 of the impact analysis means 53, P1031 and P103
Find reference definition dependency and definition reference dependency on 1032. Table 11 shows the obtained reference definition dependency relationship, and Table 12 shows the obtained definition reference relationship. Also, the dependency relationship between variables when executing the calculation path P1031, the calculation path P10
The dependency relationships between variables when executing 32 are shown in FIG.

【0044】[0044]

【表11】 [Table 11]

【0045】[0045]

【表12】 続いて、影響分析手段のステップS204に従い、求めた参
照定義依存関係および定義参照依存関係により得られる
変数間の依存関係を用いることによって、ST32で定義さ
れる変数に依存する変数の集合を検出する。ここで求め
た集合が、ST32で定義される変数から影響が及ぶ変数の
集合となる。検出した変数の集合を表13に示す。ま
た、ST32で定義される変数に依存する変数の依存関係が
図16に示されている(P1032が実行されるとしてあ
る)。
[Table 12] Then, according to step S204 of the impact analysis means, by using the obtained reference definition dependency relationship and the dependency relationship between the variables obtained by the definition reference dependency relationship, the set of variables dependent on the variable defined in ST32 is detected. . The set obtained here is the set of variables affected by the variables defined in ST32. Table 13 shows a set of detected variables. Also, FIG. 16 shows the dependency relationship of variables that depend on the variables defined in ST32 (it is assumed that P1032 is executed).

【0046】[0046]

【表13】 以上示した通り、手続きcalc_3におけるステートメント
ST32を修正した際、修正による影響を受ける変数の集合
を求めることができる。この従来の手法によって影響が
及ぶ変数の分析を行なうと、表13に示す通り、例えば
ST39で定義される変数iが、ST32に定義される変数から
影響を受けると判定されていた。
[Table 13] As shown above, the statement in procedure calc_3
When ST32 is modified, the set of variables affected by the modification can be obtained. The analysis of the variables affected by this conventional method shows, for example, as shown in Table 13.
It has been determined that the variable i defined in ST39 is affected by the variable defined in ST32.

【0047】ここで、計算経路P1032が実際に実行され
る可能性があるかどうかを調べてみる。
Here, it is investigated whether the calculation path P1032 may actually be executed.

【0048】計算経路P1032では、ST31から、ST33へで
はなくST32へと制御が移行する。そのため、ST31におい
て条件(p>0)は真となる。そして計算経路P1032で
は、引続きST32とST34とを経由した後、ST35に到達す
る。ここで、計算経路P1032において、ST31からST32とS
T34とを経由する間、変数pへの代入文が存在しないた
め、ST35でのpの値はST31でのpの値と同一である。ま
た、ST31において条件(p>0)が真であるので、ST35
での条件(p>0)は必ず真となる。そのため、ST31→
ST32→ST34→ST35と実行してきた計算経路は、引き続い
てST38方向へ実行されることは決してないことになる。
以上より、P1032は実際には実行されない計算経路であ
ることがわかる。
In the calculation path P1032, the control shifts from ST31 to ST32 instead of ST33. Therefore, in ST31, the condition (p> 0) becomes true. Then, in the calculation path P1032, after passing through ST32 and ST34, ST35 is reached. Here, in calculation path P1032, ST31 to ST32 and S
Since there is no assignment statement to the variable p while passing through T34, the value of p in ST35 is the same as the value of p in ST31. Since the condition (p> 0) is true in ST31, ST35
The condition (p> 0) is always true. Therefore, ST31 →
The calculation path executed as ST32 → ST34 → ST35 will never be executed in the direction of ST38.
From the above, it can be seen that P1032 is a calculation path that is not actually executed.

【0049】上述した従来の技術を用いると、上に示し
た通り実際には実行されない計算経路(例えばP1032)
であっても、計算経路検出手段52がその計算経路が実
行される可能性があると判定してしまうことがあった。
Using the above-mentioned conventional technique, as shown above, a calculation path that is not actually executed (for example, P1032)
Even in this case, the calculation route detecting means 52 may determine that the calculation route may be executed.

【0050】ここで、計算経路P1032が実際には実行さ
れないことを考慮に入れてもう一度、ST32に対する修正
が影響を及ぼす変数の集合を求める。計算経路P1032が
決して実行されないとすると、影響分析手段53のステ
ップS201では、ST32を経由する計算経路がP1031だけで
あることが求められる。そして、影響分析手段53のS2
02およびS203によって、計算経路P1031に対する参照定
義依存関係および定義参照依存関係が、それぞれ表14
および表15に示すように検出される。また、P1031を
実行する際に生じる変数間の依存関係が図17に示され
ている。
Here, taking into account that the calculation path P1032 is not actually executed, the set of variables affected by the modification to ST32 is obtained again. Assuming that the calculation path P1032 is never executed, in step S201 of the influence analysis means 53, it is required that only P1031 is the calculation path passing through ST32. Then, S2 of the impact analysis means 53
By 02 and S203, the reference definition dependency relationship and the definition reference dependency relationship for the calculation path P1031 are shown in Table 14 respectively.
And detected as shown in Table 15. Further, FIG. 17 shows the dependency relationship between variables that occurs when P1031 is executed.

【0051】[0051]

【表14】 [Table 14]

【0052】[0052]

【表15】 そして、影響分析手段53のS204によって、求めた参照
定義依存関係および定義参照依存関係より、ST32で定義
される変数に依存する変数の集合を求める。本変数の集
合に、着目する変数からの影響が及ぶ。求められた変数
の集合が表16に示されている。また、計算経路P1032
が実行されないとしたときのST32で定義される変数に依
存する変数の依存関係が、図18に示されている。
[Table 15] Then, in S204 of the influence analysis unit 53, a set of variables depending on the variable defined in ST32 is obtained from the obtained reference definition dependency relationship and the definition reference dependency relationship. The set of variables is affected by the variable of interest. Table 16 shows the obtained set of variables. Also, the calculation path P1032
FIG. 18 shows the dependency relationships of variables that depend on the variables defined in ST32 when is not executed.

【0053】[0053]

【表16】 従来の技術を用いると、計算経路P1032を通るものとし
て扱うので、例えばST39で定義される変数iはST32に定
義される変数から影響を受けると判定されていた。しか
し実際には、計算経路P1032を経由することが決してな
いので、ST32に定義される変数は、ST39で定義される変
数iには影響を及ぼすことはない。このように従来の技
術では、実際には影響を及ぼさないにもかかわらず、影
響が及ぶと判定してしまうという問題が発生する。
[Table 16] If the conventional technique is used, it is treated as passing through the calculation path P1032. Therefore, for example, it was determined that the variable i defined in ST39 is influenced by the variable defined in ST32. However, in reality, the variable defined in ST32 does not influence the variable i defined in ST39, since it never passes through the calculation path P1032. As described above, the conventional technique has a problem that it is determined that the influence is exerted even though the influence is not actually exerted.

【0054】[0054]

【発明が解決しようとする課題】以上示した通り、従来
の技術を適用すると、実際にはプログラムの修正による
影響が及ばないにもかかわらず、影響が及ぶと判定して
しまうことがあるという問題が発生する。この問題の原
因は、根本的には、実際には実行されない計算経路を検
出することにある。例えばあるプログラムにおいて、
その計算経路は、計算経路の分岐をもたらす2つの条件
文を経由し、最初の分岐はthen方向、2番目の分岐はel
se方向をたどる、2つの条件文に対する判定部の式の
形は同じである、条件文での判定部の式内に出現する
すべての変数の値が、2つの条件文で常に同じであり、
かつ、式内に含まれるすべての関数は、入力の値が同じ
であれば必ず同じ値を出力する、の3条件を同時に満た
す場合、その計算経路は実際には実行されないが、従来
の方法によれば、実行される計算経路として検出されて
しまう。その結果、実際には実行されない計算経路をた
どったときのみ存在する変数間の依存関係、すなわち実
際のプログラム実行では存在しないはずの変数間の依存
関係が検出されてしまう。これにより、実際には存在し
ない依存関係をもとに影響を受けるとされる変数が発生
することになり、実際には修正による響が及ばないにも
かかわらず、影響が及ぶと判定してしまうことになる。
As described above, when the conventional technique is applied, it may be judged that the influence is exerted although the influence by the program modification is not actually exerted. Occurs. The root cause of this problem is to detect computational paths that are not actually executed. For example, in a program,
The calculation path goes through two conditional statements that cause a branch of the calculation path, the first branch is in the then direction, and the second branch is el.
The expressions of the judgment part for the two conditional sentences that follow the se direction are the same. The values of all variables appearing in the expression of the judgment part in the conditional sentence are always the same in the two conditional sentences,
And if all the functions included in the formula satisfy the three conditions that output the same value if the input value is the same at the same time, the calculation path is not actually executed. According to this, it will be detected as a calculation path to be executed. As a result, a dependency relationship between variables that exists only when tracing a calculation path that is not actually executed, that is, a dependency relationship between variables that should not exist in actual program execution is detected. As a result, a variable that will be affected based on a dependency that does not actually exist will be generated, and it will be judged that it will be affected even if the modification does not actually affect it. It will be.

【0055】本発明の目的は、上述の問題点を解決し、
実際には影響を及ぼさないにも関わらず影響を及ぼすと
判定することがないような、プログラムの修正による影
響分析装置を提供することにある。
The object of the present invention is to solve the above-mentioned problems,
An object of the present invention is to provide an influence analysis device by modifying a program that does not actually determine the influence but determines that the influence is not generated.

【0056】[0056]

【課題を解決するための手段】本発明のプログラムの修
正による影響分析装置は、逐次実行される文の集まりか
らなるプログラムに関し、前記プログラムの修正による
影響を受ける変数を分析する、プログラムの修正による
影響分析装置において、前記プログラムの構文情報にし
たがって前記プログラムの実行順序をたどり、前記実行
順序をたどることにより得られる前記文の系列を計算経
路として求める計算経路検出手段と、分岐をもたらす条
件文を経由するときの当該条件文中の論理式の真偽を決
定する変数に対する拘束条件を保存し、前記計算経路に
おいて後に出現する条件文に至るまでの区間で当該変数
の値の変更の有無を監視して当該後に出現する条件文の
拘束条件を検証し、当該拘束条件が一意に決定可能であ
れば当該後に出現する条件文の分岐のうちいずれかは実
行されないと判断することを順次計算経路に沿って行な
い、実行されない計算経路を見出す計算経路限定手段
と、前記計算経路のうち前記計算経路限定手段で実行さ
れないものとして見出されなかった計算経路の中から前
記修正を施した部分を経由するものを検出し、前記検出
された各計算経路について変数の定義と参照との関係か
ら変数間の依存関係を求め、前記修正による影響を受け
る可能性の変数の集合を求める影響分析手段とを有す
る。
According to a program modification influence analysis apparatus of the present invention, a program consisting of a group of statements to be executed sequentially is analyzed, and variables affected by the program modification are analyzed. In the influence analysis device, the execution order of the programs is traced according to the syntax information of the program, and a calculation path detecting unit that obtains a sequence of the statements obtained by following the execution order as a calculation path, and a conditional statement that causes a branch. Save the constraint condition for the variable that determines the truth or falseness of the logical expression in the conditional statement when passing, and monitor the value of the variable for the section up to the conditional statement that appears later in the calculation path. Verify the constraint condition of the conditional statement that appears after that, and if the constraint condition can be uniquely determined, appear after that One of the branches of the conditional statement that is executed is determined along the calculation path in order to determine that it is not executed, and a calculation path limiting unit that finds a calculation path that is not executed; and a calculation path limiting unit that is not executed among the calculation paths Among the calculation paths not found as the ones, the ones passing through the modified portion are detected, and the dependency relationship between the variables is obtained from the relationship between the definition of the variable and the reference for each of the detected calculation paths. , An effect analysis unit for obtaining a set of variables that are likely to be affected by the modification.

【0057】[0057]

【作用】本発明のプログラムの修正による影響分析装置
では、実行されない計算経路を見出す計算経路限定手段
を設けてあるので、影響分析手段で変数間の依存関係を
求める際に、実際には実行されない計算経路を予め除外
できるので、本当ならば影響が及ばないものに対してま
で影響が及ぶと判断することを防ぐことができる。
In the influence analysis apparatus by modifying the program of the present invention, since the calculation route limiting means for finding the calculation route which is not executed is provided, it is not actually executed when the dependence relation between variables is obtained by the influence analysis means. Since the calculation route can be excluded in advance, it is possible to prevent the determination that an influence is not exerted even if the influence is not exerted.

【0058】ここで、本発明の装置を用いた影響分析の
実行について説明する。
Now, the execution of the impact analysis using the apparatus of the present invention will be described.

【0059】まず、計算経路検出手段において、実行さ
れる可能性のある計算経路を検出する。そして、計算経
路限定手段において、計算経路検出手段が検出した各計
算経路に対して、実際には実行されることのないものを
判定する。次に、影響分析手段において、計算経路検出
手段が検出した計算経路から、実際には実行されないと
計算経路限定手段が判定した計算経路を取り除く。そし
て、取り除かれずに残った計算経路をもとに影響が及ぶ
かどうかを判定する。このように影響分析を行なうこと
により、従来は影響が及ぶと判定していた領域の中で実
際には影響が及ばない部分について、(影響が及ばない
と)正しく判定することができる。
First, the calculation route detecting means detects a calculation route which may be executed. Then, the calculation route limiting means determines, for each calculation route detected by the calculation route detecting means, one that is not actually executed. Next, the influence analysis unit removes the calculation route detected by the calculation route limiting unit from the calculation route detected by the calculation route detection unit. Then, it is determined whether or not the influence is exerted on the basis of the calculation paths remaining without being removed. By performing the influence analysis in this manner, it is possible to correctly determine (if there is no influence) a portion that has not been actually influenced in the area that has been conventionally determined to have an influence.

【0060】次に、計算経路限定手段による、実行され
ない計算経路の検出手順について、図13の手続きcalc
_3のST31→ST32→ST34→ST35→ST38→ST39の計算経路P1
032(図14参照)が実際に実行されるかどうかを例に
挙げて説明する。
Next, regarding the procedure of detecting a calculation route that is not executed by the calculation route limiting means, the procedure calc of FIG.
_3 ST31 → ST32 → ST34 → ST35 → ST38 → ST39 calculation path P1
An example will be described as to whether or not 032 (see FIG. 14) is actually executed.

【0061】一般に、ある計算経路が分岐をもたらす条
件文を経由する際、実際には分岐に対応する片方の計算
経路のみを実行するため、その条件文中の論理式の真偽
が定まる。計算経路P1032の場合、計算経路がST31からt
hen方向のST32に向かうため、ST31の判定文(p>0)
は真となる。このように論理式の真偽が定まることによ
って、経由する条件文における変数の拘束条件が求ま
る。この拘束条件は、計算経路P1032の場合、(p>
0)が真であることからST31における変数の拘束条件
(p>0)となる。
Generally, when a certain calculation path passes through a conditional statement that causes a branch, only one calculation path corresponding to the branch is actually executed, so that the truth of the logical expression in the conditional statement is determined. In the case of calculation route P1032, the calculation route is from ST31 to t
Because it goes to ST32 in the hen direction, the judgment sentence of ST31 (p> 0)
Will be true. By determining the truth of the logical expression in this way, the constraint condition of the variable in the passing conditional statement can be obtained. This constraint condition is (p>
0) is true, the variable constraint condition (p> 0) in ST31 is satisfied.

【0062】その計算経路を引き続き実行させるにした
がい、求まった変数の拘束条件の表現形式を順次更新さ
せる。計算経路P1032の場合、ST31からST32,ST34を経
由する間、変数pへの代入がないため変数の拘束条件
(p>0)は不変である。このとき、その計算経路が1
つ以上の条件文を経由した後、別の条件文まで実行され
た場合、経由してきた計算経路で求まった変数の拘束関
係を順次更新することによって、到達した条件文におい
て満たされるべき変数の拘束条件を得ることが可能とな
る。計算経路P1032の場合、1つの条件文ST31と、ST32
とST34とを経由し、別の条件文ST35まで実行されたとす
る。到達した条件文ST35において変数が満たすべき拘束
条件は(p>0)である。
As the calculation path is continuously executed, the expression form of the constraint condition of the obtained variable is sequentially updated. In the case of the calculation path P1032, the variable constraint condition (p> 0) is unchanged during the passage from ST31 to ST32 and ST34 because there is no substitution to the variable p. At this time, the calculation route is 1
When one conditional statement is executed and then another conditional statement is executed, the constraint relationship of the variable that should be satisfied in the reached conditional statement is updated by sequentially updating the constraint relationship of the variables found in the calculation path that has passed. It becomes possible to obtain the conditions. In the case of calculation path P1032, one conditional statement ST31 and ST32
It is assumed that another conditional statement ST35 has been executed via the and ST34. The constraint condition that the variable should satisfy in the reached conditional sentence ST35 is (p> 0).

【0063】このようにして得られた変数の拘束条件を
到達した条件文に適用することによって、その条件文中
の論理式が真であるのか偽であるのかどちらかであるこ
とがいえることがある。計算経路P1032の場合、ST35で
変数が満たすべき拘束条件は(p>0)なので、ST35の
条件文の判定部は必ず真となるといえる。ここで、論理
式が真であるか偽であるかのどちらかであることがいえ
れば、分岐に対応する両方の計算経路のうちどちらかは
実行されないことを意味する。計算経路P1032の場合、S
T31→ST32→ST34→ST35と実行してきた計算経路はST35
のelse方向に実行されることはないため、ST35より引続
きST38の方向へ計算経路は実際には実行されることがな
いと判定できる。
By applying the constraint condition of the variable obtained in this way to the reached conditional sentence, it may be said that the logical expression in the conditional sentence is either true or false. . In the case of calculation path P1032, the constraint condition that the variable should satisfy in ST35 is (p> 0), so it can be said that the determination part of the conditional statement in ST35 is always true. Here, if it can be said that the logical expression is either true or false, it means that one of the two calculation paths corresponding to the branch is not executed. For calculation path P1032, S
The calculation route executed from T31 → ST32 → ST34 → ST35 is ST35
Since it is not executed in the else direction of, it can be determined that the calculation route is not actually executed in the direction of ST38 from ST35.

【0064】このようにして、実際には実行されること
のない計算経路を検出できる。
In this way, a calculation path that is not actually executed can be detected.

【0065】[0065]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。図19は、本発明の一実施例の影響分析装
置の構成を示すブロック図である。この影響分析装置1
0は、分析対象のプログラムを格納する分析対象プログ
ラム保持装置11に接続されるものであって、プログラ
ムの実行順序を検出する計算経路検出手段12と、実際
には実行されない計算経路を見出す計算経路限定手段1
5と、修正による影響を分析する影響分析手段13と、
全体の動作を制御する制御手段14とで構成されてい
る。以下、各構成要素について説明する。
Embodiments of the present invention will now be described with reference to the drawings. FIG. 19 is a block diagram showing the configuration of the influence analysis apparatus according to the embodiment of the present invention. This impact analyzer 1
0 is connected to the analysis target program holding device 11 that stores the analysis target program, and the calculation route detection means 12 that detects the execution order of the programs and the calculation route that finds the calculation route that is not actually executed Limiting means 1
5, and an impact analysis unit 13 that analyzes the impact of the modification,
The control means 14 controls the entire operation. Hereinafter, each component will be described.

【0066】計算経路検出手段12は、計算経路に条件
文が現われるたびに各分岐に対応した文の系列をそれぞ
れたどることにより、計算経路を求めるものである。
The calculation path detecting means 12 obtains a calculation path by tracing a series of statements corresponding to each branch each time a conditional statement appears in the calculation path.

【0067】また、影響分析手段13は、まず、与えら
れた計算経路のうち施した修正部分を経由するものを検
出し、次に、検出した各計算経路について、それぞれを
実行する時に発生する参照定義依存関係と定義参照依存
関係とを求め、最後に、求めたすべての参照定義依存関
係と定義参照依存関係とより得られる変数間の依存関係
から、修正による影響を受ける可能性のある変数の集合
を求めるものである。この影響分析手段13は、後述す
る計算経路限定手段15によって、実際には実行されな
い計算経路であると判定された計算経路に関しては、上
記の処理を行なわないようになっている。
Further, the influence analysis means 13 first detects one of the given calculation paths that goes through the applied correction portion, and then, for each detected calculation path, a reference generated when executing each of them. The definition dependency and the definition reference dependency are obtained, and finally, the relations between all the obtained reference definition dependency and the definition reference dependency and the variables obtained from them are used to identify the variables that may be affected by the modification. It seeks a set. The influence analysis unit 13 does not perform the above process on the calculation route which is determined by the calculation route limiting unit 15 described later to be a calculation route that is not actually executed.

【0068】ここで計算経路限定手段15は、計算経路
検出手段12が検出した計算経路と計算経路を検出する
対象のプログラムとが入力して、入力した各計算経路に
ついて、実際には実行されないか、実行される可能性が
あるかを判定して出力するものである。図20は、計算
経路限定手段15の構成例を示すブロック図である。こ
の図に示されるように、分析対象のプログラムを保持す
るプログラム保持手段21と、計算経路検出手段12で
検出された計算経路のデータを格納する計算経路情報保
持手段22と、計算経路の文(ステートメント)の中か
らif文などの条件文を検出してその判定部を読み出す条
件判定文検出手段23、読み出した変数についての拘束
条件を検出する拘束条件検出手段24、検出した条件文
の判定部と検出した拘束条件とを記録する条件判定文・
拘束条件記録手段25、読み出した変数の拘束条件が変
化するたびに拘束条件の表現形式を順次更新する拘束条
件更新手段26、読み出された変数の拘束条件を検出し
た条件文に適用しこの条件文の論理式が真であるか偽で
あるかのどちらであるかを判定する論理式真偽判定手段
27、論理式真偽判定手段27の判定結果に基づいてそ
の計算経路が実際に実行される可能性があるかどうかを
判定する計算経路限定判定手段28、これら各手段21
〜28の動作およびこれら各手段21〜28間でのデー
タのやりとりを制御する計算経路限定制御手段29とに
よって構成されている。
Here, the calculation route limiting means 15 is inputted with the calculation route detected by the calculation route detecting means 12 and the program for detecting the calculation route and is not actually executed for each input calculation route? , Outputs after determining whether there is a possibility of execution. FIG. 20 is a block diagram showing a configuration example of the calculation route limiting means 15. As shown in this figure, a program holding unit 21 that holds a program to be analyzed, a calculation route information holding unit 22 that stores data of a calculation route detected by the calculation route detection unit 12, and a calculation route statement ( (Statement) detects a conditional statement such as an if statement and reads the judgment section 23, a conditional judgment statement detection section 23, a constraint condition detection section 24 that detects a restriction condition for the read variable, a judgment section for the detected conditional statement. Condition judgment sentence that records the detected constraint condition
The constraint condition recording unit 25, the constraint condition updating unit 26 that sequentially updates the expression form of the constraint condition each time the constraint condition of the read variable changes, and the constraint condition of the read variable is applied to the detected condition statement and this condition is applied. The calculation path is actually executed based on the judgment result of the logical expression true / false judgment means 27 and the logical expression true / false judgment means 27 for judging whether the logical expression of the sentence is true or false. Calculation route limitation determining means 28 for determining whether there is a possibility that
˜28 and the calculation path limiting control means 29 for controlling the exchange of data between these means 21 to 28.

【0069】次に、この計算経路限定手段15の動作を
図21のフローチャートを用いて説明する。まず、プロ
グラム保持手段21に予め保持されたプログラムに関
し、計算経路情報保持手段22に入力した各計算経路に
ついて調べるものとし(ステップS301)、まだ判定して
いない計算経路のうちの1つについて着目する(ステッ
プS302)。ここで、着目する計算経路があるか調べ(ス
テップS303)、もしなかった場合にはステップS318に移
行し、着目すべき計算経路があった場合には、条件判定
文検出手段23によって着目した計算経路を先頭からた
どり、分岐をもたらす条件文を順次検出する(ステップ
S304)。そして、1個の条件文を検出できたかどうか調
べ、もし見つからなければステップS315に移行する。条
件部が検出されたら、条件文における判定部の式を記録
する(ステップS306)。
Next, the operation of the calculation path limiting means 15 will be described with reference to the flowchart of FIG. First, regarding the program held in the program holding means 21 in advance, it is assumed that each calculation route input to the calculation route information holding means 22 is examined (step S301), and attention is paid to one of the calculation routes that has not yet been determined. (Step S302). Here, it is checked whether or not there is a calculation route of interest (step S303). If not, the process proceeds to step S318, and if there is a calculation route of interest, the calculation performed by the condition determination statement detection unit 23 The path is traced from the top and the conditional statements that cause a branch are detected sequentially (step
S304). Then, it is checked whether or not one conditional sentence has been detected, and if not found, the process proceeds to step S315. When the conditional part is detected, the expression of the determination part in the conditional statement is recorded (step S306).

【0070】次に、検出した条件文に対して、着目した
計算経路を先頭よりその条件文までたどる際に通過した
すべての条件文に対して、記録されている判定部の式を
読み出す(ステップS307)。続いて、検出された条件文
に対し、着目した計算経路を先頭よりその条件文までた
どった際、読み出した変数の拘束条件がどう変るかを調
べ、拘束条件の変化があるごとに、拘束条件更新手段2
6によって、拘束条件の表現形式を順次更新する。そし
て、検出した条件文における変数の拘束条件を求める
(ステップS308)。求めた変数の拘束条件を検出した条
件文に適用して、論理式が真であるか偽であるかのどち
らかであることがいえるか判定する(ステップS309)。
Next, for the detected conditional sentences, the formulas of the judgment section recorded are read out for all the conditional sentences that have passed when the conditional route from the head to the conditional sentence was traced (step S307). Next, for the detected conditional sentence, when the focused calculation path is traced from the beginning to the conditional sentence, it is examined how the constraint condition of the read variable changes, and the constraint condition is changed every time the constraint condition changes. Update means 2
6, the expression form of the constraint condition is sequentially updated. Then, the constraint condition of the variable in the detected conditional sentence is obtained (step S308). The obtained constraint condition of the variable is applied to the detected conditional sentence to determine whether it can be said that the logical expression is true or false (step S309).

【0071】判定の結果(ステップS310)もし、真偽の
どちらであるかを確定的にいえない場合には、引続き、
次の条件文を探すために、ステップS317に移行する。確
定的にいえる場合には、計算経路限定判定手段28によ
って、その論理式が真なのか偽なのかの情報と着目した
計算経路がその条件式においてどちらに分岐するのかと
いうことから、着目した計算経路を引続きたどることが
可能か判定する(ステップS311)。この判定によって
(ステップS312)、たどることが可能であれば、ステッ
プS317に移行し、たどることができない場合には、着目
した計算経路は実行されないと判定し(ステップS31
3)、次の計算経路に着目して(ステップS314)、ステ
ップS303に移行する。
As a result of the judgment (step S310) If it cannot be definitely determined whether it is true or false, the following operation is continued.
The process moves to step S317 to search for the next conditional statement. In the case of a definite decision, the calculation route limitation determining means 28 determines whether the logical formula is true or false and which calculation route the focused calculation route branches to in the conditional formula. It is determined whether the route can be continued (step S311). According to this determination (step S312), if traceable, the process proceeds to step S317, and if traceable, it is determined that the focused calculation path is not executed (step S31).
3) Focusing on the next calculation path (step S314), the process proceeds to step S303.

【0072】ステップS305で条件式が見つからない場合
には、その着した計算経路は実行される可能性があると
判定し(ステップS315)、次の計算経路に着目して(ス
テップS316)、ステップS303に移行する。
If the conditional expression is not found in step S305, it is determined that the arrived calculation route may be executed (step S315), and the next calculation route is focused on (step S316). Move to S303.

【0073】また、ステップS310で真偽が確定的に定ま
らないと判断された場合、あるは、ステップS312で計算
経路を引続きたどれると判断された場合には、この計算
経路について引続き上記の処理を繰り返すために、着目
する計算経路を引続きたどり、次の条件文を検出し(ス
テップS317)、その後、ステップS305に移行する。
If it is determined in step S310 that the authenticity is not definitely determined, or if it is determined in step S312 that the calculation route has continued, the above process is continued for this calculation route. In order to repeat, the calculation path of interest is continuously followed, the next conditional statement is detected (step S317), and then the process proceeds to step S305.

【0074】ステップS303で着目すべき計算経路がなく
なったら、各計算経路に対する判定結果を出力して(ス
テップS318)、計算経路限定手段15での処理を終了さ
せる。このようにして、計算経路限定手段15は、実際
には実行されることのない計算経路を検出する。
When there are no more calculation routes to be noted in step S303, the determination result for each calculation route is output (step S318), and the process in the calculation route limiting means 15 is ended. In this way, the calculation route limiting means 15 detects a calculation route that is not actually executed.

【0075】次に、具体的なプログラムを対象として本
実施例を実施した結果を説明する。以下の実施例1〜5
はプログラム修正の影響が及ぶ領域が絞り込める例であ
り、実施例6は3つの条件文を持つプログラムにおいて
2つの条件文を経由することにより3つめの条件文の判
定部の真偽が限定される例であり、実施例7はあるプロ
グラムに対する独立な複数の修正が互いに影響を及ぼし
あうかどうかを判定する例である。
Next, the result of carrying out this embodiment for a specific program will be described. Examples 1 to 5 below
Is an example in which the area affected by the program modification can be narrowed down, and the sixth embodiment limits the authenticity of the determination part of the third conditional statement by passing through two conditional statements in a program having three conditional statements. Example 7 is an example of determining whether or not a plurality of independent modifications to a program affect each other.

【0076】(実施例1)2つの条件文を持つプログラ
ムにおいて判定部が同一でかつ、判定部に出現する変数
が2つの条件文で同じ場合の例である。ここでは、図1
3に示すプログラムの手続きcalc_3を例に挙げる。
(Embodiment 1) This is an example of the case where the decision section is the same in a program having two conditional statements, and the variables appearing in the decision section are the same in the two conditional statements. Here, FIG.
Take the procedure calc_3 of the program shown in 3 as an example.

【0077】計算経路検出手段12を用いると、上述の
図14に示す通り、4本の計算経路P1031〜P1034とを検
出する。ここで計算経路限定手段15は、計算経路検出
手段12が検出した各計算経路P1031〜P1034について、
実際に実行される可能性があるかどうかを判定する。
When the calculation route detecting means 12 is used, as shown in FIG. 14, the four calculation routes P1031 to P1034 are detected. Here, the calculation route limiting means 15 determines, for each of the calculation routes P1031 to P1034 detected by the calculation route detecting means 12,
Determine if it may actually be executed.

【0078】例えば計算経路P1031については、次に示
す通り判定する。
For example, the calculation route P1031 is determined as follows.

【0079】ST31からST32に進むため、ST31において
(p>0)が真であることがいえる。これによって、ST
31での変数が満たすべき条件すなわち変数の拘束条件は
(p>0)となる。ST31からST32とST34とを経由してST
35に到達する間変数pに対する代入は行なわれないた
め、P1031がST35まで到達した際、変数の拘束条件は
(p>0)である。ST35の条件文の判定部(p>0)に
おいて本拘束条件(p>0)を適用すると、ST35の判定
部(p>0)は必ず真となる。これによって、ST31から
ST32とST34とを経由してST35に到達する計算経路は引続
き、ST35に対するthen方向すなわちST36へたどることが
いえる。以上示した通り、P1031が実行される可能性が
あることが判定できる。
Since the process proceeds from ST31 to ST32, it can be said that (p> 0) is true in ST31. This allows ST
The condition that the variable in 31 must satisfy, that is, the constraint condition of the variable is (p> 0). ST31 to ST via ST32 and ST34
Since the variable p is not substituted while reaching 35, when P1031 reaches ST35, the constraint condition of the variable is (p> 0). When this constraint condition (p> 0) is applied to the judgment section (p> 0) of the conditional sentence of ST35, the judgment section (p> 0) of ST35 is always true. With this, from ST31
It can be said that the calculation route to reach ST35 via ST32 and ST34 continues to follow the then direction to ST35, that is, ST36. As described above, it can be determined that P1031 may be executed.

【0080】また、計算経路P1032については、次に示
す通り判定する。
The calculation path P1032 is determined as follows.

【0081】上に示したP1031の例より、ST31からST32
とST34とを経由してST35に到達した時、ST35での条件文
の判定部(p>0)は必ず真となることがいえる。これ
によって、ST31からST32とST34とを経由してST35に到達
する計算経路は、ST35に対するelse方向すなわちST38へ
は引続きたどることがないことがいえる。以上示した通
り、P1032は実行されないことが判定できる。
From the example of P1031 shown above, ST31 to ST32
It can be said that the conditional statement determination unit (p> 0) in ST35 is always true when the program reaches ST35 via ST34 and ST34. As a result, it can be said that the calculation route from ST31 to ST35 via ST32 and ST34 does not continue in the else direction to ST35, that is, ST38. As described above, it can be determined that P1032 is not executed.

【0082】同様にして、P1033が実行されないこと
と、P1034が実行される可能性があることが判定でき
る。以上示した通り、従来は、P1031〜P1034の各計算経
路が全てが実行される可能性があると判定していたが、
本実施例では、計算経路P1032とP1033とは実行されない
ことが判定できる。
Similarly, it can be determined that P1033 is not executed and that P1034 may be executed. As described above, conventionally, it was determined that all the calculation paths of P1031 to P1034 may be executed,
In this embodiment, it can be determined that the calculation paths P1032 and P1033 are not executed.

【0083】この計算経路限定手段15の判定結果を用
いることによって、従来、影響が及ぶと判定していた変
数のうち、実際には影響が及ばない変数の検出が可能と
なる(図18参照)。ここで、手続きcalc_3のST32「s:
=u*2」を「s:=u*4」に修正したとき、修正によって影響
を受ける変数を検出することを例にとって考える。
By using the determination result of the calculation path limiting means 15, it is possible to detect the variable which has not been actually influenced, out of the variables which have been conventionally determined to have an influence (see FIG. 18). . Here, ST32 of the procedure calc_3 "s:
As an example, when “= u * 2” is modified to “s: = u * 4”, the variable affected by the modification is detected.

【0084】従来のものでは、ST32を経由する計算経路
はP1031とP1032であると判定するため、影響分析手段を
適用すると、表7に示す参照定義依存関係と、表8に示
す定義参照関係とが得られる。そのため、ST32で定義
される変数sからST34で参照される変数sへの定義参照
依存関係と、ST34で参照される変数sからST34で定義
される変数tへの参照定義依存関係と、ST34で定義さ
れる変数tからST39で参照される変数tへの定義参照依
存関係と、ST39で参照される変数tからST39で定義さ
れる変数iへの参照定義依存関係と、を組み合わせるこ
とによって、ST32で定義される変数sは、ST39で定義さ
れる変数iへ影響を及ぼすと判定していた。
According to the conventional method, the calculation paths passing through ST32 are determined to be P1031 and P1032. Therefore, when the influence analysis means is applied, the reference definition dependency shown in Table 7 and the definition reference relation shown in Table 8 are obtained. Is obtained. Therefore, the definition reference dependency relationship from the variable s defined in ST32 to the variable s referenced in ST34, the reference definition dependency relationship from the variable s referenced in ST34 to the variable t defined in ST34, and ST34 By combining the definition reference dependency from the defined variable t to the variable t referenced in ST39 and the reference definition dependency from the variable t referenced in ST39 to the variable i defined in ST39, ST32 It was determined that the variable s defined in step 39 affects the variable i defined in ST39.

【0085】一方、本実施例では、計算経路P1032は発
生しないと判定されるため、ST32を経由する計算経路は
P1031しかないことがいえる。したがって、ST32を経由
する計算経路としてP1031しか存在しないという条件の
もとで影響分析手段13を適用すると、表14に示す参
照定義依存関係と、表15に示す定義参照依存関係とが
得られる。さらにST32で定義される変数から影響を受け
る変数を求めると、表16に示す通り、ST39で定義され
る変数iへは影響が及ばないことがいえる。
On the other hand, in this embodiment, since it is determined that the calculation route P1032 does not occur, the calculation route passing through ST32 is
It can be said that there is only P1031. Therefore, when the influence analysis unit 13 is applied under the condition that only P1031 exists as the calculation route passing through ST32, the reference definition dependency shown in Table 14 and the definition reference dependency shown in Table 15 are obtained. Further, when variables affected by the variables defined in ST32 are obtained, it can be said that the variables i defined in ST39 are not affected, as shown in Table 16.

【0086】以上より、従来影響が及ぶと判定していた
変数のうち、実際には影響が及ばないと判定できる場合
があることが示され、プログラム修正の影響が及ぶ領域
が絞り込めた。
From the above, it has been shown that it may be possible to determine that variables do not actually have an effect, out of variables that have been conventionally determined to have an effect, and the areas that have the effect of program modification have been narrowed down.

【0087】(実施例2)2つの条件文を持つプログラ
ムにおいて、判定部の形が変数名を除いて同じであり、
2つの条件文間で対応する変数の値が同じである場合の
例である。ここでは、図22に示されるプログラムの手
続きcalc_4を例に挙げる。
(Embodiment 2) In a program having two conditional statements, the shape of the judging section is the same except for the variable name,
This is an example when the values of corresponding variables are the same between the two conditional statements. Here, the procedure calc_4 of the program shown in FIG. 22 is taken as an example.

【0088】計算経路検出手段12を用いると、図23
に示す通り、4本の計算経路P1041〜P1044が検出され
る。ここで計算経路限定手段15は、計算経路検出手段
12が検出した各計算経路P1041〜P1044について、実際
に実行される可能性があるかどうかを判定する。
When the calculation route detecting means 12 is used, FIG.
As shown in (4), four calculation paths P1041 to P1044 are detected. Here, the calculation path limiting unit 15 determines whether or not there is a possibility that the calculation paths P1041 to P1044 detected by the calculation path detection unit 12 are actually executed.

【0089】詳細は上述の実施例1と同様であるが、2
つめの条件文において、変数が満たすべき拘束条件を適
用する際の手法が異なる。
The details are the same as in the first embodiment described above, but 2
In the second conditional statement, the method for applying the constraint condition that the variable should satisfy is different.

【0090】実施例1と同様に、例えばST41からST42と
ST44とを経由してST45に到達した場合(計算経路P104
2)を考える。ST41で満たすべき拘束条件(p>0)はS
T45でも満たされるが、本拘束条件(p>0)だけでは
ST45における条件文の判定部(q>0)の真偽が定
まるかどうかの判定は不可能である。しかし、calca_4
がプログラムMain4から呼び出されている場合、calc_4
のST41に計算経路が到達したときに変数pと変数qとの
間での拘束条件(p=q)を満たすことがいえるため、
ST41で満たすべき拘束条件は(p>0)だけでなく(q
>0)でもあることがいえる。また、ST41からST42とST
44とを経由してST45に到達する間qへの代入はないた
め、ST45で満たすべき拘束条件は(p>0)だけでなく
(q>0)でもあることがいえる。そのためST45の条件
文の判定部(q>0)において本条件(q>0)を適用
すると、ST45の判定部は必ず真となる。これによって、
ST41からST42とST44とを経由してST45に到達する計算経
路は、ST45に対するelse方向すなわちST48へは引続き実
行されることがないといえる。以上示した通り、計算経
路P1042は実行されないことが判定できる。
Similar to the first embodiment, for example, ST41 to ST42
When reaching ST45 via ST44 (calculation route P104
Consider 2). The constraint condition (p> 0) to be satisfied in ST41 is S
Although it is satisfied even at T45, it is impossible to determine whether or not the truth of the conditional statement determination unit (q> 0) in ST45 is determined only by the constraint condition (p> 0). But calca_4
Is called from the program Main4, calc_4
Since it can be said that the constraint condition (p = q) between the variable p and the variable q is satisfied when the calculation path reaches ST41 of
The constraint condition to be satisfied in ST41 is not only (p> 0) but (q
> 0). Also, from ST41 to ST42 and ST
Since there is no substitution to q while reaching ST45 via 44 and 44, it can be said that the constraint condition to be satisfied in ST45 is not only (p> 0) but also (q> 0). Therefore, if this condition (q> 0) is applied to the conditional statement determination section (q> 0) of ST45, the determination section of ST45 is always true. by this,
It can be said that the calculation route from ST41 to ST45 via ST42 and ST44 is not continuously executed in the else direction to ST45, that is, to ST48. As shown above, it can be determined that the calculation path P1042 is not executed.

【0091】同様にして、計算経路P1043も実行されな
いと判定されるから、結局、P1041とP1044とが実行され
る可能性のあることと、P1042とP1043とが実行されない
こととが判定できる。
Similarly, since it is determined that the calculation path P1043 is not executed, it can be determined that P1041 and P1044 may be executed and that P1042 and P1043 may not be executed.

【0092】この判定結果を用いることによって、従
来、影響が及ぶと判定していた変数のうち、実際には影
響が及ばない変数の検出が可能となる。
By using this determination result, it is possible to detect a variable that has not been actually affected, among variables that have been conventionally determined to have an effect.

【0093】ここで、手続きcalc_4のST42の「s:=u*2」
を「s:=u*4」に修正したとき、修正によって影響を受け
る変数を検出することを例にとって考える。判定方法は
実施例1と同様であり、結論をいうと、従来は、ST42を
経由する計算経路がP1041とP1042とであると判定してい
たため、ST42への修正による影響がST49で定義される変
数iに及ぶと判定していた。しかし、本実施例ではP104
2が実行されないと判定されるために、ST42の修正によ
る影響はST49で定義されるiには及ばないと判定でき
る。以上より、従来影響が及ぶと判定していた変数のう
ち、実際には影響が及ばないと判定できる場合があるこ
とが示され、プログラム修正の影響が及ぶ領域が絞り込
めた。
Here, “s: = u * 2” of ST42 of procedure calc_4
When is modified to “s: = u * 4”, consider the case where the variables affected by the modification are detected. The determination method is the same as that of the first embodiment, and in conclusion, conventionally, since it was determined that the calculation route passing through ST42 was P1041 and P1042, the effect of the modification to ST42 is defined in ST49. It was determined that the variable i was reached. However, in this embodiment, P104
Since it is determined that 2 is not executed, it can be determined that the effect of the modification in ST42 does not reach i defined in ST49. From the above, it was shown that among the variables that were previously determined to have an effect, it may be possible to determine that they do not actually have an effect, and the areas affected by the program modification were narrowed down.

【0094】(実施例3)2つの条件文を持つプログラ
ムにおいて、判定文の形が異なるが、それぞれの判定部
に出現する変数間で関連がある場合の例である。ここで
は、図24のプログラムにおける手続きcalc_5を例に挙
げる。
(Third Embodiment) In a program having two conditional statements, the judgment statements have different shapes, but there is a relation between variables appearing in the respective judgment sections. Here, the procedure calc_5 in the program of FIG. 24 is taken as an example.

【0095】計算経路検出手段12によって、図25に
示す通り、4本の計算経路P1051〜P1054が検出される。
ここで計算経路限定手段15は、計算経路検出手段12
が検出した各計算経路P1051〜P1054について、実際に実
行される可能性があるかどうかを判定する。
The calculation path detecting means 12 detects four calculation paths P1051 to P1054 as shown in FIG.
Here, the calculation route limiting means 15 is used by the calculation route detecting means 12
For each of the calculation paths P1051 to P1054 detected by, it is determined whether or not there is a possibility that it will actually be executed.

【0096】詳細は実施例1や実施例2と同様である
が、2つめの条件文において、変数が満たすべき拘束条
件を適用する際の手法が異なる。実施例1と同様に、例
えばST51からST52とST54とST55とを経由してST56に到達
した場合(計算経路P1051)を考える。ST51で満たすべ
き拘束条件(p>0)はST56でも満たされるが、この拘
束条件(p>0)だけではST56における条件文の判定部
(q>=0)の真偽が定まるかどうかの判定は不可能で
ある。しかし、上記の計算経路が経由するST54におい
て、変数pの値をもとに変数qの値を定めている。ST54
まで計算経路が到達した拘束条件(p>0)を満たして
いるが、ST54においてqへの代入が完了した状態では、
拘束条件(q<0)が新たに発生する。ST54において新
たに発生した拘束条件(q<0)は、ST56に到達する経
路上においてqに対する代入が存在しないため、ST56に
おいても引続き成立する。そのためST56の条件文の判定
部(q>=0)においてこの拘束条件(q<0)を適用
すると、ST56の判定部は必ず偽となる。これによってST
51からST52とST54とST55とを経由してST56に到達する計
算経路は、ST56に対するthen方向すなわちST57へは引続
き実行されることがないといえる。以上示した通り、P1
051は実行されないことが判定できる。
The details are similar to those of the first and second embodiments, but the method for applying the constraint condition that the variable should satisfy in the second conditional statement is different. Similar to the first embodiment, let us consider a case where the vehicle arrives at ST56 from ST51 via ST52, ST54, and ST55 (calculation route P1051). The constraint condition (p> 0) that should be satisfied in ST51 is also satisfied in ST56, but it is determined whether or not the determination unit (q> = 0) of the conditional statement in ST56 determines whether the constraint condition (p> 0) is true. Is impossible. However, in ST54 through which the above-mentioned calculation path passes, the value of the variable q is determined based on the value of the variable p. ST54
Although the constraint condition (p> 0) that the calculation path has reached is satisfied, but in the state where the substitution to q is completed in ST54,
A constraint condition (q <0) is newly generated. The constraint condition (q <0) newly generated in ST54 is still satisfied in ST56 because there is no substitution for q on the route reaching ST56. Therefore, if this constraint condition (q <0) is applied in the conditional statement determination section (q> = 0) of ST56, the determination section of ST56 is always false. By this ST
It can be said that the calculation route from 51 to ST56 via ST52, ST54, and ST55 is not continuously executed in the then direction to ST56, that is, to ST57. As shown above, P1
It can be determined that 051 is not executed.

【0097】同様の手順で計算経路P1054が実行されな
いことがわかり、結局、P1052とP1053とが実行される可
能性のあることと、P1051とP1054とが実行されないこと
とが判定できる。
It can be seen that the calculation path P1054 is not executed by the same procedure, and eventually it is possible to determine that P1052 and P1053 may be executed and that P1051 and P1054 are not executed.

【0098】この判定結果を用いることによって、従
来、影響が及ぶと判定していた変数のうち、実際には影
響が及ばない変数の検出が可能となる。ここで、手続き
calc_5のST52の「s:=u*2」を「s:=u*4」に修正したと
き、修正によって影響を受ける変数を検出することを例
にとって考える。判定方法は実施例1と同様である。
By using this determination result, it is possible to detect a variable that has not been actually affected, among variables that have been conventionally determined to have an effect. Where the procedure
When “s: = u * 2” in ST52 of calc_5 is modified to “s: = u * 4”, let us consider an example of detecting variables affected by the modification. The determination method is the same as in the first embodiment.

【0099】すなわち従来は、ST52を経由する計算経路
がP1051とP1052とであると判定していたため、ST52への
修正による影響がST57で定義される変数hに及ぶと判定
していた。しかし、本実施例ではP1051が実行されない
と判定するために、ST52への修正による影響はST57で定
義されるhには及ばないと判定できる。以上より、従来
影響が及ぶと判定していた変数のうち、実際には影響が
及ばないと判定できる場合があることが示され、プログ
ラム修正の影響が及ぶ領域が絞り込めた。
That is, conventionally, it was determined that the calculation route passing through ST52 was P1051 and P1052, and therefore it was determined that the effect of the correction on ST52 extends to the variable h defined in ST57. However, in the present embodiment, since it is determined that P1051 is not executed, it can be determined that the effect of the modification on ST52 does not reach the h defined in ST57. From the above, it was shown that among the variables that were previously determined to have an effect, it may be possible to determine that they do not actually have an effect, and the areas affected by the program modification were narrowed down.

【0100】(実施例4)2つの条件文を持つプログラ
ムにおいて、後に出現する条件文の判定部において、先
に出現する条件文の判定部に新たな条件が加わる場合の
例である。ここでは図26に示されたのプログラムにお
ける手続きcalc_6を例に挙げる。
(Embodiment 4) This is an example of a case in which in a program having two conditional statements, a new condition is added to the determination section of the conditional statement that appears later, in the determination section of the conditional statement that appears first. Here, the procedure calc_6 in the program shown in FIG. 26 is taken as an example.

【0101】計算経路検出手段12を用いると、図27
に示す通り、4本の計算経路P1061〜P1064とが検出され
る。計算経路限定手段15は、計算経路検出手段12が
検出した各計算経路P1061〜P1064について、実際に実行
される可能性があるかどうかを判定する。詳細は実施例
1などと同様であるが、2つめの条件文において、変数
が満たすべき拘束条件を適用する際の手法が異なる。
When the calculation route detecting means 12 is used, FIG.
As shown in, the four calculation paths P1061 to P1064 are detected. The calculation path limiting means 15 determines whether or not there is a possibility that the calculation paths P1061 to P1064 detected by the calculation path detecting means 12 will actually be executed. The details are the same as in Example 1 and the like, but in the second conditional statement, the method for applying the constraint condition that the variable should satisfy is different.

【0102】実施例1と同様に、例えばST61からST63と
ST64とを経由してST65に到達した場合(計算経路P106
3)を考える。ST61で満たすべき拘束条件(p<=0)
はST65でも満たされる。そのためST65の条件文の判定部
[(p>0)and(q>0)]は必ず偽となる。これに
よってST61からST63とST64とを経由してST65に到達する
計算経路は、ST65に対するthen方向すなわちST66へは引
続き実行されることがないといえる。以上示した通り、
P1063は実行されないことが判定できる。
Similar to the first embodiment, for example, ST61 to ST63
When reaching ST65 via ST64 (calculation path P106
Think 3). Restraint conditions to be satisfied in ST61 (p <= 0)
Is also met at ST65. Therefore, the determination section [(p> 0) and (q> 0)] of the conditional statement of ST65 is always false. Therefore, it can be said that the calculation route from ST61 to ST65 via ST63 and ST64 is not continuously executed in the then direction to ST65, that is, to ST66. As shown above,
It can be determined that P1063 is not executed.

【0103】結局、P1061とP1062とP1064とが実行され
る可能性のあることと、P1063が実行されないこととが
判定できる。
After all, it can be determined that P1061, P1062, and P1064 may be executed, and that P1063 may not be executed.

【0104】この判定結果を用いることによって、従
来、影響が及ぶと判定していた変数のうち、実際には影
響が及ばない変数の検出が可能となる。ここで、calc_6
のST63の「s:=u*3」を「s:=u*5」に修正したとき、修正によ
って影響を受ける変数を検出することを例にとって考え
る。判定方法は実施例1と同様である。
By using this determination result, it is possible to detect a variable that has not been actually affected, out of the variables that were conventionally determined to have an effect. Where calc_6
When “s: = u * 3” in ST63 is modified to “s: = u * 5”, let us consider an example of detecting variables affected by the modification. The determination method is the same as in the first embodiment.

【0105】すなわち従来は、ST63を経由する計算経路
がP1063とP1064とであると判定していたため、ST63への
修正による影響がST66で定義される変数hに及ぶと判定
していた。しかし本実施では、P1063が実行されないと
判定するために、ST63の修正による影響はST66で定義さ
れるhには及ばないと判定できる。
That is, in the past, it was determined that the calculation paths passing through ST63 were P1063 and P1064. Therefore, it was determined that the effect of the correction on ST63 extends to the variable h defined in ST66. However, in this embodiment, since it is determined that P1063 is not executed, it can be determined that the effect of the modification in ST63 does not reach the h defined in ST66.

【0106】以上より、従来影響が及ぶと判定していた
変数のうち、実際には影響が及ばないと判定できる場合
があることが示され、プログラム修正の影響が及ぶ領域
が絞り込めた。
From the above, it has been shown that it may be possible to determine that the variables do not actually affect, among the variables that have conventionally been determined to affect, and that the areas affected by the program modification have been narrowed down.

【0107】(実施例5)2つの条件文を持つプログラ
ムにおいて、各判定文において出現する変数間に関連が
ある場合の例である。ここでは、図28に示すプログラ
ムにおける手続きcalc_7を例に挙げる。
(Embodiment 5) This is an example of the case where variables appearing in each judgment sentence are related to each other in a program having two conditional sentences. Here, the procedure calc_7 in the program shown in FIG. 28 is taken as an example.

【0108】計算経路検出手段12を用いると、図29
に示す通り、4本の計算経路P1071〜P1074が検出され
る。計算経路限定手段15は、計算経路検出手段12が
検出した各計算経路P1071〜P1074について、実際に実行
される可能性があるかどうかを判定する。詳細は実施例
1などと同様であるが、2つめの条件文において、変数
が満たすべき拘束条件を適用する際の手法が異なる。
When the calculation route detecting means 12 is used, FIG.
As shown in, the four calculation paths P1071 to P1074 are detected. The calculation path limiting unit 15 determines whether or not there is a possibility that the calculation paths P1071 to P1074 detected by the calculation path detection unit 12 are actually executed. The details are the same as in Example 1 and the like, but in the second conditional statement, the method for applying the constraint condition that the variable should satisfy is different.

【0109】実施例1と同様に、例えばST71からST72と
ST74とST75とを経由してST76に到達した場合(計算経路
P1072)を考える。ST71で満たすべき拘束条件(p>
0)はST76でも満たされるが、この拘束条件(p>0)
だけではST76における条件文の判定部(q>0)の真偽
が定まるかどうかの判定は不可能である。しかし、上記
の計算経路P1072が経由するST74において、変数pの値
をもとに変数qの値を定めている。ST74まで計算経路が
到達した時、拘束条件(p>0)を満たしているが、ST
74においてqへの代入が完了した状態では、拘束条件
(q>10)が新たに発生する。ST74において新たに発
生した拘束条件(q>10)は、ST76に到達する経路上
においてqに対する代入が存在しないため、ST76におい
ても引続き成立する。そのためST76の条件文の判定部
(q>0)において本拘束条件(q>10)を適用する
と、ST76の判定部は必ず真となる。これによってST71か
らST72とST74とST75とを経由してST76に到達する計算経
路は、ST76に対するelse方向すなわちST79へは引続き実
行されることがないといえる。以上示した通り、P1072
は実行されないことが判定できる。
Similar to the first embodiment, for example, ST71 to ST72
When reaching ST76 via ST74 and ST75 (calculation route
Consider P1072). Constraints that ST71 must meet (p>
0) is also satisfied in ST76, but this constraint (p> 0)
Only by itself, it is impossible to judge whether the truth of the conditional statement judgment section (q> 0) in ST76 is determined. However, in ST74 through which the above-described calculation path P1072 passes, the value of the variable q is determined based on the value of the variable p. When the calculation route reaches ST74, the constraint condition (p> 0) is satisfied, but ST
In the state where the substitution to q is completed in 74, a constraint condition (q> 10) is newly generated. The constraint condition (q> 10) newly generated in ST74 is still satisfied in ST76 because there is no substitution for q on the route reaching ST76. Therefore, if this constraint condition (q> 10) is applied in the conditional statement determination unit (q> 0) of ST76, the determination unit of ST76 is always true. Therefore, it can be said that the calculation route from ST71 to ST76 via ST72, ST74, and ST75 is not continuously executed in the else direction to ST76, that is, to ST79. As shown above, P1072
Can be determined not to be executed.

【0110】結局、P1071とP1073とP1074とが実行され
る可能性のあることと、P1072が実行されないこととが
判定できる。
In the end, it can be determined that P1071, P1073, and P1074 may be executed, and that P1072 is not executed.

【0111】この判定結果を用いることによって、従
来、影響が及ぶと判定していた変数のうち、実際には影
響が及ばない変数の検出が可能となる。ここで、手続き
calc_7のST72の「s:=u*2」を「s:=u*4」に修正したと
き、修正によって影響を受ける変数を検出することを例
にとって考える。判定方法は実施例1と同様である。
By using this determination result, it is possible to detect a variable that has not been actually affected, among variables that were conventionally determined to have an effect. Where the procedure
When “s: = u * 2” in ST72 of calc_7 is modified to “s: = u * 4”, let us consider an example of detecting variables affected by the modification. The determination method is the same as in the first embodiment.

【0112】すなわち従来は、ST72を経由する計算経路
がP1071とP1072とであると判定していたため、ST72への
修正による影響がST80で定義される変数iに及ぶと判定
していた。しかし、本実施例ではP1072が実行されない
と判定するために、本修正による影響ST80で定義される
iには及ばないと判定できる。以上より、従来影響が及
ぶと判定していた変数のうち、実際には影響が及ばない
と判定できる場合があることが示され、プログラム修正
の影響が及ぶ領域が絞り込めた。
In other words, conventionally, it was determined that the calculation route passing through ST72 was P1071 and P1072, so it was determined that the effect of the correction on ST72 would extend to the variable i defined in ST80. However, in this embodiment, since it is determined that P1072 is not executed, it can be determined that the effect of this modification does not reach i defined in ST80. From the above, it was shown that among the variables that were previously determined to have an effect, it may be possible to determine that they do not actually have an effect, and the areas affected by the program modification were narrowed down.

【0113】(実施例6)3つの条件文を持つプログラ
ムにおいて、2つの条件文を経由することによって3つ
めの条件文に対する判定部の真偽が限定できる例であ
る。ここでは、図30のプログラムにおける手続きcalc
_8を例に挙げる。
(Embodiment 6) This is an example in which the authenticity of the determination section for the third conditional statement can be limited by passing through the two conditional statements in a program having three conditional statements. Here, the procedure calc in the program of FIG.
Take _8 as an example.

【0114】計算経路検出手段12を用いると、図31
に示す通り、8本の計算経路P1081〜P1088とが検出され
る。計算経路限定手段15は、計算経路検出手段12が
検出した各計算経路P1081〜P1088について、実際に実行
される可能性があるかどうかを判定する。例えば計算経
路P1082については、次に示す通り判定する。
When the calculation route detecting means 12 is used, FIG.
As shown in (8), eight calculation paths P1081 to P1088 are detected. The calculation path limiting unit 15 determines whether or not there is a possibility that the calculation paths P1081 to P1088 detected by the calculation path detection unit 12 are actually executed. For example, the calculation path P1082 is determined as follows.

【0115】ST81からST82に進むために、ST81において
(p>0)が真であることがいえる。これによってST81
での変数が満たすべき拘束条件は(p>0)となる。ST
81からST82を経由してST84に到達する間pに対する代入
は行なわれないため、P1082がST84に到達した際、変数
が満たすべき拘束条件は(p>0)である。ST84の条件
文の判定部(q>0)においてこの拘束条件(p>0)
を適用しても、ST84の判定部(q>0)の真偽は判定で
きない。しかし、計算経路がST81からST82を経由してST
84まで到達した後、計算経路P1082はST84からST85に進
むため、ST84において、ST81で定まった拘束条件(p>
0)の他に、新たな拘束条件(q>0)を得ることがで
きる。ST81からST82とST84とST85とを経由してST87に到
達する計算経路に対して、ST84からST85を経由する間、
変数pと変数qとのどちらへの代入も行なわれないた
め、ST84で満たすべき拘束条件[(p>0)and(q>
0)]は、ST87においても成立する。そのため、ST87の
条件文の判定部[(p>0)and(q>0)]に対して
この拘束条件[(p>0)and(q>0)]を適用する
と、ST87の判定文は必ず真となる。これによって、ST81
からST82とST84とST85とを経由してST87に到達する計算
経路は引続き、ST87に対するelse方向すなわちST89へは
引続き実行されることがないといえる。以上示した通
り、P1082は実行されないことが判定できる。
It can be said that (p> 0) is true in ST81 in order to proceed from ST81 to ST82. This makes ST81
The constraint condition that the variable in (4) should satisfy is (p> 0). ST
Since substitution is not performed for p from 81 to ST84 via ST82, when P1082 reaches ST84, the constraint condition to be satisfied by the variable is (p> 0). This constraint condition (p> 0) in the judgment section (q> 0) of the conditional sentence of ST84
Even if is applied, it is not possible to determine the authenticity of the determination unit (q> 0) in ST84. However, the calculation route is from ST81 to ST82
After reaching 84, the calculation route P1082 progresses from ST84 to ST85. Therefore, in ST84, the constraint condition determined in ST81 (p>
Besides 0), a new constraint condition (q> 0) can be obtained. For the calculation route reaching ST87 via ST81, ST82, ST84 and ST85, while passing ST84 to ST85,
Since neither the variable p nor the variable q is substituted, the constraint condition [(p> 0) and (q>
0)] also holds in ST87. Therefore, if this constraint condition [(p> 0) and (q> 0)] is applied to the determination part [(p> 0) and (q> 0)] of the conditional statement of ST87, the determination statement of ST87 becomes Always true. This makes ST81
It can be said that the calculation path from ST to ST87 via ST82, ST84, and ST85 continues to be executed, and the else direction to ST87, that is, ST89 is not continuously executed. As described above, it can be determined that P1082 is not executed.

【0116】同様にして、P1081とP1084とP1086とP1088
とが実行される可能性があることと、P1083とP1085とP1
087とが実行されないこととが判定できる。結局、従来
の方法によればP1081とP1082とP1083とP1084とP1085とP
1086とP1087とP1088とが実行される可能性があると判定
していたが、本実施例によって、P1082とP1083とP1085
とP1087とが実行されないことが判定できた。
Similarly, P1081, P1084, P1086 and P1088
May be executed, and P1083, P1085 and P1
It can be determined that 087 and 087 are not executed. After all, according to the conventional method, P1081, P1082, P1083, P1084, P1085 and P
Although it was determined that 1086, P1087, and P1088 may be executed, according to the present embodiment, P1082, P1083, and P1085
And P1087 could not be executed.

【0117】(実施例7)独立に施した複数の修正に対
して、それぞれが影響を及ぼす領域が異なることが示せ
る例である。ここでは、図32のプログラムにおける手
続きdevice_driverと手続きdevice_ioとを例に挙げる。
これら手続きdevice_driverとdevice_ioは、それぞれコ
ンソールから外部入出力ポートを直接操作してデータの
入出力を行なうためのものであり、手続きdevice_io中
で呼ばれる手続きPort_inとPort_outは、それぞれ入出
力を直接実行する手続きである。
(Embodiment 7) This is an example in which it is possible to show that the areas affected by a plurality of independently applied modifications are different. Here, the procedure device_driver and the procedure device_io in the program of FIG. 32 are taken as an example.
These procedures device_driver and device_io are for directly operating the external input / output port from the console to input / output data, and the procedures Port_in and Port_out called in the procedure device_io are procedures for directly executing input / output respectively. Is.

【0118】ここで、例えば手続きdvice_ioにおいて、
ST111を「d:=data」から「d:=data*4」とだけ変更する
修正1と、手続きdevice_ioにおいて、ST114を「data:=
d」から「data:=d*2」とだけ変更する修正2とを独立し
て行なった後、両方の修正部分を同じプログラムに反映
させる場合を考える。
Here, for example, in the procedure advice_io,
Modification 1 in which ST111 is changed only from "d: = data" to "d: = data * 4", and ST114 is changed to "data: =" in procedure device_io.
Consider a case in which after performing independently the modification 2 that only changes from "d" to "data: = d * 2", both modified parts are reflected in the same program.

【0119】計算経路検出手段12を用いると、図33
に示されるように、実行可能な計算経路として、8本の
計算経路P1101〜P1108を検出していた。これをもとに従
来の方法のまま影響分析手段を用いることによって、修
正2による影響は、ST106において参照されるtempdata
と、ST107において定義されるio_data1と、ST108におい
て定義されるtempdataと、ST111において参照されるdat
aと、ST111において定義されるdなどへ及ぶと判定され
ていた。そのため、修正2によって影響が及ぶ変数の集
合のうち、例えばST111で定義される変数を、修正2と
は独立に行なう修正1が変更してしまうと判定すること
になる。
When the calculation route detecting means 12 is used, FIG.
As shown in FIG. 8, eight calculation paths P1101 to P1108 were detected as executable calculation paths. Based on this, by using the impact analysis method as in the conventional method, the impact of the modification 2 is tempdata referenced in ST106.
And io_data1 defined in ST107, tempdata defined in ST108, and dat referenced in ST111.
It has been determined to extend to a and d defined in ST111. Therefore, it is determined that the variable defined in ST111 out of the set of variables affected by the modification 2 is modified by the modification 1 performed independently of the modification 2.

【0120】しかし、本実施例における計算経路限定手
段15を用いると、計算経路P1102とP1103とP1104とP11
05とP1106とP1107とが実行されないことが判定できる。
この判定から、修正2による影響はST111で定義される
変数には及ばず、修正2が及ぼす変数の集合と修正1が
及ぼす変数の集合とは交わらないことが判定でき、両修
正が互いに影響を及ぼしあわないことが判定できる。
However, when the calculation route limiting means 15 in this embodiment is used, the calculation routes P1102, P1103, P1104 and P11 are calculated.
It can be determined that 05, P1106, and P1107 are not executed.
From this judgment, it can be determined that the effect of modification 2 does not reach the variables defined in ST111, and the set of variables affected by modification 2 and the set of variables affected by modification 1 do not intersect, and both modifications affect each other. It can be determined that they do not affect each other.

【0121】[0121]

【発明の効果】以上説明したように本発明は、変数に対
する拘束条件を保存し次の条件文での拘束条件を検証す
ることによって実行されない計算経路を見出す計算経路
限定手段を設けることにより、変数間の依存関係を求め
る際に、実際には実行されない計算経路を予め除外でき
るので、プログラム修正の影響がどう及ぶかを判断する
際に、本当ならば影響が及ばないものに対してまで影響
が及ぶと判断することを防ぐことができるという効果が
ある。
As described above, according to the present invention, by providing the calculation route limiting means for finding the calculation route that is not executed by saving the constraint condition for the variable and verifying the constraint condition in the next conditional statement, When calculating the dependency between two, it is possible to exclude in advance the calculation paths that are not actually executed, so when determining what the impact of the program modification will be, it will affect even those that do not really affect. There is an effect that it is possible to prevent the judgment that it extends.

【図面の簡単な説明】[Brief description of drawings]

【図1】従来のプログラムの修正による影響分析装置の
構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a conventional effect analysis device by modifying a program.

【図2】条件文を1つ経由する計算経路を含むプログラ
ムの例を示す図である。
FIG. 2 is a diagram illustrating an example of a program including a calculation path that passes one conditional statement.

【図3】計算経路検出手段の構成を示すブロック図であ
る。
FIG. 3 is a block diagram showing a configuration of a calculation route detecting means.

【図4】図2に示したプログラム中の手続きcalc_1に対
して計算経路検出手段が求めた計算経路を示す図であ
る。
4 is a diagram showing a calculation route obtained by a calculation route detecting means for a procedure calc_1 in the program shown in FIG.

【図5】2つの条件文を経由する計算経路を含むプログ
ラムの例を示す図である。
FIG. 5 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図6】図5に示したプログラム中の手続きcalc_2に対
して計算経路検出手段が求めた計算経路を示す図であ
る。
6 is a diagram showing a calculation route obtained by a calculation route detecting means for a procedure calc_2 in the program shown in FIG.

【図7】影響分析手段の構成を示すブロック図である。FIG. 7 is a block diagram showing a configuration of an influence analysis unit.

【図8】手続きcalc_1中のST13で定義される変数に依存
する変数を示す図である。
FIG. 8 is a diagram showing variables that depend on variables defined in ST13 in procedure calc_1.

【図9】手続きcalc_1においてST13を経由する計算経路
を示す図である。
FIG. 9 is a diagram showing a calculation route via ST13 in procedure calc_1.

【図10】計算経路P1011を実行したときに発生する変
数間の依存関係を示す図である。
FIG. 10 is a diagram showing a dependency relationship between variables that occurs when the calculation path P1011 is executed.

【図11】計算経路P1012を実行したときに発生する変
数間の依存関係を示す図である。
FIG. 11 is a diagram showing a dependency relationship between variables that occurs when the calculation path P1012 is executed.

【図12】計算経路P1011とP1012とを実行したときに発
生する変数間の依存関係を示す図である。
FIG. 12 is a diagram showing a dependency relationship between variables that occurs when the calculation paths P1011 and P1012 are executed.

【図13】2つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 13 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図14】図13に示したプログラム中の手続きcalc_3
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
14 is a procedure calc_3 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図15】計算経路P1031を実行する際と計算経路P1032
を実行する際とに発生する変数間の依存関係を示す図で
ある。
FIG. 15: Execution of calculation path P1031 and calculation path P1032
It is a figure which shows the dependency relationship between the variables which arises at the time of executing.

【図16】計算経路P1032が実行されるとして、ST32で
定義される変数に依存する変数を示す図である。
FIG. 16 is a diagram showing variables depending on the variables defined in ST32, assuming that the calculation path P1032 is executed.

【図17】計算経路P1031を実行した際に発生する変数
間の依存関係を示す図である。
FIG. 17 is a diagram showing a dependency relationship between variables that occurs when the calculation path P1031 is executed.

【図18】計算経路P1032が実行されないとして、ST32
で定義される変数に依存する変数を示す図である。
FIG. 18: If the calculation path P1032 is not executed, ST32
It is a figure which shows the variable which depends on the variable defined by.

【図19】本発明の一実施例の影響分析装置の構成を示
すブロック図である。
FIG. 19 is a block diagram showing a configuration of an influence analysis device according to an exemplary embodiment of the present invention.

【図20】計算経路限定手段の構成を示すブロック図で
ある。
FIG. 20 is a block diagram showing a configuration of a calculation route limiting unit.

【図21】計算経路限定手段の動作を示すフローチャー
トである。
FIG. 21 is a flowchart showing the operation of the calculation route limiting means.

【図22】2つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 22 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図23】図23に示したプログラム中の手続きcalc_4
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
23 is a procedure calc_4 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図24】2つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 24 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図25】図24に示したプログラム中の手続きcalc_5
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
FIG. 25 is a procedure calc_5 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図26】2つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 26 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図27】図26に示したプログラム中の手続きcalc_6
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
FIG. 27 is a procedure calc_6 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図28】2つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 28 is a diagram showing an example of a program including a calculation path passing through two conditional statements.

【図29】図28に示したプログラム中の手続きcalc_7
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
FIG. 29 is a procedure calc_7 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図30】3つの条件文を経由する計算経路を含むプロ
グラムの例を示す図である。
FIG. 30 is a diagram showing an example of a program including a calculation path passing through three conditional statements.

【図31】図30に示したプログラム中の手続きcalc_8
に対して計算経路検出手段が求めた計算経路を示す図で
ある。
FIG. 31 is a procedure calc_8 in the program shown in FIG.
It is a figure which shows the calculation route which the calculation route detection means calculated | required with respect to.

【図32】コンソールから入出力ポートを直接操作する
プログラムの例を示す図である。
FIG. 32 is a diagram showing an example of a program for directly operating an input / output port from a console.

【図33】図32に示したプログラム中の手続きdevice
_driverに対して計算経路検出手段が求めた計算経路を
示す図である。
33 is a procedure device in the program shown in FIG. 32.
It is a figure which shows the calculation route which the calculation route detection means calculated with respect to _driver.

【符号の説明】[Explanation of symbols]

10,50 影響分析装置 11,51 分析対象プログラム保持装置 12,52 計算経路検出手段 13,53 影響分析手段 14,54 制御手段 15 計算経路限定手段 21 プログラム保持手段 22 計算経路情報保持手段 23 条件判定文検出手段 24 拘束条件検出手段 25 条件判定文・拘束条件記録手段 26 拘束条件更新手段 27 論理式真偽判定手段 28 計算経路限定判定手段 29 計算経路限定制御手段 10,50 Impact analysis device 11,51 Analysis target program holding device 12,52 Calculation path detection means 13,53 Impact analysis means 14,54 Control means 15 Calculation path limiting means 21 Program holding means 22 Calculation path information holding means 23 Condition determination Sentence detecting means 24 Restraint condition detecting means 25 Condition judgment sentence / restraint condition recording means 26 Restraint condition updating means 27 Logical expression true / false judgment means 28 Calculation route limitation determining means 29 Calculation route limiting control means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 逐次実行される文の集まりからなるプロ
グラムに関し、前記プログラムの修正による影響を受け
る変数を分析する、プログラムの修正による影響分析装
置において、 前記プログラムの構文情報にしたがって前記プログラム
の実行順序をたどり、前記実行順序をたどることにより
得られる前記文の系列を計算経路として求める計算経路
検出手段と、 分岐をもたらす条件文を経由するときの当該条件文中の
論理式の真偽を決定する変数に対する拘束条件を保存
し、前記計算経路において後に出現する条件文に至るま
での区間で当該変数の値の変更の有無を監視して当該後
に出現する条件文の拘束条件を検証し、当該拘束条件が
一意に決定可能であれば当該後に出現する条件文の分岐
のうちいずれかは実行されないと判断することを順次計
算経路に沿って行ない、実行されない計算経路を見出す
計算経路限定手段と、 前記計算経路のうち前記計算経路限定手段で実行されな
いものとして見出されなかった計算経路の中から前記修
正を施した部分を経由するものを検出し、前記検出され
た各計算経路について変数の定義と参照との関係から変
数間の依存関係を求め、前記修正による影響を受ける可
能性の変数の集合を求める影響分析手段とを有すること
を特徴とするプログラムの修正による影響分析装置。
1. A program modification influence analysis apparatus for analyzing a variable affected by the modification of a program for a program consisting of a group of statements to be sequentially executed, wherein the program execution is performed according to syntax information of the program. Computation path detecting means for finding a sequence of the sentence obtained by tracing the execution order and the sentence sequence obtained as a result of the execution order, and determining whether the logical expression in the conditional statement when branching through the conditional statement is true or false The constraint condition for the variable is saved, and whether or not the value of the variable is changed is monitored in the section up to the conditional sentence that appears later in the calculation path, and the constraint condition of the conditional sentence that appears later is verified, If the condition can be uniquely determined, it is judged that one of the branches of the conditional statement that appears after that is not executed. The correction is performed from the calculation route limiting means that finds a calculation route that is not executed by following the calculation route and the calculation route that is not found to be not executed by the calculation route limiting device among the calculation routes. An impact analysis that detects the one passing through a part, obtains the dependency between variables from the relation between the definition of the variable and the reference for each of the detected calculation paths, and obtains the set of variables that may be affected by the modification. An effect analysis device by modifying a program, which comprises:
JP4294610A 1992-11-02 1992-11-02 Impact analysis device due to program modification Expired - Fee Related JP2634011B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4294610A JP2634011B2 (en) 1992-11-02 1992-11-02 Impact analysis device due to program modification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4294610A JP2634011B2 (en) 1992-11-02 1992-11-02 Impact analysis device due to program modification

Publications (2)

Publication Number Publication Date
JPH06214764A true JPH06214764A (en) 1994-08-05
JP2634011B2 JP2634011B2 (en) 1997-07-23

Family

ID=17809992

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4294610A Expired - Fee Related JP2634011B2 (en) 1992-11-02 1992-11-02 Impact analysis device due to program modification

Country Status (1)

Country Link
JP (1) JP2634011B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069892B2 (en) 2013-05-10 2015-06-30 International Business Machines Corporation Reducing false-positive errors in a software change-impact analysis

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4939973B2 (en) * 2007-02-22 2012-05-30 富士通株式会社 Test control apparatus, test control method, and test control program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069892B2 (en) 2013-05-10 2015-06-30 International Business Machines Corporation Reducing false-positive errors in a software change-impact analysis
US9250890B2 (en) 2013-05-10 2016-02-02 Globalfoundries Inc. Optimizing performance of a computer system in response to a software change

Also Published As

Publication number Publication date
JP2634011B2 (en) 1997-07-23

Similar Documents

Publication Publication Date Title
US5230050A (en) Method of recompiling a program by using result of previous compilation
JPH06314203A (en) Method and device for optimizing compiler
JP2001147819A (en) Optimizing device and recording medium
US5999739A (en) Method and apparatus for elimination of redundant branch instructions from a program
JPH11250112A (en) Method and device for synthesizing hardware and recording medium recorded with hardware synthesizing program
JPH06214764A (en) Influence analysis device by correction of program
JPS63237165A (en) Method and device for work schedule plan supporting
JP3660083B2 (en) Task margin analysis device, task margin analysis method, and recording medium storing task margin analysis program
JPH0713809A (en) Program evaluation system
JP2513142B2 (en) Program simulator device
JPH09282160A (en) Multi-branching control system
JPH07234793A (en) Optimizing device for conditional branch
JPH0283749A (en) Internal interruption control system for microprocessor
JPH07152578A (en) Detection of maximum stack usage quantity
US5838953A (en) Information processing apparatus
JPH04252336A (en) Program optimization processor
JPH0793144A (en) Program analyzer
JPH05334391A (en) Control circuit generating device
JPH02100146A (en) Trace decision system
KR100218696B1 (en) A programmable logic controller having reverse trace functions on program execution paths
JPH1011320A (en) Rom program monitor device of processor of computer or the like
JPH05127945A (en) Program execution situation analysis system
JPH01263574A (en) Apparatus for automatically forming test pattern program
JPS63289654A (en) Program branching instruction monitoring system
JPH09160806A (en) Method for supporting debugging and its device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees