JPH02230330A - Inference device - Google Patents

Inference device

Info

Publication number
JPH02230330A
JPH02230330A JP1051781A JP5178189A JPH02230330A JP H02230330 A JPH02230330 A JP H02230330A JP 1051781 A JP1051781 A JP 1051781A JP 5178189 A JP5178189 A JP 5178189A JP H02230330 A JPH02230330 A JP H02230330A
Authority
JP
Japan
Prior art keywords
inference
language
data
knowledge base
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1051781A
Other languages
Japanese (ja)
Inventor
Akihiro Hori
堀 昭浩
Hiromichi Oshiba
大柴 弘道
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Steel Corp
Original Assignee
Sumitomo Metal Industries 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 Sumitomo Metal Industries Ltd filed Critical Sumitomo Metal Industries Ltd
Priority to JP1051781A priority Critical patent/JPH02230330A/en
Publication of JPH02230330A publication Critical patent/JPH02230330A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To facilitate an input/output procedure by automatically generating a procedure giving and receiving data between data of a data file and a knowledge base by means of a procedure type language in accordance with a relation stored at the time of converting an inference rule into the procedure type language by a language conversion means. CONSTITUTION:A relation description means 2 describes a corresponding relation between an inference variable given from the input means 1 of the inference variable and the field of a file in which data that is to be read into the inference variable is stored, and a storage means 3 stores the corresponding relation. A rule description means 4 describes the inference rule constituting a knowledge base by the knowledge type language, and the described inference rule is stored in the storage means 3. The language conversion means 5 converts the corresponding relation of the stored inference variable and external data, and the inference rule into the procedure type language. A program described by the procedure type language is translated in the machine language by a translation means 6 and the knowledge base 7 is constituted by the translated inference rule. Thus, the input/output processing of data can be executed by the description of the corresponding relation between external data and the variable in a device.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は推論装置に関し、更に詳述すれば、外部のデー
タベースあるいはプログラム等との間でデータを授受し
つつ推論を実行する推論装置に関する. 〔従来の技術〕 推論装置において、装置外部のデータベースのデータを
利用したり、あるいは推論処理の実行により得られた結
果を外部のデータベース等に出力゛するような場合に、
従来は旧来の手続き型言語により記述された入出力手続
きとしての外部プログラムを呼出すための記述を知識ベ
ース内でその都度実行していた.そして、実際のデータ
の授受は、推論装置から制御を移された入出力手続きと
しての外部プログラムが実行していた. このような手法は一例として特開昭62 − 2318
号公報の発明に開示されている. この発明では、第5図に示す如く、知識ベース7とは別
個に外部データ呼出し機能10を従来の手続き型言語で
記述し、これを翻訳手段6により機械語に翻訳した後、
知識ベースと結合するように構成されている.一方、推
論ルールはルール記述手段4により知識型言語にて記述
され、言語変換手段6により手続き型言語に変換された
後、翻訳手段により機械語に翻訳され、知識ヘース7を
構成する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an inference device, and more specifically, to an inference device that executes inference while exchanging data with an external database or program. [Prior Art] When an inference device uses data in a database external to the device or outputs results obtained by executing inference processing to an external database, etc.
Previously, input/output procedures written in traditional procedural languages to call external programs were executed each time within the knowledge base. The actual exchange of data was executed by an external program as an input/output procedure to which control was transferred from the inference device. An example of such a method is disclosed in Japanese Patent Application Laid-Open No. 62-2318.
It is disclosed in the invention of the publication number. In this invention, as shown in FIG. 5, the external data calling function 10 is written in a conventional procedural language separately from the knowledge base 7, and after this is translated into machine language by the translation means 6,
It is configured to connect with a knowledge base. On the other hand, the inference rules are written in a knowledge type language by the rule description means 4, converted into a procedural language by the language conversion means 6, and then translated into machine language by the translation means to form the knowledge language 7.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述の如き従来の推論装置では、データの人出力が必要
な状態が生じる都度、手続き型のプログラム言語により
データの入出力のための手続きをプログラミングする必
要があり、多大の工数を要していた. 更に、推論装置内部での入出力手続き用プログラムの呼
出しは、一般的には入出力手続きとしての外部プログラ
ム名を指定することにより実行されるものであり、この
ため知識ベース上の記述のみでは実際に実行されるデー
タの授受の内容が判別し難いという可読性の面からも問
題があり、推論装置の変更及び保守が困難である. 本発明はこのような事情に鑑みてなされたものであり、
推論装置において外部のデータベース等との間でデータ
の入出力を行う場合に入出力手続きを容易な手順にて可
能としてプログラミングする必要がなく、推論装置の知
識ベースの内容からデータ入出力の内容が容易に読取り
可能とした推論装置の提供を目的とする. 〔課題を解決するための手段〕 本発明の推論装置は、推論ルールを記述して知識ベース
を作成すると共に、これに使用される推論変数とデータ
の入出力を実行するファイルのデータ構造の対応関係を
作成し、記憶手段に記憶する.この対応関係とは、具体
的にはデータを読込むべきファイルのデータ項目とそれ
を格納すべき知識ベースの推論変数との対応、もしくは
知識ヘースの推論変数とその内容が出力されて格納され
るべきファイルのデータ項目との対応を示す記述である
.この対応関係を言語変換手段により解釈し、データの
入出力処理実行のためのプログラムを手続き型言語によ
り作成する.同時に知識ベースも言語変換手段により解
釈されて手続き型言語に変換されるが、この際知識ベー
ス中に含まれる入出力の指示はデータ入出力処理のため
のプログラムを呼出す指示に置換される。
With conventional inference devices such as those mentioned above, each time a situation arises that requires human output of data, it is necessary to program procedures for inputting and outputting data using a procedural programming language, which requires a large amount of man-hours. .. Furthermore, calling an input/output procedure program inside the inference device is generally executed by specifying the name of an external program as an input/output procedure, so it is not possible to actually use only the description on the knowledge base. There is also a problem in terms of readability, as it is difficult to determine the contents of the data exchange that is executed, and it is difficult to change and maintain the inference device. The present invention was made in view of these circumstances, and
When an inference device inputs and outputs data to and from an external database, etc., the input/output procedure can be performed in a simple manner, eliminating the need for programming, and the contents of the data input/output can be determined from the contents of the knowledge base of the inference device. The purpose is to provide an easily readable reasoning device. [Means for Solving the Problems] The inference device of the present invention creates a knowledge base by writing inference rules, and also determines the correspondence between the inference variables used therein and the data structure of a file that executes data input/output. Create a relationship and store it in a storage device. Specifically, this correspondence is the correspondence between the data item of the file from which data should be read and the inference variable of the knowledge base in which it should be stored, or the inference variable of the knowledge base and its contents are output and stored. This is a description that shows the correspondence with the data item of the file to be used. This correspondence is interpreted by a language conversion means, and a program for executing data input/output processing is created using a procedural language. At the same time, the knowledge base is also interpreted by the language conversion means and converted into a procedural language, but at this time, input/output instructions included in the knowledge base are replaced with instructions for calling a program for data input/output processing.

