JPH0319030A - Production system and its inferring method - Google Patents

Production system and its inferring method

Info

Publication number
JPH0319030A
JPH0319030A JP15233189A JP15233189A JPH0319030A JP H0319030 A JPH0319030 A JP H0319030A JP 15233189 A JP15233189 A JP 15233189A JP 15233189 A JP15233189 A JP 15233189A JP H0319030 A JPH0319030 A JP H0319030A
Authority
JP
Japan
Prior art keywords
variable
rule
fixed
fact
attribute
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
JP15233189A
Other languages
Japanese (ja)
Inventor
Hiroshi Koike
博 小池
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP15233189A priority Critical patent/JPH0319030A/en
Publication of JPH0319030A publication Critical patent/JPH0319030A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To omit the duplication of processes even if the inferences are carried out for each input of the attribute value of a variable fact and to perform these inferences at a high speed and with high efficiency by eliminating the part of an original rule where the attribute value of a fact covers a fixed value and maintaining only the part the covers the variable attribute value of the fact to use it as a new rule. CONSTITUTION:A fixed/variable state deciding means 6 extracts the fixed attrib ute value of a fact from a working memory 2 and sends it to a partial calcula tion mechanism 7. The mechanism 7 calculates partly the rule of a rule base based on the received attribute of the fact and erases the true part of a condi tional part of the rule to replace the original rule with the remaining part. Thus the original rule is reduced by an amount equal to the erased part and finally only a rule related to the variable attribute value of the fact is obtained. As a result, no duplication of processes occurs even if the inferences are carried out every time the variable attribute value is changed. Then the inferences are performed at a high speed and with high efficiency.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、プロダクションシステムに関し、さらに詳
しくは、重複した処理を回避し、高速かつ高効率に推論
を行うことが出来るプロダクションシステムに関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a production system, and more particularly to a production system that can avoid redundant processing and perform inference at high speed and with high efficiency.

[従来の技術] 従来のプロダクションシステムの一例を第8図に示す。[Conventional technology] An example of a conventional production system is shown in FIG.

このプロダクションシステム51は、ファクトの集合か
らなるワーキングメモリ52と、ルールの集合からなる
ルールベース53と、前記ファクトをもとに前記ルール
を適用して推論する推論機構54と、入出力のためのイ
ンターフェース55とを備えている。
This production system 51 includes a working memory 52 consisting of a set of facts, a rule base 53 consisting of a set of rules, an inference mechanism 54 that applies the rules based on the facts and makes inferences, and an input/output An interface 55 is provided.

ワーキングメモリ52におけるファクトは第9図に示す
ような構造をもっている。すなわち、1つのファクトに
は1つのファクト名が有り、1つのファクトは1以上の
属性をもっている。1つの属性には1つの属性名が有り
、1つの属性は1つの属性値をもっている。このような
ファクトはインターフェース55を介してワーキングメ
モリ52に入力されるが、属性値が確定しない時点で入
力されるファクトの属性値には仮の初期値が設定される
。第9図に示す図表において属性値が「0」以外の数値
のものは確定した値であり、「O」のものは仮の値とし
て「0」が設定されているものである。
The facts in the working memory 52 have a structure as shown in FIG. That is, one fact has one fact name, and one fact has one or more attributes. One attribute has one attribute name, and one attribute has one attribute value. Such facts are input to the working memory 52 via the interface 55, but when the attribute values are not determined, provisional initial values are set for the attribute values of the input facts. In the chart shown in FIG. 9, attribute values other than ``0'' are determined values, and attribute values ``O'' are set to ``0'' as temporary values.

ルールベース53におけるルールは第10図に示すよう
な構造をもっている。すなわち、1つのルールには1つ
のルール名が有り、1つのルールはIFで導かれた条件
部とTHENで導かれた結論部をもっている。条件部に
も結論部にも1以上の文を記述できる。文は属性名と演
算子と値とからなっている。条件部に記述された複数の
文はAND条件となる。
The rules in the rule base 53 have a structure as shown in FIG. That is, one rule has one rule name, and one rule has a condition part derived from IF and a conclusion part derived from THEN. One or more sentences can be written in both the conditional part and the conclusion part. A statement consists of an attribute name, an operator, and a value. The multiple statements written in the condition part become an AND condition.

推論機構54は第11図に示すフローチャートのように
作動する。すなわち、ワーキングメモリ52から1つの
ファクトの属性値を読み出して(Sl)、そのファクト
の属性値に一致するような条件部を持つルールをルール
ベース53から取り出す(S2)。そのルールの条件部
の判断に他のファクトの属性値が必要なら更にワーキン
グメモリ52から読み出すが、もしワーキングメモリ5
2に無ければインターフェース55を介して外部に入力
を要求する(S3)。1つのルールの条件部の文が全て
真になれば(S4)、そのルールの結論部をワーキング
メモリ52に追加する(S5)。このようなサイクルを
繰り返し行って、条件部の文の全てが真となるルールが
一つも存在しなくなれば、作動を終了する(S4)。こ
の時、推論の結果がワーキングメモリ52に得られてい
る。
The inference mechanism 54 operates as shown in the flowchart shown in FIG. That is, the attribute value of one fact is read from the working memory 52 (S1), and a rule having a condition part that matches the attribute value of that fact is extracted from the rule base 53 (S2). If attribute values of other facts are needed to judge the condition part of the rule, they are read out from the working memory 52.
2, an external input is requested via the interface 55 (S3). If all the sentences in the conditional part of one rule become true (S4), the conclusion part of that rule is added to the working memory 52 (S5). Such a cycle is repeated until there is no rule in which all of the statements in the condition part are true, and the operation is ended (S4). At this time, the result of the inference has been obtained in the working memory 52.

