JPH05346855A - Inference device - Google Patents

Inference device

Info

Publication number
JPH05346855A
JPH05346855A JP4155202A JP15520292A JPH05346855A JP H05346855 A JPH05346855 A JP H05346855A JP 4155202 A JP4155202 A JP 4155202A JP 15520292 A JP15520292 A JP 15520292A JP H05346855 A JPH05346855 A JP H05346855A
Authority
JP
Japan
Prior art keywords
rule
data
pattern matching
matching
stored
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
JP4155202A
Other languages
Japanese (ja)
Inventor
Susumu Hamada
進 濱田
Shoichi Kojima
昌一 小島
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP4155202A priority Critical patent/JPH05346855A/en
Publication of JPH05346855A publication Critical patent/JPH05346855A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To shorten time for collating patterns by effectively using the result of pattern collation. CONSTITUTION:When a rule selecting means 13 selects a rule having high possibility to be started among respective rules stored in a knowledge base 12, a pattern collating means 14 performs pattern collation between the condition part of this selected rule and data. The collated result of this pattern collation is stored in memories 16 and 17. Based on data stored in these memories 16 and 17, a collating condition managing means 15 manages and corrects data to be changed by rule execution among data stored in the memories 16 and 17 after the operation part of the rule is executed, and information showing how much the pattern collation is progressed concerning respective rules is recorded and updated as the collating condition. Then, the cycle of recognition- execution is repeated until no rule in which the condition part of rule and data are matched is in existence.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、条件部及び操作部から
成るルールより推論を実行する推論装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an inference device which executes inference based on a rule consisting of a condition section and an operation section.

【0002】[0002]

【従来の技術】ルールに基づく推論は、人間の認知・解
釈・行動のサイクルに当てはめて図7に示すような認知
−実行サイクルによって表される。図8はかかる推論装
置の認知−実行サイクルを模式的に示している。すなわ
ち、推論装置にはワーキングメモリ1及び知識ベース2
が備えられている。このうち、ワーキングメモリ1には
例えばタンク内の温度、圧力などの各データx1 、x2
が記憶され、又知識ベース2には例えば「x1 >A→W
(温度x1 がA度以上であれば 給水W)」などの各ル
ールが記憶されている。この場合、x1 >Aが条件であ
り、Wが操作部である。
2. Description of the Related Art Rule-based reasoning is represented by a cognition-execution cycle as shown in FIG. 7, which is applied to a human cognition / interpretation / action cycle. FIG. 8 schematically shows a recognition-execution cycle of such an inference device. That is, the inference device has a working memory 1 and a knowledge base 2.
Is provided. Of these, the working memory 1 stores, for example, respective data x1 and x2 such as temperature and pressure in the tank.
Is stored in the knowledge base 2. For example, "x1> A → W" is stored in the knowledge base 2.
Each rule such as "(temperature x1 is A degree or more, water supply W)" is stored. In this case, x1> A is the condition, and W is the operation unit.

【0003】このような各データが記憶されている状態
の推論制御は、ワーキングメモリ1に記憶されている各
データx1 、x2 に対する各ルールとのパターン照合が
行われる。このパターン照合は各データx1 、x2 と各
ルールの条件部との間で行われ、この照合の結果、各ル
ール 「x1 >A→W」 「x2 =C→Y」
In the inference control in the state where each data is stored, pattern matching is performed with each rule for each data x1 and x2 stored in the working memory 1. This pattern matching is performed between each data x1, x2 and the condition part of each rule. As a result of this matching, each rule "x1> A → W""x2 = C → Y"

【0004】が選択される。ここで、選択されたルール
は2つあり、競合ルールの集合が形成される。次にこれ
らルールの競合が解消されるが、この競合解消は例えば
各ルールの優先度の高いルールが選択され、例えばルー
ル「x1 >A→W」が選択される。そして、このルール
の操作部Wが実行され、認知−実行サイクルの1サイク
ルが終了する。このルールの実行によりワーキングメモ
リ1に記憶されるデータに変化が生じるので、再び各デ
ータと各ルールとのパターン照合が行われ、実行可能な
ルールがなくなるまで認知−実行サイクルが繰り返され
る。
Is selected. Here, there are two selected rules, and a set of conflict rules is formed. Next, the conflict of these rules is resolved. For this conflict resolution, for example, a rule with a higher priority of each rule is selected, and for example, the rule "x1> A → W" is selected. Then, the operation unit W of this rule is executed, and one cycle of the recognition-execution cycle ends. Since the data stored in the working memory 1 changes due to the execution of this rule, the pattern matching between each data and each rule is performed again, and the recognition-execution cycle is repeated until there are no executable rules.