〔作用〕[Effect]

以上の処理により得られた手続き型言語によるプログラ
ムを機械語への翻訳装置へ入力すると、その出力として
最終的に実行可能な機械語による知識ベースが作成され
る. 〔発明の実施例〕 以下、本発明をその実施例を示す図面に基づいて詳述す
る. 第1図は本発明に係る推論装置の概略構成を示すブロッ
ク図である. 図中1は推論変数の入力手段であり、推論変数を入力し
て関係記述手段2へ出力する.関係記述手段2は推論変
数の入力手段1から与えられた推論変数とその推論変数
へ読込まれるぺきデータが格納されているファイルのフ
ィールドとの間の対応関係を記述する。
When the procedural language program obtained through the above processing is input to a machine language translation device, an executable machine language knowledge base is finally created as the output. [Embodiments of the Invention] Hereinafter, the present invention will be described in detail based on drawings showing embodiments thereof. FIG. 1 is a block diagram showing a schematic configuration of an inference device according to the present invention. 1 in the figure is an inference variable input means, which inputs inference variables and outputs them to the relationship description means 2. The relationship description means 2 describes the correspondence between the inference variable given from the inference variable input means 1 and the field of the file in which the data to be read into the inference variable is stored.

記憶手段3は、たとえば磁気ディスク装置等が使用され
、関係記述手段2により記述された対応関係を記憶する
. たとえば外部ファイルとして3個のrfieldlfi
eld2, field3JからなるrfilelJを
使用し、そのrfilelJ中のIlieldNを推論
変数rvariable l J ヘ読込む場合、rf
ilelJの構造をたとえば第2図に示す如く記述し、
また推論変数rvariable I Jとrfile
lJのフィールドとの対応関係を第3図に示す如く記述
し、記憶手段3に記憶させる. 4はルール記述手段であり、知識ベースを横成する推論
ルールを知識型言語にて記述する。即ち、推論装置とし
ては一般的な“if ”then”型ルールの実行部、
即ち“then”の後にファイル名を指定した入力操作
の命令を記述する.たとえば、第4図に示す如く、rf
ilelJを読込めという命令“READ(filel
)”が記述される。なおこのルール記述手段4としては
、汎用のエディタが使用可能であり、記述された推論ル
ールは前述の記憶千段3に記憶される. 5は言語変換手段であり、上述の如くして記憶千段3に
記憶されている推論変数と外部データとの対応関係及び
推論ルールを手続き型言語に変換する.この言語変換手
段5による処理は、第2図に示したファイル構造の記述
及び第3図に示した准論変数とフィールドとの対応関係
とに従って、ファイルからデータ、即ちフィールドの内
容を読込み、必要なフィールドの値を対応する推論変数
に代入する入力手続きを実行するプログラムを自動的に
生成する.このプログラムは手続き型言語にて記述され
ている. また推論ルールの変換に際しては、第4図に示した推論
ルールの実行部でのファイル名を指定した入力命令が上
述のプログラムを呼出す指示に変換される。
The storage means 3 is, for example, a magnetic disk device or the like, and stores the correspondence described by the relation description means 2. For example, 3 rfieldlfi as external files
When using rfileJ consisting of eld2 and field3J and reading IlieldN in that rfileJ into the inference variable rvariable l J, rf
For example, the structure of ilelJ is described as shown in Figure 2,
Also, the inference variables rvariable I J and rfile
The correspondence relationship with the field of lJ is described as shown in FIG. 3 and stored in the storage means 3. 4 is a rule description means, which describes inference rules forming the knowledge base in a knowledge-based language. That is, as an inference device, there is a general “if “then” type rule execution unit,
That is, write an input operation command that specifies the file name after "then". For example, as shown in FIG.
The command “READ (file
)" is written. Note that a general-purpose editor can be used as the rule description means 4, and the written inference rule is stored in the aforementioned memory 1000 stages 3. 5 is a language conversion means, As described above, the correspondence between the inference variables and external data and the inference rules stored in the memory 3 are converted into a procedural language.The processing by the language conversion means 5 is performed using the file shown in FIG. According to the structure description and the correspondence between quasi-variables and fields shown in Figure 3, read the data, that is, the field contents, from the file and execute the input procedure to assign the necessary field values to the corresponding inference variables. This program is written in a procedural language. Also, when converting an inference rule, an input command specifying a file name in the inference rule execution part shown in is converted into an instruction to call the above program.