以上のようなプロダクションシステムの高速化のための
技術としては、情報処理学会誌[情報処理J V o 
I 、 29. No5 (May 1988)第46
7頁〜第477頁に開示されている条件部の文が全て真
となるルールの取り出しのアルゴリズムの改良等の手法
が知られている。
Techniques for speeding up production systems such as those described above are described in the Journal of the Information Processing Society of Japan [Information Processing J V o
I, 29. No5 (May 1988) No. 46
Techniques are known, such as those disclosed on pages 7 to 477, for improving algorithms for extracting rules in which all sentences in the condition part are true.

他方、複数のデータの入力を必要とするプログラムがあ
るときに、一部のデータだけが与えられると、その一部
のデータだけで処理できるプログラムの部分を先に処理
し、残りの部分を新たなプログラムとし、他の部分のデ
ータが与えられると前記新たなプログラムを用いて処理
を行う部分計算の理論が知られている。固定した値のデ
ータを与えて新プログラムを作成し、可変の値のデータ
は値が変化するごとに新プログラムに与えることを行え
ば、重複した計算を避けることが出来る。
On the other hand, if you have a program that requires input of multiple pieces of data, and only some of the data is given, the part of the program that can be processed with only that part of the data is processed first, and the remaining parts are created anew. A theory of partial calculation is known in which a program is set as a new program, and when data of another part is given, processing is performed using the new program. Duplicate calculations can be avoided by creating a new program by giving fixed value data, and giving variable value data to the new program every time the value changes.

実際にはこのような部分計算は従来はプログラマにより
なされているが、これをコンピュータで行わせるための
研究がbit誌の臨時増刊[新しい時代のソフトウェア
J (1984)第81頁〜第91頁に開示されている
In reality, such partial calculations have traditionally been performed by programmers, but a study on how to perform this on a computer was published in a special edition of BIT magazine [New Era Software J (1984), pp. 81-91. Disclosed.

[発明が解決しようとする課題] 上記従来のプロダクションシステム51において、一部
のファクトの属性値はたびたび変更されるが、他のファ
クトの属性値は常に一定であるという場合がありうるが
、推論機構54はファクトの属性値と一致するルールが
あればそれらを全て用いて推論を行うから、一部のファ
クトの属性値を変更ごとに、変更しないファクトの属性
値と一致するルールも用いて推論を行うことになる。
[Problems to be Solved by the Invention] In the conventional production system 51 described above, there may be cases where the attribute values of some facts are frequently changed while the attribute values of other facts are always constant. The mechanism 54 performs inference using all rules that match the attribute values of facts, so every time the attribute values of some facts are changed, it also makes inferences using rules that match the attribute values of facts that do not change. will be carried out.

つまり、一部のファクトの属性値を変更するたびに同じ
処理が重複して繰り返されることになり、これは無駄で
ある。
In other words, the same process is repeated every time the attribute value of some facts is changed, which is wasteful.

そこで、この発明の発明者は、重複計算を避けることを
目指した部分計算の理論に着目し、これをプロダクショ
ンシステムに適用すれば上記のような無駄を防止できる
と考え、鋭意研究を重ねた結果、この発明を完成するに
至った。
Therefore, the inventor of this invention focused on the theory of partial calculations that aims to avoid duplicate calculations, and thought that if this theory was applied to production systems, the above waste could be prevented, and as a result of intensive research. , has completed this invention.

従って、この発明の目的は、部分計算機能を具備した高
速、高効率のプロダクションシステム及びその推論方法
を提供することにある。
Therefore, an object of the present invention is to provide a high-speed, highly efficient production system equipped with partial calculation functions and an inference method thereof.

[課題を解決するための手段] この発明のプロダクションシステムは、ファクトの集合
からなるワーキングメモリと、ルールの集合からなるル
ールベースと、前記ファクトをもとに前記ルールを適用
して推論する推論機構とを備えてなるプロダクションシ
ステムにおいて、ワーキングメモリのファクトの属性値
が固定のものと可変のものとを判別する固定可変判別手
段と、その固定可変判別手段で固定と判別されたファク
トの属性値をもとにルールベースのルールを適用してル
ールの条件部のうち真となった部分を消去して残りの部
分でもとのルールの少なくとも条件部を置換する部分計
算機構とを具備してなることを構成上の特徴とするもの
である。
[Means for Solving the Problems] The production system of the present invention includes a working memory consisting of a set of facts, a rule base consisting of a set of rules, and an inference mechanism that applies the rules based on the facts and makes inferences. A production system comprising: fixed/variable discriminating means for discriminating between fixed and variable attribute values of facts in working memory; and a partial calculation mechanism that applies a rule-based rule to the original rule, deletes the true part of the conditional part of the rule, and replaces at least the conditional part of the original rule with the remaining part. is a structural feature.

また、ヤの観点では、この発明のプロダクシジ、J ンシステムは、ファクトの集合からなるワーキングメモ
リと、ルールの集合からなるルールベースと、前記ファ
クトをもとに推論する前記ルールベースに専用の推論機
構を前記ルールを適用して前記ルールベースから作成す
るルールコンパイラとを備えてなるプロダクションシス
テムにおいて、ワーキングメモリのファクトの属性値が
固定のものと可変のものとを判別する固定可変判別手段
と、その固定可変判別手段で固定と判別されたファクト
の属性値をもとに前記推論機構を部分計算して新推論機
構を作成する部分計算機構とを更に具備してなることを
構成上の特徴とするものである。
Furthermore, from the point of view of Y, the production system of the present invention includes a working memory consisting of a set of facts, a rule base consisting of a set of rules, and an inference dedicated to the rule base that makes inferences based on the facts. A production system comprising: a rule compiler that applies the rules to create a rule base from the rule base; A structural feature further comprises: a partial calculation mechanism that partially calculates the inference mechanism based on the attribute value of the fact determined to be fixed by the fixed/variable determination means to create a new inference mechanism. It is something to do.

[作用] この発明のプロダクションシステムでは、固定可変判別
手段がワーキングメモリからファクトの属性値が固定の
ものを抽出して部分計算機構に渡す。部分計算機構は渡
されたファクトの属性値をもとにルールベースのルール
を部分計算してルールの条件部のうち真となった部分を
消去して残りの部分でもとのルールを置換する。
[Operation] In the production system of the present invention, the fixed/variable determining means extracts facts with fixed attribute values from the working memory and passes them to the partial calculation mechanism. The partial calculation mechanism partially calculates the rule based rule based on the attribute value of the passed fact, deletes the part of the condition part of the rule that is true, and replaces the original rule with the remaining part.

従って、もとのルールが消去された分だけ小さくなり、
結局のところ、ファクトの属性値が可変のものに関する
ルールだけになってしまう。そこで、それら可変の属性
値の変更があるごとに推論を行っても、重複した処理は
なく、高速かつ高効率となる。
Therefore, it becomes smaller by the amount that the original rule is deleted,
In the end, there are only rules for facts whose attribute values are variable. Therefore, even if inference is performed every time there is a change in these variable attribute values, there is no duplication of processing, resulting in high speed and high efficiency.

また、他の観点では、固定可変判別手段がワーキングメ
モリからファクトの属性値が固定のものを抽出して部分
計算機構に渡す。部分計算機構は渡されたファクトの属
性値をもとに専用推論機構を部分計算して新たな専用推
論機構を作成する。
In another aspect, the fixed/variable determining means extracts facts with fixed attribute values from the working memory and passes them to the partial calculation mechanism. The partial calculation mechanism partially calculates the dedicated inference mechanism based on the attribute value of the passed fact to create a new dedicated inference mechanism.

従って、新しい専用推論機構はファクトの属性値が可変
のものに関する部分だけになってしまうから、ファクト
の属性値が固定のものについての重複した推論はなくな
り、高速かつ高効率となる。
Therefore, the new dedicated inference mechanism is only concerned with facts whose attribute values are variable, eliminating redundant inferences with respect to facts whose attribute values are fixed, resulting in high speed and efficiency.

[実施例] 以下、図に示す実施例によりこの発明を更に詳しく説明
する。なお、これによりこの発明が限定されるものでは
ない。
[Example] Hereinafter, the present invention will be explained in more detail with reference to Examples shown in the drawings. Note that this invention is not limited to this.

第1図に示すこの発明の一実施例のプロダクションシス
テム1は、ワーキングメモリ2と、ルールベース3と、
推論機構4と、インターフェース5とを備えると共に、
固定可変判別部6と、部分計算機構7とを更に具備して
なっている。
A production system 1 according to an embodiment of the present invention shown in FIG. 1 includes a working memory 2, a rule base 3,
In addition to comprising an inference mechanism 4 and an interface 5,
It further includes a fixed/variable discriminator 6 and a partial calculation mechanism 7.

ワーキングメモリ2におけるファクトは第2図に示すよ
うな構造をもっている。すなわち、1つのファクトには
1つのファクト名が有り、1つのファクトは1以上の属
性をもっている。1つの属性には1つの属性名が有り、
1つの属性は1つの属性値をもっている。さらに、属性
値ごとに「固定」か「可変」かの固定可変情報が保持さ
れている。固定可変情報は操作者(例えばファクトの入
力者)の指定により与えられると共に、後述するように
、部分計算機構7によっても与えられる。
The facts in the working memory 2 have a structure as shown in FIG. That is, one fact has one fact name, and one fact has one or more attributes. One attribute has one attribute name,
One attribute has one attribute value. Further, fixed and variable information indicating whether it is "fixed" or "variable" is held for each attribute value. The fixed variable information is given by an operator (for example, a fact input person), and is also given by the partial calculation mechanism 7, as will be described later.

ファクトはインターフェース5を介してワーキングメモ
リ2に入力される。なお第2図に示す図表において属性
値がrOJ以外の数値のものは確定した値であり、「0
」のものは仮の属性値としてrOJが設定されているも
のである。
The facts are entered into the working memory 2 via the interface 5. In addition, in the chart shown in Figure 2, attribute values other than rOJ are fixed values, and are ``0''.
" is one in which rOJ is set as a temporary attribute value.

ルールベース3におけるルールは第3図または第4図に
示すような構造をもっている。すなわち、1つのルール
には1つのルール名が有り、1つのルールはIFで導か
れた条件部とTHENで導かれた結論部をもっている。
The rules in the rule base 3 have a structure as shown in FIG. 3 or 4. That is, one rule has one rule name, and one rule has a condition part derived from IF and a conclusion part derived from THEN.

条件部にも結論部にも1以上の文を記述できる。文は属
性名と演算子と値とからなっている。条件部に記述され
た複数の文はAND条件となる。このような構造は第1
0図に示した従来のルールの構造と同一である。なお、
第3図はもともとのルールであり、第4図は後述する部
分計算機構7により置換された後の新しいルールである
One or more sentences can be written in both the conditional part and the conclusion part. A statement consists of an attribute name, an operator, and a value. The multiple statements written in the condition part become an AND condition. Such a structure is the first
This is the same structure as the conventional rule shown in FIG. In addition,
FIG. 3 shows the original rule, and FIG. 4 shows the new rule after being replaced by a partial calculation mechanism 7, which will be described later.

推論機構4は基本的には従来と同様に作動する。The inference mechanism 4 basically operates in the same manner as before.

すなわち、第11図に示すように、ワーキングメモリ2
にある1つのファクトの属性値を読み出して(Sl)、
そのファクトの属性値に照合するような条件部を持つル
ールをルールベース3から取り出す(S2)。そのルー
ルの条件部の判断に他のファクトの属性値が必要なら更
にワーキングメモリ2から読み出すが、もしワーキング
メモリ2に無ければインターフェイス5を介して外部に
入力を要求する(S3)。1つのルールの条件1部の文
が全て真になれば(S4)、そのルールの結論部をワー
キングメモリ2に追加する(S5)。このようなサイク
ルを繰り返し行って、条件部の文の全てが真となるルー
ルが一つも存在しなくなれば作動を終了する(S5)。
That is, as shown in FIG.
Read the attribute value of one fact in (Sl),
A rule having a condition part that matches the attribute value of the fact is extracted from the rule base 3 (S2). If attribute values of other facts are necessary for determining the condition part of the rule, they are read out from the working memory 2, but if they are not present in the working memory 2, input is requested from the outside via the interface 5 (S3). If all the sentences in the first part of the condition of one rule become true (S4), the conclusion part of that rule is added to the working memory 2 (S5). Such a cycle is repeated until there is no rule in which all of the statements in the condition part are true, and the operation is terminated (S5).

この時、推論の結果がワーキングメモリ2に得られるこ
とになる。
At this time, the result of the inference will be obtained in the working memory 2.

固定可変判別部6は、部分計算機構7の要求により第5
図に示すように作動する。すなわち、ワーキングメモリ
2に取り出すべきファクトの属性値があるか否かをチエ
ツクしくDl)、あればそのファクトの属性値を読み出
して(D2)、そのファクトの属性値の固定可変情報を
調べる(D3)「固定」であればそのファクトの属性値
を部分計算機構7に渡す(D4)。「可変」であれば前
記ステップD1に戻る。前記ステップD1において、ワ
ーキングメモリ2に取り出すべきファクトの属性値がな
ければその旨を部分計算機構7に通知する(D5)。
The fixed/variable discriminator 6 receives the fifth
It operates as shown in the figure. That is, check whether there is an attribute value of the fact to be retrieved in the working memory 2 (Dl), read the attribute value of that fact (D2), and check the fixed variable information of the attribute value of that fact (D3). ) If it is "fixed", the attribute value of that fact is passed to the partial calculation mechanism 7 (D4). If "variable", the process returns to step D1. In step D1, if there is no attribute value of the fact to be retrieved in the working memory 2, this is notified to the partial calculation mechanism 7 (D5).

部分計算機構7は、操作者の指示に応じて第6図(a)
(b)に示すように作動する。すなわち、ファクトの属
性値が「固定」のものをワーキングメモリ2から取り出
すように固定可変判定部6に要求しくPl)、「固定」
のファクトの属性値が有れば(P2)、それを固定可変
判定部6から受は取る(P3)。次に、そのファクトの
属性値に照合するルールをルールベース3から取り出し
くP4)、そのルールの条件部で真となる文を消去する
と共にそのルールの条件部で値が確定した文は、その値
を「固定」としてワーキングメモリ2に書き込んでから
、消去する(P5)。そして、消去できない残りの文が
あるか否かをチエツクしくP6)、あればその残りの文
からなる条件部と結論部とをもつ新ルールを作成し、こ
れをもとのルールと置換する(Pl)。一方、条件部の
文で残りがなければそのルールの結論部に進み、そのル
ールの結論部で値が確定した文は、その値を「固定」と
してワーキングメモリ2に書き込んでから、消去する(
P8)。そして、その残りの文からなる結論部をもつ新
ルールを作成し、これをもとのルールと置換する(P9
)。
The partial calculation mechanism 7 operates as shown in FIG. 6(a) in response to instructions from the operator.
It operates as shown in (b). In other words, the fixed/variable determination unit 6 is requested to retrieve the fact whose attribute value is "fixed" from the working memory 2 (Pl), and the attribute value of the fact is "fixed".
If there is an attribute value of the fact (P2), it is received from the fixed/variable determining unit 6 (P3). Next, extract the rule that matches the attribute value of that fact from Rule Base 3 (P4), delete the statement that is true in the conditional part of that rule, and delete the statement whose value is confirmed in the conditional part of that rule. The value is written to the working memory 2 as "fixed" and then erased (P5). Then, check whether there are any remaining sentences that cannot be deleted (P6), and if there are, create a new rule with a conditional part and a conclusion part made up of the remaining sentences, and replace the original rule with this ( Pl). On the other hand, if there are no remaining sentences in the conditional part, the process proceeds to the conclusion part of the rule, and for sentences whose values have been determined in the conclusion part of the rule, that value is written to the working memory 2 as "fixed" and then deleted (
P8). Then, create a new rule with a conclusion consisting of the remaining sentences, and replace the original rule with this (Page 9).
).

