JPS63138428A - Output method for logical variable - Google Patents

Output method for logical variable

Info

Publication number
JPS63138428A
JPS63138428A JP28430986A JP28430986A JPS63138428A JP S63138428 A JPS63138428 A JP S63138428A JP 28430986 A JP28430986 A JP 28430986A JP 28430986 A JP28430986 A JP 28430986A JP S63138428 A JPS63138428 A JP S63138428A
Authority
JP
Japan
Prior art keywords
logical
variable
variables
name
data
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
JP28430986A
Other languages
Japanese (ja)
Inventor
Tetsuya Masuishi
哲也 増石
Yoichi Takeuchi
洋一 竹内
Tadashi Hirose
広瀬 正
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 JP28430986A priority Critical patent/JPS63138428A/en
Publication of JPS63138428A publication Critical patent/JPS63138428A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To preserve a logical variable name and to realize output of an item including a variable by using a means to store the logical variable names and a means to check the different logical variables of the same name and outputting these logical variables with serial numbers put after the variable names. CONSTITUTION:A node memory part 101 stores the nodes described in a logical language and a processing part 102 interprets the nodes stored in the part 101 with use of a terminal equipment 103 provided in a computer 100. Then, an area is provided to a data structure 200 which expresses a logical variable to hold the name (variable name) given from a user. Thus, the different variables having the same name are checked out of those variables in an output item and then outputted with serial numbers put after the variable names. Otherwise the variable names are outputted. Thus, it is possible to output the variables having different nodes and the same name as the different variables.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、fjift理型言語の出力機能に係り、特に
論理変数名を保存したかたちで表示するのに好適な、論
理変数の出力方法に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to the output function of the fjift logical language, and in particular to a method for outputting logical variables suitable for displaying logical variable names in a preserved form. .

〔従来の技術〕[Conventional technology]

従来、プロローグなどの論理型言語においては。 Traditionally, in logical languages such as prolog.

論理変数を表示ないし出力するときに、その論理変数の
名前を保存することができず、たとえば。
For example, when displaying or printing a logical variable, it is not possible to save the name of the logical variable.

Prologプログラミング、日本コンビエータ協会(
1983)第147頁に記載のように6番号をもちいて
表示ないし出力されていた。たとえば、ユーザが、p(
X)と入力した項を出力すると。
Prolog programming, Japan Combiator Association (
1983), it was displayed or output using the 6 number as described on page 147. For example, if a user p(
When the input term is output as X).

