JP2020038482A - Program verification program, program verification method and program verification device - Google Patents

Program verification program, program verification method and program verification device Download PDF

Info

Publication number
JP2020038482A
JP2020038482A JP2018165145A JP2018165145A JP2020038482A JP 2020038482 A JP2020038482 A JP 2020038482A JP 2018165145 A JP2018165145 A JP 2018165145A JP 2018165145 A JP2018165145 A JP 2018165145A JP 2020038482 A JP2020038482 A JP 2020038482A
Authority
JP
Japan
Prior art keywords
variable
source code
value
instruction
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018165145A
Other languages
Japanese (ja)
Other versions
JP7111967B2 (en
Inventor
一寛 山下
Kazuhiro Yamashita
一寛 山下
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2018165145A priority Critical patent/JP7111967B2/en
Publication of JP2020038482A publication Critical patent/JP2020038482A/en
Application granted granted Critical
Publication of JP7111967B2 publication Critical patent/JP7111967B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

To accelerate the verification of a non-deterministic operation in a program.SOLUTION: A storage unit 11 stores a source code 13 for allowing the substitution of a plurality of values for the same variable. A processing unit 12 converts the source code 13 into a source code 14 of a static single substitution format for limiting the substitution of a value for each variable to one time. The processing unit 12 retrieves a command 15 showing writing in a database from the source code 14, detects a variable with a writing value stored in the command 15, and retrieves a command 16 showing the substitution of a value for the detected variable from the source code 14. The processing unit 12 determines whether the writing in the database is an argument of the source code 13 or a non-deterministic operation dependent on an execution state other than data of the database on the basis of an acquisition method of a value to be substituted for the variable detected in the command 16.SELECTED DRAWING: Figure 1

Description

本発明はプログラム検証プログラム、プログラム検証方法およびプログラム検証装置に関する。   The present invention relates to a program verification program, a program verification method, and a program verification device.

同一内容のデータを記憶する複数のデータベースをネットワーク上に配置した分散データベースシステムがある。例えば、トランザクション(取引)の履歴を示すブロックチェーンと呼ばれるデータベースを構築し、複数のサーバ装置が同一内容のブロックチェーンを保持することでトランザクションの正当性を担保するブロックチェーンシステムがある。分散データベースシステムにおけるデータベースの更新は、複数のサーバ装置に同じプログラムを配置しておき、それら複数のサーバ装置のプログラムに同一の入力を与えることで、複数のデータベースを並列に更新することによって行うことがある。   There is a distributed database system in which a plurality of databases storing data of the same content are arranged on a network. For example, there is a block chain system in which a database called a block chain indicating a history of a transaction (transaction) is constructed, and a plurality of server devices hold the same content of the block chain to ensure the validity of the transaction. Updating a database in a distributed database system is performed by arranging the same program in a plurality of server devices and providing the same input to the programs of the plurality of server devices, thereby updating the plurality of databases in parallel. There is.

なお、ソースコードのコンパイル時に、ソースコードから生成される中間コードに対して制御フローやデータフローの静的解析を行う静的解析方法が提案されている。提案の静的解析方法は、静的解析にあたって中間コードを静的単一代入(SSA: Static Single Assignment)形式に変換する。また、ソースコードから検証式を生成し、モデル検証ツールを用いてプログラム動作を検証するプログラム検証装置が提案されている。提案のプログラム検証装置は、ソースコードをSSA形式に変換し、元のソースコードとSSA形式ソースコードに基づいて検証対象の処理部分を決定する。   Note that a static analysis method has been proposed in which a control flow and a data flow are statically analyzed with respect to an intermediate code generated from the source code when compiling the source code. The proposed static analysis method converts an intermediate code into a static single assignment (SSA) format for static analysis. In addition, a program verification device that generates a verification formula from a source code and verifies a program operation using a model verification tool has been proposed. The proposed program verification device converts the source code into the SSA format, and determines a processing part to be verified based on the original source code and the SSA format source code.

特開平9−282173号公報JP-A-9-282173 特開2012−238235号公報JP 2012-238235 A

分散データベースシステムの複数のサーバ装置に配置されるプログラムは、同一のデータベースの内容および同一の入力に対して、データベースに書き込まれる値が同一になるという決定性をもっていることが要求される。プログラムに非決定的動作が含まれると、複数のデータベースの同一性が失われ、トランザクションの正当性の担保といった分散データベースシステムの目的を達成できなくなるおそれがある。   A program arranged in a plurality of server devices of a distributed database system is required to have determinism that values written to the database are the same for the same database contents and the same input. If a program includes non-deterministic operations, the identity of a plurality of databases may be lost, and the purpose of a distributed database system such as ensuring the validity of a transaction may not be achieved.

プログラムの非決定的動作は、データベースに書き込む値が、乱数の取得やタイムスタンプの取得などの所定の種類の操作に依存することによって発生する。そこで、複数のサーバ装置に配置されるプログラムを開発する際に、データベースへの書き込みが非決定的動作になるという不具合を発見するため、プログラムを検証することが考えられる。しかし、抽象構文木(AST:Abstract Syntax Tree)の探索やシンボリック実行など、従来のソースコードの静的解析方法では、データベースへの書き込みに関連する命令の追跡が非効率となり検証時間が増大するという問題がある。   The non-deterministic operation of the program occurs when a value to be written to the database depends on a predetermined type of operation such as obtaining a random number or obtaining a time stamp. Therefore, when developing a program to be allocated to a plurality of server devices, it is conceivable to verify the program in order to discover a problem that writing to the database is an indeterminate operation. However, conventional static analysis of source code, such as searching for an abstract syntax tree (AST) or symbolic execution, inefficiently traces instructions related to writing to a database and increases verification time. There's a problem.

1つの側面では、本発明は、非決定的動作の検証を高速化できるプログラム検証プログラム、プログラム検証方法およびプログラム検証装置を提供することを目的とする。   In one aspect, an object of the present invention is to provide a program verification program, a program verification method, and a program verification device that can speed up verification of a non-deterministic operation.

1つの態様では、コンピュータに以下の処理を実行させるプログラム検証プログラムが提供される。同一の変数への複数回の値の代入を許容する第1のソースコードを、各変数への値の代入を1回に制限する静的単一代入形式の第2のソースコードに変換する。第2のソースコードから、データベースへの書き込みを示す第1の命令を検索し、第1の命令において書き込む値が格納されている変数を検出し、第2のソースコードから、検出した変数への値の代入を示す第2の命令を検索する。第2の命令における検出した変数に代入される値の取得方法に基づいて、データベースへの書き込みが、第1のソースコードの引数およびデータベースのデータ以外の実行状況に依存する非決定的動作であるか否か判定する。また、1つの態様では、コンピュータが実行するプログラム検証方法が提供される。また、1つの態様では、記憶部と処理部とを有するプログラム検証装置が提供される。   In one aspect, a program verification program for causing a computer to execute the following processing is provided. The first source code that allows multiple values to be assigned to the same variable is converted to a static single assignment type second source code that limits the assignment of a value to each variable to one. From the second source code, a first instruction indicating writing to the database is searched, a variable storing a value to be written in the first instruction is detected, and the second source code is searched for the detected variable. Search for a second instruction that indicates a value assignment. Based on the acquisition method of the value substituted for the detected variable in the second instruction, whether writing to the database is a non-deterministic operation that depends on the execution status other than the argument of the first source code and the data of the database. Determine whether or not. In one aspect, a program verification method executed by a computer is provided. In one aspect, a program verification device having a storage unit and a processing unit is provided.

1つの側面では、非決定的動作の検証を高速化できる。   In one aspect, non-deterministic operation verification can be speeded up.

第1の実施の形態のプログラム検証装置の例を説明する図である。FIG. 2 is a diagram illustrating an example of a program verification device according to the first embodiment. 第2の実施の形態の情報処理システムの例を示す図である。FIG. 14 is a diagram illustrating an example of an information processing system according to a second embodiment. 開発装置のハードウェア例を示すブロック図である。FIG. 3 is a block diagram illustrating an example of hardware of a development device. ブロックチェーンのデータ構造例を示す図である。FIG. 3 is a diagram illustrating an example of a data structure of a block chain. スマートコントラクトの非決定的動作の例を示す図である。It is a figure showing an example of non-deterministic operation of a smart contract. スマートコントラクトの例を示す図である。It is a figure showing the example of a smart contract. 抽象構文木の第1の例を示す図である。FIG. 5 is a diagram illustrating a first example of an abstract syntax tree. 抽象構文木の第2の例を示す図である。FIG. 11 is a diagram illustrating a second example of an abstract syntax tree. シンボリック実行の例を示す図である。It is a figure showing an example of symbolic execution. SSAソースコードの例を示す図である。FIG. 3 is a diagram illustrating an example of an SSA source code. 開発装置の機能例を示すブロック図である。It is a block diagram showing an example of a function of a development device. 開発装置が保持するテーブルの例を示す図である。FIG. 4 is a diagram illustrating an example of a table held by a development device. プログラム検証の手順例を示すフローチャートである。9 is a flowchart illustrating an example of a procedure of program verification. スマートコントラクトとSSAソースコードの他の例を示す図である。It is a figure showing other examples of a smart contract and SSA source code.

以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
第1の実施の形態を説明する。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
A first embodiment will be described.

図1は、第1の実施の形態のプログラム検証装置の例を説明する図である。
第1の実施の形態のプログラム検証装置10は、開発したプログラムを検証する。検証するプログラムは、同一内容のデータを記憶する複数のデータベースを並列に更新する分散データベースシステムに用いられるプログラムであってもよい。例えば、検証するプログラムは、ブロックチェーンを管理する複数のサーバ装置で並列に実行されるものである。プログラム検証装置10は、情報処理装置やコンピュータと呼ばれることもある。プログラム検証装置10は、クライアント装置でもよいしサーバ装置でもよい。
FIG. 1 is a diagram illustrating an example of a program verification device according to the first embodiment.
The program verification device 10 according to the first embodiment verifies a developed program. The program to be verified may be a program used in a distributed database system that updates a plurality of databases storing data of the same content in parallel. For example, a program to be verified is executed in parallel by a plurality of server devices that manage a block chain. The program verification device 10 may be called an information processing device or a computer. The program verification device 10 may be a client device or a server device.

プログラム検証装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性の半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。   The program verification device 10 has a storage unit 11 and a processing unit 12. The storage unit 11 may be a volatile semiconductor memory such as a random access memory (RAM) or a nonvolatile storage such as a hard disk drive (HDD) or a flash memory. The processing unit 12 is a processor such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), and a DSP (Digital Signal Processor). However, the processing unit 12 may include a special-purpose electronic circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array). A set of multiple processors may be referred to as a “multiprocessor” or simply “processor”.

記憶部11は、検証対象のソースコード13(第1のソースコード)を記憶する。ソースコード13は、高水準言語であるプログラミング言語によって記述されている。ソースコード13は、同一の変数への複数回の値の代入を許容している。また、記憶部11は、後述するようにソースコード13から変換されたソースコード14(第2のソースコード)を記憶する。ソースコード14は、ソースコード13と同様に高水準言語であるプログラミング言語によって記述されている。ソースコード14は、静的単一代入形式(SSA形式)であり、各変数への値の代入を1回に制限している。   The storage unit 11 stores the source code 13 (first source code) to be verified. The source code 13 is described in a programming language that is a high-level language. The source code 13 allows multiple values to be assigned to the same variable. The storage unit 11 stores a source code 14 (second source code) converted from the source code 13 as described later. The source code 14 is described in a programming language that is a high-level language like the source code 13. The source code 14 is in a static single assignment format (SSA format), and limits the assignment of a value to each variable to one time.

処理部12は、ソースコード13を検証するにあたり、まずソースコード13をソースコード14に変換する。SSA形式への変換では、処理部12は、ソースコード13の中から同一の変数に対する2回目の値の代入を検出する。すると、処理部12は、ソースコード13で使用されていない新たな変数を定義し、値の代入先を新たな変数に変更し、それ以降の当該変数の参照を当該新たな変数の参照に置換する。これによって、各変数への値の代入を高々1回に制限することができる。   When verifying the source code 13, the processing unit 12 first converts the source code 13 into a source code 14. In the conversion to the SSA format, the processing unit 12 detects the second assignment of the value to the same variable from the source code 13. Then, the processing unit 12 defines a new variable that is not used in the source code 13, changes the substitution destination of the value to the new variable, and replaces the subsequent reference of the variable with the reference of the new variable. I do. As a result, it is possible to limit the substitution of a value to each variable at most once.

