JPS60540A - Predicative logic type language processor - Google Patents

Predicative logic type language processor

Info

Publication number
JPS60540A
JPS60540A JP10867983A JP10867983A JPS60540A JP S60540 A JPS60540 A JP S60540A JP 10867983 A JP10867983 A JP 10867983A JP 10867983 A JP10867983 A JP 10867983A JP S60540 A JPS60540 A JP S60540A
Authority
JP
Japan
Prior art keywords
clause
predicate
selection circuit
buffer
variable
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.)
Granted
Application number
JP10867983A
Other languages
Japanese (ja)
Other versions
JPH046984B2 (en
Inventor
Yoshinari Nakasaki
中崎 良成
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.)
NEC Corp
Original Assignee
NEC Corp
Nippon Electric Co 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 NEC Corp, Nippon Electric Co Ltd filed Critical NEC Corp
Priority to JP10867983A priority Critical patent/JPS60540A/en
Publication of JPS60540A publication Critical patent/JPS60540A/en
Publication of JPH046984B2 publication Critical patent/JPH046984B2/ja
Granted legal-status Critical Current

Links

Abstract

PURPOSE:To compare a predicate with another predicate at a high speed, by providing plural buffer memories which can read out simultaneously as the processor of a predicative logic type language. CONSTITUTION:The internal expression of a paragraph composed of a series of predicates consisting of their names and referring numbers in stored in a storage device 100. The stored internal expression of a paragraph is read out to buffer memories 102, 104, 106, and 108 by appointing an address of the device 100 through an address register 101 under the control of a control section 113. Also under the control of the control section 113, out of the outputs of each buffer memory one is selected by means of a selection circuit 110 and another one is selected by means of another selection circuit 111, simultaneously, and the selected data are sent to the control section 113. At the control section 113, readout from the buffer memories selected by means of the selection circuits 110 and 111 is simultaneously performed and predicates are compared with each other at a comparator 112, and thus, coincidence between predicates can be detected.

Description

【発明の詳細な説明】 〔発明の属する技術分野〕 本発明は述語論理型言語処理装置に関する。[Detailed description of the invention] [Technical field to which the invention pertains] The present invention relates to a predicate logical language processing device.

〔技術環境〕[Technological environment]

述語論理型言語処理装置とは述語名とその引数よシなる
述語の連な)から成る節の集合として書き下す述語論理
型言語を処理する装置であるが、以下プログラミング言
語であるプ目ログ言語を例にとシ説明する。
A predicate logical type language processing device is a device that processes a predicate logical type language written as a set of clauses consisting of a predicate name and its argument (a series of predicates). This will be explained using an example.

プロログにおいては表現すべき事象を述語名とその引数
の結合から成る「述語」によって表現し、更に述語間の
関係を記述する。例えば「太部は果物を好む」という事
象は下記のように記述できる。
In prolog, the event to be expressed is expressed by a ``predicate'' consisting of a combination of a predicate name and its argument, and the relationship between the predicates is also described. For example, the phenomenon ``Fatbe likes fruit'' can be described as follows.

好む(太部9畳物)←果物(骨物) 本例で「好む」と「果物」を述語名、「太部」「養物」
を引数と称し、蒼印はその引数が変数であることを表わ
す。即ち、上側は「太部」は「果物」という述語名で表
記された述語の引数として書かれている事物を「好む」
ことを表現している。
Prefer (fat 9 tatami) ← Fruit (bone) In this example, ``prefer'' and ``fruit'' are predicate names, and ``fat'' and ``norimono.''
is called an argument, and the blue mark indicates that the argument is a variable. In other words, in the upper part, ``fat''``likes'' the thing written as an argument of the predicate written with the predicate name ``fruit.''
It expresses that.

