JPH04340626A - Processing method for succession hierarchical logic type language - Google Patents

Processing method for succession hierarchical logic type language

Info

Publication number
JPH04340626A
JPH04340626A JP11286391A JP11286391A JPH04340626A JP H04340626 A JPH04340626 A JP H04340626A JP 11286391 A JP11286391 A JP 11286391A JP 11286391 A JP11286391 A JP 11286391A JP H04340626 A JPH04340626 A JP H04340626A
Authority
JP
Japan
Prior art keywords
clause
cell
predicate
pointer
stack
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
JP11286391A
Other languages
Japanese (ja)
Inventor
Masato Shibazaki
柴崎 真人
Takuo Oguchi
琢夫 小口
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 JP11286391A priority Critical patent/JPH04340626A/en
Publication of JPH04340626A publication Critical patent/JPH04340626A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To increase the question processing speed by reducing the frequency in unification processing of the question processing especially with respect to a rule section where basic substitution satisfying all fundamental expressions of a body part is known in the processing method of the logical language openly dealing with a succession hierarchy. CONSTITUTION:A fact section is provided with a mask flag indicating whether it can be referred or not, and a program section subjected to basic substitution is stored as the fact section in the head part of the rule section where this basic substitution satisfying all fundamental expressions of the body part is known. At the time of processing a question goal section, mask flags are released and set to limit the selection of fact sections subjected to basic substitution as an input section.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は継承階層を陽に扱う論理
型言語の処理方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for processing logical languages that explicitly handles inheritance hierarchies.

【0002】0002

【従来の技術】Prologは論理型言語として広く使
用されているが、これは、個別の事物のみを記述の対象
としている。これに対し、個別の事物を意味的に含む一
般的な概念も記述の対象とすることにより、継承階層の
表現・検索を効率的に実現しようとするものに、PAL
(赤間 ”PAL:継承階層を扱う拡張Prolog”
 情報処理学会論文誌, Vol.28, pp322
−329, 1987参照)、LOGIN(Ait−K
aci &Nasr ”LOGIN:A Logic 
Programming Language with
 Built−In Inheritance” Jo
urnal of Logic Programmin
g, Vol.3, pp185−215, 1986
参照)、EPOS(Huber.M & Varsek
.I”Extended Prolog for Or
der−SortedResolution” ’87
 International Symposium 
on Logic Programming pp34
−43参照)などがある。こういった継承階層を陽に扱
う論理型言語を以後は、「継承階層論理型言語」と呼ぶ
ことにする。これの記述形式は言語毎に異なるが、以下
では、分かりやすさのため、日本語によるProlog
風の記述形式を用いることとする。
2. Description of the Related Art Prolog is widely used as a logic language, but it only describes individual things. On the other hand, PAL is used to express and search inheritance hierarchies efficiently by including general concepts that semantically include individual things.
(Akama “PAL: Extended Prolog that handles inheritance hierarchies”
Information Processing Society of Japan Journal, Vol. 28, pp322
-329, 1987), LOGIN (Ait-K
aci & Nasr ”LOGIN:A Logic
Programming Language with
“Built-In Inheritance” Jo
Urnal of Logic Programmin
g, Vol. 3, pp185-215, 1986
), EPOS (Huber.M & Varsek
.. I”Extended Prolog for Or
der-SortedResolution” '87
International Symposium
on Logic Programming pp34
-43). Logic languages that explicitly handle inheritance hierarchies like this will be referred to as ``inheritance hierarchy logic languages.'' The description format for this differs depending on the language, but below, for ease of understanding, Prolog in Japanese is used.
We will use the wind description format.

【0003】継承階層論理型言語の扱う知識は、継承階
層とファクト節とルール節とゴール節からなる。ファク
ト節とルール節を合わせてプログラム節という。以下に
例を示す。
[0003] The knowledge handled by the inheritance hierarchy logic language consists of an inheritance hierarchy, fact clauses, rule clauses, and goal clauses. The fact clause and the rule clause are collectively called the program clause. An example is shown below.

【0004】例1)■Johnは人に属する。Example 1) ■John belongs to people.

【0005】■Bobは人に属する。■Bob belongs to humans.

【0006】■Maryは人に属する。■Mary belongs to people.

【0007】■cs1は職場に属する。■cs1 belongs to the workplace.

【0008】■Johnはcs1で働く。■John works at cs1.

【0009】■cs1の管理者はBobである。■The administrator of cs1 is Bob.

【0010】■人の働く職場の管理者がXなら、Xはそ
の人の上司である。
■If the manager of a person's workplace is X, then X is the person's boss.

【0011】■BobはMaryの管理者である。■Bob is Mary's administrator.

【0012】■cs1で働く者とその上司は?例えば、
例1を継承階層論理型言語で表現するなら、■・■・■
・■・■・■・■・■・■はそれぞれ、S1・S2・S
3・S4・S5・S6・S7・S8・Q1のように表さ
れる。S1・S2・S3・S4は継承階層。S5・S6
・S8はファクト節、S7はルール節、Q1はゴール節
である。各節の ”←” の左辺部をヘッド部、右辺部
をボディ部と呼ぶ。
■Who works at cs1 and who is their boss? for example,
If we express example 1 in inheritance hierarchy logic language, ■・■・■
・■・■・■・■・■・■ are respectively S1, S2, S
It is expressed as 3.S4.S5.S6.S7.S8.Q1. S1, S2, S3, and S4 are inheritance hierarchies. S5・S6
- S8 is a fact clause, S7 is a rule clause, and Q1 is a goal clause. The left side of each node is called the head, and the right side is called the body.

【0013】     John<人               
                         
            (S1)    Bob<人
                         
                         
   (S2)    Mary<人        
                         
                   (S3)  
  cs1<職場                 
                         
         (S4)    働く(John,
 cs1)←                   
                        (
S5)    管理者(cs1, Bob)←    
                         
             (S6)    上司(人
:X,人:Y)← 働く(人:Y,職場:Z),   
                     管理者(
職場:Z,人:X)                
   (S7)    上司(Bob, Mary)←
                         
                  (S8)   
 ← 働く(人:V,cs1), 上司(人:W,人:
V)                       
(Q1)ここで、”John”・”Bob”・”Mar
y”・”cs1”は定数、”人”・”職場”は領域、”
働く”・”管理者”・”上司”は述語である。dを領域
、xを変数とするとき、”d:x”は変数xがdに属す
る定数のみを値としてとることを示す。”d:x”と定
数を項とよぶ。Pを述語、t1,…,tnを項とすると
き、P(t1,…,tn)を基本式とよぶ。”働く(J
ohn, cs1)”・”管理者(cs1, Bob)
”・”上司(人:X,人:Y)”などは基本式である。 また、”<”の関係は推移的であり、かつ非対称的であ
るとする。すなわち、a1<a2かつa2<a3ならば
、a1<a3であり、かつ、a1<a2とa2<a1が
同時に成り立つことはない。
John<person

(S1) Bob<person

(S2) Mary<person

(S3)
cs1<workplace

(S4) Work (John,
cs1)←
(
S5) Administrator (cs1, Bob)←

(S6) Boss (person: X, person: Y) ← Work (person: Y, workplace: Z),
Administrator (
Workplace: Z, Person: X)
(S7) Boss (Bob, Mary)←

(S8)
← Working (person: V, cs1), boss (person: W, person:
V)
(Q1) Here, “John”, “Bob”, “Mar”
y" and "cs1" are constants, "person" and "workplace" are areas,"
"Worker", "Administrator", and "Boss" are predicates. When d is an area and x is a variable, "d:x" indicates that the variable x takes only constants belonging to d as values. d:
ohn, cs1)”・”Administrator (cs1, Bob)
"・"Boss (Person: If a3, then a1<a3, and a1<a2 and a2<a1 do not hold at the same time.

【0014】質問処理手順を、S1〜S8を知識として
、Q1を質問としたときの具体例により説明する。
The question processing procedure will be explained using a specific example in which S1 to S8 are knowledge and Q1 is a question.

【0015】1)Q1のボディ部の一番左にある基本式
 ”働く(人:V,cs1)”を選ぶ。これを「選択式
」とよぶ。 知識の中からこれと同じ述語をもつ節をひとつ選ぶ。こ
れを「入力節」とよぶ。ここではS5の ”働く(Jo
hn, cs1)←” を入力節とする。選択式の ”
人:V” を ”John” に置き換えることによっ
て選択式と入力節とは同一となる。このことを「代入{
人:V/John}により選択式と入力節との単一化処
理に成功する」という。すべての変数を定数によって置
き換える代入を基礎代入という。
1) Select the basic formula "Work (person: V, cs1)" on the leftmost side of the body part of Q1. This is called a "selective method." Choose one clause from your knowledge that has the same predicate. This is called an "input clause." Here, S5's "Jo"
hn, cs1)←” is the input clause.
By replacing ``person: V'' with ``John'', the selection formula and the input clause become the same.This can be expressed as ``assignment {
``Human: V/John'' successfully unifies the selection formula and the input clause.'' An assignment that replaces all variables with constants is called a basic assignment.

【0016】項t2を項t1に置き換えてよいのは次の
いずれかである。ただし、c1は定数、d1・d2は領
域、x1・x2は変数である。
The term t2 may be replaced by the term t1 in either of the following cases. However, c1 is a constant, d1 and d2 are areas, and x1 and x2 are variables.

【0017】・t2がd2:x2、項t1がc1の形を
しているときは、c1<d2の場合。
- When t2 has the form d2:x2 and the term t1 has the form c1, c1<d2.

【0018】・t2がd2:x2、項t1がd1:x1
の形をしているときは、d1<d2の場合。
・t2 is d2:x2, term t1 is d1:x1
When the shape is d1<d2.

【0019】単一化処理に成功すれば、ゴール節から選
択式を除き、入力節にボディ部があればそれをゴール節
に加えたものに、前の代入を施し、これを新たなゴール
節とする。この処理を「導出」とよぶ。ここでは導出に
より、     ← 上司(人:W,John)       
                         
        (Q2)が新たなゴール節となる。
If the unification process is successful, the selection formula is removed from the goal clause, the body part of the input clause is added to the goal clause, the previous assignment is performed, and this is created as a new goal clause. shall be. This process is called "derivation." Here, by derivation, ← Boss (person: W, John)

(Q2) will be the new goal section.

【0020】2)”上司(人:W,John)”を選択
式とし、S7の 上司(人:X,人:Y)← 働く(人:Y,職場:Z)
, 管理者(職場:Z,人:X)を入力節とする。代入
{人:X/人:W,人:Y/John}により単一化処
理に成功する。新たなゴール節は     ← 働く(John,職場:Z), 管理者(
職場:Z,人:W)               (
Q3)となる。
2) "Boss (Person: W, John)" is a multiple choice, S7's boss (Person: X, Person: Y) ← Work (Person: Y, Workplace: Z)
, Manager (workplace: Z, person: X) is the input clause. The unification process is successful by assignment {person:X/person:W, person:Y/John}. The new goal clause is ← Work (John, workplace: Z), Manager (
Workplace: Z, Person: W) (
Q3).

【0021】3)”働く(John,職場:Z)”を選
択式とし、S5の  ”働く(John, cs1)←
”  を入力節とする。代入{職場:Z/cs1}によ
り単一化処理に成功する。新たなゴール節は     ← 管理者(cs1,人:W)       
                         
       (Q4)となる。
3) Make “Work (John, Workplace: Z)” a multiple-choice option, and select “Work (John, cs1)” in S5 ←
” is the input clause. The unification process is successful by assignment {workplace: Z/cs1}. The new goal clause is ← Administrator (cs1, person: W)

(Q4).

【0022】4)”管理者(cs1,人:W)”を選択
式とし、S5の  ”管理者(cs1, Bob)←”
  を入力節とする。代入{人:W/Bob}により単
一化処理に成功する。このとき、ゴール節の中身はなく
なるが、このことを「空節が導出される」という。空節
が導出されたならば、今までの代入{人:V/John
}・{人:X/人:W,人:Y/John}・{職場:
Z/cs1}・{人:W/Bob}を合成した代入{人
:V/John,人:X/Bob,人:Y/John,
職場:Z/cs1,人:W/Bob}のうち、Q1内の
変数に関する{人:V/John,人:W/Bob}を
求める。この代入を「正解代入」という。
4) Make "Administrator (cs1, Person: W)" a selection formula, and select "Administrator (cs1, Bob) ←" in S5.
Let be the input clause. The unification process is successful by assignment {person: W/Bob}. At this time, the content of the goal clause disappears, and this is called ``an empty clause is derived.'' Once the empty clause is derived, the previous assignment {person: V/John
}・{Person: X/Person: W, Person: Y/John}・{Workplace:
Z/cs1}・{Person: W/Bob} Assignment {Person: V/John, Person: X/Bob, Person: Y/John,
Workplace: Z/cs1, person: W/Bob}, find {person: V/John, person: W/Bob} regarding the variables in Q1. This assignment is called "correct assignment."