例えば、ソースコード13は、引数の値を変数valueに代入する命令と、変数valueの値に乱数を加えた値を変数valueに代入する命令と、変数valueの値をデータベースに書き込む命令を含む。これに対してソースコード14は、引数の値を変数value0に代入する命令と、変数value0の値に乱数を加えた値を変数value1に代入する命令と、変数value1の値をデータベースに書き込む命令を含む。   For example, the source code 13 includes an instruction to assign the value of the argument to the variable value, an instruction to assign a value obtained by adding a random number to the value of the variable value to the variable value, and an instruction to write the value of the variable value to the database. On the other hand, the source code 14 issues an instruction to assign the value of the argument to the variable value0, an instruction to assign the value obtained by adding a random number to the value of the variable value0 to the variable value1, and an instruction to write the value of the variable value1 to the database. Including.

次に、処理部12は、ソースコード14から、データベースへの書き込みを示す命令15(第1の命令)を検索する。処理部12は、命令15において書き込む値が格納されている変数を検出する。書き込む値が格納されている変数は、例えば、命令15の右辺に記載されているオペランドである。処理部12は、ソースコード14から、検出した変数への値の代入を示す命令16(第2の命令)を検索する。検出した変数は、例えば、命令16の左辺に記載されている。処理部12は、例えば、命令15からソースコード14の先頭に向かって、ソースコード14の命令を走査することで命令16を検索する。   Next, the processing unit 12 searches the source code 14 for an instruction 15 (first instruction) indicating writing to the database. The processing unit 12 detects a variable in which the value to be written in the instruction 15 is stored. The variable in which the value to be written is stored is, for example, an operand described on the right side of the instruction 15. The processing unit 12 searches the source code 14 for an instruction 16 (second instruction) indicating the assignment of a value to the detected variable. The detected variable is described, for example, on the left side of the instruction 16. The processing unit 12 searches for the instruction 16 by scanning the instruction of the source code 14 from the instruction 15 toward the beginning of the source code 14, for example.

例えば、処理部12は、ソースコード14から、PutState(”key”,value1)を命令15として検出する。この命令は、”key”に対応するバリューとして変数value1の値をデータベースに書き込むものである。すると、処理部12は、ソースコード14を命令15から遡って走査し、value1=value0+rand.Int32()を命令16として検出する。この命令は、変数value0の値に乱数を加えた値をvalue1に代入するものである。   For example, the processing unit 12 detects PutState (“key”, value 1) as the instruction 15 from the source code 14. This instruction writes the value of the variable value1 to the database as a value corresponding to "key". Then, the processing unit 12 scans the source code 14 retroactively from the instruction 15, and calculates value1 = value0 + rand. Int32 () is detected as the instruction 16. This instruction substitutes a value obtained by adding a random number to the value of the variable value0 to value1.

処理部12は、命令16における検出した変数に代入される値の取得方法を特定し、特定した取得方法に基づいて、データベースへの書き込みが非決定的動作であるか判定する。変数に代入される値の取得方法は、例えば、命令16の右辺から特定することができる。非決定的動作は、書き込まれる値が、ソースコード13の引数およびデータベースに格納されているデータ以外の実行状況に依存して変化し得る動作である。   The processing unit 12 specifies an acquisition method of a value to be substituted for the detected variable in the instruction 16, and determines whether writing to the database is a non-deterministic operation based on the identified acquisition method. The method of acquiring the value to be assigned to the variable can be specified from the right side of the instruction 16, for example. The non-deterministic operation is an operation in which the value to be written can change depending on the execution status other than the argument of the source code 13 and the data stored in the database.

非決定的動作の原因には、例えば、書き込まれる値が乱数またはタイムスタンプ(現在時刻)に依存することが含まれる。また、非決定的動作の原因には、例えば、書き込まれる値が、複数のスレッドによって共有されるグローバル変数に依存することが含まれる。また、非決定的動作の原因には、例えば、書き込まれる値が、ソースコード13に規定する処理を実行するサーバ装置の外部のAPI(Application Programming Interface)を呼び出すことで取得される値に依存することが含まれる。また、非決定的動作の原因には、例えば、書き込まれる値が、Mapオブジェクトなど、複数のデータ要素を保持しておりデータ要素間の順序が保証されないデータ構造に依存することが含まれる。   Causes of non-deterministic operation include, for example, that the value to be written depends on a random number or a time stamp (current time). Also, the cause of the non-deterministic operation includes, for example, that the value to be written depends on a global variable shared by a plurality of threads. The cause of the non-deterministic operation is, for example, that the value to be written depends on a value obtained by calling an API (Application Programming Interface) external to the server device that executes the processing specified in the source code 13. Is included. The cause of the non-deterministic operation includes, for example, that the value to be written depends on a data structure such as a Map object, which holds a plurality of data elements and the order between the data elements is not guaranteed.

例えば、処理部12は、value1=value0+rand.Int32()を命令16として検出すると、変数value1に代入される値の取得方法の中に、乱数の使用が含まれていることを検出する。すると、処理部12は、命令16において変数value1に代入される値が非決定的であり、その結果として命令15でデータベースに書き込まれる値が非決定的であると判定する。   For example, the processing unit 12 determines that value1 = value0 + rand. When Int32 () is detected as the instruction 16, it is detected that the use of a random number is included in the method of acquiring the value substituted for the variable value1. Then, the processing unit 12 determines that the value assigned to the variable value1 in the instruction 16 is nondeterministic, and as a result, the value written to the database by the instruction 15 is nondeterministic.

処理部12は、データベースへの書き込みが非決定的動作であるか否かの判定結果を出力する。例えば、処理部12は、プログラム検証装置10が有するディスプレイに判定結果を表示する。ただし、処理部12は、プログラム検証装置10が有するストレージ装置に判定結果を記録してもよく、ディスプレイ以外の出力デバイスに判定結果を出力してもよい。また、処理部12は、他の情報処理装置に判定結果を送信してもよい。判定結果は、データベースへの書き込みを示す命令15を識別する情報を含んでもよく、書き込まれる値の代入を示す命令16を識別する情報を含んでもよい。命令16の右辺に乱数が含まれている場合、例えば、処理部12は、ソースコード13が規定するデータベースへの書き込みが非決定的動作であることを示す警告をディスプレイに表示する。   The processing unit 12 outputs a determination result as to whether writing to the database is a non-deterministic operation. For example, the processing unit 12 displays the determination result on a display of the program verification device 10. However, the processing unit 12 may record the determination result in a storage device of the program verification device 10 or may output the determination result to an output device other than the display. Further, the processing unit 12 may transmit the determination result to another information processing device. The determination result may include information for identifying the instruction 15 indicating writing to the database, or may include information for identifying the instruction 16 indicating substitution of a value to be written. If the right side of the instruction 16 includes a random number, for example, the processing unit 12 displays a warning on the display indicating that writing to the database defined by the source code 13 is a non-deterministic operation.

第1の実施の形態のプログラム検証装置10によれば、ソースコード13がSSA形式のソースコード14に変換される。そして、ソースコード14を用いて、データベースに書き込む値を保持する変数に関連する命令が検索され、データベースへの書き込みが非決定的動作であるか否か判定される。これにより、ソースコード13の開発時に、データベースに書き込まれる値が引数およびデータベースのデータ以外の実行状況に依存して変化するという不具合を検出することが可能となる。よって、ソースコード13に規定する処理を複数のコンピュータで並列に実行した場合に、ソースコード13の不具合によりデータベース間の整合性が失われることを抑制することができる。   According to the program verification device 10 of the first embodiment, the source code 13 is converted into the SSA format source code 14. Then, using the source code 14, an instruction related to a variable holding a value to be written to the database is searched to determine whether writing to the database is a non-deterministic operation. This makes it possible to detect a problem that the value written to the database changes during the development of the source code 13 depending on the execution status other than the argument and the data of the database. Therefore, when the processing specified in the source code 13 is executed in parallel by a plurality of computers, it is possible to suppress loss of consistency between databases due to a defect in the source code 13.

また、SSA形式のソースコード14を利用することで、データベースに書き込む値に関連する命令を検索することが容易となり、非決定的動作の検証を高速化することができる。ソースコード14では、データベースに書き込む値を保持する変数への代入は1回のみ行われ、かつ、同一関数内ではデータフローの順に命令が並んでいる。よって、例えば、データベースへの書き込みを示す命令15から逆順に命令を走査することで、変数への値の代入を示す命令16を高速に検索することができる。また、ソースコード13に対応する抽象構文木を利用する方法と比べて、変数に関連する命令を追跡するために抽象構文木を繰り返し走査しなくてよく、検索が高速化される。また、シンボリック実行を利用する方法と比べて、複雑なパス抽出を行わなくてよく検索が高速化される。   Further, by using the source code 14 in the SSA format, it is easy to search for an instruction related to a value to be written to the database, and the speed of verification of nondeterministic operation can be increased. In the source code 14, the assignment to the variable holding the value to be written to the database is performed only once, and instructions are arranged in the order of data flow in the same function. Therefore, for example, by scanning the instructions in reverse order from the instruction 15 indicating writing to the database, the instruction 16 indicating assignment of a value to a variable can be searched at high speed. Further, compared to the method using the abstract syntax tree corresponding to the source code 13, the abstract syntax tree does not need to be repeatedly scanned to track the instruction related to the variable, and the search is speeded up. Also, compared to the method using symbolic execution, complicated path extraction does not need to be performed, and the search is speeded up.

[第2の実施の形態]
次に、第2の実施の形態を説明する。
図2は、第2の実施の形態の情報処理システムの例を示す図である。
[Second embodiment]
Next, a second embodiment will be described.
FIG. 2 is a diagram illustrating an example of the information processing system according to the second embodiment.

第2の実施の形態の情報処理システムは、複数のサーバ装置を用いてブロックチェーンを管理する分散データベースシステムである。ブロックチェーンは、一連のトランザクションの履歴を示すデータベースであり、それらトランザクションに対応するブロックを連結したリストである。複数のサーバ装置が同一内容のブロックチェーンを保持して相互に確認することで、トランザクションの正当性を担保することができる。   The information processing system according to the second embodiment is a distributed database system that manages a block chain using a plurality of server devices. The block chain is a database showing the history of a series of transactions, and is a list in which blocks corresponding to those transactions are linked. A plurality of server devices hold the same contents of the block chain and mutually confirm each other, so that the legitimacy of the transaction can be secured.

第2の実施の形態の情報処理システムは、開発装置100およびサーバ装置200,200−1,200−2,200−3,200−4を含む。開発装置100およびサーバ装置200,200−1,200−2,200−3,200−4は、ネットワーク30に接続されている。ネットワーク30は、インターネットなどの広域ネットワークである。   The information processing system according to the second embodiment includes a development device 100 and server devices 200, 200-1, 200-2, 200-3, and 200-4. The development device 100 and the server devices 200, 200-1, 200-2, 200-3, and 200-4 are connected to the network 30. The network 30 is a wide area network such as the Internet.

開発装置100は、サーバ装置200,200−1,200−2,200−3,200−4で実行されるプログラムであるスマートコントラクトの開発に用いられる情報処理装置である。スマートコントラクトは、新たなトランザクションの発生に応じて、ブロックチェーンの末尾に新たなブロックを追加する。開発装置100は、同一のスマートコントラクトをサーバ装置200,200−1,200−2,200−3,200−4に配布する。開発装置100は、クライアント装置でもよいしサーバ装置でもよい。   The development device 100 is an information processing device used for developing a smart contract that is a program executed by the server devices 200, 200-1, 200-2, 200-3, and 200-4. The smart contract adds a new block to the end of the blockchain when a new transaction occurs. The development device 100 distributes the same smart contract to the server devices 200, 200-1, 200-2, 200-3, and 200-4. The development device 100 may be a client device or a server device.

サーバ装置200,200−1,200−2,200−3,200−4は、同一内容のブロックチェーンを保持する情報処理装置である。サーバ装置200,200−1,200−2,200−3,200−4には同一のスマートコントラクトが配置されている。サーバ装置200,200−1,200−2,200−3,200−4は、新たに発生したトランザクションを示す入力情報を受信し、受信した入力情報を用いてスマートコントラクトを実行することで並列にブロックチェーンを更新する。   Each of the server devices 200, 200-1, 200-2, 200-3, and 200-4 is an information processing device that holds block chains having the same contents. The same smart contract is arranged in each of the server devices 200, 200-1, 200-2, 200-3, and 200-4. The server devices 200, 200-1, 200-2, 200-3, and 200-4 receive the input information indicating the newly generated transaction, and execute the smart contract using the received input information to execute the smart contract in parallel. Update the blockchain.