次に、この部分計算機構7の作動を第2図に示すファク
トと第3図に示すルールとを用いて具体的に説明する。
Next, the operation of this partial calculation mechanism 7 will be specifically explained using the facts shown in FIG. 2 and the rules shown in FIG. 3.

まず、操作者の指示により部分計算機構7が作動を開始
し、固定可変判定部6にファクトの属性値が固定のもの
を要求する。
First, the partial calculation mechanism 7 starts operating according to an instruction from the operator, and requests the fixed/variable determination section 6 to determine that the attribute value of the fact is fixed.

固定可変判定部6は第2図に示すファクトの中からファ
クト名Aの属性名aの属性値「1」を取り出し、これは
「固定」であるから、部分計算機構7に渡す。
The fixed/variable determining section 6 extracts the attribute value "1" of the attribute name a of the fact name A from the facts shown in FIG. 2, and since this is "fixed", it passes it to the partial calculation mechanism 7.

部分計算機構7は第2図に示すルールの中からファクト
名Aの属性名aと一致する条件部をもつルール名Iを取
り出す。この条件部は2つの文からなるが、その第1の
文の演算子「=」は「左辺と右辺が等しい」を表してお
り、この文は真である。従って、部分計算機構7はこの
文を消去する。
The partial calculation mechanism 7 extracts a rule name I having a condition part that matches the attribute name a of the fact name A from among the rules shown in FIG. This conditional part consists of two sentences, and the operator "=" in the first sentence represents "the left side and the right side are equal", and this sentence is true. Therefore, the partial calculation mechanism 7 deletes this sentence.