p(−13’5)のように出力されていた。It was output as p(-13'5).

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記従来技術は、論理変数にユーザがつけた名前を出力
する点に配慮がされていないため、ユーザが意味を持た
せるためにつけた変数名が失われて、意味のない名前t
−表示してしまうという問題点がめった。
The above conventional technology does not take into account the fact that the names given by the user to the logical variables are output, so the variable names given by the user to give them meaning are lost, resulting in meaningless names.
-I rarely had the problem of it being displayed.

本発明の目的は、ユーザがつけた名前を保存して、論理
変数を出力する方法を提供することにある。
An object of the present invention is to provide a method for saving names given by the user and outputting logical variables.

〔問題点を解決するための手段〕[Means for solving problems]

上記目的は、−理変数を表現するデータ構造に。 The above purpose is - to create a data structure that represents physical variables.

ユーザがつけた名前(f数名)を保持する領域をもうけ
1項を出力するときに、その項のなかに含まれる変数に
ついて、異なる変数で同じ名前をもつものをチェックし
、これについては変数名のあとに連番をつけて出力し、
それ以外のものは、変数名を出力することにより達成さ
れる。
When you create an area to hold the name given by the user (f number name) and output one term, check whether different variables have the same name among the variables included in that term, and Output with a sequential number after the name,
Everything else is accomplished by printing the variable names.

〔作用〕[Effect]

便数の名前を記憶する領域は、5−−ザがつけた変数名
を記憶するためのものである。異なる変数で同じ変数名
をもつものには、変数名に連番をつけることにより、異
なる節で同じ名前をつけた変数についても、異なる変数
として出力することができる。
The area for storing the name of the flight number is for storing the variable name assigned by 5--the. By assigning consecutive numbers to different variables that have the same variable name, variables with the same name in different sections can be output as different variables.

〔実施例〕〔Example〕

以下では0本発明の一実施例を第1図〜第4図を用いて
説明する。
An embodiment of the present invention will be described below with reference to FIGS. 1 to 4.

第1図は1本発明のi能構成の一例を示し良ものである
。節記憶部101は、!11理型言語で記述された節を
記憶する。処理部102は0節記憶部に記憶されている
節を解釈実行する。節記憶部101と処理部102は、
計算機100内に構成され、端末装置103を用いて利
用される。
FIG. 1 shows an example of the i-function configuration of the present invention. The clause storage unit 101 is! 11 Memorize clauses written in logical language. The processing unit 102 interprets and executes the clauses stored in the 0 clause storage unit. The clause storage unit 101 and the processing unit 102 are
It is configured within the computer 100 and used using the terminal device 103.

第2図は、p(X、5(Y))と出力される項を1節記
憶部101内で記憶するデータ構造の一例である。デー
タ構造200は、上記の項の全体を表現している。デー
タ201は0項の関数子の名前がpであることを表現し
ている。データ201は0項の引数の数が2であること
を表現している。
FIG. 2 is an example of a data structure in which a term output as p(X, 5(Y)) is stored in the one-section storage unit 101. Data structure 200 represents the entirety of the above terms. Data 201 expresses that the name of the 0-term functor is p. Data 201 represents that the number of zero-term arguments is two.

データ200とデータ201とから、データ構造200
が表現している項は、関数子の名前がpで。
From data 200 and data 201, data structure 200
The term expressed by is the name of the functionor p.

引数は2個あることがわかる。データ203は。Notice that there are two arguments. The data 203 is.

この項の第1引数は、変数であることを表現し。The first argument of this term represents a variable.

゛ データ204は、その変数名はXであることを表現
している。undefは、あらかじめ決められた記号で
、変数であることを意味する。データ205とデータ2
06から、この項の第2引数は、関数子の名前がSで引
数が1個の項であることがわかる。データ207とデー
タ208とから、この第゛2引数である項の引数(1個
しかない)は、変数で、Yという変数名をもつことがわ
かる。
゛ The data 204 expresses that the variable name is X. undef is a predetermined symbol and means a variable. data 205 and data 2
06, it can be seen that the second argument of this term is a term in which the name of the functionor is S and there is one argument. From data 207 and data 208, it can be seen that the second argument (there is only one) is a variable and has the variable name Y.

第3図のデータ構造300は、 p (q ta、 Y
The data structure 300 in FIG. 3 is p (q ta, Y
.

r (X) )、 X)と出力される項を記憶するデー
タ構造の一例である。第2図の例と異なシ、同じ変数が
2ケ所に現われている。データ301から、この項は、
関数子の名前がp、引数が2個の項であることがわかる
。データ302から、この項の第1引数は、関数子の名
前がqで、引数が3個の項であることがわかる。データ
303から、この第1引数である項の第1引数は、aと
いうアトム(引数のない項)であることがわかる。デー
タ304から、第1引数の項の第2引数は、変数名がY
の変数であることがわかる。データ305から、第1引
数の項の@3引数は、関数子の名前がrで引数が1個の
項であることがわかる。データ306から、この第1引
数の第3引数である項の引数(ひとつしかない)は、変
数名Xの変数であることがわかる。データ302.デー
タ303゜データ304.データ305.データ306
とで。
This is an example of a data structure that stores terms output as r (X) ), X). Unlike the example in Figure 2, the same variable appears in two places. From the data 301, this term is
It can be seen that the name of the functionor is p and the arguments are two terms. From the data 302, it can be seen that the first argument of this term is a term whose functionor name is q and whose arguments are three. From the data 303, it can be seen that the first argument of the term that is the first argument is an atom a (a term without an argument). From the data 304, the second argument of the first argument term has the variable name Y
It can be seen that the variables are From the data 305, it can be seen that the @3 argument of the first argument term is a term in which the function name is r and there is one argument. From the data 306, it can be seen that the argument (there is only one) of the term, which is the third argument of this first argument, is a variable with variable name X. Data 302. Data 303゜Data 304. Data 305. data 306
With.

この項の第1引数を表現している。データ307は、こ
の項の第2引数は、データ306と同じであることを示
している。5hareは、あらかじめ決められた記号で
あり、その値が別の値と同じ(ユニファイされている)
ことを示す。5hareの次には、その値とユニファイ
する値のアドレスを指すポインタが格納される。この場
合、データ306の先頭アドレスを指している。
It represents the first argument of this term. Data 307 indicates that the second argument of this term is the same as data 306. 5hare is a predetermined symbol whose value is the same as another value (unified)
Show that. After 5hare, a pointer pointing to the address of the value to be unified with that value is stored. In this case, it points to the start address of data 306.

第4図は、第2図と第3図で示した項をユニファイした
状態を表現するデータ構造である。データ構造400は
第2図の項、データ構造401は第3図の項を表現して
いる。データ402により。
FIG. 4 shows a data structure representing a state in which the terms shown in FIGS. 2 and 3 are unified. Data structure 400 represents the terms in FIG. 2, and data structure 401 represents the terms in FIG. By data 402.

データ構造4000項の第1引数は、データ構造401
の項の第1引数とユニファイされていることが表現され
ている。データ403により、データ構造400の項の
第2引数と、データ構造401の項の第1引数の第3引
数の第1引数がユニファイされていることが表現されて
いる。データ307により、データ構造401の項の第
2引数と、第1引数の1%3引数の第1引数がユニファ
イされているので、データ構造400の第2引数とデー
タ構造401のWI2引数はユニファイされている。
The first argument of the data structure 4000 item is the data structure 401
It is expressed that it is unified with the first argument of the term. Data 403 expresses that the second argument of the data structure 400 term, the first argument, the third argument, and the first argument of the data structure 401 term are unified. The data 307 unifies the second argument of the term in the data structure 401 and the first argument of the 1%3 argument of the first argument, so the second argument of the data structure 400 and the WI2 argument of the data structure 401 are unified. has been done.