サーバ装置200は、ブロックチェーン210を保持し、スマートコントラクトを実行してブロックチェーン210を更新する。サーバ装置200−1は、ブロックチェーン210−1を保持し、スマートコントラクトを実行してブロックチェーン210−1を更新する。サーバ装置200−2は、ブロックチェーン210−2を保持し、スマートコントラクトを実行してブロックチェーン210−2を更新する。サーバ装置200−3は、ブロックチェーン210−3を保持し、スマートコントラクトを実行してブロックチェーン210−3を更新する。サーバ装置200−4は、ブロックチェーン210−4を保持し、スマートコントラクトを実行してブロックチェーン210−4を更新する。   The server device 200 holds the blockchain 210 and executes the smart contract to update the blockchain 210. The server device 200-1 holds the block chain 210-1 and executes the smart contract to update the block chain 210-1. The server device 200-2 holds the block chain 210-2, executes the smart contract, and updates the block chain 210-2. The server device 200-3 holds the block chain 210-3, executes the smart contract, and updates the block chain 210-3. The server device 200-4 holds the blockchain 210-4, executes the smart contract, and updates the blockchain 210-4.

図3は、開発装置のハードウェア例を示すブロック図である。
開発装置100は、バスに接続されたCPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107を有する。開発装置100は、第1の実施の形態のプログラム検証装置10に対応する。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。サーバ装置200,200−1,200−2,200−3,200−4も同様のハードウェアを有する。
FIG. 3 is a block diagram illustrating an example of hardware of the development device.
The development device 100 includes a CPU 101, a RAM 102, an HDD 103, an image signal processing unit 104, an input signal processing unit 105, a medium reader 106, and a communication interface 107 connected to a bus. The development device 100 corresponds to the program verification device 10 according to the first embodiment. The CPU 101 corresponds to the processing unit 12 according to the first embodiment. The RAM 102 or the HDD 103 corresponds to the storage unit 11 according to the first embodiment. The server devices 200, 200-1, 200-2, 200-3, and 200-4 have similar hardware.

CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。なお、CPU101は複数のプロセッサコアを備えてもよく、開発装置100は複数のプロセッサを備えてもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。   The CPU 101 is a processor that executes instructions of a program. The CPU 101 loads at least a part of the programs and data stored in the HDD 103 into the RAM 102 and executes the programs. Note that the CPU 101 may include a plurality of processor cores, and the development device 100 may include a plurality of processors. A set of multiple processors may be referred to as a “multiprocessor” or simply “processor”.

RAM102は、CPU101が実行するプログラムやCPU101が演算に使用するデータを一時的に記憶する揮発性の半導体メモリである。なお、開発装置100は、RAM以外の種類のメモリを備えてもよく、複数のメモリを備えてもよい。   The RAM 102 is a volatile semiconductor memory that temporarily stores programs executed by the CPU 101 and data used by the CPU 101 for calculations. The development device 100 may include a type of memory other than the RAM, or may include a plurality of memories.

HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性ストレージである。なお、開発装置100は、フラッシュメモリやSSD(Solid State Drive)など他の種類のストレージを備えてもよく、複数のストレージを備えてもよい。   The HDD 103 is a non-volatile storage that stores an OS (Operating System), software programs such as middleware and application software, and data. Note that the development device 100 may include another type of storage such as a flash memory or an SSD (Solid State Drive), or may include a plurality of storages.

画像信号処理部104は、CPU101からの命令に従って、開発装置100に接続されたディスプレイ111に画像を出力する。ディスプレイ111としては、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、有機EL(OEL:Organic Electro-Luminescence)ディスプレイなど、任意の種類のディスプレイを使用することができる。   The image signal processing unit 104 outputs an image to a display 111 connected to the development device 100 according to a command from the CPU 101. As the display 111, an arbitrary type of display such as a CRT (Cathode Ray Tube) display, a liquid crystal display (LCD: Liquid Crystal Display), and an organic EL (OEL: Organic Electro-Luminescence) display can be used.

入力信号処理部105は、開発装置100に接続された入力デバイス112から入力信号を受信する。入力デバイス112として、マウス、タッチパネル、タッチパッド、キーボードなど、任意の種類の入力デバイスを使用できる。また、開発装置100に複数の種類の入力デバイスが接続されてもよい。   The input signal processing unit 105 receives an input signal from the input device 112 connected to the development device 100. As the input device 112, any type of input device such as a mouse, a touch panel, a touch pad, and a keyboard can be used. Further, a plurality of types of input devices may be connected to the development device 100.

媒体リーダ106は、記録媒体113に記録されたプログラムやデータを読み取る読み取り装置である。記録媒体113として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)、半導体メモリなどを使用できる。媒体リーダ106は、例えば、記録媒体113から読み取ったプログラムやデータをRAM102またはHDD103に格納する。   The medium reader 106 is a reading device that reads programs and data recorded on the recording medium 113. As the recording medium 113, for example, a magnetic disk such as a flexible disk (FD: Flexible Disk) or an HDD, an optical disk such as a CD (Compact Disc) or a DVD (Digital Versatile Disc), a magneto-optical disk (MO: Magneto-Optical disk), A semiconductor memory or the like can be used. The medium reader 106 stores programs and data read from the recording medium 113 in the RAM 102 or the HDD 103, for example.

通信インタフェース107は、ネットワーク30に接続され、ネットワーク30を介してサーバ装置200,200−1〜200−4などの情報処理装置と通信を行うインタフェースである。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースである。ただし、基地局やアクセスポイントなどの無線通信装置に接続される無線通信インタフェースを利用してもよい。   The communication interface 107 is an interface that is connected to the network 30 and communicates with information processing devices such as the server devices 200 and 200-1 to 200-4 via the network 30. The communication interface 107 is a wired communication interface connected to a wired communication device such as a switch or a router. However, a wireless communication interface connected to a wireless communication device such as a base station or an access point may be used.

図4は、ブロックチェーンのデータ構造例を示す図である。
サーバ装置200,200−1,200−2,200−3,200−4は、図4に示すようなデータ構造のブロックチェーンを保持する。ブロックチェーンは、ブロック40,40−1,40−2などの複数のブロックを含む。1つのブロックは1つのトランザクション(取引)を示す。ブロック40−1はブロック40の前段のブロックである。ブロック40−2はブロック40の後段のブロックである。各ブロックは、例えば、データをキーとバリューの組であるキーバリュー形式で保持することができる。ブロック40は、ハッシュ値41、取引データ42、公開鍵43および署名44を含む。ブロック40−1,40−2などの他のブロックも、ブロック40と同様のデータ構造をもつ。
FIG. 4 is a diagram illustrating an example of a data structure of a block chain.
Each of the server devices 200, 200-1, 200-2, 200-3, and 200-4 holds a block chain having a data structure as shown in FIG. The block chain includes a plurality of blocks such as blocks 40, 40-1, and 40-2. One block indicates one transaction. The block 40-1 is a block preceding the block 40. Block 40-2 is a block subsequent to block 40. Each block can hold data in a key-value format, which is a set of a key and a value, for example. Block 40 includes hash value 41, transaction data 42, public key 43, and signature 44. Other blocks such as the blocks 40-1 and 40-2 have the same data structure as the block 40.

ハッシュ値41は、前段のブロック40−1の全体を所定のハッシュ関数に入力することで算出されるハッシュ値である。ハッシュ値41により、ブロック40とその前段のブロック40−1とが関連付けられる。また、ブロック40−2に含まれるハッシュ値により、ブロック40−2とその前段のブロック40とが関連付けられる。取引データ42は、取引金額などトランザクションの内容を示す。   The hash value 41 is a hash value calculated by inputting the entirety of the preceding block 40-1 to a predetermined hash function. The hash value 41 associates the block 40 with the preceding block 40-1. In addition, the block 40-2 is associated with the preceding block 40 by the hash value included in the block 40-2. The transaction data 42 indicates the content of the transaction such as the transaction amount.

公開鍵43は、取引相手の公開鍵である。ブロック40が示すトランザクションの取引相手は、後段のブロック40−2が示すトランザクションの取引主体になることが期待される。よって、公開鍵43を用いて、後段のブロック40−2に含まれる署名を検証することができる。署名44は、取引主体(取引元)の秘密鍵を用いて生成されたデジタル署名である。ブロック40が示すトランザクションの取引主体は、前段のブロック40−1が示すトランザクションの取引相手であることが期待される。よって、前段のブロック40−1の公開鍵を用いて、ブロック40の署名44を検証することができる。   The public key 43 is the public key of the business partner. It is expected that the trading partner of the transaction indicated by the block 40 will be the subject of the transaction indicated by the subsequent block 40-2. Therefore, the signature included in the subsequent block 40-2 can be verified using the public key 43. The signature 44 is a digital signature generated using a private key of a business entity (transaction source). The business entity of the transaction indicated by block 40 is expected to be the trading partner of the transaction indicated by block 40-1 at the preceding stage. Therefore, the signature 44 of the block 40 can be verified using the public key of the preceding block 40-1.

次に、スマートコントラクトの開発における問題点について説明する。
図5は、スマートコントラクトの非決定的動作の例を示す図である。
サーバ装置200,200−1,200−2,200−3,200−4は、同一の入力情報を受信して同一のスマートコントラクトを実行し、並列にブロックチェーン210,210−1,210−2,210−3,210−4を更新する。更新後のブロックチェーン210,210−1,210−2,210−3,210−4の内容は同一であることが求められる。よって、スマートコントラクトは、ブロックチェーンに書き込む値が、入力情報および更新前のブロックチェーンの内容から一意に決定されるようにし、それ以外の外部状態に依存して決定されることがないようにすることが求められる。
Next, problems in the development of a smart contract will be described.
FIG. 5 is a diagram illustrating an example of a non-deterministic operation of the smart contract.
The server devices 200, 200-1, 200-2, 200-3, and 200-4 receive the same input information, execute the same smart contract, and execute the block chains 210, 210-1, and 210-2 in parallel. , 210-3, 210-4. The contents of the updated block chains 210, 210-1, 210-2, 210-3, 210-4 are required to be the same. Therefore, the smart contract ensures that the value to be written to the blockchain is uniquely determined from the input information and the contents of the blockchain before update, and is not determined depending on other external states. Is required.

ブロックチェーンに書き込む値が、入力情報および更新前のブロックチェーンの内容のみに依存する場合、書き込みが決定的であると言うことができる。一方、ブロックチェーンに書き込む値が、入力情報および更新前のブロックチェーンの内容以外の外部状態に依存する場合、書き込みが非決定的であると言うことができる。外部状態への依存として、乱数の使用、タイムスタンプの使用、外部APIの呼び出し、グローバル変数の参照およびMapオブジェクトの反復参照が挙げられる。   If the value to be written to the blockchain depends only on the input information and the contents of the blockchain before updating, it can be said that the writing is deterministic. On the other hand, if the value to be written to the block chain depends on an external state other than the input information and the contents of the block chain before updating, it can be said that the writing is non-deterministic. Dependencies on external states include the use of random numbers, the use of timestamps, calling external APIs, referencing global variables, and iteratively referencing Map objects.

乱数を使用すると、ブロックチェーンに書き込む値がランダムに変化してしまう。タイムスタンプを使用すると、スマートコントラクトを実行する時刻の違いによってブロックチェーンに書き込む値が変化してしまう。外部APIを呼び出すと、外部APIを呼び出すことでサーバ装置の外部から受信される情報が不変であることが保証されず、ブロックチェーンに書き込む値がサーバ装置によって変化してしまう。   If a random number is used, the value written to the blockchain will change randomly. When a time stamp is used, the value written to the blockchain changes depending on the time at which the smart contract is executed. When an external API is called, it is not guaranteed that information received from outside the server device by calling the external API is unchanged, and the value to be written in the block chain changes depending on the server device.