【0005】ところで、かかる推論を高速に行うアルゴ
リズムとしてRETEアルゴリズムがある。RETEア
ルゴリズムでは、一度行ったパターン照合の結果を保存
し、再度同一のパターン照合を行うことを避けることに
よって推論を高速に行うものである。つまり、実行する
1つのルールを選択するためのパターン照合時に、各ル
ールと全データとのパターン照合の結果を全て記憶し、
ワーキングメモリ1のデータに変化があれば、その変化
分についてのみ全てのパターンの再照合を行う。このパ
ターン照合の結果から得られる競合ルールの集合から、
例えば優先度に従って実行するルールを選択する。そし
て、このルールの操作部が実行され、ワーキングメモリ
1のデータに変化が生じると、パターン照合が行われ、
実行可能なルールがなくなるまで認知−実行サイクルが
繰り返される。
By the way, there is a RETE algorithm as an algorithm for performing such inference at high speed. The RETE algorithm saves the result of pattern matching performed once and avoids performing the same pattern matching again, thereby performing inference at high speed. In other words, at the time of pattern matching for selecting one rule to be executed, all the pattern matching results of each rule and all data are stored,
If the data in the working memory 1 has changed, all patterns are re-matched only for the changed amount. From the set of conflict rules obtained from the result of this pattern matching,
For example, a rule to be executed is selected according to the priority. When the operation section of this rule is executed and the data in the working memory 1 changes, pattern matching is performed,
The cognitive-execution cycle repeats until there are no viable rules.

【0006】従って、上記推論制御では1つのルールの
認知−実行サイクルを行なうたびにルールと変化した全
データとのパターン照合を行なって完全な競合ルールの
集合を形成している。このため、パターン照合に非常に
長い時間がかかる。
Therefore, in the above-described inference control, every time one rule recognition-execution cycle is performed, pattern matching is performed between the rule and all the changed data to form a complete set of conflict rules. Therefore, pattern matching takes a very long time.

【0007】又、全てのパターン照合の結果を記憶する
ため、ルール実行によってワーキングメモリ1のデータ
に変化が生じると、それまで行われたパターン照合の結
果が、そのルールが実行されないうちに削除されて無駄
となることがある。
Further, since all the pattern matching results are stored, when the data in the working memory 1 changes due to the rule execution, the pattern matching results performed up to that point are deleted before the rule is executed. Can be wasted.

【0008】[0008]

【発明が解決しようとする課題】以上のようにパターン
照合に非常に長い時間がかかり、又全てのパターン照合
の結果を記憶するため、パターン照合の結果が削除され
て無駄となることがある。そこで本発明は、パターン照
合の結果を有効に用いてパターン照合の時間を短縮しか
つメモリ容量を小さくできる推論装置を提供することを
目的とする。
As described above, pattern matching takes a very long time, and since all pattern matching results are stored, the pattern matching results may be deleted and wasted. Therefore, an object of the present invention is to provide an inference device that can effectively use the result of pattern matching to shorten the time of pattern matching and reduce the memory capacity.

【0009】[0009]

【課題を解決するための手段】本発明は、各ルールを記
憶する知識ベース及び各データを記憶するワーキングメ
モリを備え、ルールの条件部とデータとのパターン照合
を行った後にパターンの一致したルールの操作部を実行
する認知−実行サイクルをマッチするルールがなくなる
まで繰り返す推論装置において、
SUMMARY OF THE INVENTION The present invention comprises a knowledge base for storing each rule and a working memory for storing each data, and a rule having a matched pattern after pattern matching between the condition part of the rule and the data is performed. In an inference device that repeats the cognitive-execution cycle for executing the operation unit of