【0023】5)”管理者(cs1,人:W)”を選択
式とし、S5以外の入力節を捜す。これが存在すれば、
選択式と入力節との単一化を試みる。ここでは存在しな
いので、手順3)の状態に戻る。これを「バックトラッ
ク」という。
5) Use "Administrator (cs1, Person: W)" as a selection formula, and search for input clauses other than S5. If this exists,
Attempts to unify the selection formula and the input clause. Since it does not exist here, the process returns to step 3). This is called "backtracking."

【0024】6)”働く(John,職場:Z)”を選
択式とし、S4以外の入力節を捜す。存在しないので、
手順2)の状態にバックトラックする。
6) Use "Work (John, Workplace: Z)" as a selection formula and search for input clauses other than S4. Since it doesn't exist,
Backtrack to the state in step 2).

【0025】7)”上司(人:W,John)”を選択
式とし、S6以外の入力節を捜す。S8の ”上司(B
ob, Mary)←” がえられるが、単一化処理に
失敗する。
7) Use "boss (person: W, John)" as a selection formula and search for input clauses other than S6. S8's "Boss (B)
ob, Mary)←” is obtained, but the unification process fails.

【0026】8)”上司(人:W,John)”を選択
式とし、S6とS8以外の入力節を捜す。存在しないの
で、手順1)の状態にバックトラックする。
8) Use "boss (person: W, John)" as a selection formula and search for input clauses other than S6 and S8. Since it does not exist, backtrack to the state in step 1).

【0027】9)”働く(人:V,cs1)”を選択式
とし、S5以外の入力節を捜す。存在せず、かつ、もど
る手順も残っていないので、質問処理は終了する。
9) Use "Work (person: V, cs1)" as a selection formula and search for input clauses other than S5. Since it does not exist and there are no steps left to go back, the question processing ends.

【0028】[0028]

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

(∀X/d B(X)→A(X))∧(∃X/d B(
X))というタイプの多ソート論理式を考える。これは
、領域dに属する全ての変数Xに対して、B(X)→A
(X)が成り立ち、領域dに属するある変数Xに対して
、B(X)が成り立つことを意味する。(例えば、「t
大学が購入したコンピュータはすべてa社が製造した」
という連体修飾を含む命題は多ソート論理式では(∀X
/コンピュータ 購入した(t大学,X)→製造した(
a社,X))∧(∃X/コンピュータ 購入した(t大
学,X))のように、このタイプの論理式として表すこ
とができる)これを継承階層論理型言語で表現すると、     A(d:X)←B(d:X)        
                         
       (S9)    B(c1)     
                         
                     (S10
)となる。B(c1)は、∃X/d B(X)をスコー
レム化したものであり、c1は領域dに属する定数であ
る。これに対し、d<d’であるとき、     ←A(d’:Y)             
                         
          (Q5)という質問処理を実行す