グローバル変数を参照すると、あるスレッドが参照するグローバル変数の値が他のスレッドによって書き換えられることがあり、同一サーバ装置上の複数のスレッドの実行タイミングによってブロックチェーンに書き込む値が変化してしまう。Mapオブジェクトは、複数のデータ要素(エントリやレコードと言うこともある)を格納可能なデータ構造であって、それら複数のデータ要素の格納順序が保証されないデータ構造である。そのため、for文などの反復構造を用いてMapオブジェクトに格納された複数のデータ要素を順に参照すると、それら複数のデータ要素の参照順序がサーバ装置によって変わり、ブロックチェーンに書き込む値が変化してしまう。   When referring to a global variable, the value of the global variable referred to by a certain thread may be rewritten by another thread, and the value to be written to the block chain changes depending on the execution timing of a plurality of threads on the same server device. The Map object is a data structure capable of storing a plurality of data elements (sometimes called entries or records), and the storage order of the plurality of data elements is not guaranteed. Therefore, when a plurality of data elements stored in the Map object are sequentially referred to using a repetitive structure such as a for statement, the reference order of the plurality of data elements changes depending on the server device, and the value written in the block chain changes. .

例えば、タイムスタンプ(現在時刻)をブロックチェーンに書き込むスマートコントラクト51がサーバ装置200,200−1,200−2,200−3,200−4に配置されたとする。すると、ブロックチェーン210,210−1,210−2,210−3,210−4に書き込まれる値が同一になるとは限らない。例えば、ブロックチェーン210には時刻「10:20:06 430Z」が書き込まれる。ブロックチェーン210−1には時刻「10:20:06 450Z」が書き込まれる。ブロックチェーン210−2には時刻「10:20:06 450Z」が書き込まれる。ブロックチェーン210−3には時刻「10:20:06 400Z」が書き込まれる。ブロックチェーン210−4には時刻「10:20:06 419Z」が書き込まれる。   For example, it is assumed that the smart contract 51 that writes a time stamp (current time) in the block chain is arranged in the server devices 200, 200-1, 200-2, 200-3, and 200-4. Then, the values written in the block chains 210, 210-1, 210-2, 210-3, and 210-4 are not necessarily the same. For example, the time “10:20:06 430Z” is written in the block chain 210. The time “10:20:06 450Z” is written in the block chain 210-1. The time “10:20:06 450Z” is written in the block chain 210-2. The time “10:20:06 400Z” is written in the block chain 210-3. Time “10:20:06 419Z” is written in the block chain 210-4.

ブロックチェーンへの書き込みが非決定的動作になるスマートコントラクトをサーバ装置200,200−1,200−2,200−3,200−4に配置すると、情報処理システムに不具合が発生する。そこで、開発装置100は、開発したスマートコントラクトに非決定的動作が含まれていないか検証する。   If a smart contract in which writing to the blockchain becomes a non-deterministic operation is arranged in the server device 200, 200-1, 200-2, 200-3, 200-4, a problem occurs in the information processing system. Therefore, the development device 100 verifies that the developed smart contract does not include a non-deterministic operation.

図6は、スマートコントラクトの例を示す図である。
開発装置100は、開発したスマートコントラクトを記憶する。スマートコントラクト52,53は、検証対象のスマートコントラクトの例である。
FIG. 6 is a diagram illustrating an example of a smart contract.
The development device 100 stores the developed smart contract. The smart contracts 52 and 53 are examples of a smart contract to be verified.

スマートコントラクト52は、関数Initを含む。関数Initは、呼び出されるときに4つの引数args[0]〜args[3]を受け付ける。関数Initは、引数args[0]の文字列を変数Aに代入し、整数の乱数を変数Avalに代入し、引数args[2]の文字列を変数Bに代入し、引数args[3]の文字列が表す整数を変数Bvalに代入する。乱数は関数rand.Int32を呼び出すことで取得される。   The smart contract 52 includes a function Init. The function Init receives four arguments args [0] to args [3] when called. The function Init assigns the character string of the argument args [0] to the variable A, assigns an integer random number to the variable Aval, assigns the character string of the argument args [2] to the variable B, and assigns the argument args [3] to the variable B. The integer represented by the character string is assigned to a variable Bval. The random number is a function rand. It is obtained by calling Int32.

引数args[3]の文字列を整数に変換できない場合、関数Initはエラーメッセージを出力する。関数Initは、変数Aの文字列をキーとし、変数Avalの整数を表す文字列をバリューとしてブロックチェーンに書き込む。ブロックチェーンへの書き込みは、関数PutStateを呼び出すことで行う。このときエラーが発生すると、関数Initはエラーメッセージを出力する。また、関数Initは、変数Bの文字列をキーとし、変数Bvalの整数を表す文字列をバリューとしてブロックチェーンに書き込む。このときエラーが発生すると、関数Initはエラーメッセージを出力する。   If the character string of the argument args [3] cannot be converted to an integer, the function Init outputs an error message. The function Init uses the character string of the variable A as a key and writes a character string representing an integer of the variable Aval as a value into the block chain. Writing to the block chain is performed by calling the function PutState. If an error occurs at this time, the function Init outputs an error message. The function Init uses the character string of the variable B as a key and writes a character string representing an integer of the variable Bval as a value into the block chain. If an error occurs at this time, the function Init outputs an error message.

スマートコントラクト53は、文字列型の変数A、整数型の変数Avalおよび整数型の変数Xを定義する。スマートコントラクト53は、文字列「key」を変数Aに代入し、整数「1」を変数Avalに代入し、整数の乱数を変数Xに代入する。スマートコントラクト53は、変数Avalの値に変数Xの値を加算し、加算結果を変数Avalに代入する。そして、スマートコントラクト53は、変数Aの文字列をキーとし、変数Avalの整数を表す文字列をバリューとしてブロックチェーンに書き込む。   The smart contract 53 defines a character string type variable A, an integer type variable Aval, and an integer type variable X. The smart contract 53 assigns the character string “key” to the variable A, assigns the integer “1” to the variable Aval, and assigns an integer random number to the variable X. The smart contract 53 adds the value of the variable X to the value of the variable Aval, and substitutes the addition result for the variable Aval. Then, the smart contract 53 uses the character string of the variable A as a key and writes a character string representing an integer of the variable Aval as a value into the block chain.

スマートコントラクトの非決定的動作を検証する方法としては、抽象構文木を利用する方法やシンボリック実行を利用する方法も考えられる。以下では、抽象構文木を利用する方法とシンボリック実行を利用する方法について説明する。   As a method of verifying the nondeterministic operation of the smart contract, a method using an abstract syntax tree or a method using symbolic execution can be considered. In the following, a method using an abstract syntax tree and a method using symbolic execution will be described.

図7は、抽象構文木の第1の例を示す図である。
抽象構文木61は、スマートコントラクト52から生成される抽象構文木である。抽象構文木61は、ソースコードであるスマートコントラクト52の構文を表す木構造データである。抽象構文木61は、変数の宣言(変数宣言)を示すノードや、変数への値の代入(代入演算)を示すノードを含む。また、抽象構文木61は、代入演算を示すノードの子ノードとして、代入先の変数(左辺の変数)を示すノード、演算子を示すノード、代入値を格納している変数(右辺の変数)を示すノード、代入値を算出する関数の呼び出し(関数呼び出し)を示すノードなどを含む。また、抽象構文木61は、関数呼び出しを示すノードの子ノードとして、関数の引数としての変数を示すノードを含む。
FIG. 7 is a diagram illustrating a first example of an abstract syntax tree.
The abstract syntax tree 61 is an abstract syntax tree generated from the smart contract 52. The abstract syntax tree 61 is tree structure data representing the syntax of the smart contract 52 that is the source code. The abstract syntax tree 61 includes a node indicating a variable declaration (variable declaration) and a node indicating assignment of a value to a variable (assignment operation). Further, the abstract syntax tree 61 has, as child nodes of the node indicating the assignment operation, a node indicating the assignment destination variable (the variable on the left side), a node indicating the operator, and a variable storing the assignment value (the variable on the right side). , A node indicating a call of a function for calculating an assignment value (function call), and the like. Further, the abstract syntax tree 61 includes a node indicating a variable as an argument of a function as a child node of a node indicating a function call.

ブロックチェーンへの書き込みが非決定的であるか否かを抽象構文木61を用いて検証する場合、次のような検証方法が考えられる。まず、抽象構文木61をルートノードから順に幅優先探索または深さ優先探索により走査し、ブロックチェーンへの書き込みを示す関数呼び出しのノードを検索する。関数呼び出しのノードが検出されると、その子ノードに基づいてブロックチェーンに書き込む値が格納されている変数を特定する。   When verifying whether writing to the block chain is non-deterministic using the abstract syntax tree 61, the following verification method can be considered. First, the abstract syntax tree 61 is sequentially scanned from the root node by a breadth-first search or a depth-first search, and a node of a function call indicating writing to a block chain is searched. When the node of the function call is detected, the variable that stores the value to be written to the block chain is specified based on the child node.

すると、抽象構文木61をルートノードから順に再び走査して、当該変数に値を代入する代入演算を示すノードを検索する。検出された代入演算の右辺に変数が存在する場合、抽象構文木61をルートノードから順に再び走査して、当該変数に値を代入する代入演算を示すノードを検索する。これを繰り返すことで、ブロックチェーンに書き込む値を算出する過程が追跡される。書き込む値を算出する過程で、乱数を取得する関数の呼び出しやタイムスタンプを取得する関数の呼び出しなど、非決定性の原因となる操作が行われた場合、書き込みが非決定的動作であると判定される。   Then, the abstract syntax tree 61 is again scanned in order from the root node to search for a node indicating an assignment operation for assigning a value to the variable. If a variable exists on the right side of the detected assignment operation, the abstract syntax tree 61 is again scanned in order from the root node to search for a node indicating an assignment operation for assigning a value to the variable. By repeating this, the process of calculating the value to be written to the block chain is tracked. In the process of calculating the value to be written, if an operation that causes nondeterminism is performed, such as calling a function for obtaining a random number or calling a function for obtaining a time stamp, it is determined that writing is a nondeterministic operation. .

例えば、図7の例では、まず関数PutStateの呼び出しを示すノードが検出され、関数PutStateの引数を示すノードとして変数Aを示すノードと変数Avalを示すノードが検出される。すると、抽象構文木61がルートノードから順に再び走査され、変数Aに引数args[0]の値を代入する代入演算を示すノードと、変数Avalに関数rand.Int32の戻り値を代入する代入演算を示すノードとが検出される。関数rand.Int32は乱数を取得する関数であるため、書き込む値が乱数に依存することになり、ブロックチェーンへの書き込みが非決定的であると判定される。   For example, in the example of FIG. 7, first, a node indicating a call to the function PutState is detected, and a node indicating a variable A and a node indicating a variable Aval are detected as nodes indicating arguments of the function PutState. Then, the abstract syntax tree 61 is again scanned in order from the root node, and a node indicating an assignment operation for assigning the value of the argument args [0] to the variable A, and the function rand. A node indicating an assignment operation for assigning the return value of Int32 is detected. The function rand. Since Int32 is a function for obtaining a random number, the value to be written depends on the random number, and it is determined that writing to the block chain is non-deterministic.

しかし、抽象構文木61は複数の演算の間の順序関係を表現していない。また、同一の変数に対する値の代入が複数回行われることがあり、同一の変数についての代入演算を示すノードが抽象構文木61に複数存在することがある。このため、ブロックチェーンに書き込む値を格納する変数に関連するノードが抽象構文木61の様々な箇所に分散している可能性があり、抽象構文木61の走査を何度も繰り返すことになる。   However, the abstract syntax tree 61 does not express the order relation among a plurality of operations. Further, the value substitution for the same variable may be performed a plurality of times, and a plurality of nodes indicating the substitution operation for the same variable may exist in the abstract syntax tree 61. For this reason, there is a possibility that nodes related to variables storing values to be written in the block chain are dispersed in various places in the abstract syntax tree 61, and the scanning of the abstract syntax tree 61 is repeated many times.

このため、スマートコントラクト52のサイズの増大に応じて抽象構文木61のノード数が増大し、プログラム検証の実行時間が増大する。例えば、約160行のソースコードから約600個のノードを含む抽象構文木が生成されることがある。また、約1700行のソースコードから約7500個のノードを含む抽象構文木が生成されることがある。その結果、プログラム検証が非効率になるおそれがある。   Therefore, the number of nodes in the abstract syntax tree 61 increases as the size of the smart contract 52 increases, and the execution time of program verification increases. For example, an abstract syntax tree including about 600 nodes may be generated from about 160 lines of source code. Also, an abstract syntax tree including about 7500 nodes may be generated from about 1700 lines of source code. As a result, program verification may be inefficient.