従りて 1果物(いちご石という文が他に書かれていれば、三段
論法の推論によって、「太部はいちごを好む」と−う結
論が得られる。
Therefore, if the sentence ``1 fruit (strawberry stone'') is written elsewhere, the conclusion ``Fatbe prefers strawberries'' can be reached by reasoning using syllogism.

前記のプロログは述語論理型言語としてその利用領域が
拡大している。しかし、更に利用領域を拡大するために
は、プログラムの処理効率を高める必要がある。
The application area of the prolog mentioned above is expanding as a predicate logical type language. However, in order to further expand the usage area, it is necessary to improve the processing efficiency of the program.

〔従来技術〕[Prior art]

従来、このプロログの処理は汎用計算機で実現されてす
る。しかしながら、汎用計算機のハードウェア構成によ
る制約を受け高速にプロログプログラムを処理すること
ができなかった。
Conventionally, this prolog processing has been realized on a general-purpose computer. However, it was not possible to process the prolog program at high speed due to constraints due to the hardware configuration of general-purpose computers.

プロログプログラムの実行は述語間の一致を比較する処
理が基本に々っている。例えば、前記の「・・←果物(
骨動。」と「果物(いちご)。」とを比較して両述語間
の一致を調べる処理が基本である・この処理を高速に実
現するためには双方の述語を同時に読み出して述語名お
よびそれに続く引数の一致を順次調べる必要がある。
The execution of a prolog program is basically a process of comparing matches between predicates. For example, the above “...←fruit (
Bone movement. The basic process is to compare ``and fruit (strawberry)'' to check for a match between the two predicates.To achieve this process at high speed, both predicates are read out at the same time and the predicate name and the argument that follows it are read out simultaneously. It is necessary to check the matches sequentially.

しかしながら、従来の計算機では記憶装置からの読出し
は一時には一語あるいは一つのまとまった領域からのみ
可能であシ、別個の領域から同時に読み出すことはでき
なかった。この状況は従来の計算機で高速バッファ機能
を実現しているキャッシュメモリでも同様で、処理装置
側からのキャッジ−メモリへの参照は一語あるいは一つ
の領域からのみ可能である◎このハードウェア構成が従
来の計算機でプロログプログラムを高速に処理する際の
制約となっている。
However, in conventional computers, reading from a storage device is only possible from one word or one unified area at a time, and it is not possible to read from separate areas at the same time. This situation is similar to the cache memory that realizes a high-speed buffer function in conventional computers, and the cache memory can only be referenced from a single word or area from the processing unit side.◎This hardware configuration This is a limitation when processing prolog programs at high speed on conventional computers.

〔発明の目的〕[Purpose of the invention]

本発明はプロログに代表される述語論理型言語のだめの
処理装置として、同時に読出し可能な複数のバッファメ
モリを備えることによシ、前記述語と述語を高速に比較
できるようにした装置を提供するものである。
The present invention provides a device that is capable of quickly comparing a predicate and a predicate by being equipped with a plurality of buffer memories that can be read simultaneously, as a processing device for a predicate logical language such as a prolog. It is something.

〔発明の構成〕[Structure of the invention]

本発明によると、述語名とその引数よ構成る述語の連ら
なりから成る節の集合として書き下す述語論理型言語を
処理する装置において、前記装置内での前記節の内部表
現を格納する記憶装置と、前記記憶装置から読み出され
た節の内部表現を一時的に格納する複数のバッファメモ
リと、前記複数のバッファメモリの各出力のうち1つを
選択して出力とする第1の選択回路と、前記複数のバッ
ファメモリの各出力のうち1つを選択して出力とするに
2の選択回路と、前記述語間の関係を次々にたどる道筋
を保持するためのスタック機構および内部レジスタおよ
びバッファメモリの管理機能および前記2つの選択回路
での選択指定機能およ数のバッファメモリの各出力のう
ち1つを前記第1の選択回路で選択し前記複数のバック
7メモリ制御装置に送シ前記2つの選択回路で選択され
たバッファメモリからの読出しを同時に行うことによシ
互いの述語間の一致を検出で・きるようにしたことを特
徴とする述語論理型言語処理装置が得られる。
According to the present invention, in a device that processes a predicate logical language written as a set of clauses consisting of a series of predicates constituted by a predicate name and its argument, a memory for storing an internal representation of the clause in the device is provided. a device, a plurality of buffer memories for temporarily storing internal representations of clauses read from the storage device, and a first selection of selecting one of the outputs of the plurality of buffer memories as an output. a selection circuit for selecting one of the outputs of the plurality of buffer memories as an output; a stack mechanism and an internal register for holding a path that successively traces the relationship between the predetermined words; and a buffer memory management function and a selection designation function in the two selection circuits, and one of the outputs of the plurality of buffer memories is selected by the first selection circuit and sent to the plurality of back 7 memory control devices. A predicate logic type language processing device is obtained, characterized in that a coincidence between predicates can be detected by simultaneously reading data from the buffer memories selected by the two selection circuits. .

〔実施例の説明〕[Explanation of Examples]

以下本発明の一実施例を図面を用いて詳細に説明する。 An embodiment of the present invention will be described in detail below with reference to the drawings.

本実施例では、プロログの述語を次の形式で表現する。In this embodiment, the prolog predicate is expressed in the following format.

述語名(引数1.引数2.・・・) 引数は定数または変数であシ、変数引数の先頭には斧印
を付けて区別する。プロログの一文を節と呼び、−膜形
式は以下のとおシである。
Predicate name (Argument 1, Argument 2, etc.) Arguments can be constants or variables, and variable arguments are distinguished by putting an ax at the beginning. A sentence in the prolog is called a clause, and its form is as follows.

述語1←述語2.述語3.・・・、述語n←印は論理記
号であシ、その左側に存在し得る述語は高々−箇である
。これをヘッド部と呼び、←印の右側をボディ部と呼ぶ
が、ボディ側の述語を区切る1、′印は述語間の論理積
を表わす。上記の一般形式は述語2.述語3.・・・、
述語nの論理積が成立するとき、述語lが成立すること
を表現しておシ、この形式を規則節と呼ぶ。
Predicate 1 ← Predicate 2. Predicate 3. ..., predicate n← is a logical symbol, and there are at most three predicates that can exist on the left side of it. This is called the head part, and the part to the right of the ← mark is called the body part, and the 1 and ' marks that separate the predicates on the body side represent the logical product between the predicates. The general form above is predicate 2. Predicate 3. ...,
It expresses that when the logical product of predicates n holds true, predicate l holds true, and this form is called a rule clause.

−膜形式の特殊形として、ヘッド部のみから成る節を宣
言節、ボディ部のみから成る節を間合わせ節と呼ぶ。
-As a special form of the membrane type, a clause consisting only of a head part is called a declaration clause, and a clause consisting only of a body part is called an interim clause.

プロログのプログラム実行は以下のステップで行われる
Program execution of the prolog is performed in the following steps.

(1)節のボディ部に現われる述語と同一の述語をヘッ
ド部に持つ節を見出す。ここで双方の述語の引数同士を
その並び順に比較し、一致を調べる操作を行う。ここで
すべての引数が一致するとステップ(2)に移る。すべ
ての引数が一致していなければステップ(1)の処理を
繰シ返す。
(1) Find a clause whose head part has the same predicate as the predicate that appears in the body part of the clause. Here, the arguments of both predicates are compared in the order in which they are arranged to check for a match. If all the arguments match here, the process moves to step (2). If all the arguments do not match, the process of step (1) is repeated.

引数同士の比較において、−万が変数、他方が定数であ
れば変数に定数の値がバインドされる。また双方共に変
数であれば同一値を採るべく、−万が他方へのポインタ
に書き換えられる。
When comparing arguments, if -10,000 is a variable and the other is a constant, the value of the constant is bound to the variable. Furthermore, if both are variables, -10,000 is rewritten as a pointer to the other so that they take the same value.

この二連シの処理も一致条件を満たすものである。This double process also satisfies the matching condition.

(2)ステップ(1)で比較の結果述語同士の一致が確
認された節のボディ部の処理へと制御が移シ、ステップ
(1)へ戻る・もしその節が宣言節であれば、ステップ
(1)の最初に参照された節のボディ部の引き続く述語
の処理へ移る。もし引続く述語が無ければ全処理を終了
する。
(2) Control transfers to the processing of the body of the clause whose predicates are found to match as a result of the comparison in step (1), and returns to step (1). If the clause is a declaration clause, step The process moves on to the subsequent predicate in the body of the first referenced clause in (1). If there is no subsequent predicate, all processing ends.

第1図はプロログのプログラム例を示す。図中”Pi”
、@P2”は述語名、ta)、、n 、uBn 。
FIG. 1 shows an example of a prolog program. "Pi" in the diagram
, @P2'' is the predicate name, ta), , n , uBn.

6C”・“D″p1E”は定数引数・*X” 。6C"/"D"p1E" is a constant argument/*X".

”Y”+”*z”は変数引数である。節1社規則説であ
〕、節2.節3は宣言節2節4は間合わせ節である。
“Y”+”*z” is a variable argument. Section 1 is the theory of company regulations], Section 2. Clause 3 is a declarative clause, and clause 2 and 4 are makeshift clauses.

以下、このプログラムの処理の流れを説明する。The processing flow of this program will be explained below.

プログラムの実行は間合わせ節から始まる。第1図の例
では節4の最初の述語1p1(*x、*y)”の処理か
ら始まシ、ステップ(1)によって節1が見出され、す
べての引数が一致することからステップ(2)へ進む。
Program execution begins with a makeshift clause. In the example shown in Figure 1, the first predicate 1p1(*x, *y) of clause 4 is processed. Clause 1 is found in step (1), and all arguments match, so step (2) ).

ここで変数観*X”には節1の定数値@A”がバインド
され、変数6*y”には変数u−4c z”がバインド
されて6*y”と鴫*z”の値が等しいことが示される
Here, the constant value @A” of clause 1 is bound to the variable view * It is shown that they are equal.

ステップ(2)では節1のボディ部″’P2 (B、C
,*z)”の処理へ進み、ステップ(1)へ戻って述語
名″’P2”をヘッド部として持つ節2との一致を調べ
不一致であることから、次に述語名″P2”をヘッド部
として持つ節3との一致を調べる。節1のボディ部と節
3のヘッド部とは一致して、ステップ(2)の処理へと
進む@ここで変数−*2”には節3の定数値6A” が
バインドされる。前記処理の結果、変数6*y”と変数
1*z”の値が等しい関係にあることから変数”*y”
の値も定数値”A”になる。
In step (2), the body part of node 1''P2 (B, C
, *z)", and returns to step (1) to check for a match with clause 2 which has the predicate name "'P2" as the head part. Since there is a mismatch, the predicate name "P2" is next set as the head part. The body part of clause 1 and the head part of clause 3 match, and the process proceeds to step (2). The constant value 6A" is bound. As a result of the above processing, the values of the variable 6*y" and the variable 1*z" are equal, so the variable "*y" is bound.
The value of is also a constant value "A".

前記ステップ(2)において節3が宣言節であることか
ら、節1の処理へ制御が戻る。節1のボディ部には述語
″″P2(B、C,*z)”K続く述語はないので、節
1の処理は終了し・節1の処理に制御を渡した節4の処
理へ制御が戻る。これまでの処理結果として、節4の変
数”*x”IICは定数値りVがバインドされ、変数I
I * Y 19にも同じく定数値″′A”がバインド
される。
Since clause 3 is a declaration clause in step (2), control returns to the processing of clause 1. Since there is no predicate following the predicate ``''P2(B,C,*z)''K in the body of clause 1, the processing of clause 1 ends and control is passed to the processing of clause 4, which passed control to the processing of clause 1. returns.As a result of the processing so far, the constant value V is bound to the variable "*x" IIC in clause 4, and the variable I
Similarly, the constant value "'A" is bound to I*Y19.

次に、節402番目の述語”Pi(*x、*x)”が処
理対象となシ、ステップ(1)によって節1が見出され
、引数を比較した結果述語の一致が認められる。この引
数の一致検査において、変数“*x〃の値は前記の処理
によシ得られた定数値uA ”である。また、節1の変
数“*2”値も変数1*x”と同一の値になることから
定数値″A’となる。変数”*z’は節4の1番目の述
語″’PI(*x+*)’)”ノ処理では定数値6A”
にバインドされたが、節402番目の述語″P1(*x
、*x)”の処理で社、節lは新たな処理対象である。
Next, since the second predicate "Pi (*x, *x)" of clause 402 is not to be processed, clause 1 is found in step (1), and as a result of comparing the arguments, a match of the predicates is recognized. In this argument match check, the value of the variable "*x" is the constant value uA obtained by the above processing. Furthermore, since the value of variable "*2" in clause 1 is also the same value as variable 1*x", it becomes a constant value "A'. The variable "*z' has a constant value of 6A in the processing of the first predicate "'PI(*x+*)')" in clause 4."
However, the predicate ``P1(*x
, *x)", the node l is a new processing target.

このときには変数”*z’h%定の値がバインドされて
いない変数であり、前記ステップ(1)の処理で初めて
変数6*×”の値6A”にバインドされる。
At this time, the value of the variable "*z'h% constant" is an unbound variable, and is bound to the value 6A" of the variable 6*x" for the first time in the process of step (1).

以下、ステップ(2)で節1のボディ部を処理し、ステ
ップ(1)の処理を進める0節1のボディ部と節2は不
一致となるが、節3とは一致する。次にステップ(2)
によシ、節4の2番目の述語の処理として一致したこと
を節4に返し、すべての処理を終了する。
Hereinafter, in step (2), the body part of clause 1 is processed, and the body part of clause 1, which is processed in step (1), does not match the body part of clause 2, but matches clause 3. Next step (2)
Okay, as a result of processing the second predicate of clause 4, a match is returned to clause 4, and all processing ends.

本実施例の装置においては、プロログの節の内部表現と
して、第2図の例に示す形式を用いる。
In the apparatus of this embodiment, the format shown in the example of FIG. 2 is used as the internal representation of the prolog section.

第2図は第1図に示したプロログプログラムの節1に対
応する内部表現を示す例である。本実施例の装置では節
毎に第2図に示すようなひとまとまシの領域で記述され
る内部表現を持つ。この節毎の内部表現を「コード」と
呼ぶ。第2図の各行を語と呼び1語はタグフィールドと
値フィールドから構成される。タグフィールドにはその
語の属性情報が保持され、値フィールドにはタグで示さ
れる属性に対応する値が保持されている。
FIG. 2 is an example showing an internal representation corresponding to section 1 of the prolog program shown in FIG. In the device of this embodiment, each node has an internal representation described in a group of areas as shown in FIG. This internal representation for each clause is called a "code." Each line in FIG. 2 is called a word, and one word consists of a tag field and a value field. The tag field holds the attribute information of the word, and the value field holds the value corresponding to the attribute indicated by the tag.

コードの先頭の語「ヘッダ」はコード全体に係る情報を
保持する。すなわち規則節、宣言節2間合わせ節のいず
れに対応するコードであるかを示す情報9節の中にある
ユニークな変数の数に係る情報などを保持する。
The word "header" at the beginning of the code holds information regarding the entire code. That is, it holds information on the number of unique variables in the information section 9 indicating whether the code corresponds to a rule clause, a declaration clause, 2 makeshift clauses, etc.

コードの第2語である「ポインタ」はそのコードと同一
の述語名をヘッド部として持つ節へのリンク情報を保持
する。
A "pointer", which is the second word of a code, holds link information to a clause having the same predicate name as the code as a head part.

第3語は、節1の述語名″′P1”に対応して、述語名
を値として持つことを示すタグフィールドと、その述語
名は具体的に”PI”であることを示す値フィールドを
持つ。第4語では述語″′P1(A9才t)″の第1引
数”A”の属性がアトムであることをタグフィールドで
示し、その値が@ A #であることを値フィールドで
示す。第5語では述語wp1(At*z)”の第2引数
である変数1*z”の属性が変数であることをタグフィ
ールドで示し、そ゛の変数が節1の中に現われる最初の
変数であることを示す番号(0)を値フィールドの値と
して持つ。
The third word corresponds to the predicate name "'P1" in clause 1, and has a tag field indicating that it has the predicate name as a value, and a value field indicating that the predicate name is specifically "PI". have In the fourth word, the tag field indicates that the attribute of the first argument "A" of the predicate "'P1 (A9 year old t)" is an atom, and the value field indicates that its value is @A #. In the fifth word, the tag field indicates that the attribute of variable 1*z, which is the second argument of predicate wp1(At*z), is a variable, and the variable is the first variable that appears in clause 1. The value field has a number (0) indicating that it exists.

以下、節1のボディ部の述語名”P2”、引数”B”、
uC”、’11*z”にそれぞれ第2図の第6語〜第9
語が対応する。ここで、第9語の変数6*z”と第5語
の変数”*2”とが同一の変数であることはこれらの語
の値フィールドが同一変数番号(0)であることで示さ
れる。
Below, the predicate name "P2" of the body part of clause 1, the argument "B",
uC" and '11*z" are the 6th to 9th words in Figure 2, respectively.
words correspond. Here, the fact that the variable 6*z" of the 9th word and the variable "*2" of the 5th word are the same variable is indicated by the same variable number (0) in the value fields of these words. .

第3図は以上説明した内部表現によって第1図のプログ
ラム例を表現した図である。図中値フィールド中のna
llはメモリリンクの終端であることを示す0節1,2
,3.4に対応して4つのコードが表現されている。
FIG. 3 is a diagram expressing the program example of FIG. 1 using the internal representation described above. na in the value field in the diagram
ll indicates the end of the memory link 0 clauses 1, 2
, 3.4, four codes are expressed.

ボディ部の述語の述語名と同一の述語名をヘッドとして
持つ述語との一致を調べるときに比較対象となる節を指
定するために、ボディ部の述語名にはヘッド部に同一述
語名を持つ節に対応する内部表現のアドレスが格納され
ている。これらの関係は図中の破線で示す。
In order to specify the clause to be compared when checking for a match with a predicate that has the same predicate name as the head of the predicate name of the body part, the predicate name of the body part has the same predicate name in the head part. Contains the address of the internal representation corresponding to the clause. These relationships are shown by dashed lines in the figure.

同一の述語名をヘッド部拠持つ節はコードの第2語であ
るポインタによってリンクされる。例えば、節2と節3
とは同一の述語名をヘッド部に有する節であるので、節
2から節3にリンクされる。
Clauses whose head parts have the same predicate name are linked by a pointer, which is the second word in the code. For example, clause 2 and clause 3
are clauses that have the same predicate name in the head, so clause 2 is linked to clause 3.

第4図は本発明の装置の一実施例を示すブロック図であ
る。図中100は第3図の説明で述べた内部表現をその
11の形で格納する記憶装置、101は記憶装置100
に格納されているコードを読出すだめのアドレスレジス
タ、102.104.106.108は記憶装置100
から読出されたコードを一時的に格納するバッフ丁メモ
リA1バッフ丁メモリBバッファメモリC,バッファメ
モリD、103゜105.107,109 は夫々バッ
フ了メモリ102゜104.106,108 の語を示
すだめのバッフ丁ポインタA、バッファポインタB、バ
ッフ丁ポインタC,バッフ丁ポインタD、110は前記
の4箇のバックアメモリ102,104,106,10
8の出力の中の1つの出力を選択する第1の選択回路A
、111は前記の4箇のバッフ了メモ1J102゜10
4.106,108の出力の中の1つの出力を選択する
第2の選択回路B、112tj:選択回路A110 と
選択回路B111によって選択された語の一致を比較し
て一致を検出するための比較器である@比較器112は
入力される2語のビットパターンが一致しているととを
検出するだけでなく、変数を示す語と定数を示す語との
比較において一致を検出する。113はスタック機構お
よび内部レジスタおよび各バッファメモリ102,10
4゜106.108および記憶装置100の管理を含み
比較器112からの一致検出信号に基づいて他の構成要
素の動きを制御する制御部である。制御部113は従来
型のプロセッサと同様の構成で実現できるので、その内
部機構については特に述べない。
FIG. 4 is a block diagram showing one embodiment of the apparatus of the present invention. In the figure, 100 is a storage device that stores the internal representation described in the explanation of FIG. 3 in the form 11, and 101 is a storage device 100.
The address register 102.104.106.108 is used to read the code stored in the storage device 100.
Buffer memory A1 which temporarily stores the code read from buffer memory B, buffer memory C, buffer memory D, 103゜105, 107, 109 indicates the words of buffer memory 102゜104, 106, 108, respectively. The useless buffer pointer A, buffer pointer B, buffer pointer C, buffer pointer D, 110 are the four backup memories 102, 104, 106, 10.
A first selection circuit A that selects one output from eight outputs.
, 111 is the above four buffer completion notes 1J102゜10
4. Second selection circuit B for selecting one output from the outputs of 106 and 108, 112tj: Comparison for detecting a match by comparing the words selected by the selection circuit A110 and the selection circuit B111. The comparator 112 not only detects whether the bit patterns of two input words match, but also detects a match when comparing a word indicating a variable with a word indicating a constant. 113 is a stack mechanism, an internal register, and each buffer memory 102, 10;
4.106.108 and the storage device 100, and controls the movement of other components based on the coincidence detection signal from the comparator 112. Since the control unit 113 can be realized with a configuration similar to that of a conventional processor, its internal mechanism will not be particularly described.

第4図で、アドレスレジスタ101で指定するアドレス
がアドレス線201を介して記憶装置100に送られる
と、出力がバス202を介して各バッファメモリ102
,104,106,108に送られる。バス202のデ
ータは前記4箇のバッファメモリ102,104,10
6,108のいずれかに格納される。この格納先の選定
は制御部113によって行われる。バッファメモリAl
O2,B104゜C106,D108からの出力はそれ
ぞれデータ線203.204,205,206を介して
選択回路A110および選択回路B111に送られる。
In FIG. 4, when the address specified by the address register 101 is sent to the storage device 100 via the address line 201, the output is sent to each buffer memory 100 via the bus 202.
, 104, 106, 108. The data on the bus 202 is stored in the four buffer memories 102, 104, 10.
6,108. This storage destination selection is performed by the control unit 113. Buffer memory Al
Outputs from O2, B104° C106, D108 are sent to selection circuit A110 and selection circuit B111 via data lines 203, 204, 205, 206, respectively.

選択回路A110および選択回路B111では前記のデ
ータ線203゜204.205,206の信号中の1つ
を出力として選択し、それぞれデータ線207,208
に出力する。データ線207,208の信号は共に比較
器112および制御部113への入力となる。比較器1
12で比較された結果である一致信号は信号線209を
介して制御部113に送られる。
The selection circuit A110 and the selection circuit B111 select one of the signals on the data lines 203, 204, 205, 206 as an output, and output the signals on the data lines 207, 208, respectively.
Output to. Signals on data lines 207 and 208 are both input to comparator 112 and control section 113. Comparator 1
A match signal, which is the result of the comparison in step 12, is sent to the control unit 113 via a signal line 209.

制御部113では信号線209の一致信号及びデータ線
207,208の信号を入力して、制御部113の中に
備えるスタック機構およびレジスタを操作する。更に制
御部113は、信号線212を介して記憶装置100へ
の参照を制御するためにアドレスレジス゛りlOlの内
容を更新する信号、記憶装置100から読み出されたデ
ータを格納する先として4箇のバッファメモリAlO2
,B104゜C106,D108の1つを選択する信号
、これらのバッファメモリ参照を制御するためにノくツ
ファポインタAlO3,バクフ了ポインタB105 、
ノく106.108の中に記憶装置100から転送が必
要なデータが既に格納されているか否かをチェックして
データ転送の要/不要を判定し、ル寺二選択回路A11
0および選択回路B111で選択すうO 以下、第3図、第4図、第5図および第6図を用いて第
1図に示しだ例題プログラムの本実施例における実行動
作を説明する。
The control unit 113 inputs the match signal on the signal line 209 and the signals on the data lines 207 and 208 to operate the stack mechanism and registers provided in the control unit 113. Furthermore, the control unit 113 sends a signal to update the contents of the address register 101 in order to control reference to the storage device 100 via the signal line 212, and a signal 4 as a destination for storing data read from the storage device 100. Buffer memory AlO2
, B104° C106, D108, a signal for selecting one of C106, D108, a reference pointer A103, a back-off pointer B105, and a signal to control these buffer memory references.
It checks whether data that needs to be transferred from the storage device 100 is already stored in the memory device 106 and 108, and determines whether data transfer is necessary or not.
0 and the selection circuit B111 selects O. Below, the execution operation of the example program shown in FIG. 1 in this embodiment will be explained using FIGS. 3, 4, 5, and 6.

記憶装置100には第3図に示す形式で第1図に示すプ
ロログプログラムが格納されている0記憶装置100の
データはプログラムの実行に伴って各バッファメモリ1
02,104,106,108に格納される。第5図(
a)(b)(c)(d)には、第1図のプロログプログ
ラムの処理が終了した時の各バッファメモリ102,1
04,106,108の記憶状態のステップ番号、選択
回路A110 が選択するバッファメモリおよび選択さ
れたバッファメモリの中で参照されている語のアドレス
、選択回路B111が選択するバッファメモリおよび選
択されたバッファメモリの中で参照されている語のアド
レス、選択回路All0の出力1選択回路B111の出
力、制御部113の内部レジスタ情報およびスタック情
報、その実行ステップでの動作の順に示しである。
The storage device 100 stores the prolog program shown in FIG. 1 in the format shown in FIG. 3. Data in the storage device 100 is stored in each buffer memory 1 as the program is executed.
02, 104, 106, and 108. Figure 5 (
a)(b)(c)(d) show the respective buffer memories 102 and 1 when the processing of the prolog program shown in FIG.
04, 106, 108 storage state step numbers, the buffer memory selected by the selection circuit A110 and the address of the word referenced in the selected buffer memory, the buffer memory selected by the selection circuit B111 and the selected buffer. The address of the word referenced in the memory, the output of the output 1 selection circuit B111 of the selection circuit All0, the internal register information and stack information of the control unit 113, and the operation in the execution step are shown in this order.

第1図において、節4はプロログにおける問合わせの命
令を表わしている。すなわち、節4の如くボディ部のみ
から成る間合わせ節によって実行が始まる。
In FIG. 1, clause 4 represents an inquiry instruction in the prolog. That is, execution begins with a makeshift clause such as clause 4, which consists only of the body part.

節4の内部表現は第3図に示す形式で記憶装置100の
アドレスCL4番地から順次格納されている。制御部1
13はアドレスレジスタ101にCL4番地を格納し、
その内容を読出すことによって実行を開始する。初期状
態では、各バッファメモリ102,104,106,1
08は空であシ、節4のコードは格納されていない。こ
のため、バッファメモリAlO2に節4に対応するコー
ドを格納する・この結果、第5図に示すようにバッフ了
メモ1JA102の20番地から27番地までに節4に
対応する内部表現8語が格納される。
The internal representation of node 4 is stored sequentially from address CL4 in storage device 100 in the format shown in FIG. Control part 1
13 stores the CL4 address in the address register 101,
Execution begins by reading its contents. In the initial state, each buffer memory 102, 104, 106, 1
08 is empty, and the code of clause 4 is not stored. Therefore, the code corresponding to clause 4 is stored in the buffer memory AlO2.As a result, as shown in Figure 5, the internal expression 8 words corresponding to clause 4 are stored from address 20 to address 27 of buffer memo 1JA102. be done.

制御部113はバッフ丁ポインタAlO3に節4のコー
ドの先頭番地20を格納して節4の「ヘッダ」、「ポイ
ンタ」を順次読出し、次に1番目の述語に対応する語を
読出す。この語は同じ述語名をヘッダ部に持つ節1への
アドレスを値として持ち、記憶装置100から節1に対
応するコードを読出す。節1のコードは制御部113の
指示によって、バッフ丁メモ1JB104に格納される
O以下第6図に示すステップ1の処理を開始する。
The control unit 113 stores the start address 20 of the code of clause 4 in the buffer pointer AIO3, reads out the "header" and "pointer" of clause 4 in sequence, and then reads out the word corresponding to the first predicate. This word has as a value the address of clause 1 which has the same predicate name in its header, and reads the code corresponding to clause 1 from the storage device 100. The code of node 1 starts the process of step 1 shown in FIG. 6 below O stored in the buffer memo 1JB 104 according to the instruction from the control unit 113.

ステップ1では、バッフ丁ポインタAlO3には節40
1番目の述語り1(*x+*y)”に対応するコードの
格納先を指示するアドレス22が格納され、バッフ丁ポ
インタB105には節10「ヘッダ1語の格納先番地を
示す120が格納されている。
In step 1, the buffer pointer AlO3 has node 40.
The address 22 indicating the storage destination of the code corresponding to the first predicate 1(*x+*y)" is stored, and the buffer pointer B105 stores the address 120 indicating the storage destination address of the clause 10 "Header 1 word. has been done.

それぞれのアドレスに対応してノ(ラフ丁メモリAlO
2からは節4の述語名″=P1”をデータ線203に出
力し・)くラフアメモリB104からは節1の「ヘッダ
」をデータ@204に出力する。選択回路A110は制
御部113の選択指示信号210でバッファメモリAl
O2の出力を選択するように指示される。この結果、デ
ータ線207には節4の述語名り1”が出力される。選
択回路B111は制御部113の選択指示信号211で
ノ(ラフアメモリB104の出力を選択するように指示
される。この結果、データ線208には節1の「ヘッダ
」力!出力される。このヘッダに含まれる情報はコード
の属性に係るものであシ、それ自体が実行制御に影響を
及ばずものではなく、)くラフ丁ポインタB105を歩
進して、内の実行ステップ状態となる。
Corresponding to each address (rough memory AIO
2 outputs the predicate name "=P1" of clause 4 to the data line 203, and from the outer memory B104 outputs the "header" of clause 1 to data@204. The selection circuit A110 selects the buffer memory Al in response to the selection instruction signal 210 of the control unit 113.
You will be prompted to select the O2 output. As a result, the predicate name 1'' of node 4 is output to the data line 207.The selection circuit B111 is instructed to select the output of the rough memory B104 by the selection instruction signal 211 of the control unit 113. As a result, the "header" of clause 1 is output to the data line 208.The information contained in this header is related to the attributes of the code, and does not itself affect execution control. ) Steps forward the draft pointer B105 and enters the execution step state.

第6図のステップ2で社バッフ了ポインタB105は節
1の「ヘッダ」に続く「ポインタ」を指示し、そは結果
バッファメモリB104はデータ11J204に「ポイ
ンタ」の値を出力する。この「ポインタ」はヘッド部に
同一の述語名を持つ節へのリンク情報であるが、リンク
の最終であるときにはその値杜″1null”となって
いる。節4のような間合わせ節では常に「ポインタ」は
”null”である。バッファポインタ旧05は引き続
き歩進する。
In step 2 of FIG. 6, the company buffer completion pointer B105 points to the "pointer" following the "header" of clause 1, and the resultant buffer memory B104 outputs the value of the "pointer" to data 11J204. This "pointer" is link information to a clause having the same predicate name in the head part, but when it is the last link, its value is "1 null". In a makeshift clause such as clause 4, the "pointer" is always "null". Buffer pointer old 05 continues to increment.

ステップ3ではバッフ了ポインタB105はノ(ラフア
メモリB104の122番地を指示し、)ぐラフアメモ
リB104の出力として節1の述語名”Pi”をデータ
線204に出力する。ここで、バッフ了メモ!JA10
2の出力は節4の最初の述語名であシ、バッファメモリ
B104の出力と同様に”Pi”である。選択回路Al
l0ではデータ線203のデータを選択するので、節4
の述語名″′P1′がデータ線207に出力される◎選
択回路B111ではデータ線204のデータを選択する
ので、節1の述語名−p 1mがデータ線208に出力
される。前記2つの選択回路110,111の出力が比
較器112への入力となって、入力されたデータが双方
共に述語名@PI”であることから、一致信号を信号線
209を介して制御部113に送る■制御部113でL
この比較結果によシ1節4と節1の現在比較対象になっ
ている語に続く語を次ステツプにおける比較対象にする
ため、バッフ丁ポインタAlO3,バッファポインタB
105をそれぞれ歩進する。
In step 3, the buffer completion pointer B105 points to address 122 of the rough memory B104, and outputs the predicate name "Pi" of clause 1 to the data line 204 as the output of the rough memory B104. Here, a buff note! JA10
The output of No. 2 is the first predicate name of Clause 4, which is "Pi" like the output of buffer memory B104. Selection circuit Al
Since l0 selects data on data line 203, node 4
The predicate name ``'P1'' of node 1 is output to the data line 207. Since the selection circuit B111 selects the data of the data line 204, the predicate name -p 1m of node 1 is output to the data line 208. The outputs of the selection circuits 110 and 111 are input to the comparator 112, and since both of the input data have the predicate name @PI, a match signal is sent to the control unit 113 via the signal line 209. L in the control unit 113
Based on this comparison result, in order to make the word following the word currently being compared in clause 1 and clause 1 the comparison target in the next step, buffer pointer AlO3 and buffer pointer B are set.
105 respectively.

ステップ4では、バッフ丁メモ!jA102の出力は節
4の第1の述語名″P1”に続く第1の引数である“*
X”となシ、この“*X”が選択回路A110の出力と
なる。バッファメモリB104の出力は節1の述語名パ
P1”に続く第1の引数の値り”となシ、この−A”が
選択回路B111の出力となる。
In step 4, make a buff note! The output of jA102 is “*”, which is the first argument following the first predicate name “P1” in clause 4.
X", this "*X" becomes the output of the selection circuit A110. The output of the buffer memory B104 is the value of the first argument following the predicate name parameter P1" of clause 1, this - A'' becomes the output of the selection circuit B111.

各々の出力はデータ線207 、208を介して比較器
112に送られる。変数頓*x”と′A”とは一致条件
を満たしており、比較器112は信号線209を介して
一致信号を制御部113に送る。制御部113ではスタ
ックの先頭0番目に変数“*X”の語を確保して、その
値を′A”にする。この処理によシ、変数6*x”に”
A”がノくインドされる。
Each output is sent to comparator 112 via data lines 207 and 208. The variables 'ton*x'' and 'A'' satisfy the matching condition, and the comparator 112 sends a matching signal to the control unit 113 via the signal line 209. The control unit 113 secures the word variable "*X" at the top 0 of the stack and sets its value to 'A'. Through this process, the word variable '*X' is set to 'A'.
A” is marked Indian.

バッフ了ポインタAlO3およびノぐラフ丁ポインタB
105はそれぞれ歩進する。
Buff end pointer AlO3 and Nogurafuto pointer B
105 respectively step.

ステップ5では節4の変数“*x#に続く第2の引数で
ある変数* * y nがノくラフアメモリAlO2の
出力となシ選択回路A110の出力とカる。また節4の
気A〃に続く第2の引数である変数1*L“がバッファ
メモリB104の出力となシ、選択回路B111の出力
となる。比較器112では、変数1*y“と変数1*t
”は一致条件を満足しておシ、制御部113に信号線2
09を介して一致信号を出力する。制御部113では、
スタックの1番目の語を変数”*y”の語とし、2番目
の語を変数6*z”の語として格納する。変数競*y”
と変数″′*z”が等しい値を持つべきことを示すため
に変数″I*z”の語には変数“*y”へのポインタ値
を格納して、変数6*z”を参照するときには、変数“
*y″の値を参照することにする。そしてバッファポイ
ンタAlO3、バッファポインタB105を歩進させる
In step 5, the variable * * y n, which is the second argument following the variable "* The variable 1*L", which is the second argument following , becomes the output of the buffer memory B104 and the output of the selection circuit B111. In the comparator 112, the variable 1*y" and the variable 1*t
” satisfies the matching condition, and the signal line 2 is connected to the control unit 113.
A match signal is output via 09. In the control unit 113,
The first word on the stack is stored as the word for variable "*y", and the second word is stored as the word for variable 6*z".
In order to show that the variable "I*z" and the variable "'*z" should have the same value, store the pointer value to the variable "*y" in the word variable "I*z" and refer to the variable "6*z". Sometimes the variable “
The value of *y'' is referred to. Then, the buffer pointer AlO3 and buffer pointer B105 are incremented.

前記の述語名及び述語内のすべての引数の一致を検出し
た処理によシ、節4の第1述語と節1のヘッダ部の述語
とは一致することが判明する。これによって制御は節1
のボディ部と、そのボディ部の述語名と同一の述語名を
ヘッド部に持つ節との一致検出に進む。
Through the process of detecting a match between the predicate name and all the arguments in the predicate, it is found that the first predicate in clause 4 and the predicate in the header part of clause 1 match. This controls the node 1
The process proceeds to match detection between the body part of and a clause whose head part has the same predicate name as the predicate name of the body part.

ステップ6では節lのボディ部の述語名はバッファメモ
!jB104の出力”P2”であシ、制御部113はl
″P2”をヘッド部に持つ節2へのアドレスを得る。
In step 6, the predicate name in the body of clause l is buffer memo! The output of jB104 is "P2", and the control unit 113 is
Obtain the address to node 2 whose head is "P2".

制御を述語名″′P2”の一致検出に移す前に、節4の
2番目の述語名1P1”を指示するアドレスを制御部1
13のNEXTレジスタに格納する。これは以降での述
語″′Pz(B、C,*z)”の比較処理で述語の一致
を検出したとき制御を節4の第2述語”PI(*x、*
x)”の一致検出処理に進めるためのものである。また
、同時に、節1のボディ部の述語名″=P2”を示すア
ドレスを制御部113のMTf’tYレジスタに格納す
る。これは、節1のボディ部の述語″’P2(B、C,
*z)”と一致検査対象の述語・P2(B、D、E)”
をヘッド部に持つ節との一致検査結果が不一致のときに
、述語°′Pz(H,C,A)”をヘッド部に持つ節3
との比較を改めて述語″’P2(B、C,*乙)#から
開始するためのものである。
Before shifting the control to match detection for the predicate name ``'P2'', the address indicating the second predicate name 1P1'' of clause 4 is sent to the control unit 1.
13 NEXT register. This means that when a predicate match is detected in the comparison process of the predicate "'Pz (B, C, *z)" in the following, the control is transferred to the second predicate "PI (*x, *z)" in clause 4.
x)". At the same time, the address indicating the predicate name "=P2" in the body part of clause 1 is stored in the MTf'tY register of the control unit 113. Predicate "'P2(B, C,
*z)” and the predicate to be checked for matching P2 (B, D, E)”
When the match test result with the clause with the head part is inconsistent, the clause 3 with the predicate °'Pz(H,C,A)'' in the head part
This is to start the comparison from the predicate "'P2(B, C, *B)#" again.

この不一致の処理はステップ7以後に示す。Processing for this mismatch will be shown after step 7.

ここで、NEXTレジスタ、RETRYレジスタに格納
されるアドレスはそれぞれ記憶装置100に格納されて
いる前記述語名°“Pl”、前記述語名″P2”に対応
するアドレス25,125 である。各バッファメモリ
102,104.106,108のアドレスと記憶装置
100のアドレスとの対応づけは制御部113のバッフ
ァメモリ管理機能を利用して実現する。
Here, the addresses stored in the NEXT register and the RETRY register are addresses 25 and 125 corresponding to the preceding word name "Pl" and the preceding word name "P2" stored in the storage device 100, respectively. The correspondence between the addresses of each buffer memory 102, 104, 106, and 108 and the address of the storage device 100 is realized using the buffer memory management function of the control unit 113.

ステップ7では節2のコードの先頭にあるヘッダーを参
照する。節2はバッファメモリに格納されていないので
記憶装置100がらバッファメモリC106に読込む。
In step 7, the header at the beginning of the code in clause 2 is referenced. Since clause 2 is not stored in the buffer memory, it is read from the storage device 100 into the buffer memory C106.

バッファメモリC106に格納した後バッファポインタ
0107の値は節2のヘッダーを指示する150番地と
なる。
After storing in the buffer memory C106, the value of the buffer pointer 0107 becomes address 150 indicating the header of section 2.

ステップ8では節2のポインタを参照する。このポイン
タの値は制御部113の内部レジスタであるLINKレ
ジスタに保存する。これは、以下の述語名”P2”に係
る一致検査が不一致にkつだ時にヘッド部に述語り2(
B、C,A)’を持つ節3との一致検査を開始するため
に、この節3へのアドレス情報を制御部113の中に退
避するためのものであシ、このステップ8にLINKレ
ジスタを含んだ操作を示す。
In step 8, the pointer in clause 2 is referenced. The value of this pointer is stored in the LINK register, which is an internal register of the control unit 113. This causes the predicate 2 (
The purpose is to save the address information for this node 3 in the control unit 113 in order to start a match check with node 3 having B, C, A)', and the LINK register is set in step 8. Indicates the operations involved.

ステップ9では述語名6P2”の一致を検出する@続い
て、パラフチポインタC10フ、バツフアポインタB1
05を歩進する。
In step 9, a match of the predicate name 6P2'' is detected.
Step 05.

ステップ10では述語名”P2”の第1引数が両方共に
″B”であることがら一致が検出される。
In step 10, a match is detected because the first arguments of the predicate name "P2" are both "B".

続くステップ11では節2の引数が”D”、節1の引数
が′C”であることから不一致となる。この結果は信号
a209を介して比較器112がら制御部113に送ら
れる。
In the following step 11, there is a mismatch because the argument of clause 2 is "D" and the argument of clause 1 is 'C'.This result is sent from comparator 112 to control unit 113 via signal a209.

制御部113ではヘッド部の述語名がaP2”である他
の節すなわち節3との比較を開始するため、ステップ1
2では節1の述rtup2+Btc+*z)”に関する
一致を改めて調べるために、以前に対比しておいたRE
TRYレジスタの節1の述語名” P 2”へのアドレ
スに対応するバッファメモリB104内のアドレスの値
125をバッファポインタB105に格納する0また、
以前に退避しておいたLINKレジスタの内容は節3へ
のアドレスであシ、節3は節1の述語@p2(B、C,
*z)”との比較対象となる0節3はどのバッファメモ
リにも格納されていないので節3のコードが記憶装置1
00がらバス202を介してバッファメモ!JD108
に格納される。
In the control unit 113, in order to start comparison with another clause whose predicate name in the head part is aP2'', that is, clause 3, step 1 is performed.
2, in order to re-examine the coincidence regarding the statement rtup2+Btc+*z)" in Section 1, we compare the REs that were previously compared.
0 to store the value 125 of the address in the buffer memory B104 corresponding to the address to the predicate name "P2" of clause 1 of the TRY register in the buffer pointer B105;
The contents of the previously saved LINK register are the address to clause 3, and clause 3 is the predicate of clause 1 @p2(B, C,
*z)” is not stored in any buffer memory, so the code of clause 3 is stored in storage device 1.
Buffer memo via bus 202 from 00! JD108
is stored in

ステップ12からステップ17までにおいて節1の述語
″’P2(B、C,*Z)”と節3の述語u p 2(
B、C,A)”との一致が検出される。ステップ17で
は変数1*z〃に”A”がバインドされる。
From step 12 to step 17, the predicate ``'P2(B, C, *Z)'' of clause 1 and the predicate u p 2(
B, C, A)" is detected. In step 17, "A" is bound to the variable 1*z.

との結果、スタック中の変数”*z’の領域からポイン
トされている変数1*y”の領域に”A”が格納される
As a result, "A" is stored in the area of variable 1*y, which is pointed from the area of variable "*z" in the stack.

以上の処理により、節4の第1述語”Pi(*XJ*y
)”に関する処理が終了して、次に節4の第2述語であ
るtlPl (*x + *x)”の処理に進む。第2
述語の述語名は第1述語の述語名と同様″−p1”であ
るので節lとの一致を調べる。節1は既にバッフ丁メモ
1JB104に格納されているので記憶装置100から
の読出しは行う必要はない。ステップ18からステップ
23までにおいて、節1の述語”PI (A、*z)”
との一致が検出される。
Through the above processing, the first predicate of clause 4 “Pi(*XJ*y
)” is completed, and then the processing proceeds to the second predicate of clause 4, tlPl (*x + *x)”. Second
Since the predicate name of the predicate is "-p1" like the predicate name of the first predicate, a match with clause l is checked. Since clause 1 has already been stored in buffer memo 1JB 104, there is no need to read it from storage device 100. From step 18 to step 23, the predicate "PI (A, *z)" of clause 1
A match is detected.

以後の処理では節1の述語″P2(B、C,*z)”と
節2の一致を調べ、不一致であることから節3との一致
を調べ、結果が一致することで、節4の第2述語の処理
が終了する。節4には続く述語が力いので、節4の処理
全体が終了する。
In the subsequent processing, we check whether the predicate "P2 (B, C, *z)" of clause 1 matches clause 2, and since there is a mismatch, we check whether it matches clause 3, and if the results match, we check clause 4. Processing of the second predicate ends. Since the following predicate is strong in clause 4, the entire processing of clause 4 ends.

比較器112は制御部113への制御信号を出力する。Comparator 112 outputs a control signal to control section 113.

この比較器1120機能は制御部113の一部とも考え
られる。第4図に示す実施例の説明では、比較器112
は選択回路A110および選択回路B111からの出力
を同時に参照して比較できることを説明するために制御
部113とは別に示しである。
This comparator 1120 function can also be considered as part of the control section 113. In the description of the embodiment shown in FIG.
is shown separately from the control section 113 in order to explain that the outputs from the selection circuit A110 and the selection circuit B111 can be referenced and compared at the same time.

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

以上の説明で明らかなように、本発明によシ、プロログ
に代表される述語論理型言語の処理を高速に実行するこ
とができる。
As is clear from the above description, according to the present invention, processing of a predicate logical language typified by prolog can be executed at high speed.

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

第1図はプロログのプログラム例を示す図、第2図はこ
の例における内部形式を示す図、第3図は第1図のプロ
グラム例を内部形式に変換したときの記憶装置イメージ
を示す図、第4図は本発明の装置の一実施例を示すブロ
ック図、第5図(a)(b)(C)(d)は第1図のプ
ログラム例を処理するために記憶装置からバッファメモ
リに格納された内部表現のイメージを示す図、第6図は
第1図のプログラム例を第4図に示した実施例によって
実行するときの実行ステップを示す図である。 100・・・・・・記憶装置、1o1・・・・・アドレ
スレジスタ、102・・・・・・バッファメモリA11
03・・・・・・バク7丁ポインタA、104 ・・・
・バッファメモリB、105・・・・・・バッファポイ
ンタB、106・・川・バッフ了メモIJc、107・
・・・・・バッファポインタC,108・・・・・・バ
ッファメモリD、109 ・・・・・バッファポインタ
D1110・・・・・・選択回路A、111・・・・・
・選択回路B、112・・・・・比較器、113・・・
・・・制御部。 代理人 弁理士 内 原 音 1!It PI(A 才Z>PI(B、e、水:l入伸
7P2(β、D、E八 姉3 PZ(B、e、Aへ 14 − PI(<;l) t Vジ、 PIと<z 
、t、z)。 姶 / 2 第7 図
FIG. 1 is a diagram showing an example of a prolog program, FIG. 2 is a diagram showing an internal format in this example, and FIG. 3 is a diagram showing a storage device image when the program example in FIG. 1 is converted into an internal format. FIG. 4 is a block diagram showing an embodiment of the apparatus of the present invention, and FIGS. FIG. 6 is a diagram showing an image of the stored internal representation, and is a diagram showing execution steps when the program example of FIG. 1 is executed by the embodiment shown in FIG. 4. 100...Storage device, 1o1...Address register, 102...Buffer memory A11
03...Baku7 pointer A, 104...
・Buffer memory B, 105... Buffer pointer B, 106... River ・Buffer completion memo IJc, 107.
...Buffer pointer C, 108...Buffer memory D, 109 ...Buffer pointer D1110...Selection circuit A, 111...
・Selection circuit B, 112... Comparator, 113...
...control section. Agent Patent Attorney Uchihara Oto 1! It PI (A Sai Z > PI (B, e, water: 1) 7P2 (β, D, E 8e 3 PZ (B, e, A to 14 - PI (<; l) t Vji, PI and <z
, t, z).姶 / 2 Figure 7

Claims (1)

【特許請求の範囲】[Claims] 述語名とその引数より成る述語の連らなシから成る節の
集合として書き下す述語論理型言語を処理する装置にお
いて、前記節の内部表現を格納する記憶装置と、前記記
憶装置から読み出された節の内部表現を一時的に格納す
る複数のバッファメモリと、前記複数のバッファメモリ
の各出力のうち1つを選択して出力とする第1の選択回
路と、前記複数のバッファメモリの各出力のうち1つを
選択して出力とする第2の選択回路と、前記述語間の関
係を次々にたどる道筋を保持するだめのスタック機構お
よび内部レジスタおよびバッファメモリの管理機能およ
び前記2つの選択回路での選択指定機能および前記述語
の一致を調べるための比較機能を含む制御装置とを備え
、前記制御装置の制御の下に前記複数のバッファメモリ
の各出力のうち1つを前記第1の選択回路で選択し前記
複数のバッファメモリの各出力のうちの他の1つを前記
第2の選択回路で選択して前記2つの選択回路で選択さ
れたデータを前記制御装置に送シ前記の2つの選択回路
で選択された2つのバッファメモリから読出しを同時に
行うことによシ互いの述語間の一致を検出できるように
したことを特徴とする述語論理型言語処理装置。
In a device that processes a predicate logical language written as a set of clauses consisting of a series of predicates consisting of a predicate name and its argument, there is provided a storage device that stores an internal representation of the clause, and a storage device that stores an internal representation of the clause, and a a plurality of buffer memories that temporarily store internal representations of the nodes; a first selection circuit that selects one of the outputs of the plurality of buffer memories as an output; and a first selection circuit that selects one output from each of the plurality of buffer memories; a second selection circuit that selects one of the outputs as an output; a stack mechanism that maintains a path to successively follow the relationships between the preceding words; and a management function for internal registers and buffer memory; a control device including a selection specifying function in a selection circuit and a comparison function for checking the coincidence of the predetermined words; one selection circuit selects the other one of the outputs of the plurality of buffer memories, the second selection circuit selects the data selected by the two selection circuits, and transmits the data selected by the two selection circuits to the control device. A predicate logic language processing device characterized in that a match between predicates can be detected by simultaneously reading from two buffer memories selected by the two selection circuits.
JP10867983A 1983-06-17 1983-06-17 Predicative logic type language processor Granted JPS60540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10867983A JPS60540A (en) 1983-06-17 1983-06-17 Predicative logic type language processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10867983A JPS60540A (en) 1983-06-17 1983-06-17 Predicative logic type language processor

Publications (2)

Publication Number Publication Date
JPS60540A true JPS60540A (en) 1985-01-05
JPH046984B2 JPH046984B2 (en) 1992-02-07

Family

ID=14490920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10867983A Granted JPS60540A (en) 1983-06-17 1983-06-17 Predicative logic type language processor

Country Status (1)

Country Link
JP (1) JPS60540A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4573616A (en) * 1982-05-24 1986-03-04 Flo-Con Systems, Inc. Valve, clamp, refractory and method
JPS6437631A (en) * 1987-08-03 1989-02-08 Agency Ind Science Techn Close selecting system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4573616A (en) * 1982-05-24 1986-03-04 Flo-Con Systems, Inc. Valve, clamp, refractory and method
JPS6437631A (en) * 1987-08-03 1989-02-08 Agency Ind Science Techn Close selecting system
JPH0572612B2 (en) * 1987-08-03 1993-10-12 Kogyo Gijutsuin

Also Published As

Publication number Publication date
JPH046984B2 (en) 1992-02-07

Similar Documents

Publication Publication Date Title
JP3637922B2 (en) Method and apparatus for finding termination characters in various length strings in a processor
Bailey et al. A formal model and specification language for procedure calling conventions
JPS6140650A (en) Microcomputer
US5410661A (en) Character string copying method
US6449713B1 (en) Implementation of a conditional move instruction in an out-of-order processor
Cole Macro processors
JPS60540A (en) Predicative logic type language processor
JPS607539A (en) Predicate logical word processor
Hollaar Specialized merge processor networks for combining sorted lists
US4212058A (en) Computer store mechanism
JPH0527142B2 (en)
JPS628231A (en) Logical type data processor
JPS6155736A (en) Prologue machine
JPS6074040A (en) Predicate logical type language processor
US11334627B2 (en) Data processing
JPH01177130A (en) Unification processor
JPS63251835A (en) Vector processor
JPS61148536A (en) Information processing system
JPH01187636A (en) Unification processing device
JPH10240627A (en) Sector management method and device
JP2522372B2 (en) Data driven computer
JPS63195739A (en) Unification processor
JPH04178838A (en) List output system for language processing system
JPH0566941A (en) Data processing system and language processing system
JPS62113240A (en) Prologue processor