ると、まず、代入{d’:Y/d:X}により、Q5は
S9との単一化処理に成功し、”←B(d:X)” が
新たなゴール節として得られ、次に、代入{d:X/c
1}により、これはS10との単一化に成功し、空節が
導出される。以上、2回の単一化により、正解代入{d
’:Y/cs1}を得ることができる。
(∀X/d B(X)→A(X))∧(∃X/d B(
Consider a multi-sort logical expression of type X)). This means that for all variables X belonging to area d, B(X) → A
(X) holds true, which means that B(X) holds true for a certain variable X belonging to area d. (For example, "t
All computers purchased by the university were manufactured by Company A.
In the multi-sort logical formula, the proposition containing the adjunct modification is (∀X
/ Computer Purchased (T University, X) → Manufactured (
Company a, X)) ∧(∃X/computer purchased (University t, :X)←B(d:X)

(S9) B(c1)

(S10
). B(c1) is a Skolem version of ∃X/d B(X), and c1 is a constant belonging to region d. On the other hand, when d<d', ←A(d':Y)

When the query process (Q5) is executed, Q5 succeeds in unification with S9 by assignment {d':Y/d:X}, and "←B(d:X)" becomes a new obtained as the goal clause, then the assignment {d:X/c
1}, it is successfully unified with S10 and the empty clause is derived. As above, by unifying twice, the correct answer {d
':Y/cs1} can be obtained.

【0029】 B(X)=B1(X)∧…∧Bn(X)のときは、知識
は、    A(d:X)←B1(d:X),…,Bn
(d:X)                    
   (S11)となり、Q5を質問としたとき、n+
1回の単一化処理で、正解代入が得られる。本発明では
、上の両方の場合に対し、1回または2回の単一化処理
で、正解代入が得られる処理方式を提供する。
When B(X)=B1(X)∧...∧Bn(X), the knowledge is A(d:X)←B1(d:X),...,Bn
(d:X)
(S11), and when Q5 is a question, n+
A correct assignment can be obtained with one unification process. The present invention provides a processing method that allows correct assignments to be obtained by performing unification processing once or twice for both of the above cases.

【0030】[0030]

【課題を解決するための手段】S9・S10は、S11
・S12を、n=1としたものであるので、以下では、
S11・S12のみを考える。
[Means for solving the problem] S9 and S10 are S11
・Since S12 is set to n=1, below,
Consider only S11 and S12.

【0031】S11・S12がひとまとまりの知識とし
て与えられているものとする。ここでは、ヘッド部とボ
ディ部が ”←^” という記号でつながれた新たな記
述形式を仮定し、これを連体修飾節とよぶことにする。 連体修飾節もプログラム節の一つである。S11・S1
2は、連体修飾節として、     A(X)←^ B1(X),…,Bn(X) 
                         
    (S13)と表されているものとする。まず、
S13を内部的に、S11・S12・S14のように展
開する。
It is assumed that S11 and S12 are given as a set of knowledge. Here, we will assume a new descriptive format in which the head and body parts are connected by the symbol "←^" and call this an adjunctive modifier clause. An adjunctive modification clause is also a program clause. S11・S1
2 is an adnominal modification clause, A(X)←^ B1(X),...,Bn(X)

(S13). first,
S13 is expanded internally as S11, S12, and S14.

【0032】     A(c1)                
                         
          (S14)この際、S11のA(
d:X)のデータエリア内にA(c1)へのポインタを
保持し、B1(X)〜Bn(X)のそれぞれのデータエ
リア内に、B1(c1)〜Bn(c1)へのポインタを
保持する。そして、質問処理の過程において、S11が
入力節として選ばれて単一化処理に成功したならば、S
12・S14が入力節として選ばれることがないように
マスクをかける。入力節としてのS11の処理が終われ
ばマスクをはずす。
A(c1)

(S14) At this time, A(
A pointer to A(c1) is held in the data area of d:X), and pointers to B1(c1) to Bn(c1) are held in the data areas of B1(X) to Bn(X). Hold. In the process of query processing, if S11 is selected as the input clause and the unification process is successful, then S
12. Mask S14 so that it is not selected as an input clause. When the processing of S11 as an input node is completed, the mask is removed.

【0033】ルール節およびファクト節を有するプログ
ラム節を処理対象とする継承階層論理型言語処理系にお
いて、ルール節のボディ部の基本式を満足する基礎代入
が知られているルール節に対して、そのルール節のヘッ
ド部およびボディ部の各基本式にその基礎代入を行った
ファクト節とその参照可否情報とをメモリに格納し、ゴ
ール節の処理中、入力節として選択されたルール節の処
理開始時に当該ルールのヘッド部およびボディ部の各基
本式の基礎代入例であるファクト節の参照可否情報を参
照不可に設定し、当該ルール節の処理終了時に、参照可
否情報を参照可に再設定し、参照可否情報が参照不可と
設定されているファクト節は入力節として選択しないこ
とを特徴とする。
In an inheritance hierarchical logical language processing system that processes program clauses having rule clauses and fact clauses, for a rule clause for which a basic assignment that satisfies the basic expression in the body of the rule clause is known, The fact clause whose basic substitution is made to each basic expression in the head part and body part of the rule clause and its referenceability information are stored in memory, and the rule clause selected as the input clause is processed while the goal clause is being processed. At the start, the referenceability information of the fact clause, which is a basic assignment example of each basic expression in the head and body parts of the rule, is set to non-referenceable, and at the end of processing of the rule clause, the referenceability information is reset to referenceable. However, a fact clause whose referenceability information is set to not be referenced is not selected as an input clause.

【0034】[0034]

【作用】本発明では質問処理を実行したとき、選択式が
Q5であれば、S14またはS11が入力節として選ば
れる可能性がある。S14が入力節として選ばれたなら
ば、代入{d’:Y/c1}により、1回の単一化処理
で正解代入を得ることができる。また、S11が入力節
として選ばれたならば、代入{d’:Y/d:X}によ
り、Q5とS11との単一化処理に成功するが、S12
にはマスクがかけられているので、これらが入力節とし
て選ばれることはない。すなわち、本発明では1回また
は2回の単一化処理で正解代入を得ることができる。
[Operation] In the present invention, when the question processing is executed, if the selection formula is Q5, there is a possibility that S14 or S11 will be selected as the input clause. If S14 is selected as the input clause, the correct assignment can be obtained by one unification process by assignment {d':Y/c1}. Moreover, if S11 is selected as the input clause, the unification process of Q5 and S11 will succeed by assignment {d':Y/d:X}, but S12
are masked, so they are never selected as input clauses. That is, in the present invention, a correct assignment can be obtained by performing the unification process once or twice.

【0035】[0035]

【実施例】以下、本発明の一実施例を、図面により詳細
に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail below with reference to the drawings.

【0036】図1は、本発明の実施例においてプログラ
ム節を格納するデータ構造を表す図、図2は、質問ゴー
ル節処理で使用するスタックのデータ構造を表す図、図
3は、質問ゴール節処理を表すフローチャート、図4は
、質問ゴール節処理における入力節選択処理の詳細を表
すフローチャート、図5から図7は、質問ゴール節処理
の過程におけるスタックの状態を表す図、図8は、プロ
グラム節入力時に使用する変数名テーブルのデータ構造
を表す図、図9は、入力プログラム節の格納処理を表す
フローチャート、図10は、入力プログラム節の格納処
理における連体修飾節格納処理の詳細を表すフローチャ
ート、図11は、連体修飾節格納処理における具象化フ
ァクト節格納処理の詳細を表すフローチャート、図12
は、本発明の方法を実施するための装置構成例を表す図
である。
FIG. 1 is a diagram showing a data structure for storing program clauses in an embodiment of the present invention, FIG. 2 is a diagram showing a data structure of a stack used in question goal clause processing, and FIG. FIG. 4 is a flowchart showing the details of the input clause selection process in question goal clause processing; FIGS. 5 to 7 are diagrams showing the state of the stack in the process of question goal clause processing; FIG. A diagram showing the data structure of a variable name table used when inputting a clause. FIG. 9 is a flowchart showing the input program clause storage process. FIG. 10 is a flowchart showing details of the adjunct modification clause storage process in the input program clause storage process. , FIG. 11 is a flowchart showing the details of the reified fact clause storage process in the adjunct modification clause storage process, and FIG.
1 is a diagram illustrating an example of an apparatus configuration for implementing the method of the present invention.

【0037】図1により、プログラム節の格納形式を説
明する。
The storage format of program clauses will be explained with reference to FIG.

【0038】本実施例では、プログラム節を、述語名と
プログラム節の格納位置の対応を表すインデクスセル格
納エリア101と、プログラム節のヘッド部を格納する
述語セル格納エリア102と、プログラム節のボディ部
を格納するボディ部述語セル格納エリア103に分けて
格納する。
In this embodiment, a program clause is divided into an index cell storage area 101 representing the correspondence between the predicate name and the storage position of the program clause, a predicate cell storage area 102 that stores the head part of the program clause, and the body of the program clause. The body part predicate cell storage area 103 stores the body part predicate part.

【0039】インデクスセル格納エリア101は、述語
名フィールド105と述語セルポインタ106を組とし
たインデクスセル104を格納するエリアである。述語
名フィールド105には、プログラム節の述語名を格納
する。述語セルポインタ106には、述語名フィールド
105に格納された述語名を持つプログラム節のヘッド
部が格納されている単一あるいは複数の述語セル107
の先頭アドレスを格納する。
The index cell storage area 101 is an area for storing an index cell 104 consisting of a predicate name field 105 and a predicate cell pointer 106. The predicate name field 105 stores the predicate name of the program clause. The predicate cell pointer 106 stores a single or multiple predicate cells 107 in which the head of a program clause having the predicate name stored in the predicate name field 105 is stored.
Stores the start address of.

【0040】述語セル格納エリア102は、マスクフラ
グ108、ヘッド部節フィールド109、マスク述語セ
ルポインタ110、および、ボディ部ポインタ111を
組とした述語セル107を格納するエリアである。マス
クフラグ108は質問ゴール節処理における入力節選択
処理で選択の可否を表す情報である。以下では、マスク
フラグ108の値が1であるとき選択不可であるとし、
値が0であるとき選択可とする。また、マスクフラグ1
08の値を1とすることを「マスクフラグを設定する」
といい、値を0とすることを「マスクフラグを解除する
」という。ヘッド部節フィールド109には、ファクト
節、ルール節のヘッド部および連体修飾節のヘッド部を
格納する。マスク述語セルポインタ110には、当該述
語セルのヘッド部節フィールドに格納されている節が連
体修飾節のヘッド部であるとき、格納時にその連体修飾
節のヘッド部の変数を定数化して生成した具象化ファク
ト節を格納した述語セルのアドレスを格納する。当該述
語セルのヘッド部節フィールドに格納されている節がフ
ァクト節あるいは、ルール節のヘッド部であるときには
、マスク述語セルポインタはNULL(無効ポインタを
表す)である。ボディ部ポインタ111は、当該述語セ
ルのヘッド部節フィールドに格納されている節がルール
節のヘッド部あるいは連体修飾節のヘッド部であるとき
、ボディ部の先頭の節を格納したボディ部述語セル11
2のアドレスを格納する。
The predicate cell storage area 102 is an area for storing a predicate cell 107 that is a set of a mask flag 108, a head clause field 109, a mask predicate cell pointer 110, and a body pointer 111. The mask flag 108 is information indicating whether selection is possible in the input clause selection process in the question goal clause process. In the following, it is assumed that selection is not possible when the value of the mask flag 108 is 1,
It is selectable when the value is 0. Also, mask flag 1
Setting the value of 08 to 1 is "setting a mask flag"
Setting the value to 0 is called "releasing the mask flag." The head section field 109 stores the head sections of fact clauses, rule clauses, and adjunct modifier clauses. When the clause stored in the head clause field of the predicate cell is the head part of an adnominal modifier clause, the mask predicate cell pointer 110 contains a value that is generated by constantizing the variable of the head part of the adnominal modifier clause at the time of storage. Stores the address of the predicate cell that stores the reified fact clause. When the clause stored in the head clause field of the predicate cell is the head part of a fact clause or a rule clause, the mask predicate cell pointer is NULL (representing an invalid pointer). When the clause stored in the head clause field of the predicate cell is the head part of a rule clause or the head part of an adjunct modification clause, the body part pointer 111 points to the body part predicate cell that stores the first clause of the body part. 11
Stores the address of 2.

【0041】ボディ部述語セル格納エリア103は、ボ
ディ部節フィールド113、マスク述語セルポインタ1
14、および、ボディ部次節ポインタ115を組とした
ボディ部述語セル112を格納するエリアである。ボデ
ィ部節フィールド113は、ルール節および連体修飾節
のボディ部を構成する各節を一つずつ格納する。マスク
述語セルポインタ114は、当該ボディ部述語セル11
2に格納された節が連体修飾節のボディ部の節の一つで
あるとき、格納時にそのボディ部の節の変数を定数化し
て生成した具象化ファクト節を格納した述語セル107
のアドレスを格納する。ボディ部次節ポインタ115は
、ボディ部を構成する次の節を格納したボディ部述語セ
ル112のアドレスを格納する。
The body part predicate cell storage area 103 includes a body part clause field 113 and a mask predicate cell pointer 1.
14 and a body part next clause pointer 115. The body part clause field 113 stores each clause constituting the body part of a rule clause and an adjunct modification clause, one by one. The mask predicate cell pointer 114 points to the body part predicate cell 11
When the clause stored in 2 is one of the clauses in the body part of an adjunctive modification clause, the predicate cell 107 stores the reified fact clause generated by constantizing the variable of the clause in the body part at the time of storage.
Stores the address of. The body part next clause pointer 115 stores the address of the body part predicate cell 112 that stores the next clause making up the body part.

【0042】次に、質問ゴール節処理方法について説明
することとし、プログラム節の格納処理方法については
後述する。
Next, a question goal clause processing method will be explained, and a program clause storage processing method will be described later.

【0043】図2は質問ゴール節処理で使用するスタッ
クのデータ構造を表す図である。スタック201は、ゴ
ール節フィールド203、代入フィールド204および
述語セルポインタ205からなるスタックセル202を
格納するエリアである。以下では、各スタックセルを先
頭から順に第0スタックセル、第1スタックセル、第2
スタックセル、...、第nスタックセルと呼ぶ。20
6はスタックの現在位置をさすスタックポインタである
。以下では、スタックポインタ206が指しているスタ
ックセル202を現スタックセルと呼ぶ。ゴール節フィ
ールド203には質問処理の対象となっているゴール節
を格納する。代入フィールドには、ゴール節フィールド
内の先頭の節(選択節)と格納されているプログラム節
から選択された入力節とをユニファイするための代入を
格納する。述語セルポインタ205には入力節のヘッド
部を格納した述語セル107のアドレスを格納する。
FIG. 2 is a diagram showing the data structure of the stack used in question goal clause processing. The stack 201 is an area for storing a stack cell 202 consisting of a goal clause field 203, an assignment field 204, and a predicate cell pointer 205. Below, each stack cell is listed in order from the beginning as the 0th stack cell, the 1st stack cell, and the 2nd stack cell.
Stack cell. .. .. , is called the n-th stack cell. 20
6 is a stack pointer pointing to the current position of the stack. In the following, the stack cell 202 pointed to by the stack pointer 206 will be referred to as the current stack cell. The goal clause field 203 stores the goal clause that is the target of question processing. The substitution field stores an assignment for unifying the first clause (selected clause) in the goal clause field and the input clause selected from the stored program clauses. The predicate cell pointer 205 stores the address of the predicate cell 107 that stores the head portion of the input clause.

【0044】図3のフローチャートにより、質問ゴール
節処理を詳細に説明する。
The question goal clause processing will be explained in detail with reference to the flowchart of FIG.

【0045】まず、ステップ301でスタックを初期化
する。すなわち、スタックポインタ206にスタックの
底となる第0スタックセルのアドレスを格納する。
First, in step 301, the stack is initialized. That is, the address of the 0th stack cell, which is the bottom of the stack, is stored in the stack pointer 206.

【0046】次に、ステップ302では、質問ゴール節
を入力し、スタックポインタ206を一つ進め、現スタ
ックセル202のゴール節フィールド203に入力され
た質問ゴールを格納する。このとき、代入フィールド2
04を空とし、述語セルポインタ205をNULLとす
る。次にステップ303に進む。  ステップ303で
は、現スタックセルのゴール節フィールドに格納されて
いるゴール節の先頭の節を選択式とする。次にステップ
304に進む。
Next, in step 302, a question goal clause is input, the stack pointer 206 is advanced by one, and the input question goal is stored in the goal clause field 203 of the current stack cell 202. At this time, assignment field 2
04 is empty, and the predicate cell pointer 205 is set to NULL. Next, the process advances to step 303. In step 303, the first clause of the goal clauses stored in the goal clause field of the current stack cell is selected. Next, the process advances to step 304.

【0047】ステップ304の入力節選択処理では、選
択式と同一の述語を持つ入力節を選択し、選択された入
力節のヘッド部を格納した述語セル107のアドレスを
スタックセルの述語セルポインタ205に格納する。入
力節選択処理は、本発明が従来技術と異なる点であり、
後でさらに詳細に述べる。次にステップ305に進む。
In the input clause selection process of step 304, an input clause having the same predicate as the selection formula is selected, and the address of the predicate cell 107 storing the head part of the selected input clause is transferred to the predicate cell pointer 205 of the stack cell. Store in. The input clause selection process is a point where the present invention differs from the prior art,
More details will be discussed later. Next, the process advances to step 305.

【0048】ステップ305では、ステップ304の入
力節選択処理で空でない入力節が得られたかどうかを判
定する。入力節が空、すなわち、現スタックセルの述語
セルポインタ205がNULLならばステップ306に
進み、NULLでなければステップ307に進む。
In step 305, it is determined whether a non-empty input clause was obtained in the input clause selection process in step 304. If the input clause is empty, that is, if the predicate cell pointer 205 of the current stack cell is NULL, the process proceeds to step 306; otherwise, the process proceeds to step 307.

【0049】ステップ307では、選択節と入力節との
単一化を行い、単一化するための代入を求める。単一化
が可能でなければステップ304に進む。また、単一化
が可能であれば、単一化するための代入を現スタックセ
ルの代入フィールド204に格納し、ステップ308に
進む。
In step 307, the selected clause and the input clause are unified, and an assignment for unification is obtained. If unification is not possible, proceed to step 304. Further, if unification is possible, the assignment for unification is stored in the assignment field 204 of the current stack cell, and the process proceeds to step 308.

【0050】ステップ308では、ゴール節フィールド
203に格納されているゴール節に対して入力節を適用
し新たなゴール節を導出する。すなわち、入力節がファ
クト節ならば、現スタックセルのゴール節フィールドに
格納されたゴール節に対して、選択節を取り除き、代入
フィールドに格納されている代入を施したものを、スタ
ックにプッシュする。また、入力節がルール節あるいは
連体修飾節ならば、現スタックセルのゴール節フィール
ドに格納されたゴール節に対して、選択節を入力節のボ
ディ部で置き換え、代入フィールドに格納されている代
入を施したものを、スタックにプッシュする。このとき
、代入フィールド204を空とし、述語セルポインタ2
05をNULLとする。次に、ステップ309に進む。
In step 308, the input clause is applied to the goal clause stored in the goal clause field 203 to derive a new goal clause. In other words, if the input clause is a fact clause, remove the selection clause from the goal clause stored in the goal clause field of the current stack cell, apply the assignment stored in the assignment field, and push it onto the stack. . Also, if the input clause is a rule clause or an adjunctive modification clause, the selected clause is replaced with the body part of the input clause for the goal clause stored in the goal clause field of the current stack cell, and the assignment stored in the assignment field is Push it onto the stack. At this time, the assignment field 204 is empty and the predicate cell pointer 2
05 is set to NULL. Next, the process advances to step 309.

【0051】ステップ309では、現スタックセルのゴ
ール節フィールドを参照し、もし空ならばステップ31
0に進み、空でなければステップ303に進む。
In step 309, the goal node field of the current stack cell is referred to, and if it is empty, step 31
0, and if it is not empty, proceed to step 303.

【0052】ステップ310では、スタックの底から現
スタックセルまでの間にあるスタックセルの代入フィー
ルドに格納されている代入を組み合わせて表示装置に出
力する。次に、ステップ306に進む。
In step 310, the assignments stored in the assignment fields of the stack cells between the bottom of the stack and the current stack cell are combined and output to the display device. Next, the process proceeds to step 306.

【0053】また、ステップ306では、現スタックセ
ルを解放する。すなわち、スタックポインタを底の方向
に一つ戻す。次に、ステップ311に進む。
Also, in step 306, the current stack cell is released. In other words, move the stack pointer back toward the bottom. Next, the process advances to step 311.

【0054】ステップ311ではスタックが空であるか
どうかを判定する。もし、スタックポインタがスタック
の底(第0スタックセル)を指していればスタックは空
であり、質問ゴール節処理は終了する。スタックポイン
タがスタックの底を指していなければステップ303に
戻る。
In step 311, it is determined whether the stack is empty. If the stack pointer points to the bottom of the stack (0th stack cell), the stack is empty and the question goal clause processing ends. If the stack pointer does not point to the bottom of the stack, the process returns to step 303.

【0055】次に、図4のフローチャートにより、質問
ゴール節処理における入力節選択処理(ステップ304
)の詳細を説明する。まず、ステップ401では現スタ
ックセルの述語セルポインタがNULLであるかどうか
を判定する。もしNULLであればステップ402に進
み、NULLでなければステップ403に進む。
Next, according to the flowchart of FIG. 4, input clause selection processing (step 304) in question goal clause processing is performed.
) will be explained in detail. First, in step 401, it is determined whether the predicate cell pointer of the current stack cell is NULL. If it is NULL, the process proceeds to step 402, and if not NULL, the process proceeds to step 403.

【0056】ステップ402に進むのはその述語の最初
の呼出しである場合である。ステップ402では、イン
デクスセル格納エリアを参照して選択式の述語名につい
てのインデクスセルを見つけ、そのインデクスセルの述
語セルポインタをスタックの述語セルポインタにコピー
する。次にステップ405に進む。
Step 402 is proceeded to if this is the first invocation of the predicate. In step 402, the index cell storage area is referred to to find the index cell for the predicate name of the selection formula, and the predicate cell pointer of the index cell is copied to the predicate cell pointer of the stack. Next, the process advances to step 405.

【0057】また、ステップ403では、現スタックセ
ルの述語セルポインタの指す述語セルのマスク述語セル
ポインタがNULLでない場合、マスク述語セルポイン
タが指す述語セルのマスクフラグを解除、すなわち0に
する。またこのとき、そのスタックセルのボディ部ポイ
ンタがNULLでなければ、ボディ部述語セルをたどり
各ボディ部述語セルのマスク述語セルポインタが指す述
語セルのマスクフラグをすべて解除する。次のステップ
404では、現スタックセルの述語セルポインタを1つ
進める。次にステップ405に進む。
Further, in step 403, if the mask predicate cell pointer of the predicate cell pointed to by the predicate cell pointer of the current stack cell is not NULL, the mask flag of the predicate cell pointed to by the mask predicate cell pointer is canceled, that is, set to 0. At this time, if the body part pointer of the stack cell is not NULL, the body part predicate cells are followed and all mask flags of the predicate cells pointed to by the mask predicate cell pointer of each body part predicate cell are cleared. The next step 404 advances the predicate cell pointer of the current stack cell by one. Next, the process advances to step 405.

【0058】ステップ405では、現スタックセルの述
語セルポインタが指す述語セルに選択式と同一の述語を
持つプログラム節があるかどうかを判定する。もし、そ
のようなプログラム節があればステップ407に進み、
無ければステップ406に進む。
In step 405, it is determined whether the predicate cell pointed to by the predicate cell pointer of the current stack cell has a program clause having the same predicate as the selection formula. If there is such a program clause, proceed to step 407;
If there is none, the process advances to step 406.

【0059】ステップ406では、現スタックセルの述
語セルポインタをNULLにし入力節選択処理を終了す
る。これは入力節が空であることを表す。
In step 406, the predicate cell pointer of the current stack cell is set to NULL and the input clause selection process is terminated. This indicates that the input clause is empty.

【0060】また、ステップ407では、現スタックセ
ルの述語セルポインタが指す述語セルのマスクフラグが
設定されているかどうかを判定する。マスクフラグが設
定されている、すなわち1であればステップ401に進
む。またマスクフラグが設定されていない、すなわち0
であれば、ステップ408に進む。この場合、現スタッ
クセルの述語セルポインタが指す述語セルに格納されて
いるプログラム節が入力節として選択されたことになる
In step 407, it is determined whether the mask flag of the predicate cell pointed to by the predicate cell pointer of the current stack cell is set. If the mask flag is set, that is, 1, the process proceeds to step 401. Also, the mask flag is not set, i.e. 0
If so, proceed to step 408. In this case, the program clause stored in the predicate cell pointed to by the predicate cell pointer of the current stack cell is selected as the input clause.

【0061】ステップ408では、現スタックセルの述
語セルポインタが指す述語セルのマスク述語セルポイン
タがNULLであるかどうかを判定する。もしNULL
であれば入力節選択処理は終了する。また、NULLで
なければマスクフラグを設定するためステップ409に
進む。
In step 408, it is determined whether the mask predicate cell pointer of the predicate cell pointed to by the predicate cell pointer of the current stack cell is NULL. If NULL
If so, the input clause selection process ends. If it is not NULL, the process advances to step 409 to set a mask flag.

【0062】ステップ409では現スタックセルの述語
セルポインタが指す述語セルのマスク述語セルポインタ
が指す述語セルのマスクフラグを1に設定する。次のス
テップ410では、当該述語セルのボディ部ポインタか
らボディ部述語セルのアドレスを得る。次にステップ4
11に進む。
In step 409, the mask flag of the predicate cell pointed to by the mask predicate cell pointer of the predicate cell pointer of the current stack cell is set to 1. In the next step 410, the address of the body part predicate cell is obtained from the body part pointer of the predicate cell. Next step 4
Proceed to step 11.

【0063】ステップ411では、前ステップで得られ
たボディ部述語セルのマスク述語セルポインタが指す述
語セルのマスクフラグを1に設定する。次のステップ4
12では、当該述語セルのボディ部次節ポインタがNU
LLであるかどうかを判定し、NULLであれば、入力
節選択処理を終了する。また、NULLでなければ、ス
テップ413に進み、当該述語セルのボディ部次節ポイ
ンタから次のボディ部述語セルのアドレスを得てステッ
プ411に戻る。
In step 411, the mask flag of the predicate cell pointed to by the mask predicate cell pointer of the body part predicate cell obtained in the previous step is set to 1. Next step 4
12, the body part next clause pointer of the predicate cell is NU
It is determined whether it is LL, and if it is NULL, the input clause selection process is ended. If it is not NULL, the process proceeds to step 413, where the address of the next body part predicate cell is obtained from the body part next clause pointer of the predicate cell, and the process returns to step 411.

【0064】以上述べた手順により入力節選択処理を実
現する。
The input clause selection process is realized by the procedure described above.

【0065】次に、「←製造した(a社,Y)」という
質問ゴール節を例として、質問ゴール処理の具体例を示
す。
Next, a specific example of question goal processing will be shown using the question goal clause "← manufactured (company a, Y)" as an example.

【0066】図1には、「製造した(a社,ワープロ1
)」、「購入した(t大学,WS2050)」、および
、「より高い(WS2050,100万円)」というフ
ァクト節と、「製造した(a社,コンピュータ:X)←
^購入した(t大学,コンピュータ:X),より高い(
コンピュータ:X,100万円)」という連体修飾節が
格納された状態が示されている。
FIG. 1 shows “Manufactured (company a, word processor 1
)”, “Purchased (T University, WS2050)”, and “More expensive (WS2050, 1 million yen)”, and “Manufactured (Company A, Computer: X)” ←
^Purchased (T University, Computer: X), more expensive (
A state in which the adjunctive modifier clause "Computer: X, million yen)" is stored is shown.

【0067】まず図3のステップ301でスタックを初
期化する。次に、ステップ302で質問ゴール節「←製
造した(a社,Y)」を第1スタックセルのゴール節フ
ィールドに格納する。次にステップ303で、ゴール節
から選択式を選択する。この例では「製造した(a社,
Y)」が選択式となる。次に、ステップ304で入力節
選択処理を行う。すなわち図4のステップ401に進む
First, in step 301 of FIG. 3, the stack is initialized. Next, in step 302, the question goal clause "←Manufactured (company a, Y)" is stored in the goal clause field of the first stack cell. Next, in step 303, a selection formula is selected from the goal clauses. In this example, “manufactured (company a,
Y)" is a selection formula. Next, in step 304, input clause selection processing is performed. That is, the process advances to step 401 in FIG.

【0068】図4のステップ401では、第1スタック
の述語セルポインタがNULLであるのでステップ40
2に進み、インデクスセル格納エリアを参照し、「製造
した」という述語についての述語セルポインタとして1
201番地を得て第1スタックセルの述語セルポインタ
に格納する。次のステップ405では、1201番地に
「製造した」という述語を持つプログラム節があるので
、ステップ407に進む。このとき1201番地の述語
セルではマスクフラグが設定されていないのでステップ
408に進む。この時点で「製造した(a社,ワープロ
1)」というファクト節が入力節として選択されたこと
になる。ステップ408では、マスク述語セルポインタ
がNULLであるので入力節選択処理を終了し図3のス
テップ305に戻る。
In step 401 of FIG. 4, the predicate cell pointer of the first stack is NULL, so step 40
Proceed to step 2, refer to the index cell storage area, and set 1 as the predicate cell pointer for the predicate "manufactured".
Obtain address 201 and store it in the predicate cell pointer of the first stack cell. In the next step 405, there is a program clause with the predicate "manufactured" at address 1201, so the process advances to step 407. At this time, since the mask flag is not set in the predicate cell at address 1201, the process advances to step 408. At this point, the fact clause "manufactured (company a, word processor 1)" has been selected as the input clause. In step 408, since the mask predicate cell pointer is NULL, the input clause selection process is ended and the process returns to step 305 in FIG.

【0069】次にステップ305では、第1スタックセ
ルの述語セルポインタを参照し、NULLでない(12
01番地)のでステップ307に進む。ここで、選択式
「製造した(a社,Y)」と入力節「製造した(a社,
ワープロ1)」との単一化を行う。これらは、代入「{
Y/ワープロ1}」により単一化が可能であるので、こ
の代入を第1スタックセルの代入フィールドに格納しス
テップ308に進む。ステップ308では、入力節がフ
ァクト節であるので、第1スタックセルのゴール節フィ
ールドから選択式を取り除き、代入フィールドの代入を
施したものを第2スタックセルのゴール節フィールドに
格納するが、この場合空節が格納されることになる。次
のステップ309ではゴール節が空節であるのでステッ
プ310に進む。この時のスタックの状態は、図5の通
りである。ステップ310では、スタックに格納された
代入を参照し、質問ゴール節の中の変数Yに対して「ワ
ープロ1」を解として出力しステップ306に進む。ス
テップ306ではスタックポインタを一つ戻す。 この場合スタックポインタは第1スタックセルを指すこ
とになる。次のステップ311ではスタックが空でない
のでステップ303に戻る。
Next, in step 305, the predicate cell pointer of the first stack cell is referred to, and if it is not NULL (12
01 address), the process advances to step 307. Here, the selection formula "manufactured (company a, Y)" and the input clause "manufactured (company a,
Word processor 1)". These are the assignments ``{
Y/word processor 1}", this assignment is stored in the assignment field of the first stack cell, and the process proceeds to step 308. In step 308, since the input clause is a fact clause, the selection formula is removed from the goal clause field of the first stack cell, and the result with the assignment in the assignment field is stored in the goal clause field of the second stack cell. If so, the empty clause will be stored. In the next step 309, the goal node is an empty node, so the process advances to step 310. The state of the stack at this time is as shown in FIG. In step 310, the assignment stored in the stack is referred to, and "word processor 1" is output as the solution to the variable Y in the question goal clause, and the process proceeds to step 306. In step 306, the stack pointer is returned by one. In this case, the stack pointer will point to the first stack cell. In the next step 311, the stack is not empty, so the process returns to step 303.