【0010】各ルールのうち起動される可能性の高いル
ールを選択するルール選択手段と、このルール選択手段
により選択されたルールの条件部とデータとのパターン
照合を行うパターン照合手段と、このパターン照合手段
による照合結果を記憶するメモリと、このメモリに記憶
されたデータに基づいてルールの操作部が実行された
後、各ルールの照合がどこまで進んだかを照合状況とし
て保存管理する照合状況管理手段とを備えて上記目的を
達成しようとする推論装置である。
A rule selecting means for selecting a rule that is likely to be activated among the respective rules, a pattern matching means for performing pattern matching between the condition part of the rule selected by this rule selecting means and the data, and this pattern. A memory for storing the result of matching by the matching means, and a matching status managing means for storing and managing as a matching status how far the matching of each rule has progressed after the rule operation section is executed based on the data stored in this memory. It is an inference device which is equipped with and tries to achieve the above object.

【0011】[0011]

【作用】このような手段を備えたことにより、知識ベー
スに記憶されている各ルールのうち起動される可能性の
高いルールがルール選択手段により選択されると、この
選択されたルールの条件部とデータとのパターン照合が
パターン照合手段により行われる。このパターン照合の
照合結果はメモリに記憶され、このメモリに記憶された
データに基づいてルールの操作部が実行された後、メモ
リに記憶されているデータのうち変化するデータが修正
され、又各ルールについてパターン照合がどこまで進ん
だかという照合状況が照合状況管理手段により修正管理
される。しかして、ルールの条件部とデータとがマッチ
するルールがなくなるまで認識−実行サイクルが繰り返
される。
With the provision of such means, when the rule selecting means selects one of the rules stored in the knowledge base that is likely to be activated, the condition part of this selected rule is selected. The pattern matching means performs pattern matching with the data. The matching result of this pattern matching is stored in the memory, and after the operation part of the rule is executed based on the data stored in this memory, the changing data among the data stored in the memory is corrected and The matching status managing means corrects and manages the matching status of how far the pattern matching for the rule has progressed. Then, the recognition-execution cycle is repeated until there is no rule in which the condition part of the rule and the data match.

【0012】[0012]

【実施例】以下、本発明の一実施例について図面を参照
して説明する。図1は推論装置の構成図である。推論エ
ンジン10にはワーキングメモリ11及び知識ベース1
2が接続されている。ワーキングメモリ11には各デー
タが記憶されるようになっている。このワーキングメモ
リ11に記憶される各データは (クラス アトリビュート … )
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of an inference device. The inference engine 10 has a working memory 11 and a knowledge base 1.
2 is connected. Each data is stored in the working memory 11. Each data stored in this working memory 11 is (class attribute ...)