言語変換手段5の出力である手続き型言語にて記述され
たプログラムは翻訳手段6に与えられる.關訳手段6は
、言語変換千段5から与えられたプログラムを機械語に
翻訳するが、プログラム言語のコンパイラが使用される
The output of the language conversion means 5, which is a program written in a procedural language, is given to the translation means 6. The translation means 6 translates the program given from the language conversion stage 5 into machine language using a program language compiler.

翻訳手段6により機械語に翻訳された推論ルールにて知
識ベース7が構成される。
A knowledge base 7 is constructed from the inference rules translated into machine language by the translation means 6.

〔発明の効果〕〔Effect of the invention〕

以上に詳述した如く本発明の推論装置によれば、従来の
手続き型言語にて入出力手続きをプログラミングする必
要は無く、外部のデータと装置内部の変数との間の対応
関係の記述というより高級な記述にてデータの入出力処
理が実行可能になり、プログラム作成工数の削減及び知
識ベースの可読性の向上が実現される.
As detailed above, according to the inference device of the present invention, there is no need to program input/output procedures in conventional procedural languages, and instead of writing a description of the correspondence between external data and internal variables of the device. Data input/output processing can be executed using high-level descriptions, reducing program creation time and improving the readability of the knowledge base.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明に係る推論装置の構成を示すブロック図
、第2図は本発明の推論装置に読込まれるべき外部デー
タファイルの構造を示す説明図、第3図は本発明の推論
装置の推論変数とそれに読込まれるべき外部データファ
イルとの間の対応関係を示す説明図、第4図はデータの
読込み処理を行うための推論ルールの記述例を示す模式
図、第5図は従来の推論装置の構成を示すブロック図で
ある。 ■・・・推論変数の入力手段  2・・・関係記述手段
3・・・記憶手段  4・・・ルール記述手段  5・
・・言語変換手段  6・・・翻訳手段
FIG. 1 is a block diagram showing the configuration of the inference device according to the present invention, FIG. 2 is an explanatory diagram showing the structure of an external data file to be read into the inference device of the present invention, and FIG. 3 is the inference device of the present invention. An explanatory diagram showing the correspondence between inference variables and external data files to be read into them, Figure 4 is a schematic diagram showing an example of writing an inference rule for performing data reading processing, and Figure 5 is a conventional diagram. FIG. 2 is a block diagram showing the configuration of an inference device. ■... Inference variable input means 2... Relationship description means 3... Storage means 4... Rule description means 5.
...Language conversion means 6...Translation means