図8は、抽象構文木の第2の例を示す図である。
抽象構文木62は、スマートコントラクト53から生成される抽象構文木である。ブロックチェーンへの書き込みが非決定的であるか否かを抽象構文木62を用いて検証する場合、上記の抽象構文木61と同様の検証方法が行われる。
FIG. 8 is a diagram illustrating a second example of the abstract syntax tree.
The abstract syntax tree 62 is an abstract syntax tree generated from the smart contract 53. When verifying whether writing to the block chain is non-deterministic using the abstract syntax tree 62, a verification method similar to that of the above-described abstract syntax tree 61 is performed.

例えば、図8の例では、まず関数PutStateの呼び出しを示すノードが検出され、関数PutStateの引数を示すノードとして変数Aを示すノードと変数Avalを示すノードが検出される。すると、抽象構文木62がルートノードから順に再び走査され、変数Aに文字列「key」を代入する代入演算を示すノードが検出される。また、変数Avalの値に変数Xの値を加算して変数Avalに代入する代入演算を示すノードが検出される。これらの代入演算そのものには、非決定性の原因は存在しない。   For example, in the example of FIG. 8, a node indicating a call to the function PutState is detected, and a node indicating the variable A and a node indicating the variable Aval are detected as nodes indicating the arguments of the function PutState. Then, the abstract syntax tree 62 is scanned again in order from the root node, and a node indicating an assignment operation for assigning the character string “key” to the variable A is detected. Further, a node indicating an assignment operation of adding the value of the variable X to the value of the variable Aval and assigning the result to the variable Aval is detected. There is no cause of nondeterminism in these assignment operations themselves.

一方、変数Avalの代入演算には変数Avalの前の値と変数Xの値とが使用されている。そこで、抽象構文木62がルートノードから順に再び走査され、変数Avalに整数「1」を代入する代入演算を示すノードと、変数Xに関数rand.Int32の戻り値を代入する代入演算を示すノードとが検出される。関数rand.Int32は乱数を取得する関数であるため、書き込む値が乱数に依存することになり、ブロックチェーンへの書き込みが非決定的であると判定される。このように、抽象構文木62の走査を何度も繰り返すことになり、非決定的動作の検証が非効率になる。   On the other hand, the value before the variable Aval and the value of the variable X are used in the substitution operation of the variable Aval. Therefore, the abstract syntax tree 62 is scanned again in order from the root node, and a node indicating an assignment operation for assigning an integer “1” to a variable Aval and a function rand. A node indicating an assignment operation for assigning the return value of Int32 is detected. The function rand. Since Int32 is a function for obtaining a random number, the value to be written depends on the random number, and it is determined that writing to the block chain is non-deterministic. As described above, the scanning of the abstract syntax tree 62 is repeated many times, and the verification of the nondeterministic operation becomes inefficient.

図9は、シンボリック実行の例を示す図である。
シンボリック実行は、ソースコードを解析して異なる複数の実行パスを検出する静的解析方法である。シンボリック実行では、変数に具体的な値ではなく抽象的なシンボルを代入し、ソースコードを仮想的に実行して演算結果をシンボルを用いた式で表現する。シンボルを用いた式で表された変数の値の変化を追跡することで、実行パスを検出する。
FIG. 9 is a diagram illustrating an example of symbolic execution.
Symbolic execution is a static analysis method that analyzes a source code and detects a plurality of different execution paths. In symbolic execution, an abstract symbol is substituted for a variable instead of a specific value, and the source code is virtually executed, and the operation result is represented by an expression using the symbol. The execution path is detected by tracing a change in the value of a variable represented by an expression using a symbol.

シンボリック実行フロー63は、スマートコントラクト52のシンボリック実行の処理ステップを表す。処理p1は、変数Aにシンボルa0を代入し、変数Avalにシンボルaval0を代入し、変数Bにシンボルb0を代入し、変数Bvalにシンボルbval0を代入し、変数errにシンボルe0を代入する。処理p2は、変数errの値がnil(空文字)でないか、すなわち、シンボルe0がnilでないか判断する。シンボルe0とnilの比較に応じて、実行パスが処理p3と処理p4に分岐する。シンボルe0がnilである場合(条件「e0 != nil」が偽の場合)、処理p3が実行される。処理p3は、シンボルa0をキーとし、シンボルaval0を表す文字列をバリューとしてブロックチェーンに書き込む。シンボルe0がnilでない場合(条件「e0 != nil」が真の場合)、処理p4が実行される。処理p4は、エラーを出力する。   The symbolic execution flow 63 represents processing steps of the symbolic execution of the smart contract 52. In the process p1, the symbol a0 is assigned to the variable A, the symbol aval0 is assigned to the variable Aval, the symbol b0 is assigned to the variable B, the symbol bval0 is assigned to the variable Bval, and the symbol e0 is assigned to the variable err. The process p2 determines whether the value of the variable err is not nil (empty character), that is, whether the symbol e0 is not nil. The execution path branches to processing p3 and processing p4 according to the comparison between the symbol e0 and nil. When the symbol e0 is nil (when the condition “e0! = Nil” is false), the process p3 is executed. In the process p3, the symbol a0 is used as a key, and a character string representing the symbol aval0 is written into the block chain as a value. When the symbol e0 is not nil (when the condition “e0! = Nil” is true), the process p4 is executed. The process p4 outputs an error.

パステーブル64は、シンボリック実行によって検出された実行パスを示すテーブルである。パステーブル64は、パスID、パス条件およびパスの項目を含む。パスIDは、検出された実行パスを識別する識別子である。パス条件は、その実行パスが選択されるためにシンボルが満たすべき条件、すなわち、変数に代入されるべき値の条件である。パスは、その実行パスが通過する一連の処理ステップである。   The path table 64 is a table indicating execution paths detected by symbolic execution. The path table 64 includes items of a path ID, a path condition, and a path. The path ID is an identifier for identifying the detected execution path. The path condition is a condition to be satisfied by the symbol in order to select the execution path, that is, a condition of a value to be assigned to a variable. A path is a series of processing steps that the execution path passes.

シンボリック実行フロー63からは2つの実行パスが検出される。1つの実行パスは、シンボルe0がnilである場合に選択される実行パスであり、処理p1,p2,p3を通過する。もう1つの実行パスは、シンボルe0がnilでない場合に選択される実行パスであり、処理p1,p2,p4を通過する。   Two execution paths are detected from the symbolic execution flow 63. One execution path is an execution path selected when the symbol e0 is nil, and passes through the processes p1, p2, and p3. The other execution path is an execution path selected when the symbol e0 is not nil, and passes through the processes p1, p2, and p4.

ブロックチェーンへの書き込みが非決定的であるか否かをシンボリック実行を用いて検証する場合、まずシンボリック実行によって実行パス毎のパス条件を判定し、各実行パスのパス条件に当てはまる複数の入力値をテストデータとして用意する。そして、スマートコントラクト52に複数の入力値を与えて実行結果を観察し、意図しない実行結果の変化が生じていないか判断する。意図しない実行結果の変化が存在する場合、スマートコントラクト52に非決定的動作が含まれると推定される。例えば、ある実行パスが選択されることを期待して与えた入力値から、別の実行パスが選択されて意図しない出力が得られた場合、シンボリック実行によって解析されなかった非決定性が存在すると判定される。   When using symbolic execution to verify whether writing to the block chain is non-deterministic, first determine the path conditions for each execution path by symbolic execution, and then enter multiple input values that match the path conditions for each execution path. Prepare as test data. Then, a plurality of input values are given to the smart contract 52, the execution result is observed, and it is determined whether an unintended change in the execution result has occurred. If there is an unintended change in the execution result, it is estimated that the smart contract 52 includes a non-deterministic operation. For example, if an input value given in the hope that a certain execution path is selected gives an unintended output when another execution path is selected, it is determined that there is nondeterminism that was not analyzed by symbolic execution Is done.

しかし、スマートコントラクト52のサイズの増大に応じてシンボリック実行フロー63の条件分岐が多くなり、検出される実行パスが増大してプログラム検証の実行時間が増大する。また、シンボリック実行では、実行パス毎のパス条件を算出するために、SMT(Satisfiability Modulo Theories)ソルバなどの数式処理を行う制約ソルバが用いられる。しかしながら、スマートコントラクト52の中にパス条件を判断するための情報が不足している場合など、制約ソルバによって実行パス毎のパス条件を算出できないことがある。その場合、テストデータを効率的に生成することができない。   However, as the size of the smart contract 52 increases, the number of conditional branches in the symbolic execution flow 63 increases, so that the number of execution paths to be detected increases and the execution time of program verification increases. In symbolic execution, a constraint solver that performs mathematical processing such as an SMT (Satisfiability Modulo Theories) solver is used to calculate path conditions for each execution path. However, for example, when information for determining a path condition is insufficient in the smart contract 52, a path condition for each execution path cannot be calculated by a constraint solver. In that case, test data cannot be efficiently generated.

そこで、第2の実施の形態の開発装置100は、スマートコントラクト52,53を静的単一代入(SSA)形式に変換し、SSAソースコードの静的解析によってスマートコントラクト52,53の非決定的動作を検証する。   Therefore, the development device 100 according to the second embodiment converts the smart contracts 52 and 53 into a static single assignment (SSA) format, and performs non-deterministic operation of the smart contracts 52 and 53 by static analysis of the SSA source code. Verify

図10は、SSAソースコードの例を示す図である。
開発装置100は、スマートコントラクト52をSSAソースコード71に変換して記憶し、スマートコントラクト53をSSAソースコード72に変換して記憶する。SSAソースコード71,72は、スマートコントラクト52,53と意味的に等価である。ただし、SSAソースコード71,72は、スマートコントラクト52,53と異なり、1つの変数に対する代入演算は1回だけ行うという制約をもつ。スマートコントラクト52,53からSSAソースコード71,72への変換は次のように行うことができる。
FIG. 10 is a diagram illustrating an example of the SSA source code.
The development device 100 converts the smart contract 52 into an SSA source code 71 and stores it, and converts the smart contract 53 into an SSA source code 72 and stores it. The SSA source codes 71 and 72 are semantically equivalent to the smart contracts 52 and 53. However, unlike the smart contracts 52 and 53, the SSA source codes 71 and 72 have a restriction that the assignment operation for one variable is performed only once. The conversion from the smart contracts 52, 53 to the SSA source codes 71, 72 can be performed as follows.

開発装置100は、あるスマートコントラクトを先頭から末尾に向かって走査し、同じ変数に対する2回目の代入演算を検出する。2回目の代入演算が検出されると、開発装置100は、当該スマートコントラクトで使用されていない新たな変数を定義し、2回目の代入演算の代入先を新たな変数に書き換える。そして、開発装置100は、それ以降の処理における当該変数の参照を当該新たな変数の参照に書き換える。3回目以降の代入演算についても、その都度新たな変数を定義してそれ以降の変数の参照を書き換える。これにより、プログラムの意味を変えずに1つの変数への値の代入を1回に制限できる。   The development device 100 scans a certain smart contract from the beginning to the end, and detects a second assignment operation for the same variable. When the second assignment operation is detected, the development device 100 defines a new variable that is not used in the smart contract and rewrites the assignment destination of the second assignment operation with the new variable. Then, the development device 100 rewrites the reference of the variable in the subsequent processing to the reference of the new variable. For the third and subsequent assignment operations, a new variable is defined each time, and reference to the subsequent variables is rewritten. As a result, the assignment of a value to one variable can be limited to one without changing the meaning of the program.

SSAソースコード71は、スマートコントラクト52と同様に関数Initを含む。SSAソースコード71は、引数である4つの文字列を含む文字列型配列を変数t1に代入し、変数t1の1番目の文字列を変数t2に代入し、整数の乱数を変数t3に代入する。その後、SSAソースコード71は、変数t2,t3を引数として関数PutStateを呼び出し、関数PutStateの戻り値を変数t45に代入する。   The SSA source code 71 includes a function Init as in the smart contract 52. The SSA source code 71 assigns a character string array including four character strings as arguments to a variable t1, assigns the first character string of the variable t1 to a variable t2, and assigns an integer random number to a variable t3. . Thereafter, the SSA source code 71 calls the function PutState with the variables t2 and t3 as arguments, and substitutes the return value of the function PutState into the variable t45.