【0070】ステップ303では、第1スタックセルの
ゴール節フィールドを参照し、「製造した(a社,Y)
」が再び選択式として選択される。次のステップ304
では図4の入力節選択処理を行う。すなわち、ステップ
401で第1スタックセルの述語セルポインタを参照し
、NULLでない(1201番地)のでステップ403
に進む。1201番地の述語セルのマスク述語セルポイ
ンタはNULLであるのでマスクフラグを解除すべき述
語セルが無いためそのままステップ404に進む。 ステップ404では、第1スタックセルの述語セルポイ
ンタを1つ進め1202番地とする。次のステップ40
5では1202番地に「製造した」という述語を持つプ
ログラム節があるのでステップ407に進む。1202
番地の述語セルにはマスクフラグが設定されていないの
でステップ408に進む。この時点で「製造した(a社
,コンピュータ:X)←^購入した(t大学,コンピュ
ータ:X),より高い(コンピュータ:X,100万円
)」という連体修飾節が入力節として選択されたことに
なる。次のステップ408では、1202番地の述語セ
ルのマスク述語セルポインタが1203番地を指してお
りNULLでないのでステップ409に進む。ステップ
409では、1203番地の述語セルのマスクフラグを
設定する。次のステップ410では1202番地の述語
セルのボディ部ポインタを参照し1301番地を得る。 次のステップ411では、1301番地のマスク述語セ
ルポインタによって指される1211番地の述語セルの
マスクフラグを設定する。次のステップ412では13
01番地のボディ部次節ポインタが1302番地であり
NULLでないのでステップ413に進む。次に、13
02番地のボディ部述語セルにたいしステップ411の
処理を行う。すなわち、1302番地のボディ部述語セ
ルのマスク述語セルポインタが指すところの、1221
番地の述語セルのマスクフラグを設定する。次のステッ
プ412では、1302番地のボディ部述語セルのボデ
ィ部次節ポインタがNULLであるため、入力節選択処
理を終了し、図3のステップ305に進む。
In step 303, the goal node field of the first stack cell is referred to, and "manufactured (company a, Y)
” is again selected as a multiple choice. Next step 304
Now, the input clause selection process shown in FIG. 4 is performed. That is, in step 401, the predicate cell pointer of the first stack cell is referenced, and since it is not NULL (address 1201), step 403
Proceed to. Since the mask predicate cell pointer of the predicate cell at address 1201 is NULL, there is no predicate cell whose mask flag should be canceled, so the process directly proceeds to step 404. In step 404, the predicate cell pointer of the first stack cell is advanced by one to address 1202. next step 40
In step 5, there is a program clause with the predicate "manufactured" at address 1202, so the process advances to step 407. 1202
Since no mask flag is set in the address predicate cell, the process advances to step 408. At this point, the adjunctive modifier clause “manufactured (company a, computer: X) ←^purchased (university t, computer: It turns out. In the next step 408, the mask predicate cell pointer of the predicate cell at address 1202 points to address 1203 and is not NULL, so the process advances to step 409. In step 409, the mask flag of the predicate cell at address 1203 is set. In the next step 410, the body pointer of the predicate cell at address 1202 is referenced to obtain address 1301. In the next step 411, the mask flag of the predicate cell at address 1211 pointed to by the mask predicate cell pointer at address 1301 is set. In the next step 412, 13
Since the body section next clause pointer at address 01 is address 1302 and is not NULL, the process advances to step 413. Next, 13
The process of step 411 is performed for the body part predicate cell at address 02. In other words, the mask predicate cell pointer of the body part predicate cell at address 1302 points to 1221.
Set the mask flag of the address predicate cell. In the next step 412, since the body part next clause pointer of the body part predicate cell at address 1302 is NULL, the input clause selection process is ended and the process proceeds to step 305 in FIG.

【0071】ステップ305では第1スタックセルの述
語セルポインタを参照し、NULLでない(1202番
地)のでステップ307に進む。ここで、選択式「製造
した(a社,Y)」と入力節のヘッド部「製造した(a
社,コンピュータ:X)」との単一化を行う。これらは
、代入「{Y/コンピュータ:X}」により単一化が可
能であるので、この代入を第1スタックセルの代入フィ
ールドに格納しステップ308に進む。
In step 305, the predicate cell pointer of the first stack cell is referenced, and since it is not NULL (address 1202), the process advances to step 307. Here, the selection formula "manufactured (company a, Y)" and the head part of the input clause "manufactured (a company, Y)" are used.
company, computer: X)". These can be unified by the assignment "{Y/computer:X}", so this assignment is stored in the assignment field of the first stack cell and the process proceeds to step 308.