第2の文はファクト名Aの属性名すを必要とするので、
固定可変判定部6に要求する。
The second statement requires the attribute name of fact name A, so
A request is made to the fixed/variable determining section 6.

そN固定可変判定部6は第2図に示すルールの中からフ
ァクト名Aの属性名すの属性値「5」を取り出すが、こ
れも「固定」であるから、部分計算機構7に渡す。
The N fixed variable determination section 6 extracts the attribute value "5" of the attribute name of the fact name A from the rules shown in FIG. 2, but since this is also "fixed", it passes it to the partial calculation mechanism 7.

ルール名■の第2文の演算子「→」は「左辺を右辺に代
入する」を表しており、部分計算機構7は、第2文を実
行できるようになるので、右辺の値を「固定」としてワ
ーキングメモリ2に書き込み、この第2文を消去する。
The operator “→” in the second sentence of rule name " is written into the working memory 2, and this second sentence is erased.

ルール名■の条件部が全て消去されたので、結論部に進
み、ここでの演算子「−」は「右辺を左辺に代入する」
を表しており、これも実行できるようになるので、左辺
の値であるファクト名Bの属性名Cの値を「固定」とし
てワーキングメモリ2に書き込み、この結論部を消去す
る。つまり、ルール名Iは全てが消去されたことになる
Since all the conditional parts of the rule name ■ have been deleted, proceed to the conclusion part, and the operator "-" here "substitutes the right side to the left side"
Since this can also be executed, the value of the attribute name C of the fact name B, which is the value on the left side, is written as "fixed" in the working memory 2, and this conclusion part is erased. In other words, all rule names I have been deleted.