SSAソースコード72は、変数t0として文字列型の変数Aを定義し、変数t1として整数型の変数Avalを定義し、変数t2として整数型の変数Xを定義する。SSAソースコード72は、変数t0に対応して新たに定義した変数t3に文字列「key」を代入する。また、SSAソースコード72は、変数t1に対応して新たに定義した変数t4に整数「1」を代入する。また、SSAソースコード72は、変数t2に対応して新たに定義した変数t5に整数の乱数を代入する。SSAソースコード72は、変数t4の値と変数t5の値の和を算出して新たな変数t6に代入する。そして、SSAソースコード72は、変数t3,t6を引数として関数PutStateを呼び出し、関数PutStateの戻り値を新たな変数t7に代入する。   The SSA source code 72 defines a character string type variable A as the variable t0, defines an integer type variable Aval as the variable t1, and defines an integer type variable X as the variable t2. The SSA source code 72 substitutes the character string “key” for a newly defined variable t3 corresponding to the variable t0. Further, the SSA source code 72 substitutes an integer “1” for a newly defined variable t4 corresponding to the variable t1. In addition, the SSA source code 72 substitutes an integer random number for a newly defined variable t5 corresponding to the variable t2. The SSA source code 72 calculates the sum of the value of the variable t4 and the value of the variable t5, and substitutes it for a new variable t6. Then, the SSA source code 72 calls the function PutState with the variables t3 and t6 as arguments, and substitutes the return value of the function PutState into a new variable t7.

このようなSSAソースコード71,72を利用することで、開発装置100は効率的にスマートコントラクト52,53の非決定的動作を検証することができる。開発装置100は、あるSSAソースコードを先頭から末尾に向かって走査し、ブロックチェーンへの書き込みを示す書き込み操作を検索する。書き込み操作を検出すると、開発装置100は、書き込み操作の引数に用いられている変数を特定し、当該SSAソースコードを逆方向に走査して、特定した変数への値の代入を示す代入操作を検索する。   By using such SSA source codes 71 and 72, the development device 100 can efficiently verify the non-deterministic operation of the smart contracts 52 and 53. The development device 100 scans a certain SSA source code from the beginning to the end, and searches for a write operation indicating writing to the block chain. Upon detecting the write operation, the development device 100 specifies the variable used as the argument of the write operation, scans the SSA source code in the reverse direction, and performs an assignment operation indicating the assignment of the value to the specified variable. Search for.

代入操作を検出すると、開発装置100は、乱数を取得する関数の呼び出しなど非決定性の原因となる非決定的操作が、代入操作の右辺に存在するか確認する。代入操作の右辺に非決定的操作が存在しないものの他の変数が存在する場合、開発装置100は、当該SSAソースコードを更に逆方向に走査して当該他の変数への値の代入を示す代入操作を検索する。変数の代入操作を再帰的に検索することで、ブロックチェーンに書き込む値を格納する変数に影響を与える非決定的操作を探索することができる。   When detecting the assignment operation, the development device 100 checks whether a nondeterministic operation causing nondeterminism, such as calling a function for obtaining a random number, exists on the right side of the assignment operation. If there is another variable for which there is no non-deterministic operation on the right side of the assignment operation, the development device 100 scans the SSA source code further in the reverse direction to indicate the assignment of a value to the other variable. Search for. By recursively searching for a variable assignment operation, it is possible to search for a non-deterministic operation that affects a variable that stores a value to be written to the block chain.

例えば、SSAソースコード71について、開発装置100は、関数PutStateの呼び出しを検出し、引数である変数t2,t3を特定する。開発装置100は、関数PutStateの呼び出し位置からSSAソースコード71を先頭に向かって走査し、変数t3の代入操作を検出する。変数t3の代入操作の右辺では関数rand.Int32が呼び出されているため、開発装置100は、ブロックチェーンに書き込まれる変数t3の値が乱数に依存しており非決定的であると判定する。   For example, for the SSA source code 71, the development device 100 detects the call of the function PutState and specifies the variables t2 and t3, which are the arguments. The development device 100 scans the SSA source code 71 from the calling position of the function PutState toward the top, and detects an assignment operation of the variable t3. On the right side of the assignment operation of the variable t3, the function rand. Since Int32 has been called, the development device 100 determines that the value of the variable t3 written in the block chain depends on the random number and is nondeterministic.

また、SSAソースコード72について、開発装置100は、関数PutStateの呼び出しを検出し、引数である変数t3,t6を特定する。開発装置100は、関数PutStateの呼び出し位置からSSAソースコード72を先頭に向かって走査し、変数t6の代入操作を検出する。変数t6の代入操作の右辺は、非決定的操作を含まないものの変数t4,t5を含むため、開発装置100は変数t4,t5を検索対象に追加する。開発装置100は、SSAソースコード72を更に先頭に向かって走査し、変数t5の代入操作を検出する。変数t5の代入操作の右辺では関数rand.Int32が呼び出されているため、開発装置100は、ブロックチェーンに書き込まれる変数t6の値が乱数に依存しており非決定的であると判定する。   Further, with respect to the SSA source code 72, the development device 100 detects the call of the function PutState and specifies the variables t3 and t6, which are the arguments. The development device 100 scans the SSA source code 72 from the calling position of the function PutState toward the beginning, and detects an assignment operation of the variable t6. Since the right side of the assignment operation of the variable t6 does not include the nondeterministic operation but includes the variables t4 and t5, the development device 100 adds the variables t4 and t5 to the search target. The development device 100 scans the SSA source code 72 further toward the top, and detects an assignment operation of the variable t5. On the right side of the assignment operation of the variable t5, the function rand. Since Int32 has been called, the development device 100 determines that the value of the variable t6 written in the block chain depends on the random number and is nondeterministic.

このように、SSAソースコード71,72は、同一関数内ではデータフローの順に各種操作を記述している。また、SSAソースコード71,72は、1つの変数に対する代入操作を1回に限定し、それ以降は当該変数について参照のみ許容する。このため、開発装置100は、ブロックチェーンの書き込み操作の位置から逆順に1回だけSSAソースコード71,72を走査することで、非決定性を判定することができる。   Thus, the SSA source codes 71 and 72 describe various operations in the same function in the order of data flow. Further, the SSA source codes 71 and 72 limit the assignment operation to one variable to one time, and thereafter allow only reference to the variable. Therefore, the development device 100 can determine the non-determinism by scanning the SSA source codes 71 and 72 only once in reverse order from the position of the write operation of the block chain.

次に、開発装置100の機能および処理手順について説明する。
図11は、開発装置の機能例を示すブロック図である。
開発装置100は、ソースコード記憶部121、SSAソースコード記憶部122、制御情報記憶部123、SSA変換部124、非決定性検出部125および結果表示部126を有する。ソースコード記憶部121、SSAソースコード記憶部122および制御情報記憶部123は、RAM102またはHDD103の記憶領域を用いて実装することができる。SSA変換部124、非決定性検出部125および結果表示部126は、CPU101が実行するプログラムを用いて実装することができる。
Next, functions and processing procedures of the development device 100 will be described.
FIG. 11 is a block diagram illustrating an example of functions of the development device.
The development device 100 includes a source code storage unit 121, an SSA source code storage unit 122, a control information storage unit 123, an SSA conversion unit 124, a non-deterministic detection unit 125, and a result display unit 126. The source code storage unit 121, the SSA source code storage unit 122, and the control information storage unit 123 can be implemented using the storage area of the RAM 102 or the HDD 103. The SSA conversion unit 124, the non-determinism detection unit 125, and the result display unit 126 can be implemented using a program executed by the CPU 101.

ソースコード記憶部121は、スマートコントラクト52,53など、検証対象のスマートコントラクトを記憶する。SSAソースコード記憶部122は、SSAソースコード71,72など、検証対象のスマートコントラクトから変換されたSSA形式のソースコードを記憶する。制御情報記憶部123は、スマートコントラクトの非決定的動作を検証する際に参照される制御情報を記憶する。制御情報は、ブロックチェーンの書き込み操作を示すプログラム記述や、非決定性の原因となる非決定的操作を示すプログラム記述を含む。これらのプログラム記述は、プログラミング言語毎に予め定義される。   The source code storage unit 121 stores a smart contract to be verified, such as the smart contracts 52 and 53. The SSA source code storage unit 122 stores the SSA format source code converted from the smart contract to be verified, such as the SSA source codes 71 and 72. The control information storage unit 123 stores control information that is referred to when verifying a non-deterministic operation of the smart contract. The control information includes a program description indicating a blockchain write operation and a program description indicating a nondeterministic operation that causes nondeterminism. These program descriptions are defined in advance for each programming language.

SSA変換部124は、ソースコード記憶部121から検証対象のスマートコントラクトを読み出し、スマートコントラクトをSSAソースコードに変換し、SSAソースコードをSSAソースコード記憶部122に格納する。非決定性検出部125は、SSAソースコード記憶部122からSSAソースコードを読み出し、制御情報記憶部123に記憶された制御情報を参照して、ブロックチェーンに書き込まれる値に影響する非決定的操作をSSAソースコードから検索する。結果表示部126は、非決定的動作の検出結果をディスプレイ111に表示する。検出結果には、ブロックチェーンへの書き込みが非決定的であるか否かを示すメッセージが含まれる。ブロックチェーンへの書き込みが非決定的である場合、検出結果には、問題となる非決定的操作の識別情報が含まれてもよい。   The SSA conversion unit 124 reads the smart contract to be verified from the source code storage unit 121, converts the smart contract into an SSA source code, and stores the SSA source code in the SSA source code storage unit 122. The non-deterministic detection unit 125 reads the SSA source code from the SSA source code storage unit 122, refers to the control information stored in the control information storage unit 123, and performs a non-deterministic operation that affects the value written to the block chain. Search from source code. The result display unit 126 displays the detection result of the non-deterministic operation on the display 111. The detection result includes a message indicating whether writing to the block chain is non-deterministic. If the writing to the blockchain is non-deterministic, the detection result may include the identification information of the non-deterministic operation in question.

図12は、開発装置が保持するテーブルの例を示す図である。
書き込み操作テーブル131は、予め作成されて制御情報記憶部123に記憶されている。書き込み操作テーブル131は、プログラミング言語および操作の項目を含む。プログラミング言語は、ソースコードであるスマートコントラクトの記述に用いられている高水準言語である。書き込み操作テーブル131の操作は、特定のプログラミング言語においてブロックチェーンへの書き込みに用いられるプログラム記述である。例えば、書き込み操作に用いる関数の名称とその関数の引数の個数が定義される。
FIG. 12 is a diagram illustrating an example of a table held by the development device.
The write operation table 131 is created in advance and stored in the control information storage unit 123. The write operation table 131 includes items of a programming language and an operation. A programming language is a high-level language used for describing a smart contract that is a source code. The operation of the write operation table 131 is a program description used for writing to a block chain in a specific programming language. For example, the name of a function used for a write operation and the number of arguments of the function are defined.

例えば、あるプログラミング言語(languageX)では、書き込み操作としてPutState(key,value)というプログラム記述が用いられる。また、別のプログラミング言語(languageY)では、書き込み操作としてputState(key,value)というプログラム記述が用いられる。   For example, in a certain programming language (languageX), a program description called PutState (key, value) is used as a write operation. In another programming language (languageY), a program description called putState (key, value) is used as a write operation.

非決定的操作テーブル132は、予め作成されて制御情報記憶部123に記憶されている。非決定的操作テーブル132は、プログラミング言語、カテゴリおよび操作の項目を含む。プログラミング言語は、ソースコードであるスマートコントラクトの記述に用いられている高水準言語である。カテゴリは、非決定性の原因となる非決定的操作の種類である。カテゴリには、前述のように、乱数、タイムスタンプ、外部API、グローバル変数およびMapオブジェクトが含まれる。非決定的操作テーブル132の操作は、特定のプログラミング言語において非決定的操作に用いられるプログラム記述である。例えば、非決定的操作に用いる関数の名称とその関数の引数の個数が定義される。   The non-deterministic operation table 132 is created in advance and stored in the control information storage unit 123. The non-deterministic operation table 132 includes items of programming language, category, and operation. A programming language is a high-level language used for describing a smart contract that is a source code. A category is a type of nondeterministic operation that causes nondeterminism. As described above, the category includes a random number, a time stamp, an external API, a global variable, and a Map object. The operation of the non-deterministic operation table 132 is a program description used for the non-deterministic operation in a specific programming language. For example, the name of the function used for the non-deterministic operation and the number of arguments of the function are defined.