【0072】ステップ308では、入力節が連体修飾節
であるので、第1スタックセルのゴール節フィールドに
格納されたゴール節に対して、選択式を連体修飾節のボ
ディ部で置き換え、代入フィールドの代入を施したもの
を第2スタックセルのゴール節フィールドに格納するが
、この場合「←購入した(t大学,コンピュータ:X)
,より高い(コンピュータ:X,100万円)」という
ゴール節が格納されることになる。次のステップ309
では、第2スタックセルのゴール節フィールドが空節で
ないのでステップ303に進む。
In step 308, since the input clause is an adnominal modification clause, the selection formula is replaced with the body part of the adjunction modification clause for the goal clause stored in the goal clause field of the first stack cell, and the substitution field is The substituted result is stored in the goal node field of the second stack cell, but in this case, "←Purchased (T university, computer: X)
, higher (computer: X, 1 million yen)" is stored. Next step 309
Then, since the goal node field of the second stack cell is not an empty node, the process proceeds to step 303.

【0073】ステップ303では、第2スタックセルの
ゴール節フィールドに格納されたゴール節「←購入した
(t大学,コンピュータ:X),より高い(コンピュー
タ:X,100万円)」から先頭の「購入した(t大学
,コンピュータ:X)」が選択式として選択される。 次に、ステップ304で入力節選択処理を行う。すなわ
ち図4のステップ401に進む。
In step 303, the first goal clause "←Purchased (t university, computer: X), more expensive (computer: X, 1 million yen)" stored in the goal clause field of the second stack cell is ``Purchased (t university, computer: X)'' is selected as a multiple-choice option. Next, in step 304, input clause selection processing is performed. That is, the process advances to step 401 in FIG.

【0074】図4のステップ401では、第2スタック
の述語セルポインタがNULLであるのでステップ40
2に進み、インデクスセル格納エリアを参照し、「購入
した」という述語についての述語セルポインタとして1
211番地を得て第2スタックセルの述語セルポインタ
に格納する。次のステップ405では、1211番地に
「購入した」という述語を持つプログラム節があるので
、ステップ407に進む。このとき1211番地の述語
セルではマスクフラグが設定されているのでステップ4
01に進む。
In step 401 of FIG. 4, the predicate cell pointer of the second stack is NULL, so step 40
Proceed to step 2, refer to the index cell storage area, and set 1 as the predicate cell pointer for the predicate "purchased".
The address 211 is obtained and stored in the predicate cell pointer of the second stack cell. In the next step 405, there is a program clause with the predicate "purchased" at address 1211, so the process advances to step 407. At this time, the mask flag is set in the predicate cell at address 1211, so step 4
Proceed to 01.

【0075】ステップ401では、第2スタックセルの
述語セルポインタを参照し、NULLでない(1211
番地)のでステップ403に進む。1211番地の述語
セルのマスク述語セルポインタはNULLであるのでマ
スクフラグを解除すべき述語セルが無いためそのままス
テップ404に進む。ステップ404では、第2スタッ
クセルの述語セルポインタを1つ進め1212番地とす
る。次のステップ405では1212番地に「購入した
」という述語を持つプログラム節があるのでステップ4
07に進む。1212番地の述語セルにはマスクフラグ
が設定されていないのでステップ408に進む。この時
点で「購入した(t大学,WS2050)」というファ
クト節が入力節として選択されたことになる。ステップ
408では1212番地の述語セルのマスク述語セルポ
インタがNULLであるので入力節選択処理を終了し、
図3のステップ305に戻る。
In step 401, the predicate cell pointer of the second stack cell is referenced, and if it is not NULL (1211
address), so the process advances to step 403. Since the mask predicate cell pointer of the predicate cell at address 1211 is NULL, there is no predicate cell whose mask flag should be canceled, so the process directly proceeds to step 404. In step 404, the predicate cell pointer of the second stack cell is advanced by one to address 1212. In the next step 405, there is a program clause with the predicate "purchased" at address 1212, so step 4
Proceed to 07. Since no mask flag is set in the predicate cell at address 1212, the process advances to step 408. At this point, the fact clause "Purchased (T University, WS2050)" has been selected as the input clause. In step 408, the mask predicate cell pointer of the predicate cell at address 1212 is NULL, so the input clause selection process is terminated.
Returning to step 305 in FIG.

【0076】次にステップ305では、第2スタックセ
ルの述語セルポインタを参照し、NULLでない(12
12番地)のでステップ307に進む。ここで、選択式
「購入した(t大学,コンピュータ:X)」と入力節「
購入した(t大学,WS2050)」との単一化を行う
。これらは、代入「{X/WS2050}」により単一
化が可能であるので、この代入を第2スタックセルの代
入フィールドに格納しステップ308に進む。ステップ
308では、入力節がファクト節であるので、第2スタ
ックセルのゴール節フィールドに格納されたゴール節に
対して、選択式を取り除き、代入フィールドの代入を施
したものを第3スタックセルのゴール節フィールドに格
納するが、この場合,ゴール節「←より高い(WS20
50,100万円)」が格納されることになる。次のス
テップ309ではゴール節が空節でないのでステップ3
03に進む。
Next, in step 305, the predicate cell pointer of the second stack cell is referenced, and if it is not NULL (12
12), the process advances to step 307. Here, the multiple choice "Purchased (T university, computer: X)" and the input clause "
Purchased (T University, WS2050)". These can be unified by the assignment "{X/WS2050}", so this assignment is stored in the assignment field of the second stack cell and the process proceeds to step 308. In step 308, since the input clause is a fact clause, the selection formula is removed from the goal clause stored in the goal clause field of the second stack cell, and the result obtained by assigning the substitution field is added to the third stack cell. It is stored in the goal clause field, but in this case, the goal clause ``← Higher (WS20
501 million yen)" will be stored. In the next step 309, the goal clause is not an empty clause, so step 3
Proceed to 03.

【0077】ステップ303では、第3スタックセルの
ゴール節フィールドに格納されたゴール節から「より高
い(WS2050,100万円)」が選択式として選択
される。次に、ステップ304で入力節選択処理を行う
。すなわち図4のステップ401に進む。
In step 303, "Higher (WS2050, 1 million yen)" is selected as a selection formula from the goal clauses stored in the goal clause field of the third stack cell. Next, in step 304, input clause selection processing is performed. That is, the process advances to step 401 in FIG.

【0078】図4のステップ401では、第3スタック
の述語セルポインタがNULLであるのでステップ40
2に進み、インデクスセル格納エリアを参照し、「より
高い」という述語についての述語セルポインタとして1
221番地を得て第3スタックセルの述語セルポインタ
に格納する。次のステップ405では、1221番地に
「より高い」という述語を持つプログラム節があるので
、ステップ407に進む。このとき1221番地の述語
セルではマスクフラグが設定されているのでステップ4
01に進む。
In step 401 of FIG. 4, the predicate cell pointer of the third stack is NULL, so step 40
Proceed to step 2, refer to the index cell storage area, and set 1 as the predicate cell pointer for the predicate "higher".
Obtain address 221 and store it in the predicate cell pointer of the third stack cell. In the next step 405, there is a program clause with the predicate "higher than" at address 1221, so the process advances to step 407. At this time, the mask flag is set in the predicate cell at address 1221, so step 4
Proceed to 01.

【0079】ステップ401では、第3スタックセルの
述語セルポインタを参照し、NULLでない(1221
番地)のでステップ403に進む。1221番地の述語
セルのマスク述語セルポインタはNULLであるのでマ
スクフラグを解除すべき述語セルが無いためそのままス
テップ404に進む。ステップ404では、第3スタッ
クセルの述語セルポインタを1つ進め1222番地とす
る。次のステップ405では1222番地に「より高い
」という述語を持つプログラム節があるのでステップ4
07に進む。1222番地の述語セルにはマスクフラグ
が設定されていないのでステップ408に進む。この時
点で「より高い(WS2050,100万円)」という
ファクト節が入力節として選択されたことになる。ステ
ップ408では1222番地の述語セルのマスク述語セ
ルポインタがNULLであるので入力節選択処理を終了
し、図3のステップ305に戻る。
In step 401, the predicate cell pointer of the third stack cell is referenced, and if it is not NULL (1221
address), so the process advances to step 403. Since the mask predicate cell pointer of the predicate cell at address 1221 is NULL, there is no predicate cell whose mask flag should be canceled, so the process directly proceeds to step 404. In step 404, the predicate cell pointer of the third stack cell is advanced by one to address 1222. In the next step 405, there is a program clause with the predicate "higher than" at address 1222, so step 4
Proceed to 07. Since no mask flag is set in the predicate cell at address 1222, the process advances to step 408. At this point, the fact clause "More expensive (WS2050, 1 million yen)" has been selected as the input clause. In step 408, the mask predicate cell pointer of the predicate cell at address 1222 is NULL, so the input clause selection process is ended and the process returns to step 305 in FIG.

【0080】次にステップ305では、第3スタックセ
ルの述語セルポインタを参照し、NULLでない(12
22番地)のでステップ307に進む。ここで、選択式
「より高い(WS2050,100万円)」と入力節と
の単一化を行う。これらは、同一であり恒等代入により
単一化が可能である。第3スタックセルの代入フィール
ドを空にすることにより恒等代入を表す。次のステップ
308では、入力節がファクト節であるので、第3スタ
ックセルのゴール節フィールドから選択式を取り除き、
代入フィールドの代入を施したものを第4スタックセル
のゴール節フィールドに格納するが、この場合空節が格
納されることになる。次のステップ309ではゴール節
が空節であるのでステップ310に進む。この時のスタ
ックの状態は、図6の通りである。ステップ310では
、スタックに格納された代入を参照し、質問ゴール節の
中の変数Yに対して「WS2050」を解として出力し
ステップ306に進む。ステップ306ではスタックポ
インタを一つ戻す。この場合スタックポインタは第3ス
タックセルを指すことになる。次のステップ311では
スタックが空でないのでステップ303に戻る。
Next, in step 305, the predicate cell pointer of the third stack cell is referred to, and if it is not NULL (12
22), the process advances to step 307. Here, the selection formula "Higher (WS2050, 1 million yen)" is unified with the input clause. These are the same and can be unified by identity assignment. An identity assignment is represented by emptying the assignment field of the third stack cell. In the next step 308, since the input clause is a fact clause, the selection formula is removed from the goal clause field of the third stack cell.
The substituted field is stored in the goal clause field of the fourth stack cell, but in this case an empty clause is stored. In the next step 309, the goal node is an empty node, so the process advances to step 310. The state of the stack at this time is as shown in FIG. In step 310, the assignment stored in the stack is referred to, and "WS2050" is output as the solution to variable Y in the question goal clause, and the process proceeds to step 306. In step 306, the stack pointer is returned by one. In this case, the stack pointer will point to the third stack cell. In the next step 311, the stack is not empty, so the process returns to step 303.