Claims (1)

【特許請求の範囲】 1、知識ベースを構成する推論ルールを知識型言語にて
記述するルール記述手段と、該ルール記述手段により知
識型言語にて記述された推論ルールを手続き型言語に変
換する言語変換手段と、該言語変換手段により手続き型
言語に変換された推論ルールを機械語に翻訳する翻訳手
段とを備え、手続き型言語にて記述された外部のデータ
ファイルと前記知識ベースとの間でデータを授受する推
論装置において、 前記データファイルのデータと知識ベース との間の予め記述された関係を記憶する記憶手段を備え
、 前記言語変換手段は、推論ルールを手続き 型言語に変換する際に、前記記憶手段に記憶されている
関係に従って、前記データファイルのデータと前記知識
ベースとの間でデータを授受する手続きを手続き型言語
にて自動生成すべくなしたことを特徴とする推論装置。
[Claims] 1. Rule description means for writing inference rules constituting a knowledge base in a knowledge-based language, and converting the inference rules written in the knowledge-based language into a procedural language by the rule description means A system comprising: a language conversion means; and a translation means for translating inference rules converted into a procedural language by the language conversion means into machine language; and between an external data file written in a procedural language and the knowledge base. an inference device that sends and receives data, comprising a storage means for storing a predetermined relationship between the data in the data file and the knowledge base, and the language conversion means is configured to perform processing when converting inference rules into a procedural language. The inference device is characterized in that it automatically generates in a procedural language a procedure for transmitting and receiving data between the data in the data file and the knowledge base according to the relationship stored in the storage means. .
JP1051781A 1989-03-02 1989-03-02 Inference device Pending JPH02230330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1051781A JPH02230330A (en) 1989-03-02 1989-03-02 Inference device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1051781A JPH02230330A (en) 1989-03-02 1989-03-02 Inference device

Publications (1)

Publication Number Publication Date
JPH02230330A true JPH02230330A (en) 1990-09-12

Family

ID=12896493

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1051781A Pending JPH02230330A (en) 1989-03-02 1989-03-02 Inference device

Country Status (1)

Country Link
JP (1) JPH02230330A (en)

Similar Documents

Publication Publication Date Title
JP2801931B2 (en) Logic design processing device, circuit conversion rule translation device, and circuit conversion rule translation method
JPH02230330A (en) Inference device
JP2718427B2 (en) Data access method in large-scale knowledge base
JPS6361329A (en) Programming device
JPH0272407A (en) Ladder program converter
JP2558361B2 (en) Data processing system
JPH04209027A (en) Rule inference device
JPS63318605A (en) Nc part program generating device
JPH02178845A (en) Precompiling system for data base operation language
JPH05143356A (en) Compiler device
JP2601541B2 (en) FORTRAN input / output list processing method
JPH01255934A (en) Inference device
JPS6162141A (en) Logic-type information processing device
JPH0281136A (en) Fortran compiling process system
Brown et al. Relational programming: Design and implementation of a prototype interpreter
JPS6339037A (en) Program call processing system
JPH1083328A (en) Pseudo input/output realizing system for single body test
JPS62262144A (en) Graphical language processing system
JPH0423102A (en) Programming device for programmable controller
JPH1021087A (en) Compiling method
JPH031238A (en) Compiler for information processor
JPH04297927A (en) System for making software into component and utilizing the same
JPH0451322A (en) Software development knowledge acquisition supporting system
JPH0612259A (en) Compiler processing system
JPS598055A (en) Instruction word processing method