例えば、あるプログラミング言語では、乱数を取得する非決定的操作として、rand.Int32()というプログラム記述やrand.Float32()というプログラム記述が用いられる。また、あるプログラミング言語では、タイムスタンプを取得する非決定的操作として、time.Now()というプログラム記述が用いられる。   For example, in some programming languages, the non-deterministic operation of obtaining random numbers is rand. Int32 () program description and rand. A program description called Float32 () is used. Also, in some programming languages, time.time. A program description called Now () is used.

検出結果テーブル133は、1つのスマートコントラクトの検証に対して非決定性検出部125によって生成される。検出結果テーブル133の情報は、RAM102やHDD103に保存されてもよく、ディスプレイ111に表示されてもよい。検出結果テーブル133は、位置、非決定的操作およびカテゴリの項目を含む。   The detection result table 133 is generated by the non-deterministic detection unit 125 for verification of one smart contract. Information of the detection result table 133 may be stored in the RAM 102 or the HDD 103, or may be displayed on the display 111. The detection result table 133 includes items of position, non-deterministic operation, and category.

位置は、ブロックチェーンに書き込む値に影響を与える非決定的操作が記述されているスマートコントラクト上の位置であり、例えば、スマートコントラクトの行番号で特定される。検出結果テーブル133の非決定的操作として、非決定的操作のプログラム記述が登録される。カテゴリは、非決定的操作テーブル132に定義されたカテゴリである。   The position is a position on the smart contract in which a non-deterministic operation affecting the value written to the block chain is described, and is specified by, for example, the line number of the smart contract. As the nondeterministic operation in the detection result table 133, a program description of the nondeterministic operation is registered. The category is a category defined in the non-deterministic operation table 132.

図13は、プログラム検証の手順例を示すフローチャートである。
(S10)SSA変換部124は、ソースコードであるスマートコントラクトを、SSA形式のソースコード(SSAソースコード)に変換する。SSAソースコードへの変換では、SSA変換部124は、同一の変数に対する2回目以降の代入操作を検出し、代入先の変数を新たな変数に置換し、それ以降の変数の参照を新たな変数の参照に置換する。
FIG. 13 is a flowchart illustrating an example of a procedure of program verification.
(S10) The SSA conversion unit 124 converts the smart contract that is the source code into the SSA format source code (SSA source code). In the conversion into the SSA source code, the SSA conversion unit 124 detects the second and subsequent substitution operations for the same variable, replaces the substitution destination variable with a new variable, and refers to the subsequent variables to the new variable. Replace with the reference.

(S11)非決定性検出部125は、SSAソースコードの初回の読み出しではSSAソースコードの先頭行を読む。また、非決定性検出部125は、SSAソースコードの2回目以降の読み出しでは、前回読んだ行の次の行をSSAソースコードから読む。   (S11) In the first reading of the SSA source code, the non-deterministic detection unit 125 reads the first line of the SSA source code. In the second and subsequent reading of the SSA source code, the non-deterministic detection unit 125 reads a line next to the previously read line from the SSA source code.

(S12)非決定性検出部125は、ステップS11で読んだ行が、書き込み操作テーブル131に定義された何れかの書き込み操作を含むか判断する。書き込み操作を含む場合はステップS14に進み、書き込み操作を含まない場合はステップS13に進む。   (S12) The non-deterministic detection unit 125 determines whether the row read in step S11 includes any of the write operations defined in the write operation table 131. If a write operation is included, the process proceeds to step S14; otherwise, the process proceeds to step S13.

(S13)非決定性検出部125は、ステップS11でSSAソースコードの最終行まで読んだか判断する。SSAソースコードの最終行まで読んだ場合、検証対象のスマートコントラクトはブロックチェーンの書き込み操作を含まないとして、プログラム検証が終了する。SSAソースコードの最終行に到達していない場合、ステップS11に進む。   (S13) The non-deterministic detection unit 125 determines whether the last line of the SSA source code has been read in step S11. When reading up to the last line of the SSA source code, the program verification ends, assuming that the smart contract to be verified does not include a block chain write operation. If the last line of the SSA source code has not been reached, the process proceeds to step S11.

(S14)非決定性検出部125は、ステップS11で読んだ行から、ブロックチェーンに書き込む値を格納している変数を抽出する。非決定性検出部125は、抽出した変数を、以降の検索対象の変数として登録する。   (S14) The non-deterministic detection unit 125 extracts a variable storing a value to be written to the block chain from the row read in step S11. The non-deterministic detection unit 125 registers the extracted variables as variables to be subsequently searched.

(S15)非決定性検出部125は、SSAソースコードから1つ前の行を読む。
(S16)非決定性検出部125は、ステップS15で読んだ行が、検索対象として登録された何れかの変数に値を代入する代入文であるか判断する。登録された変数の代入文である場合はステップS17に進み、それ以外の場合はステップS20に進む。
(S15) The non-deterministic detection unit 125 reads the previous line from the SSA source code.
(S16) The non-deterministic detection unit 125 determines whether the line read in step S15 is an assignment statement for assigning a value to any of the variables registered as a search target. If it is a substitution statement of a registered variable, the process proceeds to step S17; otherwise, the process proceeds to step S20.

(S17)非決定性検出部125は、ステップS15で読んだ行が、非決定的操作テーブル132に定義された何れかの非決定的操作を含むか判断する。非決定的操作を含む場合はステップS21に進み、非決定的操作を含まない場合はステップS18に進む。   (S17) The non-deterministic detection unit 125 determines whether the row read in step S15 includes any non-deterministic operation defined in the non-deterministic operation table 132. If it includes a non-deterministic operation, the process proceeds to step S21. If it does not include a non-deterministic operation, the process proceeds to step S18.

(S18)非決定性検出部125は、ステップS15で読んだ行が代入値を示す変数を含むか、すなわち、代入文の右辺が他の変数を含むか判断する。代入値を示す変数を含む場合はステップS19に進み、含まない場合はステップS20に進む。   (S18) The non-deterministic detection unit 125 determines whether the line read in step S15 includes a variable indicating an assignment value, that is, whether the right side of the assignment statement includes another variable. If the variable includes the variable indicating the substitution value, the process proceeds to step S19; otherwise, the process proceeds to step S20.

(S19)非決定性検出部125は、ステップS15で読んだ行から代入値を示す変数を抽出する。非決定性検出部125は、抽出した変数を検索対象の変数に追加登録する。
(S20)非決定性検出部125は、ステップS15でSSAソースコードの先頭行まで読んだか判断する。SSAソースコードの先頭行まで読んだ場合、非決定性検出部125は、ブロックチェーンの書き込み操作が非決定的動作ではないと判定する。そして、プログラム検証が終了する。このとき、結果表示部126は、非決定的動作が検出されなかった旨のメッセージをディスプレイ111に表示してもよい。一方、SSAソースコードの先頭行に到達していない場合、ステップS15に進む。
(S19) The non-deterministic detection unit 125 extracts a variable indicating a substitution value from the line read in step S15. The non-deterministic detection unit 125 additionally registers the extracted variable as a search target variable.
(S20) The non-deterministic detection unit 125 determines whether the first line of the SSA source code has been read in step S15. When reading up to the first line of the SSA source code, the non-deterministic detection unit 125 determines that the write operation of the block chain is not a non-deterministic operation. Then, the program verification ends. At this time, the result display unit 126 may display on the display 111 a message indicating that a nondeterministic operation has not been detected. On the other hand, if the first line of the SSA source code has not been reached, the process proceeds to step S15.

(S21)非決定性検出部125は、ブロックチェーンの書き込み操作が非決定的動作であると判定する。非決定性検出部125は、ステップS15で読んだ行について位置と非決定的操作とカテゴリを判定して検出結果テーブル133を生成する。そして、プログラム検証が終了する。このとき、結果表示部126は、非決定的動作が検出された旨のメッセージをディスプレイ111に表示してもよく、非決定的動作の原因として検出結果テーブル133の情報をディスプレイ111に表示してもよい。   (S21) The non-deterministic detection unit 125 determines that the write operation of the block chain is a non-deterministic operation. The non-deterministic detection unit 125 determines the position, non-deterministic operation, and category of the line read in step S15, and generates the detection result table 133. Then, the program verification ends. At this time, the result display unit 126 may display a message to the effect that the non-deterministic operation has been detected on the display 111, and may display information of the detection result table 133 on the display 111 as the cause of the non-deterministic operation. .

上記では、非決定的動作として、乱数やタイムスタンプなど非決定的操作によって取得した値からブロックチェーンに書き込む値を算出する例について説明した。これに対し、非決定的操作によって取得した値を条件分岐などのフロー制御に用いることで、ブロックチェーンへの書き込み方法が切り替わって非決定的動作となることがある。開発装置100は、このようなフロー制御に起因する非決定的動作についても検出することができる。   In the above, an example in which a value to be written to the block chain is calculated from a value obtained by a non-deterministic operation such as a random number or a time stamp as the non-deterministic operation has been described. On the other hand, by using the value obtained by the non-deterministic operation for flow control such as conditional branching, the method of writing to the block chain may be switched to a non-deterministic operation. The development device 100 can also detect a non-deterministic operation caused by such flow control.

例えば、非決定性検出部125は、図13のフローチャートにおいて、SSAソースコードから1つ前の行を読み、読んだ行が登録された変数の代入文でない場合、読んだ行が何らかの変数の値に依存する条件分岐文であるか判断するようにする。何らかの変数の値に依存する条件分岐文である場合、非決定性検出部125は、条件分岐文に含まれる変数を検索対象として追加登録する。これにより、ある書き込み操作が実行されるか否かが乱数やタイムスタンプに依存するような非決定的動作を検出することができる。   For example, in the flowchart of FIG. 13, the non-deterministic detection unit 125 reads the immediately preceding line from the SSA source code, and if the read line is not an assignment statement of a registered variable, the read line is replaced with the value of some variable. It is determined whether the conditional branch statement depends on it. If the conditional branch statement depends on the value of any variable, the non-deterministic detection unit 125 additionally registers a variable included in the conditional branch statement as a search target. Thus, it is possible to detect a non-deterministic operation in which whether or not a certain write operation is performed depends on a random number or a time stamp.

図14は、スマートコントラクトとSSAソースコードの他の例を示す図である。
スマートコントラクト54は、関数mainを含む。関数mainは、浮動小数点実数の乱数を変数Aに代入する。関数mainは、変数Aの値と実数「0.5」とを比較する。変数Aの値が0.5より大きい場合、関数mainは、文字列「Success」と真偽値「True」を引数として関数PutStateを呼び出す。一方、変数Aの値が0.5以下である場合、関数mainは、文字列「Success」と真偽値「False」を引数として関数PutStateを呼び出す。ブロックチェーンに書き込まれる真偽値が「True」になるか「False」になるかは乱数に依存する。
FIG. 14 is a diagram showing another example of the smart contract and the SSA source code.
The smart contract 54 includes a function main. The function main assigns a random number of a floating-point real number to a variable A. The function main compares the value of the variable A with the real number “0.5”. When the value of the variable A is larger than 0.5, the function main calls the function PutState with the character string “Success” and the boolean value “True” as arguments. On the other hand, when the value of the variable A is 0.5 or less, the function main calls the function PutState with the character string “Success” and the Boolean value “False” as arguments. Whether the true / false value written to the block chain becomes “True” or “False” depends on a random number.

開発装置100は、スマートコントラクト54をSSAソースコード73に変換する。SSAソースコード73は、浮動小数点実数の乱数を変数t0に代入し、変数t0の値が0.5より大きいか否かを示す真偽値を変数t1に代入する。SSAソースコード73は、変数t1が真を示しているときは第1番地にジャンプし、変数t1が偽を示しているときは第3番地にジャンプする。第1番地では、SSAソースコード73は、所定の文字列を変数t5に代入し、変数t5を引数に含めて関数PutStateを呼び出し、関数PutStateの戻り値を変数t6に代入する。第3番地では、SSAソースコード73は、所定の文字列を変数t10に代入し、変数t10を引数に含めて関数PutStateを呼び出し、関数PutStateの戻り値を変数t11に代入する。   The development device 100 converts the smart contract 54 into the SSA source code 73. The SSA source code 73 substitutes a random number of a floating-point real number into a variable t0, and substitutes a boolean value indicating whether or not the value of the variable t0 is greater than 0.5 into a variable t1. The SSA source code 73 jumps to the first address when the variable t1 indicates true, and jumps to the third address when the variable t1 indicates false. At the first address, the SSA source code 73 substitutes a predetermined character string for the variable t5, calls the function PutState with the variable t5 included in the argument, and substitutes the return value of the function PutState for the variable t6. At the third address, the SSA source code 73 substitutes a predetermined character string for the variable t10, calls the function PutState with the variable t10 as an argument, and substitutes the return value of the function PutState for the variable t11.