第3図のようにユニファイされた項には、同じ名前をも
つ異なる変数が存在する。すなわち、データ404とデ
ータ405である。処理部102では、このように、同
じ名前をもつ異なる変数を含む項を出力する際には、変
数名のあとに連番をつける。第4図の例を出力すると。
Different variables with the same name exist in unified terms as shown in FIG. That is, data 404 and data 405. When the processing unit 102 outputs a term including different variables having the same name, it adds a serial number after the variable name. If you output the example in Figure 4.

p (q (a、 Yl、 r (s (Y2J))、
 s (Y2))のように出力される。
p (q (a, Yl, r (s (Y2J)),
s (Y2)).

本実施例によれば、同じ名前をもつ異なる論理変数を含
む項をユニファイした場合にも、論理変数名を保存して
出力することができるので、ユーザにとって見やすい出
力結果をえることができるという効果がある。
According to this embodiment, even when terms that include different logical variables with the same name are unified, the logical variable names can be saved and output, so the user can obtain output results that are easy to read. There is.

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

本発明によれば、ユーザがつけた論理変数名を保存して
、変数を含む項を出力することができるので、ユーザに
わかりやすい出力結果をえることができるという効果が
ある。
According to the present invention, the logical variable names assigned by the user can be saved and terms including the variables can be output, so that the user can obtain output results that are easy to understand.

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

第1図は本発明を実現するシステムのブロック構成図、
第2図および第3図は、第1図の節記憶部で1項を記憶
するデータ構造の一例を示した図。 第4図は第2図の項と第3図の項をユニファイしたとき
のデータ構造の一例を示した図でらる。 第10
FIG. 1 is a block diagram of a system that realizes the present invention.
2 and 3 are diagrams showing an example of a data structure for storing one term in the clause storage section of FIG. 1. FIG. FIG. 4 is a diagram showing an example of a data structure when the terms in FIG. 2 and the terms in FIG. 3 are unified. 10th

Claims (1)

【特許請求の範囲】[Claims] 1、論理型言語における節を記憶する手段と、これを用
いて言語処理を行なう手段を有する論理型言語処理装置
において、論理変数名を記憶する手段と、同じ名前の異
なる論理変数をチェックする手段をもうけ、同じ名前の
異なる論理変数については、変数名のあとに連番をつけ
て出力することを特徴とする、論理変数の出力方法。
1. In a logical language processing device having means for storing clauses in a logical language and means for performing language processing using the same, means for storing logical variable names and means for checking different logical variables with the same name. A method for outputting logical variables, which is characterized in that, for different logical variables with the same name, a sequential number is added after the variable name.
JP28430986A 1986-12-01 1986-12-01 Output method for logical variable Pending JPS63138428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28430986A JPS63138428A (en) 1986-12-01 1986-12-01 Output method for logical variable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28430986A JPS63138428A (en) 1986-12-01 1986-12-01 Output method for logical variable

Publications (1)

Publication Number Publication Date
JPS63138428A true JPS63138428A (en) 1988-06-10

Family

ID=17676869

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28430986A Pending JPS63138428A (en) 1986-12-01 1986-12-01 Output method for logical variable

Country Status (1)

Country Link
JP (1) JPS63138428A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193181A (en) * 2008-02-13 2009-08-27 Meidensha Corp Software development support system and method, and program for the method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009193181A (en) * 2008-02-13 2009-08-27 Meidensha Corp Software development support system and method, and program for the method

Similar Documents

Publication Publication Date Title
KR920001320A (en) Method and apparatus for manipulating data in internal registers in a reduced instruction set processor
JPS63138428A (en) Output method for logical variable
JPS59178544A (en) Memory access circuit
US4984176A (en) VDH biocomputer
JPS61246839A (en) Program diagram generating device
JPS61168070A (en) Device for inputting address in kanji
JPS617874A (en) Display unit
JPH1194920A (en) Pattern generator for semiconductor testing device
JP3553093B2 (en) Data file system
SU1702367A1 (en) Instructions unpacking device
JPH0731315Y2 (en) Electronics
JPH0239240A (en) Program display method
JPS6319049A (en) File capacity display system
JPS62169241A (en) Medium integrating file system
JPH0212296A (en) Specified type character display device
JPS59202539A (en) Table graph converter
JPH02257282A (en) Table preparation processor
JPH0337886A (en) Memory write control circuit
JPH02206861A (en) State transition table preparing device
JPH04365096A (en) Character pattern generator
JPH0231278A (en) Data processor
JPS6225786A (en) Reader for memory
JPS62189581A (en) Interactive graphic processing method
JPH02270027A (en) Storage system for variable
JPS6134628A (en) Computer provided with tag