ファクト名Bの属性名Cの値が「固定」となったから、
固定可変判定部6は、ファクト名Bの属性名Cの値を部
分計算機構7に渡し、これにより部分計算機構7はルー
ル名■を取り出す。ルール部と結論部がいずれも消去さ
れる。つまり、ルール名■も全てが消去されたことにな
る。
Since the value of attribute name C of fact name B is "fixed",
The fixed variable determination unit 6 passes the value of the attribute name C of the fact name B to the partial calculation mechanism 7, and the partial calculation mechanism 7 thereby extracts the rule name ■. Both the rule part and the conclusion part are deleted. In other words, the rule name ■ has also all been deleted.

ルール名■の結論部でファクト名Cの属性名aの値が「
固定」となったから、固定可変判定部6は、ファクト名
Cの属性名aの値を部分計算機構7に渡し、これにより
部分計算機構7はルール名■を取り出す。ルール名■で
はその条件部の第1文が真となるので消去されるが、第
2文、第3文は真か否か未確定なので消去されず、従っ
て、もとのルール名■の条件部の第2文と第3文と結論
部とからなる新ルールαが作成され、ルール名■と置換
されることになる。かくして、ルールベース3のルール
は、第4図に示す如きものとなる。
In the conclusion part of rule name ■, the value of attribute name a of fact name C is "
The fixed/variable determination unit 6 passes the value of the attribute name a of the fact name C to the partial calculation mechanism 7, and the partial calculation mechanism 7 thereby extracts the rule name ■. In the rule name ■, the first sentence of the condition part is true, so it is deleted, but the second and third sentences are not deleted because it is unclear whether they are true or not. Therefore, the condition of the original rule name ■ is deleted. A new rule α consisting of the second and third sentences of the part and the conclusion part will be created and will be replaced with the rule name ■. Thus, the rules of rule base 3 are as shown in FIG.