【0081】ステップ303では、「より高い(WS2
050,100万円)」が再び選択式として選択される
。次のステップ304では図4の入力節選択処理を行う
。すなわち、ステップ401で第3スタックセルの述語
セルポインタを参照し、NULLでない(1222番地
)のでステップ403に進む。1222番地の述語セル
のマスク述語セルポインタはNULLであるのでマスク
フラグを解除すべき述語セルが無いためそのままステッ
プ404に進む。ステップ404では、第3スタックセ
ルの述語セルポインタを1つ進め1223番地とする。 次のステップ405では1223番地に「より高い」と
いう述語を持つプログラム節が無いのでステップ406
に進む。ステップ406では、第3スタックセルの述語
セルポインタをNULLにする。入力節選択処理は失敗
終了し図4のステップ305に戻る。
In step 303, ``Higher (WS2
0,501,000,000 yen)" is again selected as a multiple choice. In the next step 304, the input node selection process shown in FIG. 4 is performed. That is, in step 401, the predicate cell pointer of the third stack cell is referenced, and since it is not NULL (address 1222), the process proceeds to step 403. Since the mask predicate cell pointer of the predicate cell at address 1222 is NULL, there is no predicate cell whose mask flag should be canceled, so the process directly proceeds to step 404. In step 404, the predicate cell pointer of the third stack cell is advanced by one to address 1223. In the next step 405, there is no program clause with the predicate "higher than" at address 1223, so step 406
Proceed to. In step 406, the predicate cell pointer of the third stack cell is set to NULL. The input clause selection process ends in failure and returns to step 305 in FIG.

【0082】ステップ305では、第3スタックセルの
述語セルポインタがNULLであるため、ステップ30
6に進む。ステップ306ではスタックポインタを一つ
戻す。この場合スタックポインタは第2スタックセルを
指すことになる。次のステップ311ではスタックが空
でないのでステップ303に戻る。
In step 305, since the predicate cell pointer of the third stack cell is NULL, step 30
Proceed to step 6. In step 306, the stack pointer is returned by one. In this case, the stack pointer will point to the second stack cell. In the next step 311, the stack is not empty, so the process returns to step 303.

【0083】ステップ303では、第2スタックセルの
ゴール節フィールドに格納されたゴール節「←購入した
(t大学,コンピュータ:X),より高い(コンピュー
タ:X,100万円)」から先頭の「購入した(t大学
,コンピュータ:X)」が再び選択式として選択される
。次に、ステップ304で入力節選択処理を行う。すな
わち図4のステップ401に進む。ステップ401では
第2スタックセルの述語セルポインタを参照し、NUL
Lでない(1212番地)のでステップ403に進む。 1212番地の述語セルのマスク述語セルポインタはN
ULLであるのでマスクフラグを解除すべき述語セルが
無いためそのままステップ404に進む。ステップ40
4では、第2スタックセルの述語セルポインタを1つ進
め1213番地とする。次のステップ405では121
3番地に「購入した」という述語を持つプログラム節が
無いのでステップ406に進む。ステップ406では、
第2スタックセルの述語セルポインタをNULLにする
。入力節選択処理は失敗終了し図4のステップ305に
戻る。
In step 303, the first goal clause "←Purchased (t university, computer: X), more expensive (computer: X, 1 million yen)" stored in the goal clause field of the second stack cell is ``Purchased (t university, computer: X)'' is again selected as a multiple-choice option. Next, in step 304, input clause selection processing is performed. That is, the process advances to step 401 in FIG. In step 401, the predicate cell pointer of the second stack cell is referred to, and NUL
Since the address is not L (address 1212), the process advances to step 403. The mask predicate cell pointer of the predicate cell at address 1212 is N.
Since it is ULL, there is no predicate cell whose mask flag should be canceled, so the process directly advances to step 404. Step 40
4, the predicate cell pointer of the second stack cell is advanced by one to address 1213. 121 in the next step 405
Since there is no program clause with the predicate "purchased" at address 3, the process advances to step 406. In step 406,
Set the predicate cell pointer of the second stack cell to NULL. The input clause selection process ends in failure and returns to step 305 in FIG.

【0084】ステップ305では、第2スタックセルの
述語セルポインタがNULLであるため、ステップ30
6に進む。ステップ306ではスタックポインタを一つ
戻す。この場合スタックポインタは第1スタックセルを
指すことになる。次のステップ311ではスタックが空
でないのでステップ303に戻る。
In step 305, since the predicate cell pointer of the second stack cell is NULL, step 30
Proceed to step 6. In step 306, the stack pointer is returned by one. In this case, the stack pointer will point to the first stack cell. In the next step 311, the stack is not empty, so the process returns to step 303.

【0085】ステップ303では、「製造した(a社,
Y)」が再び選択式として選択される。次のステップ3
04では図4の入力節選択処理を行う。すなわち、ステ
ップ401で第1スタックセルの述語セルポインタを参
照し、NULLでない(1202番地)のでステップ4
03に進む。
[0085] In step 303, "manufactured (company a,
Y)" is again selected as a selection formula. Next step 3
In step 04, the input clause selection process shown in FIG. 4 is performed. That is, in step 401, the predicate cell pointer of the first stack cell is referenced, and since it is not NULL (address 1202), step 4 is performed.
Proceed to 03.

【0086】ステップ403では、1202番地の述語
セルのマスク述語セルポインタが指す述語セル(120
3番地)のマスクフラグを解除する。そして、ボディ部
ポインタによって指されている一連のボディ部述語セル
、すなわち1301番地と1302番地のボディ部述語
セルについて、各マスク述語セルポインタが指す述語セ
ル(1211番地および1221番地の述語セル)のマ
スクフラグを解除する。次のステップ404では、第1
スタックセルの述語セルポインタを1つ進め1203番
地とする。次のステップ405では1203番地に「製
造した」という述語を持つプログラム節があるのでステ
ップ407に進む。1203番地の述語セルにはマスク
フラグが設定されていないのでステップ408に進む。 この時点で「製造した(a社,コンピュータ#1)」と
いうファクト節が入力節として選択されたことになる。 ステップ408では、マスク述語セルポインタがNUL
Lであるので入力節選択処理を終了し図3のステップ3
05に戻る。
In step 403, the predicate cell (120
3)'s mask flag. Then, for the series of body part predicate cells pointed to by the body part pointers, that is, the body part predicate cells at addresses 1301 and 1302, the predicate cells pointed to by each mask predicate cell pointer (the predicate cells at addresses 1211 and 1221) are Clear the mask flag. In the next step 404, the first
The predicate cell pointer of the stack cell is advanced by one to address 1203. In the next step 405, there is a program clause with the predicate "manufactured" at address 1203, so the process advances to step 407. Since no mask flag is set in the predicate cell at address 1203, the process advances to step 408. At this point, the fact clause "manufactured (company a, computer #1)" has been selected as the input clause. In step 408, the mask predicate cell pointer is set to NUL.
Since it is L, the input clause selection process is ended and step 3 in FIG.
Return to 05.

【0087】次にステップ305では、第1スタックセ
ルの述語セルポインタを参照し、NULLでない(12
03番地)のでステップ307に進む。ここで、選択式
「製造した(a社,Y)」と入力節「製造した(a社,
コンピュータ#1)」との単一化を行う。これらは、代
入「{Y/コンピュータ#1}」により単一化が可能で
あるので、この代入を第1スタックセルの代入フィール
ドに格納しステップ308に進む。ステップ308では
、入力節がファクト節であるので、第1スタックセルの
ゴール節フィールドに格納されたゴール節に対して、選
択式を取り除き、代入フィールドの代入を施したものを
第2スタックセルのゴール節フィールドに格納するが、
この場合空節が格納されることになる。次のステップ3
09ではゴール節が空節であるのでステップ310に進
む。この時のスタックの状態は、図7の通りである。ス
テップ310では、スタックに格納された代入を参照し
、質問ゴール節の中の変数Yに対して「コンピュータ#
1」を解として出力しステップ306に進む。ステップ
306ではスタックポインタを一つ戻す。この場合スタ
ックポインタは第1スタックセルを指すことになる。次
のステップ311ではスタックが空でないのでステップ
303に戻る。
Next, in step 305, the predicate cell pointer of the first stack cell is referred to, and if it is not NULL (12
03 address), the process advances to step 307. Here, the selection formula "manufactured (company a, Y)" and the input clause "manufactured (company a,
computer #1)". These can be unified by the assignment "{Y/computer #1}", so this assignment is stored in the assignment field of the first stack cell and the process proceeds to step 308. In step 308, since the input clause is a fact clause, the selection formula is removed from the goal clause stored in the goal clause field of the first stack cell, and the result obtained by assigning the substitution field is added to the second stack cell. It is stored in the goal section field, but
In this case, the empty clause will be stored. Next step 3
In step 09, the goal node is an empty node, so the process advances to step 310. The state of the stack at this time is as shown in FIG. In step 310, the assignment stored in the stack is referred to, and "computer #
1'' is output as the solution and the process proceeds to step 306. In step 306, the stack pointer is returned by one. In this case, the stack pointer will point to the first stack cell. In the next step 311, the stack is not empty, so the process returns to step 303.

【0088】ステップ303では、「製造した(a社,
Y)」が再び選択式として選択される。次のステップ3
04では図4の入力節選択処理を行う。すなわち、ステ
ップ401で第1スタックセルの述語セルポインタを参
照し、NULLでない(1203番地)のでステップ4
03に進む。1203番地の述語セルのマスク述語セル
ポインタはNULLであるのでマスクフラグを解除すべ
き述語セルが無いためそのままステップ404に進む。 ステップ404では、第3スタックセルの述語セルポイ
ンタを1つ進め1204番地とする。次のステップ40
5では1204番地に「製造した」という述語を持つプ
ログラム節が無いのでステップ406に進む。ステップ
406では、第1スタックセルの述語セルポインタをN
ULLにする。入力節選択処理は失敗終了し図4のステ
ップ305に戻る。
[0088] In step 303, "manufactured (company a,
Y)" is again selected as a selection formula. Next step 3
In step 04, the input clause selection process shown in FIG. 4 is performed. That is, in step 401, the predicate cell pointer of the first stack cell is referenced, and since it is not NULL (address 1203), step 4 is performed.
Proceed to 03. Since the mask predicate cell pointer of the predicate cell at address 1203 is NULL, there is no predicate cell whose mask flag should be canceled, so the process directly proceeds to step 404. In step 404, the predicate cell pointer of the third stack cell is advanced by one to address 1204. next step 40
In step 5, since there is no program clause with the predicate "manufactured" at address 1204, the process advances to step 406. In step 406, the predicate cell pointer of the first stack cell is set to N
Make it ULL. The input clause selection process ends in failure and returns to step 305 in FIG.

【0089】ステップ305では、第1スタックセルの
述語セルポインタがNULLであるため、ステップ30
6に進む。ステップ306ではスタックポインタを一つ
戻す。この場合スタックポインタはスタックの底(第0
スタックセル)を指すことになる。次のステップ311
ではスタックが空である質問ゴール節処理を終了する。
In step 305, since the predicate cell pointer of the first stack cell is NULL, step 30
Proceed to step 6. In step 306, the stack pointer is returned by one. In this case, the stack pointer is at the bottom of the stack (0th
stack cell). Next step 311
Then, the question goal clause processing with an empty stack ends.

【0090】以上の質問ゴール節処理の過程では、質問
ゴール節「←製造した(a社,Y)」に含まれる変数Y
に対して、3つの解、{ワープロ1、WS2050、コ
ンピュータ#1}を正しく求めることができた。また、
マスクフラグを参照した入力節選択処理により、121
1番地と1221番地の述語セルについてそれぞれ1度
ずつ合計2回の余分な単一化処理を削減することができ
た。削減された単一化処理によって得られるべき解は1
203番地の述語セルにファクトとして予め格納されて
おり、これを入力節とした1回の単一化処理によっても
とめることができる。すなわち、この具体例では1回の
単一化処理を節約できたことになる。
[0090] In the above question goal clause processing process, the variable Y included in the question goal clause "← Manufactured (company a, Y)"
We were able to correctly find three solutions {word processor 1, WS2050, computer #1}. Also,
By input clause selection processing with reference to the mask flag, 121
It was possible to eliminate unnecessary unification processing twice, once for each of the predicate cells at addresses 1 and 1221. The solution that should be obtained by the reduced unification process is 1
It is stored in advance as a fact in the predicate cell at address 203, and can be obtained by one unification process using this as an input clause. That is, in this specific example, one unification process can be saved.

【0091】一般には、連体修飾節に対して格納された
具象化ファクト節をn個とするとn−1個の単一化処理
を節約できるという効果がある。
In general, if the number of reified fact clauses stored for an adnominal modification clause is n, there is an effect that n-1 unification processes can be saved.

【0092】次に、プログラム節の格納処理方法につい
て説明する。
Next, a method for storing program clauses will be explained.

【0093】図8は、プログラム節入力時に使用する変
数名テーブルのデータ構造を表す図である。変数名テー
ブル801は、変数名フィールド802と変数識別番号
フィールド803の組を格納するエリアである。変数名
フィールド802には、変数名を表す文字列を格納する
。変数識別番号フィールド803には各変数に与える変
数識別番号を格納する。変数名カウンタ804には使用
した変数識別番号の最大値を格納する。変数名カウンタ
は、最初のプログラム節を入力する前に一度だけ0に設
定する。変数名テーブル801はプログラム節を一つ入
力する度に空にする。一つのプログラム節内で新しい変
数が現れると、まず変数名カウンタの値を1増やし、そ
の変数に、変数名カウンタの新しい値を変数識別番号と
して与え、変数名テーブルに登録する。これにより、入
力プログラム節に現れる個々の変数にユニークな変数識
別番号を割り当てることができる。
FIG. 8 is a diagram showing the data structure of the variable name table used when inputting program clauses. The variable name table 801 is an area that stores a combination of a variable name field 802 and a variable identification number field 803. The variable name field 802 stores a character string representing a variable name. The variable identification number field 803 stores variable identification numbers given to each variable. The variable name counter 804 stores the maximum value of the variable identification numbers used. The variable name counter is set to 0 only once before entering the first program clause. The variable name table 801 is emptied every time one program clause is input. When a new variable appears in one program section, the value of the variable name counter is first incremented by 1, the new value of the variable name counter is given to that variable as a variable identification number, and the variable is registered in the variable name table. This allows a unique variable identification number to be assigned to each variable that appears in the input program section.

【0094】図9のフローチャートにより、入力プログ
ラム節の格納処理方法を説明する。
A method for storing input program clauses will be explained with reference to the flowchart of FIG.

【0095】ステップ901では、変数名カウンタ80
4を初期化する。すなわち、変数名カウンタの値を0に
する。次にステップ902に進む。
In step 901, the variable name counter 80
Initialize 4. That is, the value of the variable name counter is set to 0. Next, the process advances to step 902.

【0096】ステップ902では、変数名テーブルを初
期化する。すなわち、登録された変数が一つもない状態
にする。次にステップ903に進む。
In step 902, a variable name table is initialized. In other words, there is no registered variable. Next, the process advances to step 903.

【0097】ステップ903では、入力装置からプログ
ラム節を入力する。ステップ904に進む。ステップ9
04では、入力節が有ったかどうかを判定し、もし入力
節があればステップ905に進み、また入力節がなけれ
ばプログラム節格納処理を終了する。
In step 903, program clauses are input from the input device. Proceed to step 904. Step 9
In step 04, it is determined whether or not there is an input clause. If there is an input clause, the process proceeds to step 905; if there is no input clause, the program clause storage process ends.

【0098】ステップ905では、入力されたプログラ
ム節のヘッド部の述語と同一の述語をヘッド部に持つプ
ログラム節が既に格納されているかどうかをインデクス
セル格納エリア101を参照して判定する。もし、その
述語と述語名フィールドの内容が一致するインデクスセ
ルがあればステップ906に進み、そのようなインデク
スセルがなければステップ907に進む。
In step 905, it is determined by referring to the index cell storage area 101 whether a program clause having the same predicate in the head part as the predicate in the head part of the input program clause has already been stored. If there is an index cell whose content matches the predicate name field, the process advances to step 906; if there is no such index cell, the process advances to step 907.

【0099】ステップ907では、新しい述語名に対応
するインデクスセルの割り当てを行う。使用中のインデ
クスセルの最後尾に新しいインデクスセルを作成する。 述語名をその新しいインデクスセルの述語名フィールド
105に格納する。次にステップ908に進む。
In step 907, an index cell corresponding to the new predicate name is allocated. Create a new index cell at the end of the index cell in use. The predicate name is stored in the predicate name field 105 of the new index cell. Next, the process advances to step 908.

【0100】ステップ908では、入力されたプログラ
ム節のヘッド部を格納する述語セルを割り当てる。使用
中の述語セルの最後尾に新しい述語セルを作成する。ス
テップ909に進む。
In step 908, a predicate cell is allocated to store the head of the input program clause. Creates a new predicate cell at the end of the predicate cells in use. Proceed to step 909.

【0101】ステップ909では、ステップ907で割
り当てたインデクスセルの述語セルポインタ106に、
ステップ908で割り当てた述語セルのアドレスを格納
する。次にステップ910に進む。
In step 909, the predicate cell pointer 106 of the index cell assigned in step 907 is set to
The address of the predicate cell assigned in step 908 is stored. Next, the process proceeds to step 910.

【0102】また、ステップ906では、入力されたプ
ログラム節のヘッド部を格納する述語セルを割り当てる
。ステップ905で検出したインデクスセルの述語セル
ポインタが指す述語セルから、その述語を持つプログラ
ム節の最後尾を見つけ新しい述語セルを作成する。次に
ステップ910に進む。
Further, in step 906, a predicate cell is allocated to store the head portion of the input program clause. From the predicate cell pointed to by the predicate cell pointer of the index cell detected in step 905, the end of the program clause having that predicate is found and a new predicate cell is created. Next, the process proceeds to step 910.

【0103】ステップ910では、入力されたプログラ
ム節がルール節であるかを判定し、もしそうであればス
テップ912に進み、そうでなければ、ステップ911
に進む。
In step 910, it is determined whether the input program clause is a rule clause, and if so, the process proceeds to step 912; otherwise, the process proceeds to step 911.
Proceed to.

【0104】ステップ912では、ステップ906ある
いはステップ908で割り当てられた述語セルのヘッド
部節フィールド109に入力されたルール節のヘッド部
を格納する。次にステップ913に進む。
In step 912, the head of the rule clause input in the head clause field 109 of the predicate cell assigned in step 906 or step 908 is stored. Next, the process advances to step 913.

【0105】ステップ913では、入力されたルール節
のボディ部の節を格納するボディ部述語セルを割り当て
る。ボディ部の節の数だけ新たなボディ部述語セルを作
成し、それらをボディ部次節ポインタで連結しリストと
する。そのリストの先頭セルのアドレスをステップ90
6あるいはステップ908で割り当てられた述語セルの
ボディ部ポインタに格納する。ステップ914に進む。
In step 913, a body part predicate cell is allocated to store the body part clause of the input rule clause. New body part predicate cells are created for the number of body part clauses, and these are connected using body part next clause pointers to form a list. Enter the address of the first cell in the list in step 90.
6 or stored in the body part pointer of the predicate cell allocated in step 908. Proceed to step 914.

【0106】ステップ914では、ステップ913で割
り当てたボディ部述語セルのボディ部節フィールド11
3に、入力されたルール節のボディ部の各節を一つずつ
順に格納する。このとき、各ボディ部述語セルのマスク
述語セルポインタはNULLにする。次にステップ90
2に戻る。
In step 914, the body part clause field 11 of the body part predicate cell allocated in step 913 is
3, each clause in the body part of the input rule clause is stored one by one. At this time, the mask predicate cell pointer of each body part predicate cell is set to NULL. Next step 90
Return to 2.

【0107】また、ステップ911では、入力されたプ
ログラム節が連体修飾節であるかを判定し、もしそうで
なければステップ915に進み、そうであれば、ステッ
プ916に進む。
In step 911, it is determined whether the input program clause is an adjunctive modification clause. If not, the process proceeds to step 915; if so, the process proceeds to step 916.

【0108】ステップ915では、ステップ906ある
いはステップ908で割り当てられた述語セルのヘッド
部節フィールド109に入力されたファクト節を格納す
る。マスク述語セルポインタ110およびボディ部ポイ
ンタ111はNULLにする。次に、ステップ902に
戻る。
In step 915, the fact clause input in the head clause field 109 of the predicate cell assigned in step 906 or step 908 is stored. Mask predicate cell pointer 110 and body part pointer 111 are set to NULL. Next, the process returns to step 902.

【0109】ステップ916では、入力された連体修飾
節の格納処理を行い、ステップ902に戻る。
In step 916, the input adjunct modifier clause is stored, and the process returns to step 902.

【0110】次に、この連体修飾節格納処理について図
10のフローチャートにより説明する。
Next, this adnominal modification clause storage process will be explained with reference to the flowchart of FIG.

【0111】まず始めにステップ1001で変数名テー
ブルの作成を行う。入力された連体修飾節を走査し、変
数の出現の度に変数名テーブルを参照する。そして、そ
の変数名が既に変数名テーブル中にない場合に限り、変
数名カウンタの値を1増やし、その変数に変数名カウン
タの新しい値を変数識別番号として与え、変数名テーブ
ルに登録する。入力された連体修飾節を走査が終るとス
テップ1002に進む。
First, in step 1001, a variable name table is created. The input adjunctive modification clause is scanned, and the variable name table is referenced each time a variable appears. Then, only if the variable name is not already in the variable name table, the value of the variable name counter is incremented by 1, the new value of the variable name counter is given to the variable as a variable identification number, and the variable name is registered in the variable name table. When the input adjunct modifier clause is scanned, the process advances to step 1002.

【0112】ステップ1002では、ステップ906あ
るいはステップ908で割り当てられた述語セルのヘッ
ド部節フィールド109に入力された連体修飾節のヘッ
ド部を格納する。次のステップ1003では、前記のス
テップ905からステップ909と同一の処理により、
述語セルの割り当てを行う。次のステップ1004では
ステップ1003で割り当てた述語セルに、入力された
連体修飾節のヘッド部の変数を定数化した具象化ファク
ト節を格納する。この具象化ファクト節格納処理につい
ては後述する。次にステップ1005に進む。
In step 1002, the head part of the adjunct modifier clause inputted in the head part clause field 109 of the predicate cell assigned in step 906 or step 908 is stored. In the next step 1003, by the same process as steps 905 to 909,
Assign predicate cells. In the next step 1004, a reified fact clause in which the head variable of the input adjunct modification clause is made into a constant is stored in the predicate cell allocated in step 1003. This concrete fact clause storage process will be described later. Next, the process advances to step 1005.

【0113】ステップ1005では、ボディ部述語セル
の割り当てを行う。使用中のボディ部述語セルの最後尾
に新たなをボディ部述語セル作成する。次のステップ1
006では、ステップ1005で割り当てたボディ部述
語セルのアドレスをステップ906あるいはステップ9
08で割り当てられた述語セルのボディ部ポインタ11
1に格納する。ステップ1007に進む。
In step 1005, body part predicate cells are allocated. Create a new body part predicate cell at the end of the body part predicate cell in use. Next step 1
In step 006, the address of the body part predicate cell assigned in step 1005 is sent to step 906 or step 9.
Predicate cell body pointer 11 allocated in 08
Store in 1. Proceed to step 1007.

【0114】ステップ1007では、割り当てられたボ
ディ部述語セルのボディ部節フィールド113に、入力
された連体修飾節のボディ部の節を一つ格納する。次の
ステップ1008では、ステップ1007で格納された
ボディ部の節に対し、ステップ1003と同一の処理に
より述語セルを割り当てる。次のステップ1009では
、ステップ1008で割り当てた述語セルに、ステップ
1007で格納されたボディ部の節の変数を定数化した
具象化ファクト節を、後述の具象化ファクト節格納処理
により、格納する。ステップ1010に進む。
In step 1007, one clause of the body part of the input adjunct modification clause is stored in the body part clause field 113 of the assigned body part predicate cell. In the next step 1008, a predicate cell is assigned to the body section stored in step 1007 by the same process as step 1003. In the next step 1009, a concrete fact clause obtained by converting the variable of the clause of the body section stored in step 1007 into a constant is stored in the predicate cell allocated in step 1008 by a concrete fact clause storage process described later. Proceed to step 1010.

【0115】ステップ1010では、入力された連体修
飾節についてまだ格納されていないボディ部の節が残っ
ているかどうかを判定し、もし、残っていなければ、連
体修飾節格納処理を終了しステップ902に戻る。また
、残っていれば、ステップ1011に進む。
[0115] In step 1010, it is determined whether or not there are any clauses in the body part that have not yet been stored for the input adnominal modifier clause. If there are no clauses remaining, the adjunctive modifier storage process is terminated and the process returns to step 902. return. If there are any remaining, the process advances to step 1011.

【0116】ステップ1011では、ステップ1005
と同一の処理によりボディ部述語セルの割り当てを行う
。つぎのステップ1012では、ステップ1011で割
り当てたボディ部述語セルのアドレスを、ステップ10
07で割り当てたボディ部述語セルのボディ部次節ポイ
ンタ115に格納する。次にステップ1007に進む。
In step 1011, step 1005
The body part predicate cells are allocated using the same process as . In the next step 1012, the address of the body part predicate cell assigned in step 1011 is transferred to step 10.
It is stored in the body part next clause pointer 115 of the body part predicate cell allocated in step 07. Next, the process advances to step 1007.

【0117】ボディ部の最後の節の処理が終るとステッ
プ1010において連体修飾節格納処理を終了する。
[0117] When the processing of the last clause of the body part is completed, the adjunct modification clause storage process is ended in step 1010.

【0118】次に、図11のフローチャートにより、ス
テップ1004およびステップ1009の具象化ファク
ト節格納処理の詳細を説明する。
Next, details of the reified fact clause storage processing in steps 1004 and 1009 will be explained with reference to the flowchart in FIG.

【0119】まず、ステップ1101で、既に割り当て
られている述語セルのヘッド部節フィールド109に、
具象化して格納しようとしている節の述語部分を格納す
る。次に、ステップ1102に進む。
First, in step 1101, the head clause field 109 of the predicate cell that has already been assigned is
Stores the predicate part of the clause that is to be reified and stored. Next, the process advances to step 1102.

【0120】ステップ1102では、引数項の1つにつ
いて、その引数項が「領域名:変数名」の形をしている
かどうかを判定する。もし、「領域名:変数名」の形で
あればステップ1104に進み、そうでなければステッ
プ1103に進む。
In step 1102, it is determined whether one of the argument terms has the form "area name:variable name". If the format is "area name: variable name", the process advances to step 1104; otherwise, the process advances to step 1103.

【0121】ステップ1103では、ステップ1001
で述語部分を格納した述語セルのヘッド部節フィールド
109に、引数項を追加格納する。次に、ステップ11
06に進む。
[0121] In step 1103, step 1001
An argument term is additionally stored in the head clause field 109 of the predicate cell in which the predicate part is stored. Next, step 11
Proceed to 06.

【0122】また、ステップ1104では、変数名テー
ブルを参照し、引数項の変数名に付与されている変数識
別番号を求める。次のステップ1105では、ステップ
1001で述語部分を格納した述語セルのヘッド部節フ
ィールド109に、引数項として「領域名#変数識別番
号」という形式の定数を追加格納する。次に、ステップ
1106に進む。
In step 1104, the variable name table is referred to to find the variable identification number assigned to the variable name of the argument term. In the next step 1105, a constant in the format "area name#variable identification number" is additionally stored as an argument term in the head clause field 109 of the predicate cell in which the predicate part was stored in step 1001. Next, the process advances to step 1106.

【0123】ステップ1106では、格納されていない
引数項がまだ残っているかどうかを判定し、まだ残って
いればステップ1102に進み、残っていなければ具象
化ファクト節格納処理を終了する。
[0123] In step 1106, it is determined whether there are any unstored argument terms remaining. If there are any remaining argument terms, the process advances to step 1102; if not, the concrete fact clause storage process is terminated.

【0124】以上述べたプログラム節の格納処理方法に
より、ファクト節、ルール節および連体修飾節を図1で
示したデータ構造に格納できる。
By the program clause storage processing method described above, fact clauses, rule clauses, and adjunctive modification clauses can be stored in the data structure shown in FIG.

【0125】図12は、本発明の方法を実施するための
装置構成例を示す図である。1201は本発明の方法を
実現するプログラム手段およびプログラム節を格納する
記憶装置である。1022はCPUであり、1023は
プログラム節や質問ゴール節を入力する入力装置である
。1024は質問ゴール処理の結果である解代入を出力
するための表示装置である。
FIG. 12 is a diagram showing an example of an apparatus configuration for carrying out the method of the present invention. 1201 is a storage device that stores program means and program sections for implementing the method of the present invention. 1022 is a CPU, and 1023 is an input device for inputting program sections and question goal sections. Reference numeral 1024 is a display device for outputting solution assignments that are the results of question goal processing.

【0126】[0126]

【発明の効果】知識の集合SSを仮定する。SSにS1
1とS12を加えた知識に対する従来の質問処理方式に
よる処理過程と、SSにS13を加えた知識に対する本
発明の質問処理方式による処理過程とを比較する。
[Effect of the Invention] A set of knowledge SS is assumed. SS to S1
A comparison will be made between the processing process according to the conventional question processing method for knowledge obtained by adding S1 and S12 to the knowledge obtained by adding S13 to SS.

【0127】選択式がQ5以外のとき、従来の質問処理
方式と本発明の質問処理方式による処理過程に差異はな
い。一方、選択式がQ5であったとき、従来の質問処理
方式では、述語Aについての単一化処理(ユニフィケー
ション)と述語B1から述語Bnについての単一化処理
で計n+1回の単一化処理で正解代入{d’:Y/c1
}が求まる。本発明の質問処理方式によれば、連体修飾
節S13の格納時には、S13がルール節S11とファ
クト節S12およびS14に展開されて格納される。こ
のため、選択式Q5に対して、S14を入力節とした1
回の単一化処理で同じ正解代入が得られる。また、ルー
ル節S11が入力節として選択されるときにはファクト
節S12がマスクされるので重複して正解代入を求める
冗長な処理も発生しない。
When the selection formula is other than Q5, there is no difference in the processing process between the conventional question processing method and the question processing method of the present invention. On the other hand, when the selection formula is Q5, in the conventional question processing method, unification processing (unification) for predicate A and unification processing for predicates B1 to Bn is performed a total of n+1 times. Assign the correct answer {d': Y/c1
} is found. According to the question processing method of the present invention, when storing the adnominal modifier clause S13, S13 is expanded into the rule clause S11 and fact clauses S12 and S14 and stored. Therefore, for selection formula Q5, 1 with S14 as the input clause
The same correct assignment can be obtained by unification processing. Furthermore, when the rule clause S11 is selected as an input clause, the fact clause S12 is masked, so redundant processing for duplicating correct assignments does not occur.

【0128】このように、本発明の質問処理方式によれ
ば正解代入を求めるための単一化処理の回数を削減でき
るため、質問処理を高速化する効果がある。
[0128] As described above, according to the question processing method of the present invention, it is possible to reduce the number of times of unification processing to obtain the correct answer assignment, and thus has the effect of speeding up the question processing.

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

【図1】プログラム節を格納するデータ構造を表す図で
ある。
FIG. 1 is a diagram representing a data structure for storing program clauses.

【図2】質問ゴール処理で使用するスタックのデータ構
造を表す図である。
FIG. 2 is a diagram showing the data structure of a stack used in question goal processing.

【図3】質問ゴール処理を表すフローチャートである。FIG. 3 is a flowchart showing question goal processing.

【図4】質問ゴール処理における入力節選択処理の詳細
を表すフローチャートである。
FIG. 4 is a flowchart showing details of input clause selection processing in question goal processing.

【図5】質問ゴール処理における入力節選択処理の詳細
を表すフローチャートである。
FIG. 5 is a flowchart showing details of input clause selection processing in question goal processing.

【図6】質問ゴール処理における入力節選択処理の詳細
を表すフローチャートである。
FIG. 6 is a flowchart showing details of input clause selection processing in question goal processing.

【図7】質問ゴール処理の過程におけるスタックの状態
を表す図である。
FIG. 7 is a diagram showing the state of the stack in the process of question goal processing.

【図8】プログラム節入力時に使用する変数名テーブル
のデータ構造を表す図である。
FIG. 8 is a diagram showing the data structure of a variable name table used when inputting program clauses.

【図9】入力プログラム節の展開処理を表すフローチャ
ートである。
FIG. 9 is a flowchart illustrating input program section expansion processing.

【図10】入力プログラム節の展開処理における連体修
飾節格納処理の詳細を表すフローチャートである。
FIG. 10 is a flowchart showing details of adjunctive modification clause storage processing in input program clause expansion processing.

【図11】連体修飾節格納処理における具象化ファクト
節格納処理の詳細を表すフローチャートである。
FIG. 11 is a flowchart showing details of the reified fact clause storage process in the adnominal modification clause storage process.

【図12】本発明の方法を実施するための装置構成例を
表す図である。
FIG. 12 is a diagram illustrating an example of an apparatus configuration for implementing the method of the present invention.

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

101…インデクスセル格納エリア、102…述語セル
格納エリア、103…ボディ部述語セル格納エリア、1
04…インデクスセル、105…述語名フィールド、1
06…述語セルポインタ、107…ポインタ述語セル、
108…マスクフラグ、109…ヘッド部節フィールド
、110…マスク述語セルポインタ、111…ボディ部
ポインタ、112…ボディ部述語セル、113…ボディ
部節フィールド、114…マスク述語セルポインタ、1
15…ボディ部次節ポインタ。
101... Index cell storage area, 102... Predicate cell storage area, 103... Body part predicate cell storage area, 1
04... Index cell, 105... Predicate name field, 1
06...Predicate cell pointer, 107...Pointer predicate cell,
108...Mask flag, 109...Head part clause field, 110...Mask predicate cell pointer, 111...Body part pointer, 112...Body part predicate cell, 113...Body part clause field, 114...Mask predicate cell pointer, 1
15...Body part next clause pointer.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】ルール節およびファクト節を有するプログ
ラム節を処理対象とする継承階層論理型言語処理系にお
いて、前記ルール節のボディ部の基本式を満足する基礎
代入が知られている前記ルール節に対して、該ルール節
のヘッド部およびボディ部の各基本式にその基礎代入を
行った前記ファクト節とその参照可否情報とをメモリに
格納し、ゴール節の処理中、入力節として選択されたル
ール節の処理開始時に当該ルール節のヘッド部およびボ
ディ部の各基本式の基礎代入例であるファクト節の参照
可否情報を参照不可に設定し、当該ルール節の処理終了
時に、前記参照可否情報を参照可に再設定し、該参照可
否情報が参照不可と設定されているファクト節は入力節
として選択しないことを特徴とする継承階層論理型言語
の処理方法。
1. In an inheritance hierarchical logical language processing system that processes a program clause having a rule clause and a fact clause, the rule clause has a known basic assignment that satisfies a basic expression in the body of the rule clause. , the fact clause whose basic substitution has been made to each basic expression in the head part and body part of the rule clause and its referenceability information are stored in memory, and during the processing of the goal clause, the fact clause is selected as an input clause. At the start of processing of a rule clause, the referenceability information of the fact clause, which is a basic substitution example of each basic expression in the head and body parts of the rule clause, is set to non-referenceable, and at the end of processing of the rule clause, the referenceability information is set to non-referenceable. A method for processing an inheritance hierarchical logical language, characterized in that information is reset to be referenceable, and fact clauses whose referenceability information is set to be not referenceable are not selected as input clauses.
【請求項2】前記ルール節のヘッド部およびボディ部の
各基本式に基礎代入を行った前記プログラム節を前記フ
ァクト節として格納する際に、前記ルール節のヘッド部
およびボディ部のデータエリア内にその基礎代入例であ
る前記ファクト節へのポインタを保持し、前記ゴール節
の処理中、前記入力節として選択された前記ルール節の
処理開始時にそのポインタによって指される前記ファク
ト節の参照可否情報を参照不可に設定し、当該ゴール節
に対する当該ルール節の処理終了時にそのポインタによ
って指されるファクト節の参照可否情報を参照可に設定
することを特徴とする請求項1記載の継承階層論理型言
語の処理方法。
2. When storing the program clause in which basic substitutions have been made to each basic expression in the head part and body part of the rule clause as the fact clause, the data areas of the head part and body part of the rule clause are holds a pointer to the fact clause, which is an example of its basic assignment, and determines whether or not the fact clause pointed to by the pointer can be referenced at the start of processing of the rule clause selected as the input clause during processing of the goal clause. The inheritance hierarchy logic according to claim 1, characterized in that the information is set to be unreferenceable, and the referenceability information of the fact clause pointed to by the pointer is set to be referenceable when the processing of the rule clause for the goal clause is completed. How to handle type languages.
JP11286391A 1991-05-17 1991-05-17 Processing method for succession hierarchical logic type language Pending JPH04340626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11286391A JPH04340626A (en) 1991-05-17 1991-05-17 Processing method for succession hierarchical logic type language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11286391A JPH04340626A (en) 1991-05-17 1991-05-17 Processing method for succession hierarchical logic type language

Publications (1)

Publication Number Publication Date
JPH04340626A true JPH04340626A (en) 1992-11-27

Family

ID=14597415

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11286391A Pending JPH04340626A (en) 1991-05-17 1991-05-17 Processing method for succession hierarchical logic type language

Country Status (1)

Country Link
JP (1) JPH04340626A (en)

Similar Documents

Publication Publication Date Title
EP0365309B1 (en) A data unification system and method
King A program verifier
US20040205751A1 (en) Virtual supercomputer
van Emden An Interpreting Algorithm for Prolog Programs.
US5301260A (en) Inference processor using data consistency holder
US5923837A (en) Method of accessing data using approximate data structures
JPH04340626A (en) Processing method for succession hierarchical logic type language
Deshpande et al. C & Data Structures
AU4966690A (en) Rule optimization in signed processing
Kobbaey et al. Data Structures and Algorithms with Python
EP0511437A1 (en) Computer system
Johnson et al. Optimal parallel and sequential algorithms for the vertex updating problem of a minimum spanning tree
JP2814391B2 (en) Programming device for fuzzy inference rules
Milner String handling in ALGOL
JPH0231232A (en) Data processor
Butler et al. Performing algorithmic refinement before data refinement in B
Kortright Recursively decomposable graph techniques and applications to non-graph problems
Meigs Investigation of a tagged computer architecture for the Prolog language
Reuss Macro implementation of a structured assembly language
Howard Another iteration on “A synthesis of several sorting algorithms”
Adamski et al. Incremental evaluators for ordered macro attribute grammars
Numbers Complexity Practice
Bruckner Annotated transformation of SETL existential expressions to C
Clayton et al. Programming Language APL, Extended International Standards Organisation DIS 8485 (1997)
Higa et al. An integrated rule-based reduction system