JP6260179B2 - Arithmetic apparatus and arithmetic method - Google Patents
Arithmetic apparatus and arithmetic method Download PDFInfo
- Publication number
- JP6260179B2 JP6260179B2 JP2013206973A JP2013206973A JP6260179B2 JP 6260179 B2 JP6260179 B2 JP 6260179B2 JP 2013206973 A JP2013206973 A JP 2013206973A JP 2013206973 A JP2013206973 A JP 2013206973A JP 6260179 B2 JP6260179 B2 JP 6260179B2
- Authority
- JP
- Japan
- Prior art keywords
- value
- variable
- stored
- format
- storage area
- 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.)
- Active
Links
Images
Description
本発明は、シンボリック実行技術に関する。 The present invention relates to a symbolic execution technique.
プログラム内に条件分岐が有る場合、プログラムには複数の処理パスが存在する。プログラムのテストを行う際には、テスト実施者は、プログラムにおける複数の処理パスを網羅的に実行できるようにテストデータやシナリオを設計する。 When there are conditional branches in the program, there are a plurality of processing paths in the program. When testing a program, the tester designs test data and scenarios so that a plurality of processing paths in the program can be executed comprehensively.
プログラムをテストする1つの方法として、シンボリック実行(symbolic execution)という技術が知られている。シンボリック実行とは、変数の初期値を、実数値ではなく不定のシンボル値に設定し、プログラムにおける複数の処理パスを網羅するように、擬似的にプログラムを実行する技術である。シンボリック実行を行うことによって、プログラムにおける複数の処理パスの各々について、条件分岐を辿った履歴を表すパス条件を得ることができる。そこで、各パスについてパス条件を満たす変数の値を求めることで、プログラムのテストデータを得ることができる。 One method of testing a program is known as symbolic execution. Symbolic execution is a technique in which an initial value of a variable is set to an indeterminate symbol value instead of a real value, and a program is executed in a pseudo manner so as to cover a plurality of processing paths in the program. By performing symbolic execution, it is possible to obtain a path condition representing a history of following conditional branches for each of a plurality of processing paths in the program. Therefore, the test data of the program can be obtained by obtaining the value of the variable that satisfies the path condition for each path.
ところで、プログラムにおける演算(例えば、転記演算或いは比較演算等)の対象となる変数には、様々な形式(内部形式とも呼ばれる)が存在する。例えばCOBOLというプログラミング言語には、1バイトに1桁を割り当てる形式(以下、外部10進形式と呼ぶ)、1バイトに2桁を割り当てる形式(以下、内部10進形式と呼ぶ)、及び値を2進表現で格納する形式(以下、内部2進形式と呼ぶ)等がある。 By the way, there are various formats (also referred to as internal formats) for variables to be subjected to operations in the program (for example, transcription operation or comparison operation). For example, a programming language called COBOL has a format in which 1 digit is assigned to 1 byte (hereinafter referred to as an external decimal format), a format in which 2 digits are assigned to 1 byte (hereinafter referred to as an internal decimal format), and a value of 2 There are formats for storing in hexadecimal expression (hereinafter referred to as internal binary format).
しかし、従来の技術においては、シンボリック実行における変数の形式の取り扱いについて、十分な検討がなされていない。そのため、従来のシンボリック実行だと、正しい演算結果を得ることができず、その結果、テストデータを漏れなく抽出することができない場合がある。 However, in the prior art, sufficient consideration has not been given to the handling of variable formats in symbolic execution. Therefore, with the conventional symbolic execution, a correct calculation result cannot be obtained, and as a result, test data may not be extracted without omission.
従って、本発明の目的は、1つの側面では、シンボリック実行において変数の演算を適切に行うための技術を提供することである。 Accordingly, an object of the present invention, in one aspect, is to provide a technique for appropriately performing variable operations in symbolic execution.
本発明に係る演算装置は、シンボリック実行における演算の対象である第1の変数の具体値を、桁毎に値を有する形式である第1の形式に変換すると共に、第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換する第1変換部と、第1変換部による変換後の具体値を、第1の記憶領域に格納すると共に、第1変換部による変換後のシンボル値を、第1の記憶領域とは異なる第2の記憶領域に格納する第1格納処理部とを有する。 The arithmetic device according to the present invention converts the specific value of the first variable that is the object of the symbolic execution into the first format that has a value for each digit, and the symbol value of the first variable. Is converted into a second format which is a format having a value for each digit, the specific value after conversion by the first conversion unit is stored in the first storage area, and the first conversion unit And a first storage processing unit for storing the symbol value after conversion in the second storage area different from the first storage area.
1つの側面では、シンボリック実行において変数の演算を適切に行えるようになる。 In one aspect, variable operations can be appropriately performed in symbolic execution.
図1に、シンボリックの対象となるプログラムの一例を示す。図1に示されたプログラムは、COBOLで書かれたプログラムであり、以下のような特徴がある。 FIG. 1 shows an example of a program to be symbolized. The program shown in FIG. 1 is a program written in COBOL and has the following characteristics.
(1)内部形式が異なる複数の変数が存在する。変数Aは外部10進形式で主記憶装置の領域を確保する。変数Bは内部10進形式で主記憶装置の領域を確保する。変数Cは内部2進形式で主記憶装置の領域を確保する。 (1) There are a plurality of variables having different internal formats. The variable A secures an area of the main storage device in the external decimal format. The variable B reserves an area of the main storage device in the internal decimal format. The variable C secures an area of the main storage device in an internal binary format.
(2)同じ変数についてシンボル値と具体値とが混在する状況が生じる。具体的には、プログラムの110行目では、変数Aの2桁目のみを具体値「4」に書き換える。また、120行目では、変数Aの3桁目のみを具体値「9」に書き換える。一方、その他の桁は具体値ではなくシンボル値等である。 (2) A situation occurs in which symbol values and specific values are mixed for the same variable. Specifically, in the 110th line of the program, only the second digit of the variable A is rewritten to the specific value “4”. In the 120th line, only the third digit of the variable A is rewritten to the specific value “9”. On the other hand, the other digits are not concrete values but symbol values and the like.
(3)或る変数に格納される、シンボル値及び具体値の両方を含む値が、転記演算によって別の変数に転記され、また比較演算によって別の変数と比較される。具体的には、140行目においては、変数Aに格納されている値が、変数Bに転記され、150行目においては、変数Aに格納されている値が、変数Cに転記される。160行目および190行目においては、変数Aに格納されている値が変数B及び変数Cに格納されている値と比較される。 (3) A value including both a symbol value and a concrete value stored in a variable is transferred to another variable by a transfer operation, and compared with another variable by a comparison operation. Specifically, in line 140, the value stored in variable A is transferred to variable B, and in line 150, the value stored in variable A is transferred to variable C. On lines 160 and 190, the value stored in variable A is compared with the values stored in variable B and variable C.
シンボリック実行をする場合、160行目の「IF (変数A=変数B) THEN」においては、処理パスを網羅するため、真も偽も成立すべきである。しかし、以下で説明する本実施の形態の方法を用いない場合、140行目の「MOVE 変数A TO 変数B」および150行目「MOVE 変数A TO 変数C」の転記によって、例えば図2のように主記憶装置の領域が書き換えられる。具体的には、変数Aについては、アドレスA2及びA3に具体値が格納され、その他のアドレスにシンボル値等が格納される。変数Bについては、アドレスA5に具体値が格納され、その他のアドレスにシンボル値等が格納される。変数Cについては、アドレスA8に具体値が格納され、その他のアドレスにシンボル値等が格納される。なお、小数点の位置は別途レジスタ上に格納される。 When performing symbolic execution, “IF (variable A = variable B) THEN” on the 160th line should be true or false to cover the processing path. However, when the method of the present embodiment described below is not used, the “MOVE variable A TO variable B” on the 140th line and the “MOVE variable A TO variable C” on the 150th line are transferred, for example, as shown in FIG. The area of the main storage device is rewritten. Specifically, for variable A, specific values are stored at addresses A2 and A3, and symbol values and the like are stored at other addresses. For variable B, a specific value is stored at address A5, and a symbol value or the like is stored at other addresses. For variable C, a specific value is stored at address A8, and a symbol value or the like is stored at other addresses. Note that the position of the decimal point is separately stored in a register.
従って、160行目の「IF (変数A=変数B) THEN」においては、「[00][49][0_0]=[49][00]」が成立するか判定するので、真のみ成立するという結果になる。なお、本例では、括弧は1バイトを表し、例えば[00]であれば1バイトに「00」という値が格納される。また、末尾の値は符号部の値であり、本実施の形態においては、正の値、負の値、及び値無しの3とおりがある。 Accordingly, in “IF (variable A = variable B) THEN” on the 160th line, it is determined whether “[00] [49] [0_0] = [49] [00]” is satisfied, so only true is satisfied. Result. In this example, the parentheses represent 1 byte. For example, if [00], the value “00” is stored in 1 byte. The last value is the value of the sign part, and in the present embodiment, there are three values: a positive value, a negative value, and no value.
同様に、190行目の「IF (変数A=変数C) THEN」についても、シンボリック実行では真も偽も成立すべきである。しかし、本実施の形態を用いない場合、「[00][49][00]=[00][49][00]」が成立するか判定するので、真のみ成立するという結果になる。 Similarly, “IF (variable A = variable C) THEN” on the 190th line should be true or false in symbolic execution. However, when this embodiment is not used, since it is determined whether “[00] [49] [00] = [00] [49] [00]” is established, only true is obtained.
なお、COBOLの文法仕様により、値の比較時には、桁が不足する箇所に0が補完される。左辺及び右辺のいずれも末尾は符号部である。文法仕様については、例えば、「NetCOBOL V10.5 COBOL文法書(http://software.fujitsu.com/jp/manual/manualfiles/m120024/b1wd1361/06z000/b1wd-1361-06z0.pdf)」を参照のこと。 Note that, according to the COBOL grammar specification, when values are compared, 0 is supplemented in places where digits are insufficient. The end of both the left side and the right side is a sign part. For grammar specifications, see, for example, “NetCOBOL V10.5 COBOL Grammar Book (http://software.fujitsu.com/jp/manual/manualfiles/m120024/b1wd1361/06z000/b1wd-1361-06z0.pdf)” about.
このように、以下で説明する本実施の形態を用いない場合、同じ変数についてシンボル値と具体値とが混在する(すなわち、異なる桁にシンボル値及び具体値が存在する)状況において、転記が適切に行われなくなる。さらに、比較も適切に行われなくなる。すなわち、シンボリック実行であるにもかかわらず、分岐において真のみ成立すると判定してしまうので、偽である場合の処理パスを網羅することができなくなる。その結果、偽である場合の処理パスについてテストデータを抽出することができなくなる。 As described above, when the present embodiment described below is not used, in a situation where symbol values and specific values are mixed for the same variable (that is, symbol values and specific values exist in different digits), the transcription is appropriate. Will not be done. Furthermore, the comparison is not properly performed. That is, since it is determined that only true is established at a branch despite symbolic execution, it is not possible to cover the processing paths when it is false. As a result, test data cannot be extracted for the processing path in the case of false.
そこで、本実施の形態においては、以下で示すような形式で変数の値を保持することによって、シンボリック実行における演算の誤りを無くすことができるようにする。 Therefore, in the present embodiment, by holding variable values in the following format, it is possible to eliminate calculation errors in symbolic execution.
図3に、本実施の形態における情報処理装置10のブロック図を示す。情報処理装置10は、プログラム格納部6と、プログラム読み出し部51、命令実行装置52、カウンタ制御部53及び記録部54を含むシンボリック実行装置5と、実行履歴格納部4と、外部レジスタ3と、主記憶装置2と、シンボル値演算装置1とを有する。
FIG. 3 shows a block diagram of the
プログラム格納部6には、シンボリック実行の対象となるプログラムが格納される。プログラム読み出し部51は、プログラム格納部6に格納されているプログラムを読み出し、命令実行装置52に出力する。命令実行装置52は、プログラムを実行すると共に、所定の命令(本実施の形態では、転記命令及び比較命令)を、シンボル値演算装置1に出力する。また、命令実行装置52は、プログラムにおける演算の結果を外部レジスタ3に格納する。命令実行装置52は、プログラム読み出し部51から受け取ったプログラムの実行が完了すると、その旨をカウンタ制御部53に通知する。カウンタ制御部53は、プログラムカウンタを管理しており、プログラム読み出し部51による読み出しを制御する。記録部54は、命令実行装置52から受け取った情報に基づき実行履歴(例えば、パス条件等)を生成し、実行履歴格納部4に格納する。シンボル値演算装置1は、外部レジスタ3に格納されているデータ及び主記憶装置2に格納されているデータ等を用いて転記演算を行い、結果を主記憶装置2に格納する。また、シンボル値演算装置1は、主記憶装置2に格納されているデータを用いて比較演算を行い、結果を外部レジスタ3に格納する。
The program storage unit 6 stores a program to be subjected to symbolic execution. The
図4に、シンボル値演算装置1のブロック図を示す。シンボル値演算装置1は、命令デコーダ100と、読み出し部101と、第1転送処理部111及び第2転送処理部112を含む転送処理部110と、第1形式変換部121及び第2形式変換部122を含む第1変換部120と、第3形式変換部131及び第4形式変換部132を含む第2変換部130と、変換装置102と、データレジスタ103と、書き出し部104と、比較演算部105と、混合値生成部106とを有する。
FIG. 4 shows a block diagram of the symbol
命令デコーダ100は、シンボリック実行装置5から受け取った命令をデコードし、変数(本実施の形態においては、転記元変数及び転記先変数、又は、比較元変数及び比較先変数)の情報を特定する。そして、命令デコーダ100は、変数の情報及びデコードされた命令に基づく処理の実行を、読み出し部101に指示する。
The
読み出し部101は、命令デコーダ100からの指示に従い、外部レジスタ3から変数の値を読み出し又は主記憶装置2から変数の値を読み出す。読み出し部101は、命令が転記命令である場合には、読み出した転記元変数の値を転送処理部110に出力する。読み出し部101は、命令が比較命令である場合には、読み出した比較元変数及び比較先変数の値を比較演算部105に出力する。
The
第1転送処理部111は、読み出し部101から受け取った転記元変数の値(ここでは具体値)を、第1形式変換部121及び第3形式変換部131に出力する。第2転送処理部112は、読み出し部から受け取った転記元変数の値(ここではシンボル値)を、第2形式変換部122及び第4形式変換部132に出力する。
The first
第1形式変換部121は、第1転送処理部111から受け取った転記元変数の具体値の形式をパック形式(パック形式は、内部10進形式と同じである)に変換する処理を行い、処理結果を変換装置102に出力する。第2形式変換部122は、第2転送処理部112から受け取った転記元変数のシンボル値の形式を桁数形式に変換する処理を行い、処理結果を変換装置102に出力する。桁数形式は、桁毎に値を有する形式(すなわち、各要素が1桁の値を表す配列)である。
The first
第3形式変換部131は、第1転送処理部111から受け取った転記元変数の具体値及び命令デコーダ100から受け取った転記先変数の情報を用いて、データレジスタ103に格納されているパック形式の具体値を転記先変数の形式に変換する処理を行う。そして、第3形式変換部131は、処理結果を変換装置102に出力する。第4形式変換部132は、第2転送処理部112から受け取った転記元変数のシンボル値及び命令デコーダ100から受け取った転記先変数の情報を用いて、データレジスタ103に格納されている桁数形式の転記元変数のシンボル値を転記先変数の形式に変換する処理を行う。そして、第4形式変換部132は、処理結果を変換装置102に出力する。
The third
変換装置102は、第1変換部120から受け取った処理結果及び第2変換部130から受け取った処理結果をデータレジスタ103に格納する。
The
書き出し部104は、命令デコーダ100から受け取った転記先変数の情報を用いて、データレジスタ103に格納されているデータを、主記憶装置2に格納する。
The
比較演算部105は、混合値生成部106に、混合値の生成を指示する。混合値生成部106は、比較元の変数及び比較先の変数の各々について混合値を生成し、データレジスタ103に格納する。また、比較演算部105は、比較元の変数の混合値と比較先の変数の混合値とを比較する処理を行い、処理結果を外部レジスタ3に格納する。
The
なお、図4における太い矢印はデータの読み出しを表し、図4における太い点線の矢印はデータの書き出しを表す。 Note that the thick arrow in FIG. 4 represents data reading, and the thick dotted arrow in FIG. 4 represents data writing.
図5に、主記憶装置2に格納されるデータの一例を示す。図5の例では、各変数について、値が格納されるアドレスと、各アドレスに対応する具体値と、各アドレスに対応するシンボル値とが格納される。このように、主記憶装置2には、具体値が格納される領域とシンボル値が格納される領域とが別々に設けられる。アドレスA1乃至A8の各々は、1バイトの容量を有する格納領域のアドレスである。S1乃至S4、S6乃至S8、及びS10乃至S12はシンボル値を表し、F5、F9及びF13は符号部の値を表す。なお、内部2進形式においては、1バイトあたり2桁として記憶領域が確保される。図5において、アドレスA7に格納されているS11は変数Cの100の位に対応する。
FIG. 5 shows an example of data stored in the
図6に、外部レジスタ3に格納されるデータの一例を示す。図6の例では、各アドレスに対応する具体値と、各アドレスに対応するシンボル値とが格納される。「NA」は、値が空であることを表す。主記憶装置2と同様、外部レジスタ3には、具体値が格納される領域とシンボル値が格納される領域とが別々に設けられる。
FIG. 6 shows an example of data stored in the
次に、図7乃至図28を用いて、シンボル値演算装置1の動作について説明する。
Next, the operation of the symbol
まず、シンボル値演算装置1における命令デコーダ100は、シンボリック実行装置5から受け取った命令をデコードし、転記元変数及び転記先変数の情報、又は、比較元変数及び比較先変数の情報を特定する(図7:ステップS1)。ステップS1において特定される情報には、例えば、開始アドレス、データ長、開始位置の情報、桁数、小数部、及び変数の形式の情報等が含まれる。
First, the
読み出し部101は、命令デコーダから受け取った変数の情報に従い、変数の値を外部レジスタ3又は主記憶装置2から読み出す(ステップS3)。また、読み出し部101は、命令の種類が転記命令であるか判断する(ステップS5)。転記命令である場合(ステップS5:Yesルート)、読み出し部101は、読みだされた転記元変数の値を、転送処理部110に出力する。また、命令デコーダ100は、転記元変数及び転記先変数の情報を転送処理部110に出力し、転記元変数の情報を第1変換部120に出力し、転記先変数の情報を第2変換部130及び書き出し部104に出力する。
The
これに応じ、転送処理部110は、具体値の転記演算(ステップS7)及びシンボル値の転記演算(ステップS9)を実行する。はじめに、具体値の転記演算について、図8を用いて説明する。
In response to this, the
まず、転送処理部110における第1転送処理部111は、転記元変数の具体値を第1形式変換部121及び第3形式変換部131に出力する。第1形式変換部121は、転記元変数の具体値をパック形式に変換し、データレジスタ103のアドレスRAに格納する(図8:ステップS21)。なお、データレジスタ103への格納は、変換装置102が行う。
First, the first
第1転送処理部111は、命令デコーダ100から受け取った転記先変数の情報を用いて、転記元変数の小数値桁数と転記先変数の小数値桁数との差異を計算し、差異の分だけ、アドレスRAに格納されている変換後の具体値をシフトする(ステップS23)。すなわち、小数点の位置を合わせる処理を実行する。
The first
第1転送処理部111は、転記先変数の符号部に値が格納されていない場合には、ステップS23の処理が実行された後の具体値の符号部に、正の符号値を設定する(ステップS25)。
If no value is stored in the sign part of the transfer destination variable, the first
第1転送処理部111は、ステップS25の処理が実行された後の具体値を、転記先変数の桁数に格納できる桁数に変換する(ステップS27)。
The first
第3形式変換部131は、ステップS27の処理が実行された後の具体値を、命令デコーダ100から受け取った転記先変数の情報を用いて転記先変数の形式に変換し、データレジスタ103のアドレスRAに上書きする(ステップS29)。そして、呼び出し元の処理に戻る。なお、データレジスタ103への上書きは、変換装置102が行う。
The third
次に、シンボル値の転記演算について、図9を用いて説明する。 Next, the symbol value transfer operation will be described with reference to FIG.
まず、転送処理部110における第2転送処理部112は、転記元変数のシンボル値を第2形式変換部122及び第4形式変換部132に出力する。第2形式変換部122は、転記元変数のシンボル値を桁数形式に変換し、データレジスタ103のアドレスRBに格納する(図9:ステップS31)。なお、データレジスタ103への格納は、変換装置102が行う。
First, the second
ここで、第2形式変換部122が実行する、桁数形式への変換について図10を用いて説明する。まず、第2形式変換部122は、格納に使用するアドレスの数を計算する(図10:ステップS41)。ここで、格納に使用するアドレスの数は、(((元のデータ長)−1)/2+((元のデータ長)−1)%2)+1によって求める。「%」は、剰余を求めるための演算子であり、「%2」によって2で割った際の剰余を求めることができる。また、第2形式変換部122は、データレジスタ103のアドレスRBにおける末尾のアドレスから順に、変換後のシンボル値を格納する(ステップS43)。そして処理を終了する。
Here, the conversion to the digit number format performed by the second
図9の説明に戻り、第2転送処理部112は、命令デコーダ100から受け取った転記先変数の情報を用いて、転記元変数の小数値桁数と転記先変数の小数値桁数との差異を計算し、差異の分だけ、アドレスRBに格納されている変換後のシンボル値をシフトする(ステップS33)。すなわち、小数点の位置を合わせる処理を実行する。
Returning to the description of FIG. 9, the second
第2転送処理部112は、転記先変数の符号部に値が格納されていない場合には、ステップS33の処理が実行された後のシンボル値の符号部に、正の符号値を設定する(ステップS35)。
If no value is stored in the sign part of the transfer destination variable, the second
第2転送処理部112は、ステップS35の処理が実行された後のシンボル値を、転記先変数の桁数に格納できる桁数に変換する(ステップS37)。
The second
第4形式変換部132は、ステップS37の処理が実行された後のシンボル値を、命令デコーダ100から受け取った転記先変数の情報を用いて転記先変数の形式に変換し、データレジスタ103のアドレスRBに上書きする(ステップS39)。そして呼び出し元の処理に戻る。なお、データレジスタ103への上書きは、変換装置102が行う。
The fourth
図7の説明に戻り、書き出し部104は、データレジスタ103に格納されている具体値及びシンボル値を、主記憶装置2に書き出す(ステップS11)。そして処理を終了する。
Returning to the description of FIG. 7, the
以上のように、桁毎に値を有する形式で具体値及びシンボル値を管理すると共に、両者を別々の領域に保存することで、同じ変数における異なる桁に具体値とシンボル値とが存在するような場合であっても、適切な演算を行えるようになる。 As described above, the specific value and the symbol value are managed in a format having a value for each digit, and the two values are stored in different areas so that the specific value and the symbol value exist in different digits in the same variable. Even in such a case, an appropriate calculation can be performed.
また、変数がどのような形式であっても、一旦は共通の形式に変換するので、演算に用いられる部品を共通化することが容易になる。 In addition, since any variable format is once converted into a common format, it is easy to share components used for computation.
また、上で述べた例では、変数の値における或る桁に具体値が転記された場合に、シンボル値を空としている。これにより、変数の値における各桁が具体値及びシンボル値のいずれであるかを、シンボル値が空であるか否かによって判定できるようになる。 Further, in the example described above, when a specific value is transferred to a certain digit in the value of the variable, the symbol value is emptied. This makes it possible to determine whether each digit in the value of the variable is a specific value or a symbol value depending on whether the symbol value is empty.
ここで、上で説明した転記演算について具体例を示す。 Here, a specific example is shown about the transcription | transfer operation demonstrated above.
例えば、図5に示したデータが主記憶装置2に格納され、図6に示したデータが外部レジスタ3に格納されているとする。そして、以下のような転記命令があったとする。
・転記元の具体値は、開始アドレスがR1であり、データ長が1であり、開始位置が1(桁目)であり、桁数が1であり、小数部が0であり、形式が外部10進形式である。
・転記先変数(変数A)は、開始アドレスがA1であり、データ長が4であり、開始位置が2であり、桁数が1であり、小数部が0であり、形式が外部10進形式である。
For example, assume that the data shown in FIG. 5 is stored in the
-The specific value of the transfer source is that the start address is R1, the data length is 1, the start position is 1 (digit), the number of digits is 1, the decimal part is 0, and the format is external Decimal format.
The transfer destination variable (variable A) has a start address of A1, a data length of 4, a start position of 2, a number of digits of 1, a decimal part of 0, and a format of external decimal Format.
図11に、上で述べたような状況においてデータレジスタ103に格納される具体値の変化を示す。図11の例では、最初の段階で具体値[4]がデータレジスタ103に格納されており、その後、第1転送処理部111の処理等を経た後も、変化がない。
FIG. 11 shows changes in specific values stored in the data register 103 in the situation described above. In the example of FIG. 11, the specific value [4] is stored in the data register 103 at the initial stage, and does not change after the processing of the first
図12に、上で述べたような状況においてデータレジスタ103に格納されるシンボル値の変化を示す。図12の例では、最初の段階でシンボル値[NA]がデータレジスタ103に格納されており、その後、第2転送処理部112の処理等を経た後も、変化がない。これは、上で述べた命令が具体値の転記命令であり、転送元にシンボル値が無いからである。
FIG. 12 shows changes in symbol values stored in the data register 103 in the situation described above. In the example of FIG. 12, the symbol value [NA] is stored in the data register 103 at the initial stage, and does not change after the processing of the second
図13に、上で述べた転記命令における具体値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図13においては、図5に示したデータと異なる部分に色が付されている。データレジスタ103における具体値[4]は、主記憶装置2におけるアドレスA2に格納されている。この段階では、シンボル値は格納されていない。
FIG. 13 shows an example of data stored in the
図14に、上で述べた転記命令におけるシンボル値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図14においては、図5に示したデータと異なる部分に色が付されている。データレジスタ103におけるシンボル値[NA]は、主記憶装置2におけるアドレスA2に格納されている。但し、具体値とシンボル値とは別々の領域に格納されている。
FIG. 14 shows an example of data stored in the
また、例えば図15に示したデータが主記憶装置2に格納されている状態において、以下のような転記命令があったとする。
・転記元変数(変数A)の具体値は、開始アドレスがA1であり、データ長が4であり、開始位置が1であり、桁数が4であり、小数部が2であり、形式が外部10進形式である。
・転記先変数(変数B)は、開始アドレスがA5であり、データ長が2であり、開始位置が1であり、桁数が3であり、小数部が2であり、形式が内部10進形式である。
Further, for example, in the state where the data shown in FIG.
The specific value of the transfer source variable (variable A) is that the start address is A1, the data length is 4, the start position is 1, the number of digits is 4, the decimal part is 2, and the format is External decimal format.
-The transfer destination variable (variable B) has a start address of A5, a data length of 2, a start position of 1, a number of digits of 3, a decimal part of 2, and a format of internal decimal Format.
図16に、上で述べたような状況においてデータレジスタ103に格納される具体値の変化を示す。図16の例では、最初の段階で具体値[0][4][9][00]が主記憶装置2から読み出され、第1形式変換部121の処理によって、[00][49][00]というパック形式に変換される。さらに、第1転送処理部111の処理によって、[49][00]という形式に変換される。
FIG. 16 shows changes in specific values stored in the data register 103 in the situation described above. In the example of FIG. 16, the specific values [0] [4] [9] [00] are read from the
図17に、上で述べたような状況においてデータレジスタ103に格納されるシンボル値の変化を示す。図17の例では、最初の段階でシンボル値[S1][NA][NA][S4_F5]が主記憶装置2から読み出され、第2形式変換部122の処理によって、[NA_S1][NA_NA][S4_F5]という桁数形式に変換される。さらに、第2転送処理部112の処理によって、[NA_NA][S4_F5]という形式に変換される。
FIG. 17 shows changes in symbol values stored in the data register 103 in the situation described above. In the example of FIG. 17, the symbol value [S1] [NA] [NA] [S4_F5] is read from the
図18に、上で述べた転記命令における具体値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図18においては、図15に示したデータと異なる部分に色が付されている。変数Bは内部10進形式であるため、アドレスA5に具体値「4」及び具体値「9」が格納される。この段階では、シンボル値は格納されていない。
FIG. 18 shows an example of data stored in the
図19に、上で述べた転記命令におけるシンボル値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図19においては、図15に示したデータと異なる部分に色が付されている。アドレスA5における、シンボル値を格納する領域に、具体値「4」に対応するシンボル値「NA」及び具体値「9」に対応するシンボル値「NA」が格納される。
FIG. 19 shows an example of data stored in the
また、例えば図19に示したデータが主記憶装置2に格納されている状態において、以下のような転記命令があったとする。
・転記元変数(変数A)の具体値は、開始アドレスがA1であり、データ長が4であり、開始位置が1であり、桁数が4であり、小数部が2であり、形式が外部10進形式である。
・転記先変数(変数C)は、開始アドレスがA7であり、データ長が2であり、開始位置が1であり、桁数が3であり、小数部が1であり、形式が内部2進形式である。
Further, for example, in the state where the data shown in FIG.
The specific value of the transfer source variable (variable A) is that the start address is A1, the data length is 4, the start position is 1, the number of digits is 4, the decimal part is 2, and the format is External decimal format.
-The transfer destination variable (variable C) has a start address of A7, a data length of 2, a start position of 1, a number of digits of 3, a decimal part of 1, and a format of internal binary Format.
図20に、上で述べたような状況においてデータレジスタ103に格納される具体値の変化を示す。図20の例では、最初の段階で具体値[0][4][9][00]が主記憶装置2から読み出され、第1形式変換部121の処理によって、[00][49][00]というパック形式に変換される。また、第1転送処理部111が、小数点の位置を合わせるため、右シフトして[04][90]という形式にする。さらに、第3形式変換部131の処理によって、[0x00][0x31]という転記先変数の形式に変換される。
FIG. 20 shows changes in specific values stored in the data register 103 in the situation described above. In the example of FIG. 20, the specific values [0] [4] [9] [00] are read from the
図21に、上で述べたような状況においてデータレジスタ103に格納されるシンボル値の変化を示す。図21の例では、最初の段階でシンボル値[S1][NA][NA][S4_F5]が主記憶装置2から読み出され、第2形式変換部122の処理によって、[NA_S1][NA_NA][S4_F5]という桁数形式に変換される。また、第2転送処理部112が、小数点の位置を合わせるため、右シフトして[S1_NA][NA_F5]という形式にする。
FIG. 21 shows changes in symbol values stored in the data register 103 in the situation as described above. In the example of FIG. 21, the symbol value [S1] [NA] [NA] [S4_F5] is read from the
図22に、上で述べた転記命令における具体値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図22においては、図19に示したデータと異なる部分に色が付されている。変数Cは内部2進形式であるため、アドレスA7に具体値「0x00」が格納され、アドレスA8に具体値「0x31」が格納される。この段階では、シンボル値は格納されていない。
FIG. 22 shows an example of data stored in the
図23に、上で述べた転記命令におけるシンボル値の転記が終了した際に主記憶装置2に格納されるデータの一例を示す。図23においては、図19に示したデータと異なる部分に色が付されている。アドレスA7における、シンボル値を格納する領域に、具体値「0x00」に対応するシンボル値「S1」及び「NA」が格納され、アドレスA8における、シンボル値を格納する領域に、具体値「0x31」に対応するシンボル値「NA」が格納される。
FIG. 23 shows an example of data stored in the
図7の説明に戻り、ステップS5において命令の種類は転記ではない場合(ステップS5:Noルート)、命令の種類は比較である。よって、読み出し部101は、読みだされた比較元変数の値及び比較先変数の値を、比較演算部105に出力する。そして、比較演算部105は、比較演算を実行する(ステップS13)。比較演算については、図24及び図25を用いて説明する。
Returning to the description of FIG. 7, if the instruction type is not transcription in step S5 (step S5: No route), the instruction type is comparison. Therefore, the
まず、比較演算部105は、比較元変数の値及び比較先変数の値を、混合値生成部106に出力する。これに応じ、混合値生成部106は、比較元変数及び比較先変数の各々について、混合値生成処理を実行する(図24:ステップS51)。混合値生成処理については、図25を用いて説明する。
First, the
まず、混合値生成部106は、比較元変数のシンボル値及び比較先変数のシンボル値の形式を、桁数形式に変換し、データレジスタ103のアドレスRAに格納する(図25:ステップS61)。なお、ステップS61において、混合値生成部106は、第1変換部120における第2形式変換部122に変換を実行させる。
First, the mixed
混合値生成部106は、比較元変数の具体値及び比較先変数の具体値の形式を、パック形式に変換し、データレジスタ103のアドレスRBに格納する(ステップS63)。なお、ステップS63において、混合値生成部106は、第1変換部120における第1形式変換部121に変換を実行させる。
The mixed
混合値生成部106は、アドレスRAに格納されている、比較元変数のシンボル値及び比較先変数のシンボル値において、空である桁が有るか判断する(ステップS65)。空である桁が無い場合(ステップS65:Noルート)、呼び出し元の処理に戻る。一方、空である桁が有る場合(ステップS65:Yesルート)、空である桁に、アドレスRBに格納されている具体値における同じ桁の値を設定する(ステップS67)。そして呼び出し元の処理に戻る。例えば、比較元変数のシンボル値における3桁目が空である場合は、比較元変数の具体値における3桁目の値を設定する。また、例えば、比較先変数のシンボル値における2桁目が空である場合は、比較先変数の具体値における2桁目の値を設定する。上で述べたように、シンボル値の桁のうち空である桁には、具体値が存在する。
The mixed
以上のような処理を実行すれば、具体値及びシンボル値が異なる桁に存在する値を生成できるようになる。 By executing the processing as described above, it is possible to generate values in which specific values and symbol values exist in different digits.
図24の説明に戻り、比較演算部105は、混合値生成処理により生成された2つの混合値について、小数値桁数の差異を計算し、差異の分だけ、小数の桁数が少ない方の混合値を左シフトする(ステップS53)。すなわち、小数点の位置を調整する処理を実行する。
Returning to the description of FIG. 24, the
比較演算部105は、比較元の混合値及び比較先の混合値のいずれかに符号が無い(すなわち、符号部に値が無い)場合には、両者の符号部に正の符号値を設定する(ステップS55)。
When there is no sign in either the comparison source mixed value or the comparison target mixed value (that is, the sign part has no value), the
比較演算部105は、充足可能性の判定を行う(ステップS57)。なお、充足可能性の判定は、制約ソルバ等を用いて行ってもよい。制約ソルバについては、例えば、上で示した非特許文献1を参照のこと。
The
比較演算部105は、充足可能性の判定結果を外部レジスタ3に格納する(ステップS59)。そして、図7の説明に戻り、処理を終了する。
The
図26に、ステップS59の処理によって外部レジスタ3に格納されるデータの一例を示す。図26の例では、アドレスRTに、分岐条件が真である状態を充足するか否かを表す情報が格納され、アドレスRFに、分岐条件が偽である状態を充足するか否かを表す情報が格納される。図26の例では、「1」であれば条件が成立することを表し、「0」であれば条件が成立しないことを表す。従って、本例では、分岐条件が真である状態と偽である状態との両方を充足する。
FIG. 26 shows an example of data stored in the
例えば、図1に示したプログラムの140行目「MOVE 変数A TO 変数B」および150行目「MOVE 変数A TO 変数C」の転記演算によって、図23に示したデータが主記憶装置2に格納されたとする。そして、そのデータを用いて、160行目「IF (変数A=変数B) THEN」において、混合値[0_S1][4_9][S4_F5]と混合値[4_9][S4_F5]との比較を行うとする。ここで、S1の値が0以外なら(変数A=変数B)の分岐条件は偽であり、S1の値が0なら(変数A=変数B)の分岐条件は真である。
For example, the data shown in FIG. 23 is stored in the
また、190行目「IF (変数A=変数C) THEN」において、混合値[0_S1][4_9][S4_F5]」と混合値[0_S1][4_9][0_F5]」との比較を行うとする。ここで、S4の値が0以外なら(変数A=変数C)の分岐条件は偽であり、S4の値が0なら(変数A=変数C)の分岐条件は真である。 Also, in line 190 “IF (variable A = variable C) THEN”, the mixed value [0_S1] [4_9] [S4_F5] ”and the mixed value [0_S1] [4_9] [0_F5]” are compared. . Here, if the value of S4 is other than 0 (variable A = variable C), the branch condition is false, and if the value of S4 is 0 (variable A = variable C), the branch condition is true.
よって、本実施の形態の方法によれば、分岐条件について真及び偽の両方が成立すると判定され、両方の処理パスを実行することができる。これにより、シンボリック実行において、処理パスを網羅することができるので、テストデータの抽出漏れが無くなる。 Therefore, according to the method of the present embodiment, it is determined that both true and false are satisfied for the branch condition, and both processing paths can be executed. As a result, the processing paths can be covered in symbolic execution, so that there is no omission of test data extraction.
ここで、上で説明した混合値生成について具体例を示す。 Here, a specific example of the mixed value generation described above will be shown.
図27に、変数Aについての混合値生成の一例を示す。図27の例では、主記憶装置2に、図23に示したデータが格納されているとする。この場合、まず主記憶装置2から変数Aの具体値[0][4][9][00]が読み出され、また、主記憶装置2から変数Aのシンボル値[S1][NA][NA][S4_F5]が読み出される。具体値[0][4][9][00]は、第1形式変換部121の処理によって[00][49][00]というパック形式に変換される。また、シンボル値[S1][NA][NA][S4_F5]は、第2形式変換部122の処理によって[NA_S1][NA_NA][S4_F5]という桁数形式に変換される。そして、混合値生成部106が、具体値[00][49][00]及びシンボル値[NA_S1][NA_NA][S4_F5]によって混合値を生成すると、[0_S1][4_9][S4_F5]になる。
FIG. 27 shows an example of mixed value generation for variable A. In the example of FIG. 27, it is assumed that the data shown in FIG. In this case, first, the specific value [0] [4] [9] [00] of the variable A is read from the
図28に、変数Cについての混合値生成の一例を示す。図28の例では、主記憶装置2に、図23に示したデータが格納されているとする。この場合、まず主記憶装置2から変数Cの具体値[0x00][0x31]が読み出され、また、主記憶装置2から変数Cのシンボル値[S1][NA][NA][S4_F5]が読み出される。具体値[0x00][0x31]は、第1形式変換部121の処理によって[04][90]というパック形式に変換される。また、シンボル値[S1][NA][NA][S4_F5]は、第2形式変換部122の処理によって[S1_NA][NA_F5]という桁数形式に変換される。そして、混合値生成部106が、具体値[04][90]及びシンボル値[S1_NA][NA_F5]によって混合値を生成すると、[S1_4][9_F5]になる。なお、比較演算部105が、変数Aについての混合値と小数点の位置を合わせる処理を実行すると、最終的に、混合値は[0_S1][4_9][0_F5]という形式になる。
FIG. 28 shows an example of mixed value generation for variable C. In the example of FIG. 28, it is assumed that the data shown in FIG. In this case, first, the specific value [0x00] [0x31] of the variable C is read from the
以上本発明の一実施の形態を説明したが、本発明はこれに限定されるものではない。例えば、上で説明した情報処理装置10の機能ブロック構成は実際のモジュール構成に一致しない場合もある。
Although one embodiment of the present invention has been described above, the present invention is not limited to this. For example, the functional block configuration of the
また、上で説明した各テーブルの構成は一例であって、上記のような構成でなければならないわけではない。さらに、処理フローにおいても、処理結果が変わらなければ処理の順番を入れ替えることも可能である。さらに、並列に実行させるようにしても良い。 Further, the configuration of each table described above is an example, and the configuration as described above is not necessarily required. Further, in the processing flow, the processing order can be changed if the processing result does not change. Further, it may be executed in parallel.
例えば、上で述べた例では、具体値の転記処理を実行した後にシンボル値の転記処理を実行するが、両者を並列に実行してもよい。 For example, in the example described above, the symbol value transfer process is executed after the specific value transfer process is executed, but both may be executed in parallel.
また、1バイトに2桁の値を保持する形式を桁数形式としたが、言語がサポートする形式によって、桁数形式を変更してもよい。例えば、1バイトに1桁の値を格納する形式にしてもよいし、1バイトに4桁の値を格納する形式にしてもよい。 In addition, although the format for holding a 2-digit value in one byte is the digit number format, the digit number format may be changed depending on the format supported by the language. For example, a format in which a 1-digit value is stored in 1 byte or a format in which a 4-digit value is stored in 1 byte may be used.
以上述べた本発明の実施の形態をまとめると、以下のようになる。 The embodiment of the present invention described above is summarized as follows.
本実施の形態の第1の態様に係る演算装置は、(A)シンボリック実行における演算の対象である第1の変数の具体値を、桁毎に値を有する形式である第1の形式に変換すると共に、第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換する第1変換部と、(B)第1変換部による変換後の具体値を、第1の記憶領域に格納すると共に、第1変換部による変換後のシンボル値を、第1の記憶領域とは異なる第2の記憶領域に格納する第1格納処理部とを有する。 The arithmetic device according to the first aspect of the present embodiment converts (A) the specific value of the first variable that is the target of the calculation in symbolic execution into the first format that has a value for each digit. In addition, a first conversion unit that converts the symbol value of the first variable into a second format that has a value for each digit, and (B) a specific value after conversion by the first conversion unit, And a first storage processing unit that stores the symbol value after conversion by the first conversion unit in a second storage region different from the first storage region.
このようにすれば、シンボリック実行において変数の演算を適切に行えるようになる。具体的には、同じ変数における異なる桁に具体値とシンボル値とが存在するような場合であっても、演算の誤りを無くせるようになる。さらに、変数がどのような形式であったとしても、共通の形式に変換するので、転記演算等に用いられる部品を共通化しやすくなる。 In this way, it is possible to appropriately perform variable operations in symbolic execution. More specifically, even when the specific value and the symbol value exist in different digits in the same variable, it is possible to eliminate an operation error. Furthermore, since the variable is converted into a common format no matter what the format is, it is easy to share the parts used for the transfer operation or the like.
また、上で述べた演算装置が、(C)第1の記憶領域に格納された具体値を、転記先の変数である第2の変数の形式に変換すると共に、第2の記憶領域に格納されたシンボル値を、第2の変数の形式に変換する第2変換部と、(D)第2変換部による変換後の具体値を第3の記憶領域に格納すると共に、第2変換部による変換後のシンボル値を、第3の記憶領域とは異なる第4の記憶領域に格納する第2格納処理部とをさらに有してもよい。このようにすれば、シンボリック実行において変数の間で転記演算を行えるようになる。 In addition, the arithmetic device described above converts (C) the specific value stored in the first storage area into the format of the second variable that is the transfer destination variable, and stores it in the second storage area. A second conversion unit that converts the converted symbol value into a second variable format; and (D) a specific value after conversion by the second conversion unit is stored in the third storage area, and by the second conversion unit. You may further have the 2nd storage process part which stores the symbol value after conversion in the 4th storage area different from a 3rd storage area. In this way, a transcription operation can be performed between variables in symbolic execution.
また、上で述べた演算装置が、(E)第2変換部による変換の実行前に、具体値及びシンボル値の各々について、小数点の位置を第2の変数に合わせる処理をすると共に、桁数を第2の変数の桁数に合わせる処理を行う第1処理部をさらに有してもよい。これにより、転記演算が適切に行われるようになる。 In addition, the arithmetic unit described above (E) performs processing for adjusting the position of the decimal point to the second variable for each of the concrete value and the symbol value before the conversion by the second conversion unit, and the number of digits. You may further have a 1st process part which performs the process which adjusts to the number of digits of a 2nd variable. Thereby, a transcription | transfer operation comes to be performed appropriately.
また、上で述べた演算装置が、(F)第2の記憶領域に格納されたシンボル値の桁のうち空である桁を第1の記憶領域に格納された具体値の同じ桁で置換して第1の混合値を生成すると共に、第5の記憶領域に格納された具体値を第1の形式に変換し、第6の記憶領域に格納されたシンボル値を第2の形式に変換し、変換後のシンボル値の桁のうち空である桁を、変換後の具体値における同じ桁で置換して第2の混合値を生成する生成部と、(G)第1の混合値と第2の混合値との比較を行う比較部とをさらに有してもよい。このようにすれば、シンボリック実行において変数の間で比較演算を行えるようになる。 In addition, the arithmetic unit described above replaces (F) an empty digit among the digits of the symbol value stored in the second storage area with the same digit of the specific value stored in the first storage area. To generate the first mixed value, convert the specific value stored in the fifth storage area into the first format, and convert the symbol value stored in the sixth storage area into the second format. A generation unit that generates a second mixed value by replacing an empty digit in the converted symbol value digits with the same digit in the converted concrete value, and (G) the first mixed value and the first You may further have a comparison part which compares with 2 mixed values. In this way, comparison operations can be performed between variables in symbolic execution.
また、上で述べた比較部は、(g1)第1の混合値の小数点の位置と、第2の混合値の小数点の位置とを合わせる処理をしてもよい。このようにすれば、比較演算が適切に行われるようになる。 Further, the comparison unit described above may perform (g1) a process of matching the decimal point position of the first mixed value with the decimal point position of the second mixed value. In this way, the comparison operation is appropriately performed.
本実施の形態の第2の態様に係る演算方法は、(H)シンボリック実行における演算の対象である第1の変数の具体値を、桁毎に値を有する形式である第1の形式に変換し、第1の記憶領域に格納し、(I)第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換し、第1の記憶領域とは異なる第2の記憶領域に格納する処理を含む。 The calculation method according to the second aspect of the present embodiment converts (H) the specific value of the first variable that is the object of calculation in symbolic execution into the first format that has a value for each digit. (I) a symbol value of the first variable is converted to a second format that has a value for each digit, and is different from the first storage region. Including the process of storing in the storage area.
なお、上記方法による処理をコンピュータに行わせるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブルディスク、CD−ROM、光磁気ディスク、半導体メモリ、ハードディスク等のコンピュータ読み取り可能な記憶媒体又は記憶装置に格納される。尚、中間的な処理結果はメインメモリ等の記憶装置に一時保管される。 A program for causing a computer to perform the processing according to the above method can be created. The program can be a computer-readable storage medium such as a flexible disk, a CD-ROM, a magneto-optical disk, a semiconductor memory, a hard disk, or the like. It is stored in a storage device. The intermediate processing result is temporarily stored in a storage device such as a main memory.
以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。 The following supplementary notes are further disclosed with respect to the embodiments including the above examples.
(付記1)
シンボリック実行における演算の対象である第1の変数の具体値を、桁毎に値を有する形式である第1の形式に変換すると共に、前記第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換する第1変換部と、
前記第1変換部による変換後の具体値を、第1の記憶領域に格納すると共に、前記第1変換部による変換後のシンボル値を、前記第1の記憶領域とは異なる第2の記憶領域に格納する第1格納処理部と、
を有する演算装置。
(Appendix 1)
The specific value of the first variable that is the object of the operation in the symbolic execution is converted to the first format that has a value for each digit, and the symbol value of the first variable is changed to a value for each digit. A first conversion unit for converting to a second format which is a format having
A specific value after conversion by the first conversion unit is stored in a first storage area, and a symbol value after conversion by the first conversion unit is stored in a second storage area different from the first storage area. A first storage processing unit for storing in
A computing device having
(付記2)
前記第1の記憶領域に格納された具体値を、転記先の変数である第2の変数の形式に変換すると共に、前記第2の記憶領域に格納されたシンボル値を、前記第2の変数の形式に変換する第2変換部と、
前記第2変換部による変換後の具体値を第3の記憶領域に格納すると共に、前記第2変換部による変換後のシンボル値を、前記第3の記憶領域とは異なる第4の記憶領域に格納する第2格納処理部と、
をさらに有する付記1記載の演算装置。
(Appendix 2)
The specific value stored in the first storage area is converted into the format of a second variable that is a transfer destination variable, and the symbol value stored in the second storage area is converted into the second variable. A second conversion unit for converting to the format of
The specific value after conversion by the second conversion unit is stored in a third storage area, and the symbol value after conversion by the second conversion unit is stored in a fourth storage area different from the third storage area. A second storage processing unit for storing;
The arithmetic unit according to
(付記3)
前記第2変換部による変換の実行前に、前記具体値及びシンボル値の各々について、小数点の位置を前記第2の変数に合わせる処理をすると共に、桁数を前記第2の変数の桁数に合わせる処理をする第1処理部
をさらに有する付記2記載の演算装置。
(Appendix 3)
Before executing the conversion by the second conversion unit, for each of the specific value and the symbol value, a process for adjusting the position of the decimal point to the second variable and setting the number of digits to the number of digits of the second variable The arithmetic unit according to
(付記4)
前記第2の記憶領域に格納されたシンボル値の桁のうち空である桁を前記第1の記憶領域に格納された具体値の同じ桁で置換して第1の混合値を生成すると共に、第5の記憶領域に格納された具体値を前記第1の形式に変換し、第6の記憶領域に格納されたシンボル値を前記第2の形式に変換し、変換後の前記シンボル値の桁のうち空である桁を、変換後の前記具体値における同じ桁で置換して第2の混合値を生成する生成部と、
前記第1の混合値と前記第2の混合値との比較を行う比較部と、
をさらに有する付記1乃至3のいずれか1つ記載の演算装置。
(Appendix 4)
Generating a first mixed value by replacing an empty digit among the digits of the symbol value stored in the second storage area with the same digit of the specific value stored in the first storage area; The specific value stored in the fifth storage area is converted into the first format, the symbol value stored in the sixth storage area is converted into the second format, and the digit of the symbol value after conversion A generation unit that generates a second mixed value by replacing an empty digit by the same digit in the converted concrete value;
A comparison unit for comparing the first mixed value and the second mixed value;
The arithmetic unit according to any one of
(付記5)
前記比較部は、
前記第1の混合値の小数点の位置と、前記第2の混合値の小数点の位置とを合わせる処理をする
ことを特徴とする付記4記載の演算装置。
(Appendix 5)
The comparison unit includes:
The arithmetic unit according to
(付記6)
シンボリック実行における演算の対象である第1の変数の具体値を、桁毎に値を有する形式である第1の形式に変換し、第1の記憶領域に格納し、
前記第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換し、前記第1の記憶領域とは異なる第2の記憶領域に格納する
処理を演算装置が実行する演算方法。
(Appendix 6)
The specific value of the first variable that is the target of the operation in symbolic execution is converted into a first format that has a value for each digit, and is stored in the first storage area.
The arithmetic unit executes a process of converting the symbol value of the first variable into a second format which is a format having a value for each digit and storing the symbol value in a second storage area different from the first storage area Calculation method to be performed.
1 シンボル値演算装置 2 主記憶装置
3 外部レジスタ 4 実行履歴格納部
5 シンボリック実行装置 51 プログラム読み出し部
52 命令実行装置 53 カウンタ制御部
54 記録部 6 プログラム格納部
10 情報処理装置 100 命令デコーダ
101 読み出し部 102 変換装置
103 データレジスタ 104 書き出し部
105 比較演算部 106 混合値生成部
110 転送処理部 111 第1転送処理部
112 第2転送処理部 120 第1変換部
121 第1形式変換部 122 第2形式変換部
130 第2変換部 131 第3形式変換部
132 第4形式変換部
DESCRIPTION OF
Claims (4)
前記第1の変数の具体値の変換後の具体値である第1の具体値を、第1の記憶領域に格納し、前記第1変数のシンボル値の変換後のシンボル値である第1のシンボル値を、前記第1の記憶領域とは異なる第2の記憶領域に格納し、前記第2の変数の具体値の変換後の具体値である第2の具体値を、第3の記憶領域に格納し、前記第2の変数のシンボル値の変換後のシンボル値である第2のシンボル値を、前記第3の記憶領域とは異なる第4の記憶領域に格納する第1格納処理部と、
前記第2の記憶領域に格納された前記第1のシンボル値の桁のうち空である桁を、前記第1の記憶領域に格納された前記第1の具体値の同じ桁で置換して第1の混合値を生成し、前記第4の記憶領域に格納された前記第2のシンボル値の桁のうち空である桁を、前記第3の記憶領域に格納された前記第2の具体値の同じ桁で置換して第2の混合値を生成する生成部と、
前記第1の混合値と前記第2の混合値との比較を行う比較部と、
を有する演算装置。 The specific value of the first variable that is the target of the operation in symbolic execution is converted to the first format that has a value for each digit, and the symbol value of the first variable has a value for each digit. Is converted to the second format, and the specific value of the second variable that is the target of the operation in the symbolic execution is converted to the first format, and the symbol value of the second variable is converted to the second variable. A first conversion unit for converting to a format of 2 ,
The first specific value, which is the specific value after conversion of the specific value of the first variable , is stored in the first storage area, and the first symbol value after conversion of the symbol value of the first variable is the first value A symbol value is stored in a second storage area different from the first storage area, and a second specific value that is a converted specific value of the second variable is stored in a third storage area. A first storage processing unit for storing a second symbol value, which is a symbol value after conversion of the symbol value of the second variable, in a fourth storage area different from the third storage area ; ,
An empty digit among the digits of the first symbol value stored in the second storage area is replaced with the same digit of the first concrete value stored in the first storage area. 1 is generated, and an empty digit among the digits of the second symbol value stored in the fourth storage area is replaced with the second specific value stored in the third storage area. Generating a second mixed value by replacing with the same digit of
A comparison unit for comparing the first mixed value and the second mixed value;
A computing device having
前記第2変換部による変換後の前記第1の具体値を第5の記憶領域に格納すると共に、前記第2変換部による変換後の前記第1のシンボル値を、前記第5の記憶領域とは異なる第6の記憶領域に格納する第2格納処理部と、
をさらに有する請求項1記載の演算装置。 Wherein the first of said first specific value stored in the storage area, and converts the third type of variable is a transfer destination variable, the second of said first symbol stored in the storage area A second conversion unit for converting a value into the format of the third variable;
The first specific value after conversion by the second conversion unit is stored in a fifth storage area, and the first symbol value after conversion by the second conversion unit is stored in the fifth storage area. A second storage processing unit for storing in a different sixth storage area;
The arithmetic device according to claim 1, further comprising:
前記第1の混合値の小数点の位置と、前記第2の混合値の小数点の位置とを合わせる処理をするA process of matching the decimal point position of the first mixed value with the decimal point position of the second mixed value.
請求項1又は2記載の演算装置。The arithmetic device according to claim 1 or 2.
前記第1の変数のシンボル値を、桁毎に値を有する形式である第2の形式に変換し、変換後のシンボル値である第1のシンボル値を、前記第1の記憶領域とは異なる第2の記憶領域に格納し、
前記第2の記憶領域に格納された前記第1のシンボル値の桁のうち空である桁を、前記第1の記憶領域に格納された前記第1の具体値の同じ桁で置換して第1の混合値を生成し、
前記シンボリック実行における演算の対象である第2の変数の具体値を、前記第1の形式に変換し、変換後の具体値である第2の具体値を第3の記憶領域に格納し、
前記第2の変数のシンボル値を、前記第2の形式に変換し、変換後のシンボル値である第2のシンボル値を、前記第3の記憶領域とは異なる第4の記憶領域に格納し、
前記第4の記憶領域に格納された前記第2のシンボル値の桁のうち空である桁を、前記第3の記憶領域に格納された前記第2の具体値の同じ桁で置換して第2の混合値を生成し、
前記第1の混合値と前記第2の混合値との比較を行う、
処理を演算装置が実行する演算方法。 The specific value of the first variable that is the target of the operation in the symbolic execution is converted to the first format that has a value for each digit, and the first specific value that is the converted specific value is the first value Store it in the storage area,
The symbol value of the first variable is converted to a second format that has a value for each digit, and the first symbol value that is the converted symbol value is different from that of the first storage area. Stored in the second storage area ,
An empty digit among the digits of the first symbol value stored in the second storage area is replaced with the same digit of the first concrete value stored in the first storage area. Produces a blend value of 1
Converting the specific value of the second variable that is the object of the calculation in the symbolic execution into the first format, storing the second specific value that is the converted specific value in the third storage area,
The symbol value of the second variable is converted into the second format, and the converted second symbol value is stored in a fourth storage area different from the third storage area. ,
An empty digit among the digits of the second symbol value stored in the fourth storage area is replaced with the same digit of the second concrete value stored in the third storage area. Produces a mixed value of 2
Making a comparison between the first blend value and the second blend value;
An arithmetic method in which the arithmetic device executes processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013206973A JP6260179B2 (en) | 2013-10-02 | 2013-10-02 | Arithmetic apparatus and arithmetic method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013206973A JP6260179B2 (en) | 2013-10-02 | 2013-10-02 | Arithmetic apparatus and arithmetic method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015072538A JP2015072538A (en) | 2015-04-16 |
JP6260179B2 true JP6260179B2 (en) | 2018-01-17 |
Family
ID=53014876
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013206973A Active JP6260179B2 (en) | 2013-10-02 | 2013-10-02 | Arithmetic apparatus and arithmetic method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6260179B2 (en) |
-
2013
- 2013-10-02 JP JP2013206973A patent/JP6260179B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015072538A (en) | 2015-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105278921B (en) | For eliminating the instruction set of unjustified memory access during handling the array with unjustified data line | |
WO2010087144A1 (en) | Parallel comparison/selection operation device, processor and parallel comparison/selection operation method | |
US10768931B2 (en) | Fine-grained management of exception enablement of floating point controls | |
US10671386B2 (en) | Compiler controls for program regions | |
US10732930B2 (en) | Compiler controls for program language constructs | |
US10564967B2 (en) | Move string processing via inline decode-based micro-operations expansion | |
US10684852B2 (en) | Employing prefixes to control floating point operations | |
WO2015159501A1 (en) | Verification property integration device, verification property integration method, and recording medium having verification property integration program stored therein | |
US10740067B2 (en) | Selective updating of floating point controls | |
JP6260179B2 (en) | Arithmetic apparatus and arithmetic method | |
JP2011253253A (en) | Computer testing method, computer testing device and computer testing program | |
CN110914801B (en) | Vector interleaving in a data processing device | |
JP6079201B2 (en) | Symbolic execution method, symbolic execution program, and symbolic execution device | |
US9047343B2 (en) | Find regular expression instruction on substring of larger string | |
JP2017207843A (en) | Metadata registration method, metadata registration program and metadata registration device | |
JP6583033B2 (en) | Driver generation program, apparatus, and method | |
AU2019469404B2 (en) | Secret multiple repetition calculation apparatus, method and program | |
JP2010282248A (en) | Programming language analysis execution program | |
JP3753572B2 (en) | Simulation system and instruction simulation method | |
WO2011099104A1 (en) | File name management method and file name management device | |
CN114064124A (en) | Data processing method and device, electronic equipment and storage medium | |
US9747074B2 (en) | Division circuit and microprocessor | |
JP5263497B2 (en) | Signal processor and semiconductor device | |
CN117608590A (en) | Data group package unpacking method and device and computer equipment | |
JP4735507B2 (en) | Programmable controller calculation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160606 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170321 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170418 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170616 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20171114 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171127 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6260179 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |