JPS60163132A - Predicate logical program execution device - Google Patents

Predicate logical program execution device

Info

Publication number
JPS60163132A
JPS60163132A JP1773484A JP1773484A JPS60163132A JP S60163132 A JPS60163132 A JP S60163132A JP 1773484 A JP1773484 A JP 1773484A JP 1773484 A JP1773484 A JP 1773484A JP S60163132 A JPS60163132 A JP S60163132A
Authority
JP
Japan
Prior art keywords
predicate
flower
execution
processing
program
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
JP1773484A
Other languages
Japanese (ja)
Inventor
Masahiro Yamamoto
昌弘 山本
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 JP1773484A priority Critical patent/JPS60163132A/en
Publication of JPS60163132A publication Critical patent/JPS60163132A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To decrease the execution time of a predicate logical program by distinguishing a predicate different in character from other predicates and executing the result by other device. CONSTITUTION:Suppose that an inquiry of ''like (Taro, X)'' to a Prolog program in the figure and the 3rd rule in the figure is executed. The 2nd processing unit makes execution of the predicate of ''like (Taro, X)'' at first. Then a predicate ''plant (flower, X)'' is executed and it is detected that a predicate ''plant (flower, X)'' is an external predicate. Then, the next predicate is ''color (X, red)'' and since this is a predicate of an external predicate name, the execution of ''plant (flower, X)'' and ''color (X, red)'' is requested to the 1st processing unit. When this processing unit executes the ''plant (flower, X)'', three results of ''(flower, chrysanthemum)'', ''(flower, tulip)'', ''(flower, morning glory)'' are obtained, and two parameter pairs of ''(flower, tulip)'' and ''(flower, morning glory)'' are obtained as the result of further verification and the result is sent to the 2nd processing unit.

Description

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

〔技術分野〕 本発明はProlog言語に代表される述語論理プログ
ラムを実行する処理装置に関する。 〔共通技術〕 述語論理型言語の代表であるProlog言語で61述
語は 述語名(引
[Technical Field] The present invention relates to a processing device that executes a predicate logic program typified by the Prolog language. [Common technology] In the Prolog language, which is a representative predicate logical language, 61 predicates are called predicate names (quotes).

【・、引数、・・・、引数)。 の形式を持ちP、 Q、 R,・・・を述語とした時、
事実(assertion )は P。 Q。 R1 の形式で1き、述語P、 Q、Rが貞であることを表わ
す。 又、規則(rule)は PニーQ、It。 の形式で書き、述語Qと凡が共に真の時には、述語Pが
真であることを表わす。 又、間合せ(comm5Lnd)は ニーP、Q、R,。 の形式を持ち、述語P、Q、Rが共に直になるデータを
めることを示す。 第1図は事実と規則のプログラムの第1の例を示し、2
2図は第1図の事実と却、則に対する間合せプログラム
と出力結果を示す。 杭1図に示したプログラム例は簡ヰ々ものであるが、具
体的な応用プログラノ・は更に?神である。 例えば、第3図1に示す第2の例のように、植物、動物
といった述語を導入したW5合には、プログラムは膨大
々量に増加する。この時、鎖3図に示した規則が述語枦
物を実行するとこれらを満たすデータを眉鷹実から捜す
処理を行う。 〔ケ:来技術〕 この処理を従来型の述語論理型プログラムを実行する1
宿(例えに、英国ニシンバラ大学のデー・ワレンらによ
るDECSystem−10Prolog :Pere
iraル、、Pereira 、F 、 and Wa
rren 、D、 、 ”U−set’s Guide
 to DECSystem−10Prolog”。 Dept、 AI Re5earch、Edinbur
gh Univ、、1978)で行つと、ユニイフィケ
ーションメカニズムによシ達成されるため多量の実行メ
モリと実行時間を必要とするという欠点がある。 〔発明の目的〕 本発明の目的は、このような欠点を解決し、第3図に示
すような述語論理プログラムを高速に処理する述語論理
プログラム実行装置を提供することにある。 〔発明の構成〕 本発明の装置は、第1の種類の述語名と第2の種類の述
語名とを区別できる述語名と引数とからなる述語で構成
される述語論理プログラムを格納する格納手段と、供給
される第1の種類の述語名の述語を処理し一度に一つ以
上の処理結芽を出力する第1の処理手段と、前記格納手
段から供給される第1の種類の述語名の述語と第2の種
類の述語名の述語との検出を行ない前記第1の種類の述
語名の述語を前記第1の処理手段に供給し前記第1の処
理手段から前記処理結果の供給をうけ前記第2の種類の
述語名の述語の処理を行なう第2の処理手段とを含んで
構成される。 〔実施例〕 次に本発明の一実施例についてし1面を参照して詳細に
説明する。 第5図は本発明の一実施例を示すブロック図である1、
第5図の述語論理プログラム実行装置は、外部述語名(
後述)を処理し、実行結果を遂次形式又は一括ノト式で
渡す第1の処理袋N1と、第1の処理袋filからの実
行結果を受け取り々から内部述語名(後述)の述語の実
行を行う第2の処理装置2と述語プログラムを貯える記
憶装置3とから構成される。 本実施例では、第3図に示すような声の多い事実を示す
述語は第1の処理装置lに格納する。この第1の処理装
置1では植物(花、×)のような述語を実行するが、こ
の第1の処理装置1は述語論理型プログラムを実行する
構造のものではなく、例えば関係代数演算処理装置(例
えば、アール・ニブスタイy : Epstein、R
,、et、al、:the IDM500−Commu
nication l5sues with Back
−end Processors、COMPCON、P
P、112−114゜1981 )によって高速に実行
する。このため、第1の処理装置1に貯えた述語は外部
述語名として区別し、第3図に示した規則は第4図に示
す却則として表現する。即ち、第4図では外部述語名は
Yで始まる述語名によシ区別している。第1の処理装置
1は述語名と複数個のパラメータから成る述語を実行す
るもので、この述語を満たすパラメータ対を高速にめる
処理を行うもので、例えば、前述の関係代数演算装置な
どで実現できる。従来型の関係代数@q4装慟と異って
、述語を満たす糺1果が傍数個存在する場合には、処刑
を効率的に行なうためパラメータ対を1つづつ遂次形式
で出力する制御と、パラメータ対を後に述べるリスト形
式にして捷とめ一括形式で出方する制御とを行う機能設
け1=リ 複数個の述語を連続して実行する機能を設け
T【すすることが考えられる1゜第2の処理装置2は通
常のPhologプログラム処理装置で構成されるが、
外部述語名の実行については、実行結果を遂次形式又は
−話形式で第1の処理袋w1から貰い、それを用いなが
ら内部述語基の述語を実行する。 記俤装置3は述語論理型プログラムを貯えるもので汎用
計り8機の主記憶装置などで構成される。 次に具体例を用いて本実施例の動作について説明する。 第4図のPrologプログラムに対して間合せニー好
き(太部、×) を行い、第4図の第3番目の規則を実行したとする1、
第6図は実行の制御に使用するデータ領域の変化、第7
図は第6図に対応する動作フロー図を示す。 先ず第2の処理装置2は、好き(太部、×)の述語のだ
めのデータ領域を確保し、右辺の述語の実行に移る(第
6図(a)および第7図のステップ10)。 同様に述語f植物(花、×)を実行するためのデータ領
域を確保しく第6図(b)および第7図のステップ20
)述飴峯榴物(花、×)が外部述語名であることを検出
する。つぎに、次の述語をみると、1色(×、赤)とな
っておシ、同様に外部述語名の述語のため、¥植物(花
、×)とγ色(×、赤)との述語の実行を含めて第1の
処理装置1に実行依頼する。 第1の処理】装置1はまず子植物(花、×)を実行する
と、(花、菊)、(花、チー−リップ)、(花、朝顔)
という3つの結果を得る。次に、Y色(×、赤)の実行
に移るが、蓋槓物(花、×)の第1の結果である(花、
η)を選び、変数×の対応づけによシ×はηと決シ、Y
色(菊、赤)が事実に合致するかを検証することになる
。尋藝本姿者巻判必当検証の結果、満たさないことが判
明する。次に、(花、チューリップ)に移るが、同様な
検証が行われ、(チー−リップ、赤)が存在するため、
検RIl〕が成立する。同様に、(花、朝顔)について
も行われ、成立することが検証される。その結果、第1
の処理装置」の結果として、(花、チー−リップ)と(
花、朝顔)という2つのパラメータ対がめられ、第2の
処理装置2へ渡すことになる。 第2の処理装置2は第1の処理装置1からこの結果を貰
い処理を続けるが、PHologプログラムの問合せに
対する応答として2つの形式、即ち、答を1つだけ出す
モードと全ての答を出すモード、があシ、その形式によ
シ実行動作が異なる。 先ず、答を1つだけ出すモードについて説明する3、こ
の場合には第1の処理装e1から(花、チー−リップ)
を貰い、第2の処理装置2はこれを表わすデータ領域を
作る(第6図(C)および詑7図のステップ31)。 次に、第2の処理装置2はル初のデータである(花、チ
ー−リップ)を用いて豫数対応づけ(Prolog テ
ldユニフィケーシコンと呼ぶ)を行い×として、チュ
ーリップがめられる。 更に結果が要求されると、同様なプロセスを経て(花、
朝顔)を第1の処理装置」から貰い、×として朝顔をめ
る。 次に、全ての答を出すモードについて説明する。 この場合には第1の処理装置1から(花、チューリップ
)、(花、朝顔)を貰い、第2の処理装置2はこれを示
すデータv域を作る(第6図(d)および第7図のステ
ップ32)。 次に第2の処理装置2は(花、チューリップ)を用いて
ユニフィケーションを行い、×としてチューリップをめ
、切に、(花、朝顔)を用いてユニフィケーションを行
い、×として朝顔をめ、×の答としてチー−リップと朝
顔とを出す。 以上のように、本実施例では¥植物、Y色という外部述
語名の述語の実行を第1の処理装置1によシ高速に処理
できる1、また本実施例では、外部述語名が連続してい
たが、連続しない場合も同様に処理できる。 本実が(ツ例はl’r?Kに簡却々例を示したが、外部
述語名として例えは機械酊1訳の辞皆データを対応させ
第1の処理装置1で高速に変換することなどに有効であ
る。 〔発明の効果〕 本発明には性格の異なる述語を他の述語と区別しこれの
実行を別の1仇に高速に惰なわせることによシ述詔論理
プログラムの実行時間を格段に知縮できるという効果が
ある。
[・, argument, ..., argument). When it has the form P, Q, R,... as predicates,
The assertion is P. Q. It is 1 in the form R1, which means that the predicates P, Q, and R are faithful. Also, the rule is P knee Q, It. It is written in the form , and when both predicate Q and general are true, it means that predicate P is true. Also, the alignment (comm5Lnd) is knee P, Q, R,. It has the form , and indicates that the predicates P, Q, and R are all direct. Figure 1 shows the first example of a fact and rule program, and 2
Figure 2 shows the adjustment program and output results for the facts, denials, and rules in Figure 1. The program example shown in Figure 1 is a simple one, but what about a more specific application program? It is God. For example, as in the second example shown in FIG. 3, when W5 introduces predicates such as plants and animals, the number of programs increases enormously. At this time, when the rule shown in the chain diagram 3 executes the predicate, a process is performed to search for data that satisfies these conditions from the eyebrows. [Ke: Next technology] This process is executed by a conventional predicate logic program 1
Accommodation (for example, DECSystem-10 Prolog by De Wallen et al. of Nishinburgh University, UK: Pere
iraru, , Pereira, F., and Wa.
rren, D., ``U-set's Guide
to DECSystem-10Prolog”. Dept, AI Re5earch, Edinburgh
gh Univ, 1978) has the disadvantage that it requires a large amount of execution memory and execution time because it is achieved by a unification mechanism. [Object of the Invention] An object of the present invention is to provide a predicate logic program execution device that solves these drawbacks and processes a predicate logic program as shown in FIG. 3 at high speed. [Structure of the Invention] The device of the present invention includes a storage means for storing a predicate logic program consisting of a predicate name and an argument that can distinguish between a first type of predicate name and a second type of predicate name. and a first processing means for processing a predicate of a first type of predicate name supplied and outputting one or more processed seeds at a time, and a first type of predicate name supplied from the storage means. and a predicate having a second type of predicate name, supplying the predicate having the first type of predicate name to the first processing means, and supplying the processing result from the first processing means. and a second processing means for processing the predicate having the second type of predicate name. [Example] Next, an example of the present invention will be described in detail with reference to page 1. FIG. 5 is a block diagram showing one embodiment of the present invention.
The predicate logic program execution device shown in FIG.
(described later) and passes the execution results in sequential format or batch note format, and executes the predicate of the internal predicate name (described later) from the first processing bag N1 that receives the execution result from the first processing bag fil. It is composed of a second processing device 2 that performs the processing, and a storage device 3 that stores the predicate program. In this embodiment, predicates indicating facts that are often talked about as shown in FIG. 3 are stored in the first processing device l. This first processing device 1 executes predicates such as plants (flowers, (For example, Earl Nibstein: Epstein, R.
,,et,al,:the IDM500-Commu
nication l5sues with Back
-end Processors, COMPCON, P
P., 112-114° 1981). Therefore, the predicates stored in the first processing device 1 are distinguished as external predicate names, and the rules shown in FIG. 3 are expressed as rejection rules shown in FIG. 4. That is, in FIG. 4, external predicate names are distinguished by predicate names starting with Y. The first processing device 1 executes a predicate consisting of a predicate name and a plurality of parameters, and performs processing to quickly find a parameter pair that satisfies this predicate. realizable. Unlike the conventional relational algebra @q4 system, if there are several results that satisfy the predicate, control outputs parameter pairs one by one in a sequential format in order to perform execution efficiently. A function is provided to control parameter pairs to be put into a list format, which will be described later, and output in a batch format.゜The second processing device 2 is composed of a normal Pholog program processing device,
Regarding the execution of the external predicate name, the execution result is obtained from the first processing bag w1 in a sequential format or a -talk format, and the predicate of the internal predicate base is executed using it. The storage device 3 stores predicate logic type programs and is composed of a main memory device of eight general-purpose devices. Next, the operation of this embodiment will be explained using a specific example. Assume that the Prolog program shown in Fig. 4 is subjected to make-up knee-like (fat section, ×), and the third rule in Fig. 4 is executed.
Figure 6 shows changes in the data area used to control execution, Figure 7
The figure shows an operation flow diagram corresponding to FIG. First, the second processing device 2 secures a data area for the predicate of its choice (bold section, x) and moves to execution of the predicate on the right side (step 10 in FIGS. 6(a) and 7). Similarly, the data area for executing the predicate f plant (flower, ×) is secured in step 20 of FIGS.
) Detects that the predicate name (flower, ×) is an external predicate name. Next, when we look at the following predicate, it becomes one color (×, red), and similarly, because it is a predicate with an external predicate name, ¥ plant (flower, ×) and γ color (×, red) are combined. The execution request is made to the first processing device 1 including the execution of the predicate. First processing] Device 1 first executes the child plant (flower,
We get three results: Next, we move on to the execution of the Y color (x, red), which is the first result of the lid cover (flower, ×) (flower,
η), and by mapping the variables ×, × is determined to be η, and Y
We will verify whether the colors (chrysanthemum, red) match the facts. As a result of the necessary verification of the Jingeihon Sashisha Makiban, it was found that the requirements were not met. Next, moving on to (flower, tulip), a similar verification is performed, and since (chee-lip, red) exists,
test RIl] is established. Similarly, this is also done for (flower, morning glory), and it is verified that it holds true. As a result, the first
As a result of ``processing equipment'', (flowers, chee-lips) and (
Two parameter pairs (flower, morning glory) are determined and passed to the second processing device 2. The second processing device 2 receives this result from the first processing device 1 and continues processing, but there are two types of responses to the PHolog program's queries: a mode in which only one answer is given, and a mode in which all answers are given. , the execution behavior differs depending on its format. First, we will explain the mode in which only one answer is produced (3).
, and the second processing device 2 creates a data area representing this (step 31 in FIG. 6(C) and FIG. 7). Next, the second processing device 2 uses the first data (flower, chee-lip) to make a tulip correspondence (referred to as Prolog teld unificacon), and finds a tulip as an x. If further results are required, a similar process (flower,
A morning glory) is received from the first processing device, and a morning glory is received as an x. Next, the mode that gives all answers will be explained. In this case, the first processing device 1 receives (flower, tulip) and (flower, morning glory), and the second processing device 2 creates a data area v indicating this (Fig. 6(d) and 7). Step 32 in the figure). Next, the second processing device 2 performs unification using (flower, tulip), places a tulip as ×, performs unification using (flower, morning glory), uses morning glory as ×, and unifies ×. As an answer, I give Chee Lip and Morning Glory. As described above, in this embodiment, the first processing device 1 can execute the predicates with external predicate names such as \Plant and Y color at high speed. However, it can be processed in the same way even if they are not consecutive. A simple example was shown in l'r?K, but for example, the external predicate name corresponds to the data translated by machine drunkenness 1, and the first processing device 1 converts it at high speed. [Effects of the Invention] The present invention has a method for improving a predicate logic program by distinguishing predicates with different characteristics from other predicates and having another predicate execute the predicates at high speed. This has the effect of significantly reducing execution time.

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

第1図は、Prologプログラムの事実と規則の第1
の例を示す図、第2図は第1の例のP1′・010gプ
ログラムの間合ゼの例を示す図、第3図は21010g
プログラムの事実と規則の第2の例を示す図、第4図U
本発明の一笑施、例で用いるPrologプログラムの
事実と規則の例を示す図、第5図は本発明の一火施例を
示すブロック図、第6図(a)〜(d)はProlog
プログラムを実行する時のデータ領域を示す概念図、柁
7図は第6図に対応する動作フローを示す図である。 1・・・・・・第1の処理装置、2・・・・・・第2の
処到′装置、3・・・・・・記憶装置。 第21 凹 第 2 図 第3 閃 乎74 図 攬6− 図 第6 図 (a ) (b ) (C) 巖’712!1 1す 2.7
Figure 1 shows the first set of facts and rules for the Prolog program.
Figure 2 is a diagram showing an example of the timing of the P1'/010g program in the first example, Figure 3 is a diagram showing an example of the 21010g program.
A diagram showing a second example of program facts and rules, Figure 4U
Figure 5 is a block diagram showing an example of the Prolog program used in the example, and Figures 6(a) to 6(d) are Prolog program examples.
A conceptual diagram showing a data area when a program is executed, FIG. 7 is a diagram showing an operation flow corresponding to FIG. 6. 1...First processing device, 2...Second processing device, 3...Storage device. 21st concave 2nd figure 3rd figure 74 figure 6- figure 6 figure (a) (b) (C) Iwao'712!1 1s2.7

Claims (1)

【特許請求の範囲】 第1の種類の述語名と第2の種類の述語名とを区別でき
る述語名と引数とからなる述記診胛プログラムを格納す
る格納手段と、 供給される第1の種類の述語を処理し一度に一つ以上の
処理結果を出力する第1の処理手段と、記第゛1の種類
の述語名の述語を前記第1の処理1手段に伊2給し、前
記第1の処理手段から前翫“処P)結果の供給友うけ前
記第2の種類の述語名の述語の処理を行表う第2の処理
手段とを含むことを植機とする述語論理プログラム実行
装置1゜
[Scope of Claims] Storage means for storing a predicate diagnosis machine program consisting of predicate names and arguments that can distinguish between a first type of predicate name and a second type of predicate name; a first processing means for processing predicates of a type and outputting one or more processing results at a time; and a second processing means for receiving the result from the first processing means and processing the predicate having the second type of predicate name. Execution device 1゜
JP1773484A 1984-02-03 1984-02-03 Predicate logical program execution device Pending JPS60163132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1773484A JPS60163132A (en) 1984-02-03 1984-02-03 Predicate logical program execution device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1773484A JPS60163132A (en) 1984-02-03 1984-02-03 Predicate logical program execution device

Publications (1)

Publication Number Publication Date
JPS60163132A true JPS60163132A (en) 1985-08-26

Family

ID=11951973

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1773484A Pending JPS60163132A (en) 1984-02-03 1984-02-03 Predicate logical program execution device

Country Status (1)

Country Link
JP (1) JPS60163132A (en)

Similar Documents

Publication Publication Date Title
Hudak et al. Serial combinators:" optimal" grains of parallelism
WO1989001203A1 (en) Mimd computer system
JPS60163132A (en) Predicate logical program execution device
Treleaven et al. A multi-processor reduction machine for user-defined reduction languages.
JPS6219940A (en) High-speed processing system for inference
Hesselink Wait-free linearization with a mechanical proof
JP2585780B2 (en) DO loop optimization processing method for input / output library
JPH0328933A (en) Task control method
JP3140442B2 (en) Data processing device
JPS6063640A (en) Predicate logical type program processor
Runciman Modula and a vision laboratory
Zuenko et al. Joint Application of Constraint Propagation and Structural Decomposition Methods for A Priori Analysis of SPARQL Queries
JP2601541B2 (en) FORTRAN input / output list processing method
JPH04287121A (en) Tuple space system
JPH01166223A (en) Information processing system
JPS60142744A (en) Multiple language processing system
JPS6020275A (en) Simple programming system of multiprocessor
Di Vito et al. The deductive theory manager: a knowledge based system for formal verification
JPH0799499B2 (en) Information processing equipment
JPS6361366A (en) Cad system
JPH0713962A (en) Compiler device
CA2010268A1 (en) Parallel computer architecture
JPH03208136A (en) Debug device for parallel logical language
JPS60195644A (en) Information processor
JPH04209026A (en) Rule inference device