第3図と第4図とを比較すれば分かるように、極めてシ
ンプルなルールに変換されている。そこで、ファクト名
Cの属性名dとファクト名りの属性名dとが与えられる
ごとに推論を行っても、無駄な重複を生じず、高速かつ
高効率に推論が行われることが理解されよう。
As can be seen by comparing Figures 3 and 4, the rules have been converted to extremely simple rules. Therefore, it will be understood that even if inference is performed each time attribute name d of fact name C and attribute name d of fact name are given, inference will be performed quickly and efficiently without unnecessary duplication. .

3右、上述のように新しいルールを作成してからインタ
プリタ型の推論を行う外に、新しいルールからルールコ
ンパイラによって専用推論機構を作成し、これを用いて
推論を行っても同じ効果を得ることが出来る。
3 Right: In addition to creating a new rule and then performing interpreted inference as described above, you can also obtain the same effect by creating a dedicated inference mechanism from the new rule using a rule compiler and performing inference using this. I can do it.

次に第7図(a)(b)はこの発明の他の実施例を示す
ものであって、上記実施例では部分計算によりルールを
縮減していたが、この実施例ではルールを縮減しないま
までルールコンパイラにより専用推論機構を作成しくC
3)、その専用推論機構に部分計算を適用して新たな専
用推論機構を作成する(C5)ものである。もとの専用
推論機構よりも縮減された新しい専用推論機構が得られ
るため、「可変」のファクトの属性値を変更するごとに
入力しくC9)、推論を行わせたとき、上記と同じ効果
を得られることは容易に理解されるであろう。
Next, FIGS. 7(a) and 7(b) show another embodiment of the present invention. In the above embodiment, the rules were reduced by partial calculation, but in this embodiment, the rules were not reduced. Create a dedicated inference mechanism using the rule compiler in C
3), a new dedicated inference mechanism is created by applying partial calculation to the dedicated inference mechanism (C5). Since a new dedicated inference mechanism is obtained that is reduced in size compared to the original dedicated inference mechanism, it is necessary to input it every time the attribute value of the "variable" fact is changed (C9), and when inference is performed, the same effect as above can be obtained. What is obtained will be easily understood.

さらに他の実施例としては、ファクトの属性に各々対応
してその属性値のの更新歴をワーキングメモリに保持す
るようにすると共に、その属性値更い属性値を固定と判
定し他を可変と判定する固定可変判別手段を用いたもの
が挙げられる。更新が所定期間行われなかったものは「
固定」と推定できるからである。
Still another example is to store the update history of the attribute values in the working memory corresponding to each attribute of the fact, and to determine that the attribute values are fixed and the others to be variable. One example is one using a fixed/variable discriminating means. Items that have not been updated for a specified period of time are
This is because it can be assumed to be "fixed."

また、上記プロダクションシステム及びその推論方法は
、エキスパートシステムに利用することが出来るばかり
でなく、処理が高速かつ高効率になるから、膨大なデー
タを扱うエキスパートデータベースシステムや、高度の
処理を行う知識ベースシステムにも好適に利用すること
が出来る。
In addition, the above production system and its inference method can not only be used in expert systems, but also provide high-speed and highly efficient processing, so they can be used in expert database systems that handle huge amounts of data, and knowledge bases that perform advanced processing. It can also be suitably used in systems.