ここで、関数PutStateの引数として使用される変数t5,t10などの変数と、条件分岐文に使用される変数t1とは、SSAソースコード73上で代入関係をもたない。しかし、開発装置100は、条件分岐文に使用される変数t1も追跡することで、制御フローに起因する非決定的動作をSSAソースコード73から検出できる。   Here, variables such as variables t5 and t10 used as arguments of the function PutState and the variable t1 used in the conditional branch statement do not have an assignment relationship on the SSA source code 73. However, the development device 100 can also detect the nondeterministic operation caused by the control flow from the SSA source code 73 by tracking the variable t1 used in the conditional branch statement.

第2の実施の形態の情報処理システムによれば、スマートコントラクトがSSAソースコードに変換され、SSAソースコード上で所定の書き込み操作が検出され、SSAソースコードを逆順に走査して書き込み値に影響を与える非決定的操作が検出される。   According to the information processing system of the second embodiment, the smart contract is converted into the SSA source code, a predetermined write operation is detected on the SSA source code, and the SSA source code is scanned in reverse order to affect the write value. Is detected.

これにより、ブロックチェーンに書き込む値が入力情報および書き込み前のブロックチェーンの内容以外の外部状態に依存して変化するという不具合を検出することが可能となる。よって、複数のサーバ装置の間でブロックチェーンの整合性が失われることを防ぐことができる。また、SSAソースコードを利用することで、ブロックチェーンに書き込む値に関連する代入操作を少ない走査回数で高速に検索することができ、スマートコントラクトの非決定的動作の検証を短時間で実行することができる。   This makes it possible to detect a problem that the value to be written in the block chain changes depending on the input information and the external state other than the contents of the block chain before writing. Therefore, it is possible to prevent the blockchain from being lost in consistency among the plurality of server devices. In addition, by using the SSA source code, it is possible to quickly search for the assignment operation related to the value to be written to the block chain with a small number of scans, and to execute the non-deterministic operation verification of the smart contract in a short time. it can.

10 プログラム検証装置
11 記憶部
12 処理部
13,14 ソースコード
15,16 命令
Reference Signs List 10 program verification device 11 storage unit 12 processing unit 13, 14 source code 15, 16 instruction

Claims (6)

コンピュータに、
同一の変数への複数回の値の代入を許容する第1のソースコードを、各変数への値の代入を1回に制限する静的単一代入形式の第2のソースコードに変換し、
前記第2のソースコードから、データベースへの書き込みを示す第1の命令を検索し、前記第1の命令において書き込む値が格納されている変数を検出し、前記第2のソースコードから、前記検出した変数への値の代入を示す第2の命令を検索し、
前記第2の命令における前記検出した変数に代入される値の取得方法に基づいて、前記データベースへの書き込みが、前記第1のソースコードの引数および前記データベースのデータ以外の実行状況に依存する非決定的動作であるか否か判定する、
処理を実行させるプログラム検証プログラム。
On the computer,
Converting a first source code that allows multiple values to be assigned to the same variable into a second single source code in a static single assignment format that limits the assignment of a value to each variable to one time;
The second source code is searched for a first instruction indicating writing to a database, a variable storing a value to be written in the first instruction is detected, and the detection is performed from the second source code. Search for a second instruction indicating the assignment of a value to the assigned variable,
The non-determination that the writing to the database depends on the execution status other than the argument of the first source code and the data of the database based on a method of obtaining a value substituted for the detected variable in the second instruction. Judge whether it is a dynamic operation,
A program verification program that executes processing.
前記第2の命令の検索では、前記第1の命令から前記第2のソースコードの先頭に向かって、前記第2のソースコードに含まれる命令を走査する、
請求項1記載のプログラム検証プログラム。
In the search for the second instruction, an instruction included in the second source code is scanned from the first instruction toward the beginning of the second source code.
The program verification program according to claim 1.
前記コンピュータに更に、
前記第2の命令において前記検出した変数への値の代入の際に参照される他の変数を検出し、前記第2の命令から前記第2のソースコードの先頭に向かって命令を走査して、前記検出した他の変数への値の代入を示す第3の命令を検索し、
前記第3の命令に基づいて、前記検出した変数に代入される値の取得方法を追跡する、
処理を実行させる請求項1記載のプログラム検証プログラム。
The computer further comprises:
In the second instruction, another variable referred to when assigning a value to the detected variable is detected, and the instruction is scanned from the second instruction toward the head of the second source code. Searching for a third instruction indicating the assignment of a value to the other detected variable,
Tracking a method of obtaining a value to be assigned to the detected variable based on the third instruction;
The program verification program according to claim 1, wherein the program is executed.
前記非決定的動作の判定では、前記検出した変数に代入される値の取得方法が、乱数の取得、タイムスタンプの取得およびグローバル変数の参照の少なくとも1つを含む場合、前記データベースへの書き込みが前記非決定的動作であると判定する、
請求項1記載のプログラム検証プログラム。
In the determination of the non-deterministic operation, when the acquisition method of the value substituted for the detected variable includes at least one of acquisition of a random number, acquisition of a time stamp, and reference to a global variable, the writing to the database is performed by the Determine that the operation is non-deterministic;
The program verification program according to claim 1.
コンピュータが、
同一の変数への複数回の値の代入を許容する第1のソースコードを、各変数への値の代入を1回に制限する静的単一代入形式の第2のソースコードに変換し、
前記第2のソースコードから、データベースへの書き込みを示す第1の命令を検索し、前記第1の命令において書き込む値が格納されている変数を検出し、前記第2のソースコードから、前記検出した変数への値の代入を示す第2の命令を検索し、
前記第2の命令における前記検出した変数に代入される値の取得方法に基づいて、前記データベースへの書き込みが、前記第1のソースコードの引数および前記データベースのデータ以外の実行状況に依存する非決定的動作であるか否か判定する、
プログラム検証方法。
Computer
Converting a first source code that allows multiple values to be assigned to the same variable into a static single assignment type second source code that limits the assignment of a value to each variable to one time;
The second source code is searched for a first instruction indicating writing to a database, a variable storing a value to be written in the first instruction is detected, and the detection is performed from the second source code. Search for a second instruction indicating the assignment of a value to the assigned variable,
The non-determination that the writing to the database depends on the execution status other than the argument of the first source code and the data of the database based on a method of obtaining a value substituted for the detected variable in the second instruction. Judge whether it is a dynamic operation,
Program verification method.
同一の変数への複数回の値の代入を許容する第1のソースコードを記憶する記憶部と、
前記第1のソースコードを、各変数への値の代入を1回に制限する静的単一代入形式の第2のソースコードに変換し、前記第2のソースコードから、データベースへの書き込みを示す第1の命令を検索し、前記第1の命令において書き込む値が格納されている変数を検出し、前記第2のソースコードから、前記検出した変数への値の代入を示す第2の命令を検索し、前記第2の命令における前記検出した変数に代入される値の取得方法に基づいて、前記データベースへの書き込みが、前記第1のソースコードの引数および前記データベースのデータ以外の実行状況に依存する非決定的動作であるか否か判定する処理部と、
を有するプログラム検証装置。
A storage unit that stores a first source code that allows a plurality of values to be substituted for the same variable;
The first source code is converted to a second source code in a static single assignment format that limits assignment of a value to each variable to one time, and writing from the second source code to a database is performed. A second instruction that indicates a substitution of a value into the detected variable from the second source code by searching for a variable in which a value to be written in the first instruction is stored. Based on a method of acquiring a value to be substituted for the detected variable in the second instruction, the execution status of the writing to the database being other than the argument of the first source code and the data of the database. A processing unit that determines whether or not the non-deterministic operation depends on
A program verification device having:
JP2018165145A 2018-09-04 2018-09-04 Program verification program, program verification method and program verification device Active JP7111967B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018165145A JP7111967B2 (en) 2018-09-04 2018-09-04 Program verification program, program verification method and program verification device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018165145A JP7111967B2 (en) 2018-09-04 2018-09-04 Program verification program, program verification method and program verification device

Publications (2)

Publication Number Publication Date
JP2020038482A true JP2020038482A (en) 2020-03-12
JP7111967B2 JP7111967B2 (en) 2022-08-03

Family

ID=69738032

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018165145A Active JP7111967B2 (en) 2018-09-04 2018-09-04 Program verification program, program verification method and program verification device

Country Status (1)

Country Link
JP (1) JP7111967B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562906A (en) * 2020-04-15 2020-08-21 杭州云象网络技术有限公司 Intelligent contract development and verification method based on Noesis logic

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014089700A (en) * 2012-09-27 2014-05-15 Tata Consultancy Services Ltd System and method for discriminating source of run time execution fault
WO2016121074A1 (en) * 2015-01-30 2016-08-04 株式会社日立製作所 Software inspection apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014089700A (en) * 2012-09-27 2014-05-15 Tata Consultancy Services Ltd System and method for discriminating source of run time execution fault
WO2016121074A1 (en) * 2015-01-30 2016-08-04 株式会社日立製作所 Software inspection apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
樽井 翔 ほか: "脆弱性検出のための値範囲解析", 電子情報通信学会技術研究報告, vol. 107, no. 175, JPN6022025169, 2007, JP, pages 95 - 100, ISSN: 0004803175 *
立石 孝彰 ほか: "ブロックチェーンアプリケーション開発の実践と今後の課題", ソフトウェアエンジニアリングシンポジウム2017論文集, JPN6022025167, 23 August 2017 (2017-08-23), pages 204 - 211, ISSN: 0004803174 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562906A (en) * 2020-04-15 2020-08-21 杭州云象网络技术有限公司 Intelligent contract development and verification method based on Noesis logic
CN111562906B (en) * 2020-04-15 2023-06-06 杭州云象网络技术有限公司 Intelligent contract development and verification method based on Noesis logic

Also Published As

Publication number Publication date
JP7111967B2 (en) 2022-08-03

Similar Documents

Publication Publication Date Title
CN110059009B (en) Method and apparatus for testing code files
US8935673B1 (en) System and method for debugging computer program based on execution history
US9158514B2 (en) Method and apparatus for providing change-related information
JP2020510925A (en) Method and apparatus for performing a test using a test case
US9588872B2 (en) Discovery of code paths
US9645799B2 (en) Method and system for model driven development
US9785416B2 (en) Presenting a custom view in an integrated development environment based on a variable selection
JP2020119348A (en) Analysis program, analysis method, and analysis device
CN114138281A (en) Compiling method, device, equipment and medium of software engineering
Bouajjani et al. Verifying robustness of event-driven asynchronous programs against concurrency
US10839124B1 (en) Interactive compilation of software to a hardware language to satisfy formal verification constraints
CN116560683A (en) Software updating method, device, equipment and storage medium
US10678864B2 (en) Analysis model preparing system, programming apparatus, and analysis model preparing method
JP7111967B2 (en) Program verification program, program verification method and program verification device
US11334475B1 (en) Graph based event-driven computing
US11119761B2 (en) Identifying implicit dependencies between code artifacts
JP6955162B2 (en) Analytical equipment, analysis method and analysis program
US11256602B2 (en) Source code file retrieval
US9354870B2 (en) Maintaining integrity of output of code generators
US20210173639A1 (en) System and method for interprocedural analysis
US20200134476A1 (en) Generating code performance hints using source code coverage analytics, inspection, and unstructured programming documents
US20220414101A1 (en) Shifting left database degradation detection
US20240045658A1 (en) Reducing code path permutations
JP2020024533A (en) Analysis support method and analysis support program
US9465723B2 (en) Systems and/or methods for monitoring live software

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210610

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210614

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20210614

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220531

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: 20220621

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220704

R150 Certificate of patent or registration of utility model

Ref document number: 7111967

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150