JP2015156053A - Information processor, its control method and program - Google Patents

Information processor, its control method and program Download PDF

Info

Publication number
JP2015156053A
JP2015156053A JP2014029959A JP2014029959A JP2015156053A JP 2015156053 A JP2015156053 A JP 2015156053A JP 2014029959 A JP2014029959 A JP 2014029959A JP 2014029959 A JP2014029959 A JP 2014029959A JP 2015156053 A JP2015156053 A JP 2015156053A
Authority
JP
Japan
Prior art keywords
program
verification
verified
information processing
processing apparatus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2014029959A
Other languages
Japanese (ja)
Inventor
榎本 寿
Hisashi Enomoto
寿 榎本
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2014029959A priority Critical patent/JP2015156053A/en
Publication of JP2015156053A publication Critical patent/JP2015156053A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a processor which reduces a state number necessary for model verification by suitably reducing a verification program at a portion which is low in a correlation, in program verification using model verification equipment.
SOLUTION: An information processor creates a verification formula which indicates a content for verifying a program to be verified, determines whether or not the program is correlated to the verification formula at a prescribed unit of each program to be verified, converts the program to be verified to a program for implementing a model verification program with respect to the program to be verified which is determined to be the program which is correlated to the verification formula, creates a simple program which is implemented by the model verification program by using template application data which are defined in advance with respect to the program to be verified which is determined not to be the program correlated to the verification formula, and verifies the converted program and the created program by using the model verification program.
COPYRIGHT: (C)2015,JPO&INPIT

Description

本発明は、モデル検証プログラムを用いた情報処理装置、その制御方法、及びプログラムに関する。   The present invention relates to an information processing apparatus using a model verification program, a control method thereof, and a program.

プログラムの振る舞いを自動的且つ網羅的に検証する為の方法として、モデル検証プログラムを用いたプログラム検証方法がある。検証方法では、ユーザーの作成したプログラム(以下、被検証プログラムコードと称する。)及び検証式が、SPINやSMVのようなモデル検証プログラムを利用できる言語のプログラムコード(以下、検証用プログラムコードと称する。)に変換される。変換された上でモデル検証プログラムに入力・実行し、検証式違反の有無の確認が行われる。   As a method for automatically and comprehensively verifying the behavior of a program, there is a program verification method using a model verification program. In the verification method, a program created by a user (hereinafter referred to as a program code to be verified) and a verification formula are written in a language that can use a model verification program such as SPIN or SMV (hereinafter referred to as a verification program code). .). After being converted, it is input and executed in the model verification program, and whether or not there is a violation of the verification formula is confirmed.

このプログラム検証方法において、被検証プログラムコードの規模により、一般的に状態爆発と言われる状態数の多さ故にメモリ不足に陥りプログラム検証を実行できなくなってしまう問題がある。その為、モデル検証プログラムにおいては、特許文献1のように、取り扱える状態数を増加させる必要がある。また、モデル検証プログラムのユーザーは、検証を行う検証用プログラムコードをモデル検証プログラムを取り扱えるだけの、小ささに留める必要がある。   In this program verification method, there is a problem that the program verification cannot be executed due to a shortage of memory due to the large number of states generally referred to as state explosion depending on the scale of the program code to be verified. Therefore, in the model verification program, as in Patent Document 1, it is necessary to increase the number of states that can be handled. In addition, the user of the model verification program needs to keep the verification program code for verification small enough to handle the model verification program.