【0013】により表される。ここで、クラスは人間や
犬などのデータの型を表し、アトリビュート(以下、at
r により表す)はクラスの属性値、例えば名前や年令、
身長を表している。以下、各データ[0]〜[5]につ
いて(クラス atr1、atr2)により表すと、 [0] (A 2) [1] (A −1 0) [2] (A 6) [3] (B 1 3) [4] (B 1 4) [5] (B 1 −1) となる。例えば、データ[0]はクラス「A」でatr1が
「2」を表し、データ[3]はクラス「B」でatr1が
「1」、atr2が「3」を表している。一方、知識ベース
12には次に示すような各ルールが記憶されている。
Is represented by Here, the class represents the type of data such as human or dog, and the attribute (hereinafter, at
(represented by r) is the attribute value of the class, such as name or age,
It represents your height. Hereinafter, when each data [0] to [5] is represented by (class atr1, atr2), [0] (A2) [1] (A-10) [2] (A6) [3] (B 1 3) [4] (B 1 4) [5] (B 1 -1). For example, data [0] represents class “A” and atr1 represents “2”, and data [3] represents class “B” in which atr1 represents “1” and atr2 represents “3”. On the other hand, the knowledge base 12 stores the following rules.

【0014】[0014]

【数1】 [Equation 1]

【0015】ここで、ルールは「→」までの前側が条件
部を表し、後側が操作部を表している。例えば、ルール
「1」の意味は、ワーキングメモリ11にクラスAでat
r が「0」以上のものが存在し、かつクラスBでatr1が
「1」、atr2がクラスAのatrの値xよりも大きいもの
が存在すれば、対象となったクラスAのワーキングメモ
リ11におけるクラスAのデータを削除する内容とな
る。
Here, in the rule, the front side up to "→" represents the condition section, and the rear side represents the operation section. For example, the meaning of the rule "1" is that the class A in the working memory 11 is at
If there is one with r equal to or greater than “0”, and if atr1 is “1” in class B and atr2 is larger than the value x of atr in class A, the working memory of the target class A 11 This is the content of deleting the data of class A in.

【0016】又、ルール名の後ろに記載されている数
値、例えばルール「1」では(50) は、そのルールの優
先度を示し、この値が大きい程優先度が高いことを示し
ている。
Further, in the numerical value described after the rule name, for example, "50" in the rule "1" indicates the priority of the rule, and the larger this value is, the higher the priority is.

【0017】推論エンジン10は、ルールの条件部とデ
ータとのパターン照合を行った後にパターンの一致した
ルールの操作部を実行する認知−実行サイクルをマッチ
するルールがなくなるまで繰り返す機能を有するもの
で、この機能の他に推論エンジン10はルール選択手段
13及び照合状況管理手段15の各機能を有している。
又、この推論エンジン10には、αメモリ16及びβメ
モリ17が接続されている。前記ルール選択手段13
は、知識ベース12に記憶されている各ルールのうち、
例えば優先度の高い順に従ってルールを選択する機能を
有するものである。
The inference engine 10 has a function of repeating the recognition-execution cycle of executing the operation part of the rule-matching pattern after performing pattern matching between the condition part of the rule and the data until there is no matching rule. In addition to this function, the inference engine 10 has the functions of the rule selection means 13 and the matching status management means 15.
Further, an α memory 16 and a β memory 17 are connected to the inference engine 10. The rule selection means 13
Of the rules stored in the knowledge base 12,
For example, it has a function of selecting rules according to the order of priority.

【0018】パターン照合手段14は、ルール選択手段
13により選択されたルールの条件部とデータとのパタ
ーン照合を行う機能を有するものである。そして、この
パターン照合手段14による照合途中に得られるルール
の条件部と一致したデータ及び照合の結果により得られ
るルールの条件部と一致したデータは、αメモリ16又
はβメモリ17に記憶されるようになっている。なお、
αメモリ16には単独のデータ記憶専用であり、βメモ
リ17は各データの組み合わせの記憶専用となってい
る。
The pattern matching means 14 has a function of performing pattern matching between the condition part of the rule selected by the rule selecting means 13 and the data. Then, the data matching the condition part of the rule obtained during the matching by the pattern matching means 14 and the data matching the condition part of the rule obtained as a result of the matching are stored in the α memory 16 or the β memory 17. It has become. In addition,
The α memory 16 is dedicated to storing individual data, and the β memory 17 is dedicated to storing each data combination.

【0019】又、照合状況管理手段15は、各ルールに
関するパターン照合がどこまで(どのデータについてど
の条件まで)行われたかというパターン照合の状況を記
録・更新し、実行の結果、データに加えられた操作に基
づき、照合結果及び照合状況を修正する機能を有してい
る。次に上記の如く構成された装置の推論制御について
説明する。
Further, the collation status management means 15 records and updates the pattern collation status indicating to what extent (for which data and under what condition) the pattern collation for each rule has been performed, and the result is added to the data. It has a function to correct the collation result and collation status based on the operation. Next, the inference control of the device configured as described above will be described.

【0020】この推論制御では上記各ルール「1」
「2」による推論を説明するが、これらルール「1」
「2」での推論制御は図2に示すRETEネットワーク
の展開図に従って実行される。
In this inference control, each rule above "1"
I will explain the reasoning by "2", but these rules "1"
The inference control at "2" is executed according to the development view of the RETE network shown in FIG.

【0021】ところで、同図において「○」はワーキン
グメモリ11に記憶された1つのデータのみに関連する
比較項目を示すイントラノードであり、例えば「クラス
がAか?」「atr の値は0以上か?」という比較が行わ
れる。「◎」は異なるデータ相互で満たさなければなら
ない比較項目を示すインタノードであり、例えば「クラ
スBのatr2の値はクラスAのatr の値xよりも大きいか
?」というような比較が行われる。又、「△」「▲」に
より示した各ノードはそれぞれαメモリ16及びβメモ
リ17への記憶を行うところであり、これらノードまで
のパス上に存在するイントラノードとインタノードにお
けるパターン照合で一致し、そのノードに到達したデー
タが記憶される。「□」により示したノードは、ネット
ワークの終端であり、各ルール「1」「2」に対応して
いる。なお、このノード「□」に到達したデータがあれ
ば、そのルール「1」又は「2」は実行可能となる。以
下、推論制御について図3に示す推論制御の流れ図に従
って説明する。
By the way, in the figure, “◯” is an intra node indicating a comparison item related to only one data stored in the working memory 11. For example, “Is the class A?” “The value of atr is 0 or more. "?" Is made. “⊚” is an internode indicating a comparison item that must be satisfied by different data. For example, a comparison is made such as “is the value of atr2 of class B greater than the value x of atr of class A?”. .. Further, each node indicated by “Δ” and “▲” is for storing in the α memory 16 and the β memory 17, respectively, and the intra-node and the inter-node existing on the path to these nodes are matched by the pattern matching. , The data arriving at that node is stored. The node indicated by “□” is the end of the network and corresponds to each rule “1” and “2”. If there is data that has reached this node "□", the rule "1" or "2" can be executed. The inference control will be described below with reference to the flow chart of the inference control shown in FIG.

【0022】ステップ#1においてルール選択手段13
はパータン照合したルールを除外するためにパターン照
合状況を参照するが、最初の認知−実行サイクルにおい
ては、まだパターン照合は行なわれていないので、次に
実行される可能性の高いルールとして、知識ベース12
に記憶されている各ルールから優先度の最も高い上記ル
ール1を選択する。
In step # 1, the rule selection means 13
Refers to the pattern matching status in order to exclude the pattern matching rule, but since the pattern matching has not yet been performed in the first recognition-execution cycle, the knowledge as a rule that is likely to be executed next is Base 12
The rule 1 having the highest priority is selected from the respective rules stored in.

【0023】次にステップ#2に移り、パターン照合手
段14は、先ずノードNAにおいて各データ[0]〜
[5]とクラスがAであるかどうかのパターン照合を行
いデータ[0]〜[2]を次のノードに流す。次にノー
ドN1においてルール「1」の条件部に記載されている
クラスAの条件と各データ[0]〜[2]とのパターン
照合を行う。このパターン照合の結果、「クラスがA
で、art の値が0以上か?」の条件を満たすデータは
[0][2]であり、満たさないデータは[1]であ
る。これによりパターン照合手段14は図4に示すよう
に各データ[0][2]をαメモリ16の領域M1に記
憶する。
Next, proceeding to step # 2, the pattern matching means 14 first sets each data [0] to
Pattern matching is performed to determine whether the class is A with [5], and the data [0] to [2] are sent to the next node. Next, in the node N1, pattern matching is performed between the condition of class A described in the condition part of the rule “1” and each data [0] to [2]. As a result of this pattern matching, "the class is A
So is the value of art 0 or more? The data satisfying the condition of “” is [0] [2], and the data not satisfying the condition is [1]. As a result, the pattern matching means 14 stores each data [0] [2] in the area M1 of the α memory 16 as shown in FIG.

【0024】次にパターン照合手段14は、ノードNB
において各データ[0]〜[5]とクラスがBであるか
どうかのパターン照合を行いデータ[3]〜[5]を次
のノードに流す。ノードN2においてルール「1」の条
件部に記載されているクラスBの条件と各データ[3]
〜[5]とのパターン照合を行う。このパターン照合の
結果、「クラスがBで、かつatr1が1」の条件を満たす
データは[3][4][5]であり、これによりパター
ン照合手段14は各データ[3][4][5]をαメモ
リ16の領域M2に記憶する。
Next, the pattern matching means 14 determines the node NB.
In, the data [0] to [5] is compared with the pattern whether the class is B or not, and the data [3] to [5] are sent to the next node. In node N2, the condition of class B described in the condition part of rule "1" and each data [3]
~ Pattern matching with [5] is performed. As a result of this pattern matching, the data satisfying the condition of "class is B and atr1 is 1" is [3] [4] [5], and accordingly, the pattern matching means 14 sets each data [3] [4]. [5] is stored in the area M2 of the α memory 16.

【0025】次にパターン照合手段14はαメモリ16
の各領域M1、M2に記憶された各データ[0][2]
及び[3][4][5]についてイントラノードN4で
の比較、つまり各条件「クラスがAで、art の値が0以
上か?」及び「クラスがBで、かつatr 1が1、atr 2
の値がクラスAのatr の値xよりも大きいか?」を共に
満たすデータの組み合わせを選択するパターン照合を実
行する。このパターン照合の結果、両条件を満たすデー
タは([0][4])の組み合わせ、([0][3])
の組み合わせの2組となる。従って、パターン照合手段
14はこれらデータの組み合わせを図5に示すように領
域M3に記憶する。
Next, the pattern matching means 14 uses the α memory 16
Data [0] [2] stored in the respective areas M1 and M2 of
And [3], [4], and [5] at the intranode N4, that is, each condition “class is A, is art value 0 or more?” And “class is B, and atr 1 is 1, atr. Two
The value of is greater than the value x of the atr of class A? Pattern matching is performed to select a combination of data that both satisfy ". As a result of this pattern matching, data satisfying both conditions are a combination of ([0] [4]) and ([0] [3]).
It becomes two sets of the combination of. Therefore, the pattern matching means 14 stores the combination of these data in the area M3 as shown in FIG.

【0026】この後、ステップ#3において推論エンジ
ン10はルール「1」を実行する。この場合、各データ
の組み合わせ([0][4])、([0][3])のう
ちどちらを先に実行してもよいので、例えば先に得られ
たデータ([0][4])についてのルール「1」を実
行する。
Thereafter, the inference engine 10 executes the rule "1" in step # 3. In this case, whichever of the data combinations ([0] [4]) and ([0] [3]) may be executed first, for example, the previously obtained data ([0] [4] ]) Is executed.

【0027】次にステップ#4に移り、推論エンジン1
0の照合状況管理手段15は、ルール1に関するパター
ン照合が終了したことを照合状況メモリに保存し、又ル
ール「1」に関するデータの流れにより各データ[3]
[4][5]がノードN2に流れたことを把握して照合
状況メモリに保存すると共にルール「2」に関するノー
ドN3以下の照合は済んでいない状況であることを把握
してその状況を照合状況メモリに保存する。又、実行の
結果データ[0]は消去されるので、M1及びM3中の
[0]を含む組み合わせデータを消去する。これによ
り、ルール「1」は、実行できる組み合わせがなくなる
ので、実行も終了したことが保存される。以上のように
してルール「1」に関する1サイクルが終了し、再びス
テップ#1に戻る。
Next, the process proceeds to step # 4, inference engine 1
The matching status management unit 15 of 0 stores the completion of the pattern matching for rule 1 in the matching status memory, and each data [3] according to the data flow for rule “1”.
[4] It is confirmed that [5] has flowed to the node N2 and is stored in the collation status memory, and at the same time, that the collation of the node N3 and below relating to the rule "2" is not completed and the situation is collated. Save to situation memory. Since the execution result data [0] is deleted, the combination data including [0] in M1 and M3 is deleted. As a result, there is no combination that can be executed for rule “1”, and the fact that execution has ended is saved. As described above, one cycle of the rule "1" is completed, and the process returns to step # 1.

【0028】次にルール選択手段13は、照合状況によ
りルール「1」は既に照合及び実行が終了したことが分
かるので、次に実行される可能性の高いルールとして、
知識ベース12に記憶されている各ルールから次に優先
度の高い上記ルール「2」を選択する。以下、上記ステ
ップ#1〜#4を実行し、マッチするルールがなくなる
まで認知−実行サイクルを繰り返す。
Next, the rule selecting means 13 knows that the matching and execution of the rule "1" have already been completed depending on the matching status, so that the rule which is likely to be executed next is
From the rules stored in the knowledge base 12, the rule "2" having the next highest priority is selected. Hereinafter, the above steps # 1 to # 4 are executed, and the recognition-execution cycle is repeated until there is no matching rule.

【0029】このように上記一実施例においては、知識
ベース12に記憶されている各ルールのうち優先度の高
いルールがルール選択手段13により選択され、このル
ールの条件部とデータとのパターン照合がパターン照合
手段14により行われ、この照合結果が各メモリ17、
18に記憶され、これらデータに基づいてルールの操作
部が実行された後、各メモリ17、18に記憶されてい
るデータのうち変化するデータが照合状況管理手段によ
り修正管理するようにしたので、パターン照合の対象と
する範囲が限定され、この範囲のみについてパターン照
合を行なうようになり、1つのルールを実行するまでに
必要とされるパターン処理の処理量を少なくできる。
又、途中まで行なわれたパターン照合の修正やワーキン
グメモリ11のデータ変化による無駄なパターン照合を
少なくできる。従って、実行時に必要なα及びβメモリ
17、18の容量は小さくできる。
As described above, in the above embodiment, the rule selecting means 13 selects a rule having a high priority among the rules stored in the knowledge base 12, and the pattern matching between the condition part of this rule and the data is performed. Is performed by the pattern matching means 14, and the result of this matching is stored in each memory 17,
Since the rule operation unit is executed based on these data stored in the memory 18, the changing data among the data stored in the memories 17 and 18 is corrected and managed by the collation status management means. The range to be subjected to the pattern matching is limited, and the pattern matching is performed only in this range, so that the processing amount of the pattern processing required to execute one rule can be reduced.
Further, it is possible to reduce unnecessary pattern matching due to correction of pattern matching performed halfway and change of data in the working memory 11. Therefore, the capacity of the α and β memories 17 and 18 required at the time of execution can be reduced.

【0030】なお、本発明は上記一実施例に限定される
ものでなくその要旨を変更しない範囲で変形してもよ
い。例えば、ルールの競合解消は優先度に限らず、最近
実行されたルールを優先的に選択する方法や前に実行さ
れたルールの条件部又は操作部に類似したルールを選択
する方法などにしてもよい。
The present invention is not limited to the above-mentioned one embodiment, and may be modified within the scope of the invention. For example, rule conflict resolution is not limited to priority, but a method of preferentially selecting a recently executed rule or a method of selecting a rule similar to the condition part or operation part of a previously executed rule may be used. Good.

【0031】又、ルール競合解消の方法に合わせてルー
ルの確信度や記述順を併用することも可能である。例え
ば、ルール競合解消の方法にワーキングメモリデータの
タイムタグや確信度が用いられる場合には、ワーキング
メモリデータの各クラスにおけるタイムタグを調べ、ル
ールの条件部に記載されているワーキングメモリデータ
に対して新しいものが多いルールからパターン照合を行
なうようにしてもよい。
It is also possible to use the certainty factor of rules and the order of description according to the method for resolving rule conflicts. For example, if the time tag or certainty factor of working memory data is used for the rule conflict resolution method, check the time tag in each class of working memory data, and check the working memory data described in the condition part of the rule. Then, pattern matching may be performed from a rule that has many new ones.

【0032】さらにデータについて競合解消の方法に基
づく選択や順序付けを行なってパターン照合範囲を限定
してもよい。例えば、最も新しいデータとマッチしたル
ールを優先するならば、データをタイムタグの順にソー
トして順番にパターン照合を行ない、実行可能なルール
が1つでも得られれば、その時点でパターン照合を止め
るようにしてもよい。
Further, the pattern matching range may be limited by selecting or ordering the data based on the conflict resolution method. For example, if the rule that matches the latest data is given priority, the data is sorted in order of time tags and pattern matching is performed in order. If even one executable rule is obtained, pattern matching is stopped at that point. You may do it.

【0033】[0033]

【発明の効果】以上詳記したように本発明によれば、パ
ターン照合の結果を有効に用いてパターン照合の時間を
短縮しかつメモリ容量を小さくできる推論装置を提供で
きる。
As described in detail above, according to the present invention, it is possible to provide an inference apparatus that can effectively use the result of pattern matching to shorten the time of pattern matching and reduce the memory capacity.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明に係わる推論装置の一実施例を示す構成
図。
FIG. 1 is a configuration diagram showing an embodiment of an inference device according to the present invention.

【図2】同装置で実行するルールのRETEネットワー
クの展開図。
FIG. 2 is a development view of a Rete network of rules executed by the device.

【図3】同装置における推論制御の流れ図。FIG. 3 is a flow chart of inference control in the device.

【図4】同装置におけるパターン照合処理を示す図。FIG. 4 is a diagram showing pattern matching processing in the apparatus.

【図5】同装置における1つのルールに対するパターン
照合処理を示す図。
FIG. 5 is a diagram showing a pattern matching process for one rule in the apparatus.

【図6】従来装置で実行する通常のRETEネットワー
クの展開図。
FIG. 6 is a development view of a normal RETE network executed by a conventional device.

【図7】推論制御の認知−実行サイクルを示す図。FIG. 7 is a diagram showing a recognition-execution cycle of inference control.

【図8】推論制御の模式図。FIG. 8 is a schematic diagram of inference control.

【符号の説明】[Explanation of symbols]

10…推論エンジン、11…ワーキングメモリ、12…
知識ベース、13…ルール選択手段、14…パターン照
合手段、15…照合状況管理手段、16…αメモリ、1
7…βメモリ。
10 ... inference engine, 11 ... working memory, 12 ...
Knowledge base, 13 ... Rule selection means, 14 ... Pattern matching means, 15 ... Matching status management means, 16 ... α memory, 1
7 ... β memory.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 各ルールを記憶する知識ベース及び各デ
ータを記憶するワーキングメモリを備え、前記ルールの
条件部とデータとのパターン照合を行った後にパターン
の一致したルールの操作部を実行する認知−実行サイク
ルをマッチするルールがなくなるまで繰り返す推論装置
において、 前記各ルールのうち起動される可能性の高いルールを選
択するルール選択手段と、このルール選択手段により選
択されたルールの条件部とデータとのパターン照合を行
うパターン照合手段と、このパターン照合手段による照
合結果を記憶するメモリと、このメモリに記憶されたデ
ータに基づいて前記ルールの操作部が実行された後、各
ルールの照合がどこまで進んだかを照合状況として保存
管理する照合状況管理手段とを具備したことを特徴とす
る推論装置。
1. A recognition system comprising a knowledge base for storing each rule and a working memory for storing each data, and performing a pattern matching between the condition part of the rule and the data, and then executing an operation part of the rule having a matched pattern. In an inference device that repeats execution cycles until there are no more matching rules, rule selection means for selecting a rule that is more likely to be activated among the above rules, and condition parts and data for the rules selected by this rule selection means Pattern matching means for performing pattern matching with the pattern matching means, a memory for storing the matching result by the pattern matching means, and the rule operation section based on the data stored in this memory Inference, characterized by having a collation status management means for storing and managing the progress as a collation status Location.
JP4155202A 1992-06-15 1992-06-15 Inference device Pending JPH05346855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4155202A JPH05346855A (en) 1992-06-15 1992-06-15 Inference device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4155202A JPH05346855A (en) 1992-06-15 1992-06-15 Inference device

Publications (1)

Publication Number Publication Date
JPH05346855A true JPH05346855A (en) 1993-12-27

Family

ID=15600735

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4155202A Pending JPH05346855A (en) 1992-06-15 1992-06-15 Inference device

Country Status (1)

Country Link
JP (1) JPH05346855A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856059B2 (en) 2011-11-01 2014-10-07 The Bank of Tokyo—Mitsubishi UFJ, Ltd. Inference device and inference method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856059B2 (en) 2011-11-01 2014-10-07 The Bank of Tokyo—Mitsubishi UFJ, Ltd. Inference device and inference method

Similar Documents

Publication Publication Date Title
JP4004619B2 (en) Inventory management device capable of automatic inventory allocation
TWI733390B (en) Method and device for simultaneously executing transactions in block chain, computer readable storage medium and computing equipment
JPH0652502B2 (en) Reasoning method
CN109885580A (en) A kind of hot spot account batch updating method, apparatus, server and storage medium
JPH0565892B2 (en)
WO2021036259A1 (en) Method and device for executing transactions in parallel in blockchain
JPH05346855A (en) Inference device
CN115269205B (en) Neural network computing-oriented memory optimization method and device
JP2507593B2 (en) Inference method
CN113434360A (en) Method and system for monitoring operation
CN110083603A (en) A kind of querying method and system for realizing node path based on adjacency list
CN112068948A (en) Data hashing method, readable storage medium and electronic device
KR940008092B1 (en) Inference system
JPH0398128A (en) Serial number control system
JP2001117774A (en) Production system with adaptation mechanism
JP3299164B2 (en) Computer system
CN115801773A (en) Method and device for electing distributed cluster
JPH0830457A (en) Inferring method of production system
CN116542413A (en) Task processing method, device, equipment and storage medium based on time coordinates
JPH11259302A (en) Forward rule type production system
CN117349369A (en) Data synchronization method and device for packet execution
JP3124389B2 (en) Hypothetical reasoning device
JPS63181037A (en) Inference system
JPH03147033A (en) Data base control system
JPH0495132A (en) Knowledge inference processing device