[発明の効果コ この発明のプロダクションシステム及び推論方法によれ
ば、もとのルールのうちファクトの属性値が固定のもの
にかかる部分が消去され、ファクトの属性値が可変のも
のにかかる部分だけが残されて新ルールとされるから、
可変のファクトの属性値を入力するごとに推論を行って
も処理の重複がなく、高速かつ高効率に推論を行えるこ
ととなる。
[Effect of the invention: According to the production system and inference method of this invention, the part of the original rule that applies to facts with fixed attribute values is deleted, and only the part that applies to facts with variable attribute values is deleted. Since it is left as a new rule,
Even if inference is performed each time a variable fact attribute value is input, there is no duplication of processing, and inference can be performed at high speed and with high efficiency.

また、もとのルールからルールコンパイラにより専用推
論機構を作成するプロダクションシステムにおいても、
その専用推論機構のうちのファクトの属性値が固定のも
のにかかる部分が消去され、ファクトの属性値が可変の
ものにかかる部分だけが残されて新妻用推論機構とされ
るから、やはり高速かつ高効率に推論を行えることとな
る。
Also, in production systems where a dedicated inference mechanism is created from the original rules using a rule compiler,
The part of the dedicated inference mechanism that applies to facts whose attribute values are fixed is deleted, and only the part that applies to facts whose attribute values are variable is left as the inference mechanism for Niizuma, so it is still fast and Inference can be performed with high efficiency.

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

第1図はこの発明の一実施例のプロダクションシステム
のブロック図、第2図は第1図に示すプロダクションシ
ステムにおけるファクトの構造を示す概念図、第3図は
第1図に示すプロダクションシステムにおけるルールの
構造を示す概念図、第4図は第1図に示すプロダクショ
ンシステムにおける新ルールを示す概念図、第5図は第
1図に示すプロダクションシステムにおける固定可変判
定部の作動を示す要部フローチャート、第6図(a)(
b)は第1図に示すプロダクションシステムにおける部
分計算機構の作動を示す要部フローチャート、第7図(
a)(b)はこの発明の他の実施例のプロダクションシ
ステムの作動を示す概略フローチャート、第8図は従来
のプロダクションシステムのブロック図、第9図は第8
図に示すプロダクションシステムにおけるファクトの構
造を示す概念図、糸は第8図に示すプロダクションシス
テムにおけるルールの構造を示す概念図、第11図は推
論機構の作動を示す要部フローチャートである。 (符号の説明) 1・・・プロダクションシステム 2・・・ワーキングメモリ 3・・・ルールベース 4・・・推論機構 5・・・インターフェース 6・・・固定可変判定部 7・・・部分計算機構。
Figure 1 is a block diagram of a production system according to an embodiment of the present invention, Figure 2 is a conceptual diagram showing the structure of facts in the production system shown in Figure 1, and Figure 3 is a rule for the production system shown in Figure 1. FIG. 4 is a conceptual diagram showing the new rules in the production system shown in FIG. 1; FIG. 5 is a flowchart showing the main parts of the operation of the fixed variable determination section in the production system shown in FIG. 1; Figure 6(a) (
b) is a main part flowchart showing the operation of the partial calculation mechanism in the production system shown in Fig. 1, and Fig. 7 (
a) and (b) are schematic flowcharts showing the operation of a production system according to another embodiment of the present invention, FIG. 8 is a block diagram of a conventional production system, and FIG.
A conceptual diagram showing the structure of facts in the production system shown in the figure, a conceptual diagram showing the structure of rules in the production system shown in FIG. (Explanation of symbols) 1...Production system 2...Working memory 3...Rule base 4...Inference mechanism 5...Interface 6...Fixed variable determination unit 7...Partial calculation mechanism.

Claims (1)

【特許請求の範囲】 1、ファクトの集合からなるワーキングメモリと、ルー
ルの集合からなるルールベースと、前記ファクトをもと
に前記ルールを適用して推論する推論機構とを備えてな
るプロダクションシステムにおいて、 ワーキングメモリのファクトの属性値が固定のものと可
変のものとを判別する固定可変判別手段と、 その固定可変判別手段で固定と判別されたファクトの属
性値をもとにルールベースのルールを適用してルールの
条件部のうち真となった部分を消去して残りの部分でも
とのルールの条件部を置換する部分計算機構と を具備してなることを特徴とするプロダクションシステ
ム。 2、ファクトの集合からなるワーキングメモリと、ルー
ルの集合からなるルールベースと、前記ファクトをもと
に推論する前記ルールベースに専用の推論機構を前記ル
ールを適用して前記ルールベースから作成するルールコ
ンパイラとを備えてなるプロダクションシステムにおい
て、 ワーキングメモリのファクトの属性値が固定のものと可
変のものとを判別する固定可変判別手段と、 その固定可変判別手段で固定と判別されたファクトの属
性値をもとに前記推論機構を部分計算して新推論機構を
作成する部分計算機構と を更に具備してなることを特徴とするプロダクションシ
ステム。 3、ファクトの属性に各々対応してその値が固定か可変
かの情報をワーキングメモリが保持すると共に、固定可
変判別手段は前記ワーキングメモリに保持した固定可変
情報を参照してその属性値が固定か可変かを判別する請
求項1または請求項2のいずれか一つのプロダクション
システム。 4、操作者の指定により固定可変情報が与えられる請求
項1、請求項2または請求項3のいずれか一つのプロダ
クションシステム。 5、ファクトの属性に各々対応してその属性値の更新歴
をワーキングメモリが保持すると共に、固定可変判別手
段は前記ワーキングメモリに保持した属性値更新歴を参
照して所定の期間以後は更新されていない属性値を固定
と判定し他を可変と判定する請求項1、請求項2、請求
項3または請求項4のいずれか一つのプロダクションシ
ステム。 6、部分計算機構が、条件部または結論部で確定したフ
ァクトの属性値を固定の値としてワーキングメモリに書
き込む請求項1、請求項2、請求項3、請求項4または
請求項5のいずれか一つのプロダクションシステム。 7、ファクトの属性値が不変のものと可変のものとを判
別し、 前記判別の結果、ファクトの不変の属性値 を参照して、ルールの条件部のうち真となる部分を消去
し、 前記消去の結果、残った部分で前記ルールの条件部を置
換する、 ことを特徴とする高速推論方法。 8、ファクトの属性値の更新歴情報を参照して、前記フ
ァクトの可変の属性値が予め定めた期間、更新されてい
ない場合に、該可変の属性値を不変のものと判別する、 請求項7の高速推論方法。
[Claims] 1. In a production system comprising a working memory consisting of a set of facts, a rule base consisting of a set of rules, and an inference mechanism that applies the rules based on the facts and makes inferences. , a fixed-variable discriminator for determining whether the attribute value of a fact in working memory is fixed or variable, and a rule-based rule based on the attribute value of the fact determined to be fixed by the fixed-variable discriminator. 1. A production system comprising: a partial calculation mechanism for deleting a part of a conditional part of a rule that becomes true by application and replacing the conditional part of the original rule with the remaining part. 2. A working memory consisting of a set of facts, a rule base consisting of a set of rules, and a dedicated inference mechanism for the rule base that makes inferences based on the facts, and rules that are created from the rule base by applying the rules. a compiler; fixed/variable determining means for determining whether attribute values of facts in working memory are fixed or variable; and attribute values of facts determined to be fixed by the fixed/variable determining means. A production system further comprising: a partial calculation mechanism that partially calculates the inference mechanism based on the above to create a new inference mechanism. 3. The working memory holds information as to whether the value is fixed or variable corresponding to each attribute of the fact, and the fixed/variable determining means refers to the fixed/variable information held in the working memory to determine whether the attribute value is fixed. 3. The production system according to claim 1 or 2, wherein the production system determines whether or not the variable is variable. 4. The production system according to any one of claims 1, 2, and 3, wherein the fixed variable information is given according to an operator's designation. 5. The working memory stores an update history of attribute values corresponding to each attribute of the fact, and the fixed variable determining means refers to the attribute value update history held in the working memory and updates the attribute values after a predetermined period. The production system according to any one of claims 1, 2, 3, and 4, wherein attribute values that are not specified are determined to be fixed, and other attribute values are determined to be variable. 6. Any one of claims 1, 2, 3, 4, and 5, wherein the partial calculation mechanism writes the attribute value of the fact determined in the condition part or the conclusion part as a fixed value in the working memory. One production system. 7. Determine whether the attribute value of the fact is immutable or variable, and as a result of the determination, refer to the immutable attribute value of the fact and delete the part of the conditional part of the rule that is true; A high-speed inference method characterized in that the condition part of the rule is replaced with the part that remains as a result of deletion. 8. Referring to the update history information of the attribute values of the fact, if the variable attribute value of the fact has not been updated for a predetermined period, the variable attribute value is determined to be immutable. 7 fast inference methods.
JP15233189A 1989-06-16 1989-06-16 Production system and its inferring method Pending JPH0319030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15233189A JPH0319030A (en) 1989-06-16 1989-06-16 Production system and its inferring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15233189A JPH0319030A (en) 1989-06-16 1989-06-16 Production system and its inferring method

Publications (1)

Publication Number Publication Date
JPH0319030A true JPH0319030A (en) 1991-01-28

Family

ID=15538198

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15233189A Pending JPH0319030A (en) 1989-06-16 1989-06-16 Production system and its inferring method

Country Status (1)

Country Link
JP (1) JPH0319030A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006333126A (en) * 2005-05-26 2006-12-07 Funai Electric Co Ltd Television

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006333126A (en) * 2005-05-26 2006-12-07 Funai Electric Co Ltd Television

Similar Documents

Publication Publication Date Title
US7054860B2 (en) Method and system for retrieving a document and computer readable storage medium
US5790760A (en) Program generating apparatus and method thereof
CN112650766B (en) Database data operation method, system and server
JPH04342025A (en) Text managing and restoring system
US6778983B1 (en) Apparatus and method for accessing HTML files using an SQL query
JP3318051B2 (en) Translation processing method
JPH0319030A (en) Production system and its inferring method
CN115098365A (en) SQL code debugging method and device, electronic equipment and readable storage medium
JPH07146880A (en) Document retrieval device and method therefor
JP3328995B2 (en) Information retrieval system
US20220245112A1 (en) Hashing a data set with multiple hash engines
JP2722684B2 (en) File system search device
JPH0675958A (en) Document processor
de Armas et al. An External Memory Approach for Large Genome De Novo Assembly
JP2024503035A (en) lightweight extension
JPH04195559A (en) Subfile management system
JPS63204434A (en) Electronic document retrieving device
KR20140104882A (en) Method for processing query based on hadoop
JPH03189747A (en) Memory control processing system
JPH05127965A (en) Design information restoring method
JPS63285631A (en) Updating and processing system for index file
JPH03148751A (en) Document processor
JPH05216684A (en) Program execution device and execution method
JPH0261715A (en) Command interpreter with memory function
JP2002149702A (en) Method and device for retrieving tree-structure information