検証用プログラムコードを小さくする為には、被検証プログラムコードを各々の検証式毎にした検証用プログラムコードを複数生成し、且つ各々の検証に関係の無いプログラムコード及び変数シンボルを削除(以下、プログラムスライスと称する)する方法がある。或いは、使用メモリサイズを必要最小限のビット長さまで小さくする、意味的に有意性のある代表インデックス値に変換する(以下、データ抽象化と称する)等の方法がある。   In order to reduce the verification program code, a plurality of verification program codes are generated for each verification formula of the program code to be verified, and program codes and variable symbols not related to each verification are deleted (hereinafter, There is a method called a program slice. Alternatively, there are methods such as reducing the used memory size to the necessary minimum bit length and converting it to a semantically significant representative index value (hereinafter referred to as data abstraction).

特開平07−334566号公報Japanese Patent Application Laid-Open No. 07-334666

しかしながら、上記従来技術には以下に記載する問題がある。上記従来技術では、被検証プログラムコードの動作の検証を行うことが可能である。しかし、この方法を用いた場合、大域的な制御に対する検証を行う場合に、より多くの検証用プログラムコード・メモリが必要となり、状態爆発が発生して検証を実行することができない場合がある。   However, the above prior art has the following problems. In the above prior art, it is possible to verify the operation of the program code to be verified. However, when this method is used, when verification for global control is performed, more verification program code memory is required, and a state explosion may occur and verification may not be executed.

大域的な制御に対する検証を行う場合には、大域的な制御に含まれる全ての被検証プログラムコードから検証用プログラムコードを作成する。そのため、本来検証したい内容との関係はあるものの、関連性の低い被検証プログラムコード断片や、別の方法によって既に十分に検証が行われている被検証プログラムコード断片も検証用プログラムコードに組み込まれてしまう。したがって、検証用プログラムコードの使用するメモリ数やステップ数が増大してしまい、状態爆発が発生してしまう。   When verifying global control, verification program code is created from all program codes to be verified included in global control. Therefore, although there is a relationship with the content that you want to verify, the program code fragment to be verified that is less relevant or the program code fragment to be verified that has already been sufficiently verified by another method is also incorporated into the verification program code. End up. Therefore, the number of memories and steps used by the verification program code increases, and a state explosion occurs.

本発明は、上述の問題に鑑みて成されたものであり、モデル検証器を用いたプログラム検証において、関連性の低い部分の検証用プログラムを好適に削減することにより、モデル検証に必要な状態数を削減する仕組みを提供することを目的とする。   The present invention has been made in view of the above-described problems, and in the program verification using the model verifier, the state necessary for the model verification is preferably reduced by suitably reducing the verification program of the portion having low relevance. The purpose is to provide a mechanism to reduce the number.

本発明は、情報処理装置であって、被検証プログラムの検証する内容を示す検証式を作成する作成手段と、前記作成手段によって作成された検証式に関連するプログラムであるか否かを所定単位の被検証プログラムごとに判定する判定手段と、前記判定手段によって前記検証式に関連するプログラムであると判定された前記被検証プログラムについては、該被検証プログラムの状態を網羅的に探索して検証するモデル検証プログラムを実行するためのプログラムに該被検証プログラムを変換する変換手段と、前記判定手段によって前記検証式に関連するプログラムでないと判定された前記被検証プログラムについては、予め定義されたテンプレート適用データを用いて、前記モデル検証プログラムで実行する簡易的なプログラムを生成する生成手段と、前記変換手段によって変換されたプログラム、及び前記生成手段によって生成されたプログラムを前記モデル検証プログラムによって検証する検証手段とを備えることを特徴とする。   The present invention is an information processing apparatus, and includes a creation unit that creates a verification formula indicating the contents to be verified by a program to be verified, and whether the program is related to the verification formula created by the creation unit. Determining means for each program to be verified, and for the program to be verified determined by the determining means to be a program related to the verification formula, the state of the verified program is exhaustively searched and verified A conversion unit that converts the program to be verified into a program for executing the model verification program, and a template defined in advance for the program to be verified determined by the determination unit as not being a program related to the verification formula Using the application data, a raw program that generates a simple program to be executed by the model verification program Means, characterized in that it comprises a verification means for verifying the conversion program, and the program generated by the generating means and the model verification program by said converting means.

本発明によれば、モデル検証器を用いたプログラム検証において、関連性の低い部分の検証用プログラムを好適に削減することにより、モデル検証に必要な状態数を削減することができる。   According to the present invention, in the program verification using the model verifier, the number of states necessary for the model verification can be reduced by suitably reducing the verification program of the portion having low relevance.

第1の実施形態に係る情報処理装置のソフトウェア構成を示すブロック図。FIG. 2 is a block diagram showing a software configuration of the information processing apparatus according to the first embodiment. 第1の実施形態に係る情報処理装置のハードウェア構成を示すブロック図。The block diagram which shows the hardware constitutions of the information processing apparatus which concerns on 1st Embodiment. , 第1の実施形態に係る情報処理装置の処理手順を示すフローチャート。5 is a flowchart showing a processing procedure of the information processing apparatus according to the first embodiment. , , , , , 第1の実施形態に係る被検証プログラムを示す図。The figure which shows the to-be-verified program which concerns on 1st Embodiment. , 第2の実施形態に係る情報処理装置の処理手順を示す図。The figure which shows the process sequence of the information processing apparatus which concerns on 2nd Embodiment. , , , , , 第2の実施形態に係る被検証プログラムを示す図。The figure which shows the to-be-verified program which concerns on 2nd Embodiment.

以下、添付図面を参照して本発明の実施形態を詳しく説明する。なお、以下の実施形態は特許請求の範囲に係る本発明を限定するものでなく、また本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。   Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The following embodiments do not limit the present invention according to the claims, and all combinations of features described in the present embodiments are not necessarily essential to the solution means of the present invention. .

<第1の実施形態>
以下では、図1乃至図4Fを参照して本発明の第1の実施形態について説明する。検証すべきプログラムの性質の例として、被検証コードがC言語で記述されたソースコードである場合、「配列外へのメモリアクセスは行ってはならない」(以下、配列外参照と称する。)等の言語仕様からもたらされる検証仕様がある。配列外参照の検証を行うには、被検証プログラムを解析して配列アクセスを行うプログラム断片の関数名と位置を求め、配列の添え字が配列に対して確保されたメモリ容量を超えないことを確認するための検証式を生成する。配列の添え字や割り算の分母が定数である場合には、静的プログラム解析のみで検証を終了することが可能である。一方、配列の添え字や割り算の分母が変数である場合には、静的プログラム解析だけで検証を終えられない場合が多い。本実施形態は、配列の添え字が定数ではなく変数である場合について、モデル検証プログラムとしてSPINを用いて、性質についてのプログラム検証を行う場合について説明する。SPINとは、チャネル通信オートマトンを記述するための言語であるPromelaによる記述を入力として、網羅的に状態を探索し、その性質を検証するモデル検証プログラムである。
<First Embodiment>
Hereinafter, a first embodiment of the present invention will be described with reference to FIGS. 1 to 4F. As an example of the nature of the program to be verified, when the code to be verified is source code written in C language, “memory access outside the array must not be performed” (hereinafter referred to as an out-of-array reference) or the like. There is a verification specification that comes from the language specification. To verify an out-of-array reference, analyze the program to be verified to determine the function name and position of the program fragment that performs array access, and check that the array subscript does not exceed the memory capacity reserved for the array. Generate a verification formula to confirm. If the array subscript or division denominator is a constant, the verification can be completed only by static program analysis. On the other hand, when array subscripts and division denominators are variables, verification is often not completed by static program analysis alone. In the present embodiment, a case where program verification of properties is performed using SPIN as a model verification program when the array subscript is not a constant but a variable will be described. SPIN is a model verification program that searches a state exhaustively and verifies its properties by using a description by Promela, which is a language for describing a channel communication automaton, as an input.

<ソフトウェア構成>
まず、図1を参照して、本実施形態に係るプログラム検証装置である情報処理装置のソフトウェア構成について説明する。プログラム検証プログラム101は、図2に示す情報処理装置201において実行される。プログラム検証プログラム101は、動作制御ブロック102、被検証プログラムコード使用判断ブロック105、テンプレートコード生成ブロック106、コード縮小ブロック107、言語変換ブロック108、及びモデル検証プログラム110を含む。
<Software configuration>
First, a software configuration of an information processing apparatus that is a program verification apparatus according to the present embodiment will be described with reference to FIG. The program verification program 101 is executed in the information processing apparatus 201 shown in FIG. The program verification program 101 includes an operation control block 102, a verified program code use determination block 105, a template code generation block 106, a code reduction block 107, a language conversion block 108, and a model verification program 110.

動作制御ブロック102は、プログラム検証プログラムの様々な処理を行う為の動作制御ブロックである。被検証プログラムコード103は、検証を行う対象である様々なユーザープログラムである。テンプレート適用データ104は、プログラム検証プログラム101内の被検証プログラムコード使用判断ブロック105及びテンプレートコード生成ブロック106で解釈可能な形式仕様記述言語で記述されている。テンプレート適用データ104は、プログラムコード断片の振る舞いやメモリの性質を示すデータであり、モデル検証プログラム110に入力する検証対象のプログラムコードを生成するためのデータである。当該テンプレート適用データ104を用いて、モデル検証プログラム110で実行されるコードを生成すると、当該被検証プログラムをそのままモデル検証プログラムで実行可能な形式に変換するよりも、簡略化されたコードを生成することができる。   The operation control block 102 is an operation control block for performing various processes of the program verification program. The program code 103 to be verified is various user programs to be verified. The template application data 104 is described in a formal specification description language that can be interpreted by the verified program code use determination block 105 and the template code generation block 106 in the program verification program 101. The template application data 104 is data indicating the behavior of the program code fragment and the nature of the memory, and is data for generating a program code to be verified that is input to the model verification program 110. Generating a code to be executed by the model verification program 110 using the template application data 104 generates a simplified code rather than converting the program to be verified into a format executable by the model verification program as it is. be able to.

動作制御ブロック102は、被検証プログラムコード使用判断ブロック105に、被検証プログラムコード103とテンプレート適用データ104の両方を入力し、被検証プログラムコード103を解析した後に使用するコードを判断させる。具体的には、被検証プログラムコード103を使用するのか、又は、テンプレート適用データ104から生成したプログラムコードを使用するのかを判断する。被検証プログラムコード使用判断ブロック105が被検証プログラムコード103を使用すると判断した場合には、動作制御ブロック102は、被検証プログラムコード103をコード縮小ブロック107に入力する。コード縮小ブロック107は、コード縮小を行ったプログラムコード断片を出力する。その後、動作制御ブロック102は、当該プログラムコード断片を、言語変換ブロック108に入力して検証用プログラム109の断片を作成する。   The operation control block 102 inputs both the verified program code 103 and the template application data 104 to the verified program code use determination block 105 and causes the verified program code 103 to be analyzed after determining the code to be used. Specifically, it is determined whether the program code 103 to be verified is used or the program code generated from the template application data 104 is used. When the verified program code use determination block 105 determines that the verified program code 103 is used, the operation control block 102 inputs the verified program code 103 to the code reduction block 107. The code reduction block 107 outputs the program code fragment after the code reduction. Thereafter, the operation control block 102 inputs the program code fragment to the language conversion block 108 to create a fragment of the verification program 109.

一方、テンプレート適用データ104を使用する場合には、動作制御ブロック102は、テンプレート適用データ104をテンプレートコード生成ブロック106に入力して検証用プログラム109の断片を作成する。モデル検証プログラム110を実行するのに必要な全ての検証用プログラム109の断片を作成した後、動作制御ブロック102は、検証用プログラム109をモデル検証プログラム110に入力し、検証結果111を作成、取得し、当該検証結果をユーザーに報知する。   On the other hand, when the template application data 104 is used, the operation control block 102 inputs the template application data 104 to the template code generation block 106 and creates a fragment of the verification program 109. After creating all fragments of the verification program 109 necessary for executing the model verification program 110, the operation control block 102 inputs the verification program 109 to the model verification program 110, and generates and obtains a verification result 111. Then, the verification result is notified to the user.

<ハードウェア構成>
次に、図2に、本提案のプログラム検証装置を構成するハードウェアブロック図を示す。情報処理装置201は、ユーザーの作成したプログラムの検証を行う装置である。情報処理装置201は、本体部202、表示装置203、キーボード204、及びマウス205を備える。また、本体部202は、中央処理装置206、主記憶装置207、及びハードディスク208を備える。図1に示したモデル検証プログラム110及びプログラム検証装置用プログラム100は、ハードディスク208に格納されており、実行時には主記憶装置207にロードされ、中央処理装置(CPU)206によって実行される。
<Hardware configuration>
Next, FIG. 2 shows a hardware block diagram of the proposed program verification apparatus. The information processing apparatus 201 is an apparatus that verifies a program created by a user. The information processing apparatus 201 includes a main body unit 202, a display device 203, a keyboard 204, and a mouse 205. The main body 202 also includes a central processing unit 206, a main storage device 207, and a hard disk 208. The model verification program 110 and the program verification device program 100 shown in FIG. 1 are stored in the hard disk 208, loaded into the main storage device 207 at the time of execution, and executed by the central processing unit (CPU) 206.

<プログラム例>
次に、図4を参照して、本実施形態で説明する被検証プログラムコード103と、モデル検証プログラム110としてSPINを用いる場合の検証用プログラム109との一例について説明する。本実施形態では、図4Aに示すC言語の被検証プログラムコードを一般的なコンパイラで、図4Bに示すように、3番地コード化した上でプログラム検証作業を行う。また、本実施形態では、図4BのtargetSub関数の4行目の配列アクセス(data[i]=0;)についての配列外参照について説明する。図4BのBIT_FIELD_REF<xx,y,z>は、xx変数のzbit目からybitだけのデータを示す。
<Program example>
Next, an example of the program code 103 to be verified described in the present embodiment and a verification program 109 when SPIN is used as the model verification program 110 will be described with reference to FIG. In this embodiment, the program verification work is performed after the C-language-verified program code shown in FIG. 4A is converted into a third address code as shown in FIG. 4B by a general compiler. In this embodiment, an out-of-array reference for array access (data [i] = 0;) in the fourth row of the targetSub function in FIG. 4B will be described. BIT_FIELD_REF <xx, y, z> in FIG. 4B indicates data of only y bits from the z bit of the xx variable.

図4Cは、上記配列外参照についてプログラム検証プログラム101の作成した検証式データである。検証式には、図4Cに示すように、関数名と、当該関数内における行番号と、当該行番号における検証内容(検証式)とが含まれる。図4Cでは、1つの検証式のみが例示されているが、複数の検証式が予め定義されてもよい。また、図4Dは、比較例となる検証用プログラム109を全て被検証プログラムコード103から作成した場合の検証プログラムを示す。図4Fは、updatePaperPa関数について被検証プログラムコード103ではなく、テンプレート適用データ104から生成した検証用プログラム109を示す。   FIG. 4C shows verification formula data created by the program verification program 101 for the out-of-array reference. As shown in FIG. 4C, the verification expression includes a function name, a line number in the function, and a verification content (verification expression) in the line number. Although only one verification formula is illustrated in FIG. 4C, a plurality of verification formulas may be defined in advance. FIG. 4D shows a verification program when the verification program 109 as a comparative example is all created from the program code 103 to be verified. FIG. 4F shows a verification program 109 generated from the template application data 104 instead of the verified program code 103 for the updatePaperPa function.

図4Eは、updatePaperPap関数についてのテンプレート適用データである。図4EはXML形式でプログラム動作中に値が変化する変数を定義している。本実施形態ではvolatileMemoryタグは、プログラム動作中に値が変化する変数の定義に用いられるタグである。nameOfSymbolは上記変数の名称の記述例である。SettleFuncは上記変数を定義する関数名の記述例である。updateIntervalは上記関数を指定回数呼び出した場合に変数が更新される間隔を定義する場合の記述例である。即ち、図4Eにおいては、sensor.papはupdateSensorPapが10回呼び出される毎に、いずれかの値に変化する変数であることを示す。   FIG. 4E shows template application data for the updatePaperPap function. FIG. 4E defines a variable whose value changes during the program operation in the XML format. In this embodiment, the volumeMemory tag is a tag used for defining a variable whose value changes during a program operation. nameOfSymbol is a description example of the name of the variable. SettleFunc is a description example of a function name that defines the variable. updateInterval is a description example for defining an interval at which a variable is updated when the above function is called a specified number of times. That is, in FIG. pap is a variable that changes to any value every time updateSensorPap is called 10 times.

<処理フロー>
次に、図3A及び図3Bを参照して、本実施形態のプログラム検証における処理フローについて説明する。本実施形態では、targetSub関数内の配列外参照(data[i]=0;)を検証するケースについて説明する。以下で説明する処理は、中央処理装置(CPU)206が、ハードディスク208に格納されたプログラム検証プログラム101を主記憶装置207に読み出して実行することにより実現される。図3Aの300は、プログラム検証の全体フローを示す。図3Bの310は、フローチャート300内のS304のサブフローチャートを示す。図3Bの320は、フローチャート300のS305内のサブフローチャートを示す。
<Processing flow>
Next, with reference to FIG. 3A and FIG. 3B, the processing flow in the program verification of this embodiment is demonstrated. In this embodiment, a case will be described in which an out-of-array reference (data [i] = 0;) in the targetSub function is verified. The processing described below is realized by the central processing unit (CPU) 206 reading out the program verification program 101 stored in the hard disk 208 to the main storage device 207 and executing it. Reference numeral 300 in FIG. 3A shows an overall flow of program verification. 3B in FIG. 3B shows a sub-flowchart of S304 in the flowchart 300. 3B of FIG. 3B shows a sub-flowchart in S305 of the flowchart 300.

S301、S302において、CPU206は、図4Aに示す被検証プログラムコード103と、図4Eに示すテンプレート適用データ104とを読み出し、被検証プログラムコード103を解析する。途中、CPU206は、図4Bのように3番地コード化して副作用動作プログラムコードを単一動作プログラムコードに変換し、検証式と行番号の対応を簡便化することが可能である。   In S301 and S302, the CPU 206 reads the verified program code 103 shown in FIG. 4A and the template application data 104 shown in FIG. 4E, and analyzes the verified program code 103. In the middle, the CPU 206 can convert the side effect action program code into a single action program code by converting into a 3-address code as shown in FIG. 4B, thereby simplifying the correspondence between the verification formula and the line number.

S303において、CPU206は、図4Cのような検証式リストを作成する。つまり、ここでは、被検証プログラムコード103において検証する項目を作成している。これは、例えば、ユーザ指示に基づいて行われてもよい。当該ユーザ指示については、予め定義されたリスト等から選択する形式でもよい。CPU206は、検証式リストの番号に対応する各々の検証プログラムを作成する。そのため、検証式によって、targetSubの4行目における変数iについてコード縮小ブロック107を用いて被検証プログラムコード103を縮小化し、必要な被検証プログラム断片を取得する。その結果、targetSubは、main関数から呼び出されており、グローバル変数sensor.papによって実行されるか否かの到達性が定義され、且つ、グローバル変数sensor.papは、main関数の呼び出すupdateSensorPapによって値が設定されることを理解する。   In S303, the CPU 206 creates a verification formula list as shown in FIG. 4C. That is, here, an item to be verified is created in the program code 103 to be verified. This may be performed based on a user instruction, for example. The user instruction may be selected from a predefined list or the like. The CPU 206 creates each verification program corresponding to the verification formula list number. Therefore, the program code 103 to be verified is reduced using the code reduction block 107 for the variable i in the fourth line of the targetSub using the verification formula, and the necessary program fragment to be verified is acquired. As a result, targetSub is called from the main function, and the global variable sensor. The reachability of whether to be executed by pap is defined, and the global variable sensor. pap understands that the value is set by the updateSensorPap called by the main function.

S304において、CPU206は、被検証プログラムコード103を使用するか否かを判断する。即ち、被検証プログラムコードをモデル検証プログラムで実行できる形式にそのまま変換した詳細な被検証プログラムに変換するか、或いは、被検証プログラムの代わりにテンプレート適用データを使用した簡易的な被検証プログラムを生成するかを判断している。本実施形態によれば、プログラムの所定単位ごと、例えば関数ごとにこの判定を行い、検証を網羅的に行うか否かを決定している。なお、判断基準としては、S303で作成した検証リストに含まれる項目が当該関数を実行することにより実行されるか否かで判断することが望ましい。S304の詳細な処理についてはフローチャート310を用いて後述する。被検証プログラムコード103を使用する場合はS306に進み、使用しない場合はS305に進む。targetSub関数及びmain関数は、図4Eのテンプレート適用データに含まれていない。updateSensorPap関数はテンプレート適用データに含まれており、10回呼び出された場合に、sensor.papをいずれかの値に設定する関数である。さらに、sensor.papは、1bit長さである。CPU206は、このように、検証対象のプログラムを理解する。したがって、targetSub関数及びmain関数については、S306に進み、updateSensorPap関数についてはS305に進む。   In step S <b> 304, the CPU 206 determines whether to use the program code 103 to be verified. In other words, the program code to be verified is converted into a detailed program to be verified that is directly converted into a format that can be executed by the model verification program, or a simple program to be verified is generated using template application data instead of the program to be verified Judging what to do. According to the present embodiment, this determination is performed for each predetermined unit of the program, for example, for each function, and it is determined whether or not the verification is comprehensively performed. Note that it is desirable to determine whether or not the item included in the verification list created in S303 is executed by executing the function as a determination criterion. Detailed processing in S304 will be described later with reference to the flowchart 310. If the program code 103 to be verified is used, the process proceeds to S306, and if not, the process proceeds to S305. The targetSub function and the main function are not included in the template application data in FIG. 4E. The updateSensorPap function is included in the template application data, and when called 10 times, sensor. This function sets pap to any value. Furthermore, sensor. pap is 1 bit long. In this way, the CPU 206 understands the program to be verified. Therefore, the process proceeds to S306 for the targetSub function and the main function, and proceeds to S305 for the updateSensorPap function.

被検証プログラムコード103を使用する場合、S306において、CPU206は、main関数とtargetSub関数については、被検証プログラムコード103を変換した上で、検証式をプログラム断片に変換して検証プログラム断片を埋め込む。一方、S305において、CPU206は、updateSensorPap関数について、テンプレート適用データ104をテンプレートコード生成ブロック106に入力してテンプレートコードを生成しS308に進む。S305の詳細については、フローチャート305を用いて後述する。   When using the program code 103 to be verified, in S306, for the main function and the targetSub function, the CPU 206 converts the program code 103 to be verified, converts the verification expression into a program fragment, and embeds the verification program fragment. On the other hand, in S305, the CPU 206 inputs the template application data 104 to the template code generation block 106 for the updateSensorPap function, generates a template code, and proceeds to S308. Details of S305 will be described later with reference to a flowchart 305.

S308において、CPU206は、モデル検証プログラムへ、S305又はS306からのプログラムを入力して実行する。仮にupdateSensorPap関数をテンプレート適用データ104から生成せず、被検証プログラムコード103から生成した場合の検証用プログラム109を図4Dに示す。io.papは誰からも設定されることのない外部モデルに含まれる変数であるため、別スレッドとして、検証用プログラム断片を生成し不定性を定義する必要がある。また、updateSensorPapは、図4Bの被検証プログラムコードから変換したコードである。   In S308, the CPU 206 inputs the program from S305 or S306 to the model verification program and executes it. FIG. 4D shows a verification program 109 when the updateSensorPap function is not generated from the template application data 104 but is generated from the program code 103 to be verified. io. Since pap is a variable included in an external model that is not set by anyone, it is necessary to generate a verification program fragment and define indefiniteness as a separate thread. Further, updateSensorPap is a code converted from the verified program code of FIG. 4B.

図3Aの説明に戻る。S309において、CPU206は、検証結果111を取得し、ユーザーに提示する。これにより、検証式が不成立な場合があること等をユーザーに報知することができる。   Returning to the description of FIG. In S309, the CPU 206 acquires the verification result 111 and presents it to the user. Thereby, it is possible to notify the user that the verification formula may not be established.

次に、図3Bのフローチャート310について説明する。フローチャート310はフローチャート300のS304の詳細を示す。   Next, the flowchart 310 of FIG. 3B is demonstrated. A flowchart 310 shows details of S304 of the flowchart 300.

まず、S3041において、CPU206は、図4Cに示す検証式に関連する被検証プログラムコードを抽出する。続いて、S3042において、CPU206は、S3041で抽出した被検証プログラムコードに図4Cに示す検証式が含まれるか否かを判定する。該当する検証式が含まれる場合はS3043に進み、含まれない場合S3045に進む。   First, in S3041, the CPU 206 extracts the program code to be verified related to the verification formula shown in FIG. 4C. In step S3042, the CPU 206 determines whether the verification program code extracted in step S3041 includes the verification formula shown in FIG. 4C. If the corresponding verification expression is included, the process proceeds to S3043, and if not included, the process proceeds to S3045.

S3043において、CPU206は、当該検証式が被検証プログラムの制御フローにのみ関連するものであるか否かを判定する。当該検証式が被検証プログラムの制御フローにのみ関連するものであれば、S3045に進み、そうでなければS3044に進む。   In step S3043, the CPU 206 determines whether or not the verification formula is related only to the control flow of the program to be verified. If the verification formula relates only to the control flow of the program to be verified, the process proceeds to S3045, and if not, the process proceeds to S3044.

S3044において、CPU206は、被検証プログラムコードを使用すると判断し、処理を終了する。一方、S3045において、CPU206は、テンプレートコードを使用する(生成する)と判断し、処理を終了する。   In step S3044, the CPU 206 determines that the program code to be verified is used, and ends the process. On the other hand, in S3045, the CPU 206 determines that the template code is to be used (generated), and ends the process.

次に、図3Bのフローチャート320について説明する。フローチャート320はフローチャート300のS305の詳細を示す。つまり、フローチャート320は、テンプレートコード生成ブロック106の処理に相当する。   Next, the flowchart 320 of FIG. 3B will be described. A flowchart 320 shows details of S305 of the flowchart 300. That is, the flowchart 320 corresponds to the processing of the template code generation block 106.

S3051において、CPU206は、出力変数名と、ビット長さとを記憶する。続いて、S3052において、CPU206は、入力変数のビット長さを記憶する。S3053において、CPU206は、出力変数の更新頻度(10)を記憶する。S3054において、CPU206は、プログラムコード(テンプレートコード)を出力し、処理を終了する。出力されたテンプレートコードは、例えば、図4Fに示すupdateSensorPap関数のコードとなる。なお、上述のフローチャートでは、説明を容易にするため、各関数ごと検証する例を示したが、本実施形態では、各関数ごとのプログラムコードを変換又は生成し、それらを合成した被検証プログラムをモデル検証プログラム110で検証することが望ましい。   In S3051, the CPU 206 stores the output variable name and the bit length. Subsequently, in S3052, the CPU 206 stores the bit length of the input variable. In step S3053, the CPU 206 stores the update frequency (10) of the output variable. In S3054, the CPU 206 outputs a program code (template code) and ends the process. The output template code is, for example, the code of the updateSensorPap function shown in FIG. 4F. In the above flowchart, for ease of explanation, an example in which each function is verified is shown. However, in this embodiment, a program to be verified is generated by converting or generating program codes for each function and combining them. It is desirable to verify with the model verification program 110.

図4Dと図4Fを比べると、図4Fはio.papとcnt1が不要になっていること、sensor.papを合成する論理が無くなっていることから、モデル検証プログラム110の使用メモリは削減されている。実際にSPINを用いて調べると、状態ベクタは28バイトから20バイトに削減されている。図4Aに示す被検証プログラムコードの例では、図4Dでも図4Fでもモデル検証プログラムは実行可能であったものの、実際のプログラム検証ではより複雑なアルゴリズムも存在し、その場合にもより簡単な検証プログラムを合成することが可能である。   Comparing FIG. 4D and FIG. 4F, FIG. pap and cnt1 are unnecessary, sensor. Since the logic for synthesizing the pap is lost, the memory used by the model verification program 110 is reduced. When actually using SPIN, the state vector is reduced from 28 bytes to 20 bytes. In the example of the program code to be verified shown in FIG. 4A, although the model verification program can be executed in either FIG. 4D or FIG. 4F, there are more complicated algorithms in actual program verification, and even simpler verification is possible in that case. It is possible to synthesize a program.

以上説明したように、本実施形態に係る情報処理装置は、所定単位の被検証プログラムごとに、検証対象のコードを有するか(検証式に関連するプログラムであるか)否かに応じて、被検証プログラムコードを使用するか否かを切り替える。つまり、本実施形態に係る情報処理装置は、検証対象のコード、例えば、配列外参照のコードを有する場合には詳細な検証を実行し、配列外参照のコードを含まなければテンプレートコードを用いた簡易的な検証を行う。なお、本実施形態では、所定単位のプログラムを関数ごとの例で説明したが、本発明をこれに限定する意図はなく他の単位のプログラムごとに上記判定を行ってもよい。このように、本実施形態によれば、所定の検証プログラムごとに、モデル検証プログラムの利用するメモリ使用量を削減し、状態爆発を低減することが可能である。   As described above, the information processing apparatus according to the present embodiment depends on whether each verification target program has a code to be verified (whether it is a program related to a verification expression) or not. Switch whether to use verification program code. In other words, the information processing apparatus according to the present embodiment performs detailed verification when a verification target code, for example, an out-of-sequence reference code is included, and uses a template code if the out-of-sequence reference code is not included. Perform simple verification. In the present embodiment, the program of a predetermined unit has been described by an example for each function. However, the present invention is not intended to be limited to this, and the above determination may be made for each program of another unit. Thus, according to the present embodiment, it is possible to reduce the amount of memory used by the model verification program for each predetermined verification program and reduce state explosion.

<第2の実施形態>
以下では、図5乃至図6Fを参照して、本発明の第2の実施形態について説明する。本実施形態は、配列の添え字が定数ではなく変数である場合について、モデル検証プログラム110としてSPINを用いて、「配列外へのメモリアクセスは行ってはならない」などの性質についてのプログラム検証を行う場合について説明する。上記第1の実施形態では、テンプレートを適用する関数が検証式を調査するためのプログラム断片への到達性に関連するものであった。一方、本実施形態では、テンプレートを適用する関数の振る舞いが、検証式内の変数値に関連する場合で、関数の振る舞いが複数存在する場合について説明する。
<Second Embodiment>
Hereinafter, a second embodiment of the present invention will be described with reference to FIGS. 5 to 6F. In the present embodiment, when the array subscript is a variable instead of a constant, program verification is performed using SPIN as the model verification program 110 for a property such as “memory access outside the array should not be performed”. The case where it performs is demonstrated. In the first embodiment, the function to which the template is applied relates to the reachability to the program fragment for examining the verification formula. On the other hand, in the present embodiment, a case will be described in which a behavior of a function to which a template is applied is related to a variable value in a verification expression, and there are a plurality of behaviors of the function.

<プログラム例>
図6を参照して、本実施形態で説明する被検証プログラムコード103と、モデル検証プログラム110としてSPINを用いる場合の検証用プログラム109との一例について説明する。図6Aは、C言語で記述された被検証プログラムコードと併記されたコメント文601中のテンプレート適用データを示す。
<Program example>
With reference to FIG. 6, an example of the program code 103 to be verified described in the present embodiment and the verification program 109 when SPIN is used as the model verification program 110 will be described. FIG. 6A shows template application data in the comment sentence 601 written together with the program code to be verified written in C language.

コメント文601中における、DataAbstructionタグはデータに対する振る舞いを抽象化した例を示す。nameOfSymbolタグは上記振る舞いを抽象化したデータの変数名称を示す。本実施形態では、nameOfFuncタグの示す関数の振る舞いについて、テンプレートデータを用いて検証プログラムを生成する。   The DataAbstraction tag in the comment sentence 601 indicates an example in which the behavior for data is abstracted. The nameOfSymbol tag indicates a variable name of data obtained by abstracting the above behavior. In the present embodiment, a verification program is generated using template data for the behavior of the function indicated by the nameOfFunc tag.

Abstructionタグは各々のテンプレートを示す。Conditionタグは条件文を意味し、valueタグはConditionタグを満たす場合の値の定義式を記述する。1つ目のテンプレート適用データ(第1のテンプレート適用データ)は、条件式((_b&1)==1)が真の場合にはcalc_b関数の返し値がb集合要素のいずれかから256を引いた値である。一方、偽の場合にはcalc_b関数の返し値がbb集合要素のいずれかから256を引いた値であることを意味する。2つ目のテンプレート適用データ(第2のテンプレート適用データ)は、calc_b関数の返し値がbとbbの和集合の集合要素のいずれかから256を引いた値であることを意味する。   The Abstract tag indicates each template. The Condition tag means a conditional statement, and the value tag describes a value defining expression when the Condition tag is satisfied. The first template application data (first template application data) is obtained by subtracting 256 from any of the b set elements when the conditional expression ((_b & 1) == 1) is true. Value. On the other hand, if it is false, it means that the return value of the calc_b function is a value obtained by subtracting 256 from any of the bb set elements. The second template application data (second template application data) means that the return value of the calc_b function is a value obtained by subtracting 256 from one of the set elements of the union of b and bb.

本実施形態ではC言語の図6Aに示す被検証プログラムコードを一般的なコンパイラで、図6Bに示すように、3番地コード化した上でプログラム検証作業を行う。また、本実施形態では、図6Bのmain関数の5行目の配列アクセス(c[B]=(unsigned char)_b;)についての配列外参照について説明する。図6Cは、配列外参照についてプログラム検証プログラム101の作成した検証式データである。図6Dは、比較例となる検証プログラムを全て被検証プログラムコード103から作成した場合の検証プログラムを示す。図6Eは、図6Aの被検証プログラムコードに併記されたコメント文601中に記述された第1のテンプレート適用データを元にして検証プログラムコードを生成したものである。図6Fは、第2のテンプレート適用データを元にして検証用プログラム109を生成したものである。   In this embodiment, the verification program code shown in FIG. 6A in C language is converted into a 3-address code as shown in FIG. Further, in the present embodiment, an out-of-array reference for array access (c [B] = (unsigned char) _b;) in the fifth row of the main function in FIG. 6B will be described. FIG. 6C shows verification formula data created by the program verification program 101 for out-of-array references. FIG. 6D shows a verification program when all verification programs as comparative examples are created from the program code 103 to be verified. FIG. 6E shows a verification program code generated based on the first template application data described in the comment sentence 601 written together with the program code to be verified of FIG. 6A. FIG. 6F shows the verification program 109 generated based on the second template application data.

<処理フロー>
次に、図5A及び図5Bを参照して、本実施形態のプログラム検証における処理フローについて説明する。以下で説明する処理は、中央処理装置(CPU)206が、ハードディスク208に格納されたプログラム検証プログラム101を主記憶装置207に読み出して実行することにより実現される。図5Aの500は、プログラム検証の全体フローを示す。図5Bの510は、フローチャート500内のS504のサブフローチャートを示す。図5Bの520は、フローチャート500のS505内のサブフローチャートを示す。
<Processing flow>
Next, with reference to FIG. 5A and FIG. 5B, the processing flow in the program verification of this embodiment is demonstrated. The processing described below is realized by the central processing unit (CPU) 206 reading out the program verification program 101 stored in the hard disk 208 to the main storage device 207 and executing it. 5A in FIG. 5A shows the overall flow of program verification. 5B in FIG. 5B shows a sub-flowchart of S504 in the flowchart 500. 520 in FIG. 5B shows a sub-flowchart in S505 of the flowchart 500.

S501、S502において、CPU206は、図6Aに示す被検証プログラムコード103と、テンプレート適用データ104とを読み出し、被検証プログラムコード103を解析する。途中、CPU206は、図6Bのように3番地コード化して副作用動作プログラムコードを単一動作プログラムコードに変換し、検証式と行番号の対応を簡便化することが可能である。また、CPU206は、図6Aのコメント文601中に記述されるテンプレート適用データを解析し、テンプレートコード利用時の適用方法、即ち、2つのテンプレート適用データ(第1及び第2のテンプレート適用データ)を取得する。更に、CPU206は、定数配列bとbbに対する記述を解析し、定数配列、即ちb集合の要素は258,257,255で要素数は3の集合であることを理解する。さらに、bb定数配列、即ちbb集合の要素は、256,257,258で要素数が3の集合であることを理解することができる。   In S501 and S502, the CPU 206 reads the verified program code 103 and the template application data 104 shown in FIG. 6A, and analyzes the verified program code 103. On the way, the CPU 206 can convert the side effect action program code into a single action program code by converting into a 3-address code as shown in FIG. 6B, thereby simplifying the correspondence between the verification formula and the line number. Further, the CPU 206 analyzes the template application data described in the comment sentence 601 of FIG. 6A, and applies an application method when using the template code, that is, two template application data (first and second template application data). get. Further, the CPU 206 analyzes the descriptions for the constant arrays b and bb, and understands that the constant arrays, that is, the elements of the b set are 258, 257, and 255 and the number of elements is 3. Furthermore, it can be understood that the bb constant array, that is, the elements of the bb set is a set of 256, 257, 258 and 3 elements.

S503において、CPU206は、図6Cに示す検証式リストを作成する。さらに、CPU206は、検証式リストの番号に対応する各々の検証プログラムを作成する。そのため、検証式によって、main関数の5行目における変数Bについてコード縮小ブロック107を用いて被検証プログラムコード103の縮小化と必要最小限な被検証プログラムコード103の断片を取得する。ここで、検証式は、関数名と、行番号と、行番号における検証内容とを示すものである。その結果、変数Bはcalc_b関数の返し値であり、calc_b関数はmain関数から呼び出しされることを理解する。   In step S503, the CPU 206 creates a verification formula list shown in FIG. 6C. Further, the CPU 206 creates each verification program corresponding to the verification formula list number. Therefore, the verification program code 103 is reduced and the minimum required fragment of the program code 103 to be verified is acquired by using the code reduction block 107 for the variable B in the fifth line of the main function by the verification formula. Here, the verification expression indicates the function name, the line number, and the verification content at the line number. As a result, it is understood that the variable B is a return value of the calc_b function, and the calc_b function is called from the main function.

S504において、CPU206は、被検証プログラムコード使用判断ブロック105を用いて、被検証プログラムコード103を使用するか否かを判断する。被検証プログラムコード103を使用する場合はS506に進み、使用しない場合はS505に進む。main関数はテンプレート適用データに含まれておらず、且つ、calc_b関数及びcalc_b関数の返し値はテンプレート適用データに含まれている。なお、calc_b関数の返し値は、S503で作成した図6Cに示す検証式内に含まれているため、S506に進む。   In step S <b> 504, the CPU 206 determines whether to use the verified program code 103 using the verified program code use determination block 105. If the program code 103 to be verified is used, the process proceeds to S506, and if not, the process proceeds to S505. The main function is not included in the template application data, and the return values of the calc_b function and the calc_b function are included in the template application data. Since the return value of the calc_b function is included in the verification expression shown in FIG. 6C created in S503, the process proceeds to S506.

S506において、CPU206は、コード縮小ブロック107を用いて、被検証プログラムコード103のみを用いて図6Cに示す検証を行うのに必要最小限な被検証プログラム断片を作成する。さらに、モデル検証プログラムの理解できる検証用プログラム109に変換する。その後、S508において、CPU206は、動作制御ブロック102によって、検証用プログラム109をモデル検証プログラム110に入力して、S509で検証結果111を取得する。S510において、CPU206は、モデル検証プログラム110を実行した検証結果111が、状態爆発を起こしたことを示すか否かを判定する。状態爆発を起こしていることを示す場合には、S511に進み、状態爆発を起こすことなく検証を終了することができたことを示す場合には、検証結果111をユーザーに表示してプログラム検証を終了する。S511において、CPU206は、利用可能なテンプレート適用データがあるか否かを判定し、あればS505に進み、無ければ処理を終了する。   In step S <b> 506, the CPU 206 uses the code reduction block 107 to create a minimum program fragment to be verified necessary for performing the verification shown in FIG. 6C using only the program code 103 to be verified. Further, it is converted into a verification program 109 that can be understood by the model verification program. Thereafter, in S508, the CPU 206 inputs the verification program 109 to the model verification program 110 by the operation control block 102, and acquires the verification result 111 in S509. In S510, the CPU 206 determines whether or not the verification result 111 obtained by executing the model verification program 110 indicates that a state explosion has occurred. If it indicates that a state explosion has occurred, the process proceeds to S511, and if it indicates that the verification could be completed without causing a state explosion, the verification result 111 is displayed to the user to verify the program. finish. In step S511, the CPU 206 determines whether there is any template application data that can be used, and if there is, proceeds to step S505, and if not, ends the processing.

S505において、CPU206は、動作制御ブロック102によって、テンプレート適用データ104の第1のテンプレートコードをテンプレートコード生成ブロック106に入力し、出力される検証用プログラム断片で検証用プログラム109を更新する。その後、S508に進み、上述したように、モデル検証プログラム110を実行し、S509で検証結果111を取得し、S510以降の処理を実行する。なお、モデル検証プログラム110を実行した際に状態爆発を発生し、結果を取得できない場合には、CPU206は、S511においてS505から検証を再度行う。また、S511で既に適用可能なテンプレート適用データが存在しないと判定すると、CPU206は、検証作業が終了しなかったことをユーザーに報知した上で、処理を終了する。   In step S <b> 505, the CPU 206 inputs the first template code of the template application data 104 to the template code generation block 106 through the operation control block 102, and updates the verification program 109 with the output verification program fragment. Thereafter, the process proceeds to S508, and as described above, the model verification program 110 is executed, the verification result 111 is acquired in S509, and the processes after S510 are executed. If a state explosion occurs when the model verification program 110 is executed and the result cannot be acquired, the CPU 206 performs verification again from S505 in S511. If it is determined in step S511 that there is no template application data that can be applied, the CPU 206 informs the user that the verification work has not ended, and then ends the process.

次に、図5Bのフローチャート510について説明する。フローチャート510はフローチャート500のS504の詳細を示す。   Next, the flowchart 510 of FIG. 5B will be described. A flowchart 510 shows details of S504 of the flowchart 500.

まず、S5041において、CPU206は、図6Cに示す検証式に関連する被検証プログラムコードを抽出する。続いて、S5042において、CPU206は、S5041で抽出した被検証プログラムコードに図6Cに示す検証式が含まれるか否かを判定する。該当する検証式が含まれる場合はS5043に進み、含まれない場合はS5046に進む。   First, in S5041, the CPU 206 extracts the program code to be verified related to the verification formula shown in FIG. 6C. In step S5042, the CPU 206 determines whether the verification program code extracted in step S5041 includes the verification formula shown in FIG. 6C. If the corresponding verification expression is included, the process proceeds to S5043, and if not included, the process proceeds to S5046.

S5043において、CPU206は、当該検証式が被検証プログラムの制御フローにのみ関連するものであるか否かを判定する。当該検証式が被検証プログラムの制御フローにのみ関連するものであれば、S5045に進み、そうでなければS5044に進む。S5044において、CPU206は、プログラム検証が初回であるか否かを判定する。ここでの判定は、モデル検証プログラムを既に実行しているか否かを判定する。例えば、一度S508のモデル検証プログラムを実行して、S510で状態爆発が発生したと判断してテンプレートコードを生成してやり直した場合は、初回ではないと判定される。したがって、CPU206は、S508でモデル検証プログラムを実行した場合に、実行回数等を保持しておくようにしてもよい。初回であればS5045に進み、初回でなければS5046に進む。   In S5043, the CPU 206 determines whether or not the verification formula is related only to the control flow of the program to be verified. If the verification formula relates only to the control flow of the program to be verified, the process proceeds to S5045, and if not, the process proceeds to S5044. In step S5044, the CPU 206 determines whether the program verification is the first time. In this determination, it is determined whether or not the model verification program has already been executed. For example, if the model verification program in S508 is executed once, it is determined in S510 that a state explosion has occurred, and a template code is generated and then redone, it is determined that this is not the first time. Therefore, the CPU 206 may store the number of executions when the model verification program is executed in S508. If it is the first time, the process proceeds to S5045, and if it is not the first time, the process proceeds to S5046.

S5045において、CPU206は、被検証プログラムコードを使用すると判断し、処理を終了する。一方、S5046において、CPU206は、テンプレートコードを使用すると判断し、処理を終了する。   In step S5045, the CPU 206 determines that the program code to be verified is used, and ends the process. On the other hand, in S5046, the CPU 206 determines that the template code is to be used, and ends the process.

次に、図5Bのフローチャート520について説明する。フローチャート520はフローチャート500のS505の詳細を示す。つまり、フローチャート520は、テンプレートコード生成ブロック106の処理に相当する。   Next, the flowchart 520 in FIG. 5B will be described. A flowchart 520 shows details of S505 of the flowchart 500. That is, the flowchart 520 corresponds to the processing of the template code generation block 106.

S5051において、CPU206は、利用するテンプレートを選択する。ここでは、例えば、第1のテンプレート適用データ又は第2のテンプレート適用データが選択される。なお、選択方法は、予め定めれた順で選択されてもよいし、ユーザーの指示に基づくようにしてもよい。続いて、S5052において、CPU206は、出力変数名と、ビット長さとを記憶する。S5053において、CPU206は、入力変数のビット長さを記憶する。S5054において、CPU206は、出力変数の更新頻度(10)を記憶する。S5055において、CPU206は、プログラムコード(テンプレートコード)を出力する。出力されたテンプレートコードは、第1のテンプレート適用データを使用した場合、例えば、図6Eに示すコードとなる。一方、第2のテンプレート適用データを使用した場合は、図6Fに示すコードとなる。最後に、S5056において、CPU206は、利用したテンプレートを記憶して処理を終了する。   In step S5051, the CPU 206 selects a template to be used. Here, for example, the first template application data or the second template application data is selected. Note that the selection method may be selected in a predetermined order or based on a user instruction. Subsequently, in S5052, the CPU 206 stores the output variable name and the bit length. In S5053, the CPU 206 stores the bit length of the input variable. In S5054, the CPU 206 stores the update frequency (10) of the output variable. In S5055, the CPU 206 outputs a program code (template code). When the first template application data is used, the output template code is, for example, the code shown in FIG. 6E. On the other hand, when the second template application data is used, the code is as shown in FIG. 6F. Finally, in S5056, the CPU 206 stores the used template and ends the process.

本実施形態で示した図6Aの被検証プログラムコード103は、実際には全て被検証プログラムコード103を用いても、検証プログラムは状態爆発を起こさずに配列外参照を指摘することができる。しかし、使用する状態ベクタ容量は、全ての検証プログラム断片を被検証プログラムコード103から作成した場合は48バイトとなり、第1のテンプレート適用データ104を使用した場合が20バイトとなった。また、第2のテンプレート適用データを使用した場合が16バイトと大幅に削減できており、実際には様々に複雑化する、ユーザーの作成する被検証プログラムコード103を検証するために有効である。   The verification program code 103 of FIG. 6A shown in the present embodiment can be pointed out of the array reference without causing a state explosion even if the verification program code 103 is actually used. However, the state vector capacity to be used is 48 bytes when all the verification program fragments are created from the program code 103 to be verified, and 20 bytes when the first template application data 104 is used. In addition, the case where the second template application data is used can be greatly reduced to 16 bytes, which is effective for verifying the program code 103 to be verified created by the user, which is actually complicated.

以上説明したように、本実施形態に係る情報処理装置は、モデル検証プログラムの利用するメモリ使用量を削減し、状態爆発を低減することが可能である。   As described above, the information processing apparatus according to the present embodiment can reduce the amount of memory used by the model verification program and reduce state explosion.

<その他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(又はCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, etc.) of the system or apparatus reads the program. It is a process to be executed.

Claims (13)

情報処理装置であって、
被検証プログラムの検証する内容を示す検証式を作成する作成手段と、
前記作成手段によって作成された検証式に関連するプログラムであるか否かを所定単位の被検証プログラムごとに判定する判定手段と、
前記判定手段によって前記検証式に関連するプログラムであると判定された前記被検証プログラムについては、該被検証プログラムの状態を網羅的に探索して検証するモデル検証プログラムを実行するためのプログラムに該被検証プログラムを変換する変換手段と、
前記判定手段によって前記検証式に関連するプログラムでないと判定された前記被検証プログラムについては、予め定義されたテンプレート適用データを用いて、前記モデル検証プログラムで実行する簡易的なプログラムを生成する生成手段と、
前記変換手段によって変換されたプログラム、及び前記生成手段によって生成されたプログラムを前記モデル検証プログラムによって検証する検証手段と
を備えることを特徴とする情報処理装置。
An information processing apparatus,
Creating means for creating a verification expression indicating the contents to be verified by the program to be verified;
Determining means for determining whether the program is related to the verification formula created by the creating means for each program to be verified in a predetermined unit;
For the program to be verified that is determined to be a program related to the verification formula by the determination means, the program for executing a model verification program that comprehensively searches and verifies the state of the program to be verified Conversion means for converting the program to be verified;
Generating means for generating a simple program to be executed by the model verification program using predefined template application data for the program to be verified determined by the determination means as not being a program related to the verification formula When,
An information processing apparatus comprising: a program converted by the conversion unit; and a verification unit that verifies the program generated by the generation unit by the model verification program.
前記判定手段は、初回の検証であれば、前記検証式に関連するプログラムであっても、前記検証式に関連するプログラムでないものとして判定することを特徴とする請求項1に記載の情報処理装置。   2. The information processing apparatus according to claim 1, wherein the determination unit determines that a program related to the verification formula is not a program related to the verification formula if it is an initial verification. . 前記検証手段は、前記モデル検証プログラムによって検証した検証結果が状態爆発を起こしていると判断すると、利用可能な前記テンプレート適用データがあれば、前記生成手段によって該テンプレート適用データを用いて前記簡易的なプログラムを生成させ、検証を再度行うことを特徴とする請求項2に記載の情報処理装置。   If it is determined that the verification result verified by the model verification program has caused a state explosion, the verification unit uses the template application data by the generation unit if the template application data is available. The information processing apparatus according to claim 2, wherein a valid program is generated and verification is performed again. 前記変換手段は、さらに、前記変換した被検証プログラムに、前記検証式を埋め込むことを特徴とする請求項1乃至3の何れか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the conversion unit further embeds the verification expression in the converted program to be verified. 前記テンプレート適用データは、形式仕様記述言語で記述されていることを特徴とする請求項1乃至4の何れか1項に記載の情報処理装置。   The information processing apparatus according to any one of claims 1 to 4, wherein the template application data is described in a formal specification description language. 前記判定手段は、前記関連するプログラムであるか否かを、前記所定単位の被検証プログラムの中に前記検証式に対応するコードを含むか否かによって判定することを特徴とする請求項1乃至5の何れか1項に記載の情報処理装置。   2. The determination unit according to claim 1, wherein the determination unit determines whether or not the program is the related program based on whether or not a code corresponding to the verification formula is included in the program to be verified in the predetermined unit. The information processing apparatus according to any one of 5. 前記所定単位とは、関数であることを特徴とする請求項1乃至6の何れか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the predetermined unit is a function. 前記所定単位とは、変数であることを特徴とする請求項1乃至6の何れか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the predetermined unit is a variable. 前記検証式には、関数名と、該関数内における行番号、及び検証内容を示す検証式が含まれることを特徴とする請求項7に記載の情報処理装置。   The information processing apparatus according to claim 7, wherein the verification expression includes a function name, a line number in the function, and a verification expression indicating verification contents. 前記検証式において検証する内容は、配列外参照であることを特徴とする請求項1乃至9の何れか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the content to be verified in the verification formula is an out-of-array reference. 前記検証手段による検証結果をユーザーに提示する手段をさらに備えることを特徴とする請求項1乃至10の何れか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, further comprising means for presenting a verification result by the verification means to a user. 情報処理装置の制御方法であって、
作成手段が、被検証プログラムの検証する内容を示す検証式を作成する作成工程と、
判定手段が、前記作成工程において作成された検証式に関連するプログラムであるか否かを所定単位の被検証プログラムごとに判定する判定工程と、
変換手段が、前記判定工程において前記検証式に関連するプログラムであると判定された前記被検証プログラムについては、該被検証プログラムの状態を網羅的に探索して検証するモデル検証プログラムを実行するためのプログラムに該被検証プログラムを変換する変換工程と、
生成手段が、前記判定工程において前記検証式に関連するプログラムでないと判定された前記被検証プログラムについては、予め定義されたテンプレート適用データを用いて、前記モデル検証プログラムで実行する簡易的なプログラムを生成する生成工程と、
検証手段が、前記変換工程において変換されたプログラム、及び前記生成工程において生成されたプログラムを前記モデル検証プログラムによって検証する検証工程と
を実行することを特徴とする情報処理装置の制御方法。
A method for controlling an information processing apparatus,
A creating step in which the creating means creates a verification expression indicating the contents to be verified by the program to be verified;
A determination step of determining whether or not the determination means is a program related to the verification formula created in the creation step for each program to be verified;
In order to execute a model verification program in which the conversion means comprehensively searches and verifies the state of the verified program for the verified program determined to be a program related to the verification formula in the determining step A conversion step of converting the program to be verified into a program of
A simple program executed by the model verification program using the template application data defined in advance for the program to be verified that has been determined by the generation means not to be a program related to the verification formula in the determination step. A generation process to generate;
A control method for an information processing apparatus, wherein the verification means executes a program converted in the conversion step and a verification step of verifying the program generated in the generation step with the model verification program.
請求項1乃至10の何れか1項に記載の情報処理装置としてコンピュータを機能させるための該コンピュータで読み取り可能なプログラム。   A computer-readable program for causing a computer to function as the information processing apparatus according to claim 1.
JP2014029959A 2014-02-19 2014-02-19 Information processor, its control method and program Pending JP2015156053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014029959A JP2015156053A (en) 2014-02-19 2014-02-19 Information processor, its control method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014029959A JP2015156053A (en) 2014-02-19 2014-02-19 Information processor, its control method and program

Publications (1)

Publication Number Publication Date
JP2015156053A true JP2015156053A (en) 2015-08-27

Family

ID=54775345

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014029959A Pending JP2015156053A (en) 2014-02-19 2014-02-19 Information processor, its control method and program

Country Status (1)

Country Link
JP (1) JP2015156053A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014205280A (en) * 2013-04-11 2014-10-30 三菱樹脂株式会社 Transparent laminated film and transparent substrate

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014205280A (en) * 2013-04-11 2014-10-30 三菱樹脂株式会社 Transparent laminated film and transparent substrate

Similar Documents

Publication Publication Date Title
US10878086B2 (en) Dynamic code extraction-based automatic anti analysis evasion and code logic analysis apparatus
WO2013058118A1 (en) Text implication assessment device, text implication assessment method, and computer-readable recording medium
US8707273B2 (en) Precondition generating apparatus
US20170255877A1 (en) Heterogeneous computing method
CN104077265B (en) Utilize the method for shared memory transmitting mixed messaging
KR102074909B1 (en) Apparatus and method for classifying software vulnerability
US20130318540A1 (en) Data flow graph processing device, data flow graph processing method, and data flow graph processing program
WO2020075644A1 (en) Hyperparameter tuning method, device and program
US9507852B2 (en) Techniques for discriminative dependency parsing
US20180025162A1 (en) Application program analysis apparatus and method
US9507693B2 (en) Method, device and computer-readable storage medium for closure testing
US20120150886A1 (en) Placeholders returned for data representation items
US9274755B2 (en) Infrastructure for generating code using annotation and template generators
US9298480B2 (en) Programmatic editing of text files
Xu et al. Empowering R with high performance computing resources for big data analytics
KR20210061284A (en) System and method for dependent parsing
JP2015156053A (en) Information processor, its control method and program
US20120291019A1 (en) Program verification apparatus based on model verifying and storage medium
Luckow et al. Symbolic pathfinder v7
KR20160098794A (en) Apparatus and method for skeleton code generation based on device program structure modeling
JP5530469B2 (en) Natural language analysis processing apparatus, method, and program
KR20170129225A (en) Declarative cascade reordering of styles
JP6937589B2 (en) License management device, license management method, and program
Friedmann et al. Ramsey-based inclusion checking for visibly pushdown automata
JP2009295122A (en) Structured document processing system, structured document processing method, and structured document processing program