JPH0476738A - Automatic diagnostic system for object program of compiler - Google Patents
Automatic diagnostic system for object program of compilerInfo
- Publication number
- JPH0476738A JPH0476738A JP2190229A JP19022990A JPH0476738A JP H0476738 A JPH0476738 A JP H0476738A JP 2190229 A JP2190229 A JP 2190229A JP 19022990 A JP19022990 A JP 19022990A JP H0476738 A JPH0476738 A JP H0476738A
- Authority
- JP
- Japan
- Prior art keywords
- program
- compiler
- object program
- intermediate language
- list
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007246 mechanism Effects 0.000 claims abstract description 14
- 238000003745 diagnosis Methods 0.000 claims description 10
- 238000000034 method Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 241000287107 Passer Species 0.000 abstract 1
- 238000012360 testing method Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、コンパイラのオブジェクトプログラム自動診
断システムに関し、特に開発中のコンパイラ(言語処理
プロセッサー)においてそのオブジェクトプログラムの
正当性を診断する為に、人工知能を利用したコーディン
グエキスパートシステムを利用して、自動的に診断する
システムに関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an automatic object program diagnosis system for a compiler, and in particular, for diagnosing the validity of an object program in a compiler (language processing processor) under development. It relates to a system that automatically diagnoses using a coding expert system that uses artificial intelligence.
従来、コンパイラが生成するオブジェクトプログラムが
正しいか否かを判断する為に、コンパイラのオブジェク
ト生成フェーズに組込んだオブジェクトリスト変換機構
により出力された中間言語プログラムリストを人間が目
視により確認したり、膨大な評価パッケージにより確認
している。Conventionally, in order to determine whether the object program generated by a compiler is correct, humans have to visually check the intermediate language program list output by an object list conversion mechanism built into the object generation phase of the compiler. This has been confirmed using a comprehensive evaluation package.
上述した従来のオブジェクトプログラム診断方式では、
オブジェクトリスト上で不正な形式で表示されていても
、人為的なミスでそのエラーを見逃したり、テストプロ
グラムによる走行確認でも、テスト条件で不正に生成し
たオブジェクト命令部が走行されなかったり、走行され
てもたまたま正しい結果となり、不正オブジェクトを見
逃すという欠点がある。In the conventional object program diagnosis method described above,
Even if the object is displayed in an incorrect format on the object list, the error may be overlooked due to human error, or even when the test program is used to confirm running, the object instruction section that was incorrectly generated under the test conditions may not run or may not run. However, the problem is that the result is correct by chance, and invalid objects are overlooked.
またコンパイラが生成するオブジェクトパターンは、一
般に膨大な組合せがあり、人手による診断やテストプロ
グラムによる診断では相当な工数を必要とし、これらの
方式だけでは限界がきているという問題もある。In addition, the object patterns generated by compilers generally have a huge number of combinations, and manual diagnosis or diagnosis using test programs requires a considerable amount of man-hours, and there is also the problem that these methods alone are reaching their limits.
本発明のコンパイラのオブジェクトプログラム自動診断
システムは、ソースプログラムと、そのソースプログラ
ムを翻訳する診断対象のコンパイラと、前記ソースプロ
グラムを翻訳した結果、前記コンパイラによって生成さ
れる中間言語プログラムを格納する中間言語リストファ
イルと、前記中間言語リストファイルを入力し、推論機
構が処理しやすい構造に変換するオブジェクトパーサと
。The compiler object program automatic diagnosis system of the present invention includes a source program, a compiler to be diagnosed that translates the source program, and an intermediate language program that stores an intermediate language program generated by the compiler as a result of translating the source program. a list file, and an object parser that inputs the intermediate language list file and converts it into a structure that is easy to process by an inference mechanism.
前記オブジェクトパーサによってオブジェクトプログラ
ムをLISPの8式の構造に変換した結果が格納される
パースツリーファイルと、前記コンパイラによって生成
された中間言語プログラムが正しいオブジェクトか否か
を診断する為に使用される知識データベースと、前記知
識データベースをもとにパースツリーファイルを入力し
て、オブジェクトプログラムを診断する推論機構と、前
記推論機構によって出力されるオブジェクトプログラム
の診断結果リストと、ををしている。A parse tree file that stores the result of converting an object program into a LISP 8 structure by the object parser, and knowledge used to diagnose whether the intermediate language program generated by the compiler is a correct object. The system includes a database, an inference mechanism for diagnosing an object program by inputting a parse tree file based on the knowledge database, and a list of diagnosis results of the object program output by the inference mechanism.
次に本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.
第1図はオブジェクトプログラム自動診断システムの構
成を示す。第1図において、本実施例のオブジェクトプ
ログラム自動診断システムは、ソースプログラム1と被
診断対象となるコンパイラ2と中間言語リストファイル
3とオブジェクトパーサ4とパースツリーファイル5と
知識データベース6と推論機構7と推論結果リスト8と
から、その主要部が構成されている。FIG. 1 shows the configuration of an object program automatic diagnosis system. In FIG. 1, the object program automatic diagnosis system of this embodiment includes a source program 1, a compiler to be diagnosed 2, an intermediate language list file 3, an object parser 4, a parse tree file 5, a knowledge database 6, and an inference mechanism 7. and the inference result list 8 constitute the main part.
第2図は本発明の一実施例における各機構の入出力デー
タを示す。第2図において、本実施例においては、オブ
ジェクトプログラム診断の対象とコンパイラの入力とな
る言語のソースプログラムの一部となっている移送命令
21と、その部分の結果の中間言語プログラムリスト2
2と、その中間言語プログラムリスト22をパーサによ
って変換された結果のバースツリー23と、オブジェク
トプログラムを診断する為に使用される知識ベースに格
納されるルールコーディング24との具体例を示してい
る。次にこのように構成°されたコンパイラのオブジェ
クトプログラム自動診断システムの動作について説明す
る。FIG. 2 shows input/output data of each mechanism in an embodiment of the present invention. In FIG. 2, in this embodiment, there are a transport instruction 21 that is part of the source program of the language that is the target of object program diagnosis and input to the compiler, and an intermediate language program list 2 that is the result of that part.
2, a birth tree 23 as a result of converting the intermediate language program list 22 by a parser, and rule coding 24 stored in a knowledge base used for diagnosing an object program. Next, the operation of the compiler object program automatic diagnosis system configured as described above will be explained.
コンパイラ2は、ソースプログラム1を入力すると、オ
ブジェクト生成フェーズで中間言語プログラムを生成す
る。これは通常ソースプログラムの言語水準より一段低
い水準である。ソースプログラム内の移送命令21は、
コンパイラ2によって、中間言語プログラム22に示さ
れるようなベースレジスタロード命令(LBD)と、メ
モリ移送命令(MVCE)とに展開される。これは次の
推論機能の入力となるがこのままでは、処理が困難な為
、LISPの8式の構造23にオブジェクトパーサによ
って変換され、変換後のプログラムは、パースツリーフ
ァイル5に格納される。パースツリーの構成は、中間言
語プログラム(この場合はアセンブラ言語)専用に作ら
れており、LBD命令の命令形式を分析して、リスト形
式で構成要素の値が並べられた構造となる。When the compiler 2 receives the source program 1, it generates an intermediate language program in an object generation phase. This is usually one level lower than the language level of the source program. The transfer instruction 21 in the source program is
The compiler 2 expands it into a base register load instruction (LBD) and a memory migration instruction (MVCE) as shown in the intermediate language program 22. This becomes the input for the next inference function, but as it is difficult to process as it is, it is converted by the object parser into a LISP 8-style structure 23, and the converted program is stored in the parse tree file 5. The structure of the parse tree is created exclusively for intermediate language programs (in this case, assembler language), and the instruction format of the LBD instruction is analyzed to create a structure in which component values are arranged in a list format.
また、オブジェクトプログラムが正しいかどうか判断す
る為に使用される知識データベース内には予めオブジェ
クトプログラムの生成規則をルールコーディングしたも
のが格納されている。今「診断されるオブジェクトプロ
グラムの中間言語プログラムの中でペースレジスタロー
ド命令で使用される第2オペランドの修飾ペースレジス
タは、B1以外は許されない」という規則があるとき、
ルールコーディング24を知識データペースに予め登録
しておく。ルールコーディング24の知識表現をフレー
ムと呼び、体系的な知識を表現するための宣言型の知識
表現形式であり、この例では、LBD命令の第2オペラ
ンドのペースレジスタ修飾がB1以外(BO,B2.B
S、B4゜B5.Be、B7)のとき、ルール違反であ
ることを表現している。In addition, the knowledge database used to determine whether an object program is correct or not is stored in advance with rule-coding rules for generating the object program. Now, when there is a rule that ``the second operand modified pace register used in the pace register load instruction in the intermediate language program of the object program to be diagnosed is not allowed to be anything other than B1.''
Rule coding 24 is registered in advance in the knowledge database. The knowledge expression of rule coding 24 is called a frame, which is a declarative knowledge expression format for expressing systematic knowledge. In this example, the pace register modification of the second operand of the LBD instruction is other than B1 (BO, B2 .B
S, B4゜B5. Be, B7), it expresses that it is a violation of the rules.
推論機構7は、パースツリーファイル23から1命令を
取り出すと、知識データベース6に登録されているルー
ルコーディング24とリスト構造が合致するか推論する
。その結果を推論結果リスト8に出力する。知識データ
ベース6に登録されているルールコーディングをすべて
推論したら、パースツリーファイル6から次の命令を取
り出し同様に繰り返し、パースツリーファイルをすべて
入力する迄処理を行なう。When the inference mechanism 7 extracts one instruction from the parse tree file 23, it infers whether the list structure matches the rule coding 24 registered in the knowledge database 6. The results are output to the inference result list 8. After inferring all the rule codings registered in the knowledge database 6, the next command is extracted from the parse tree file 6 and the same process is repeated until all the parse tree files are input.
以上説明したように本発明は、コンパイラが生成するオ
ブジェクトプログラムを、パースツリー形式にオブジェ
クトパーサで変換し、オブジェクトプログラムの不正を
診断する為のルールコーディングを知識ペースに予め登
録しておくことにより、推論機構で前記パースツリー形
式のオブジェクトプログラムを自動的に診断することに
より、人手による不正オブジェクトの見逃しや、テスト
プログラムによる不正オブジェクトの検出もれを防ぐ効
果がある。また自動化による品質作業のコスト削減にも
効果がある。またコンパイラの改造に際してもオブジェ
クトの該当箇所の検出を行なう場合、該当部の検出条件
をルールコーディングし、知識データベースに登録して
おくことにより、自動的に検出させることもできる効果
がある。As explained above, the present invention converts an object program generated by a compiler into a parse tree format using an object parser, and registers rule coding for diagnosing irregularities in the object program in advance in the knowledge pace. By automatically diagnosing the object program in the parse tree format using an inference mechanism, it is possible to prevent an incorrect object from being overlooked manually or an incorrect object from being detected by a test program. Automation is also effective in reducing quality work costs. In addition, when modifying the compiler and detecting a relevant part of an object, the detection conditions for the relevant part can be rule-coded and registered in the knowledge database, thereby making it possible to automatically detect the relevant part.
第1図は本発明の一実施例であるコンパイラのオブジェ
クトプログラム自動診断システムを示す全体構成図、第
2図は本発明の一実施例における各機構が入出力するデ
ータの具体的な一部例を示す図である。
1・・・ソースプログラム、2・・・コンパイラ、3・
・・中間言語リストファイル、4・・・オブジェクトパ
ーサ、5・・・パースツリーファイル、6・・・知識デ
ータベース、7・・・推論機構、8・・・推論結果リス
ト、21・・・ソースプログラムの移送命令部分、22
・・・移送命令のオブジェクト命令部分、23・・・ペ
ースレジスタロード命令のパースツリ一部、24・・・
ルールコーディングの例。
遭 /ilFIG. 1 is an overall configuration diagram showing a compiler object program automatic diagnosis system according to an embodiment of the present invention, and FIG. 2 is a specific example of data input and output by each mechanism according to an embodiment of the present invention. FIG. 1... Source program, 2... Compiler, 3.
...Intermediate language list file, 4...Object parser, 5...Parse tree file, 6...Knowledge database, 7...Inference mechanism, 8...Inference result list, 21...Source program Transfer order part, 22
...Object instruction part of the transfer instruction, 23...Parse tree part of the pace register load instruction, 24...
Example of rule coding. Encounter /il
Claims (1)
る診断対象のコンパイラと、前記ソースプログラムを翻
訳した結果、前記コンパイラによって生成される中間言
語プログラムを格納する中間言語リストファイルと、前
記中間言語リストファイルを入力し、推論機構が処理し
やすい構造に変換するオブジェクトパーサと、前記オブ
ジェクトパーサによってオブジェクトプログラムをLI
SPのS式の構造に変換した結果を格納するパースツリ
ーファイルと、前記コンパイラによって生成された中間
言語プログラムが正しいオブジェクトか否かを診断する
為に使用される知識データベースと、前記知識データベ
ースをもとにパースツリーファイルを入力して、オブジ
ェクトプログラムを診断する推論機構と、前記推論機構
によって出力されるオブジェクトプログラムの診断結果
リストと、を含むことを特徴とするコンパイラのオブジ
ェクトプログラム自動診断システム。Input a source program, a compiler to be diagnosed that translates the source program, an intermediate language list file that stores an intermediate language program generated by the compiler as a result of translating the source program, and the intermediate language list file. , an object parser that converts the structure into a structure that is easy for the inference mechanism to process, and an object program that is converted into a LI
A parse tree file that stores the result of conversion into the SP S-formula structure, a knowledge database used to diagnose whether the intermediate language program generated by the compiler is a correct object, and the knowledge database. An object program automatic diagnosis system for a compiler, comprising: an inference mechanism that inputs a parse tree file to diagnose an object program; and a list of diagnosis results of the object program output by the inference mechanism.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2190229A JPH0476738A (en) | 1990-07-18 | 1990-07-18 | Automatic diagnostic system for object program of compiler |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2190229A JPH0476738A (en) | 1990-07-18 | 1990-07-18 | Automatic diagnostic system for object program of compiler |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0476738A true JPH0476738A (en) | 1992-03-11 |
Family
ID=16254638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2190229A Pending JPH0476738A (en) | 1990-07-18 | 1990-07-18 | Automatic diagnostic system for object program of compiler |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0476738A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107203469A (en) * | 2017-04-28 | 2017-09-26 | 北京大学 | Complier test accelerated method based on machine learning |
-
1990
- 1990-07-18 JP JP2190229A patent/JPH0476738A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107203469A (en) * | 2017-04-28 | 2017-09-26 | 北京大学 | Complier test accelerated method based on machine learning |
CN107203469B (en) * | 2017-04-28 | 2020-04-03 | 北京大学 | Compiler test acceleration method based on machine learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Ramamoorthy et al. | Application of a methodology for the development and validation of reliable process control software | |
US7979848B2 (en) | Systems, methods and apparatus for pattern matching in procedure development and verification | |
Eisenberg et al. | Dependently typed programming with singletons | |
US5193143A (en) | Problem state monitoring | |
Gries | An exercise in proving parallel programs correct | |
Donat | Automating formal specification-based testing | |
US20070074180A1 (en) | Systems, Methods and Apparatus for Procedure Development and Verification | |
Gómez-Abajo et al. | Wodel-Test: a model-based framework for language-independent mutation testing | |
EP0746814A1 (en) | Method and process of inter-machine communication and generalized method for program preparation therefor | |
Cui et al. | Data-oriented exception handling | |
JPH03188535A (en) | Assembly language programming error detecting process | |
Saptawijaya et al. | Tabled abduction in logic programs | |
JPH0476738A (en) | Automatic diagnostic system for object program of compiler | |
Moonen | A generic architecture for data flow analysis to support reverse engineering | |
Dahll et al. | An investigation of methods for production and verification of highly reliable software | |
Gibbons | Formal Methods: Why Should I Care? The Development of the T800 Transputer Floating− Point Unit | |
Jafar | A tool for interactive verification and validation of rule-based expert systems | |
Bashev et al. | PoST2ST: A web service for translating post programs to the IEC 61131-3 structured text | |
Li et al. | A requirements inspection method based on scenarios generated by model mutation and the experimental validation | |
Kopinsky et al. | Modernizing SMT-Based Type Error Localization | |
Kopynksi et al. | Modernizing SMT-Based Type Error Localization | |
Donat | A discipline of specification-based test derivation | |
Zyubin et al. | Using Process-Oriented Structured Text for IEC 61499 Function Block Specification | |
CA1278390C (en) | Expert system apparatus and methods | |
Chen et al. | Debugging with an enriched dependency-based model or how to distinguish between aliasing and value assignment |