JPS61115138A - Copying method of data structure of list format in program - Google Patents

Copying method of data structure of list format in program

Info

Publication number
JPS61115138A
JPS61115138A JP23662884A JP23662884A JPS61115138A JP S61115138 A JPS61115138 A JP S61115138A JP 23662884 A JP23662884 A JP 23662884A JP 23662884 A JP23662884 A JP 23662884A JP S61115138 A JPS61115138 A JP S61115138A
Authority
JP
Japan
Prior art keywords
list
data structure
variable
tag
copy
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
JP23662884A
Other languages
Japanese (ja)
Inventor
Hidekazu Matsumoto
松本 秀和
Tadaaki Bando
忠秋 坂東
Shinichiro Yamaguchi
伸一朗 山口
Kenji Hirose
広瀬 健二
Hiroaki Nakanishi
宏明 中西
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 Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Engineering Co Ltd
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 Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Engineering Co Ltd
Priority to JP23662884A priority Critical patent/JPS61115138A/en
Publication of JPS61115138A publication Critical patent/JPS61115138A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To improve the recording efficiency and performance by equipping a tag for showing that a variable is included in a data structure and that for showing that a variable is excluded in the data structure and discriminating the data structure without a variable. CONSTITUTION:A source program stated at a prologue is compiled and stored in a code area (CODE) in a memory M in a table format. An interpreter reads the CODE for accumulating a result outputted from the compiler to execute the prologue and uses a copy area (COPY) for copying a list, etc., such as a stack area (STK) and a structure as a work area at the time of executing a program. An area in the memory M is used for the STK and COPY. In addition to the interpreter system that an interpreter reads and executes the result converted into a table format, such a compiler system can be applicable that a compiler generates directly a machine language and executes it. Thus factors on a list followed by a variable appearing latest need not be copied, whereby memory capacity and the number of memory access circuits can be reduced.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、プロローグ(PLOLOG)の如き導出原理
に基づく述語論理型プログラミング言語の処理方法、特
にプログラム内に出現するリスト形式のデータ構造の構
造体コピー方法に関する。
[Detailed Description of the Invention] [Field of Application of the Invention] The present invention relates to a method for processing a predicate logical programming language based on a derivation principle such as a prologue (PLOLOG), and in particular to a structure of a list-format data structure that appears in a program. Concerning copying methods.

〔発明の背景〕[Background of the invention]

フォートラン(FORTRAN)に代表されるよう外手
続きを主体としてプログラミング記述される言語系では
、プロシジャとデータとが分離して扱われる。一方、P
LOLOGの如き導出原理に基づく述語論理をプログラ
ミング言語では、データ自身を評価することによって処
理が進められる。
In language systems, such as FORTRAN, in which programming is mainly written using external procedures, procedures and data are handled separately. On the other hand, P
In a programming language using predicate logic based on a derivation principle such as LOLOG, processing proceeds by evaluating the data itself.

PLOLOGにライズは、例えば、rW、F。Rise to PLOLOG, for example, rW, F.

(::tocks in C,S、 Me l l i
sh共著Springer−Verlag Berli
n )(eldelberg Qemany(1981
)Jに詳しく記載されている。
(::tocks in C,S, Me l l i
Sh co-author Springer-Verlag Berli
n ) (Eldelberg Qemany (1981
) is described in detail in J.

PLOLOGの実行は、ユニフィケーションとバンクト
ラックによって行う。この処理系にあっては、例えば、
 rD、 H,D Wa r ren署、■mp 1 
emen t a−ting  Plolog−Com
piling  PredicateLogtc pr
ograms、voz 1,2、DAI  Re5ea
rchRel)Ort、A39.40. Univer
sity of Edinburgh(1977)Jに
詳述されている。
PLOLOG is executed by unification and bank track. In this processing system, for example,
rD, H, D Warren station, ■mp 1
ement a-ting Plog-Com
piling PredicateLogtc pr
ograms, voz 1,2, DAI Re5ea
rchRel) Ort, A39.40. Univer
City of Edinburgh (1977) J.

第2図、第3図はPLOLOGで記述されたプログラム
の一例を示す。第2図はancestor (祖先)の
定義を示す。ここで、大文字x、y、z変数を示す。プ
ログラムは、記号″″ニーで区切られた右辺と左辺から
成り、右辺が成立すると左辺が成立する関係となる。第
2図■では、変数Xと変数Yの間に、XがYのpare
nt  (親)であれば(右辺)、XはYのances
tor (祖先)である(左辺)ことを表わしている。
FIGS. 2 and 3 show an example of a program written in PLOLOG. Figure 2 shows the definition of ancestor. Here, capital letters x, y, z indicate variables. The program consists of a right side and a left side separated by the symbol ``'' knee, and the relationship is such that when the right side holds true, the left side holds true. In Figure 2 ■, between variable X and variable Y, there is a pare between X and Y.
If nt (parent) (right side), then X is the ances of Y
tor (ancestor) (left side).

第2図■で、′、′で区切られた2つの項Parent
 (X * Z )とancestor (Z + Y
 )とは、アンド条件にあると考えてよい。即ち、第2
図■は、XがZのparentで、ZがYのances
torであれば(右辺)、XはYのancestorで
おる(左辺)ことを示している。
In Figure 2 ■, the two terms Parent separated by ′, ′
(X * Z) and ancestor (Z + Y
) can be thought of as an AND condition. That is, the second
In Figure ■, X is the parent of Z, and Z is the ances of Y.
If it is tor (right side), then X is the ancestor of Y (left side).

第3図は左辺にリスト型式のデータ構造を含むプログラ
ムの一節(clause )を示す。リスト形式のデー
タ構造とは、複数のデータがポインタで連結された構造
から成゛るもので、第3図で1〔”。
FIG. 3 shows a program clause that includes a list-type data structure on the left side. A list-format data structure is a structure in which multiple pieces of data are linked using pointers, and is indicated by 1 ['' in Figure 3.

“〕”で囲まれた部分、即ち”(e、x、d、c)”の
部分が相当する。尚、第3図でa、gは述語名を意味す
る。更に、このリストは、リスト処理言語LISPと同
様でるり、リストの内部表現形式は、例えば「中西正和
著、LISP入門、近代科学社、1977Jに詳述され
ている。
The part surrounded by "]", that is, the part "(e, x, d, c)" corresponds. In addition, a and g in FIG. 3 mean predicate names. Furthermore, this list is similar to the list processing language LISP, and the internal representation format of the list is described in detail in, for example, Masakazu Nakanishi, Introduction to LISP, Kindai Kagakusha, 1977J.

リスト形式のデータ構造内に変数が含まれる場合、変数
に対して特別の配慮が必要となる。一般に1つの節はい
くつかの質問から呼出されて実行されるが、その場合に
前記節円にリスト形式のデータ構造が含まれ、且つ前記
データ構造内に変数が含まれる場合には、前記変数には
各々の呼出しに応じて別々の格納エリアが必要となる。
Variables require special consideration when they are included in a list-like data structure. Generally, one clause is called and executed from several questions, but in that case, if the clause contains a list-format data structure and the data structure contains a variable, the variable requires a separate storage area for each call.

このため、PLOLOGの処理系において、構造体、即
ち構造を持ったデータの扱いに2fit類の方式がある
。一方は、構造体処理方式と呼ばれるもので、前述のW
 a r r e nの処理系で採用している方式であ
り、他方は、構造体コピー方式で、構造を待ったデータ
内に変数が含まれる場合に、そのデータ全体のコピーを
作成する方式である。
For this reason, in the PLOLOG processing system, there is a 2fit type method for handling structures, that is, structured data. One is called the structure processing method, which is the W
This is the method adopted by the a r r e n processing system.The other is the structure copy method, which creates a copy of the entire data when a variable is included in the data waiting for the structure. .

構造体コピー方式については、例えば「情報処理学会、
第26回全国大会予稿集、6D−9゜pp55〜56(
1983)Jに詳述されている。
Regarding the structure copy method, for example, "Information Processing Society of Japan,
Proceedings of the 26th National Conference, 6D-9゜pp55-56 (
1983) J.

従来の構造体コピー方式では、リスト形式のデータ構造
に変数が1個でも含まれる場合、その変数を含む前記デ
ータ構造のすべてのコピーを作成していた。従って、前
記データ構造の要素の大部分が定数であっても、変数が
1個でも含まれていれば、それらの定数を含めてすべて
コピーしなければならなかった。
In the conventional structure copying method, if a list-format data structure includes at least one variable, all copies of the data structure including that variable are created. Therefore, even if most of the elements of the data structure are constants, if even one variable is included, everything including those constants must be copied.

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

本発明の目的は、リスト形式のデータ構造のコピーを生
成するに際して、コピー対象となる部分を削減し、メモ
リアクセス回数を低減して記録効率の向上と性能を向上
させてなる構造体コピー方法を提供するものである。
An object of the present invention is to provide a structure copying method that reduces the number of parts to be copied and reduces the number of memory accesses to improve recording efficiency and performance when generating a copy of a list-format data structure. This is what we provide.

〔発明の概要〕[Summary of the invention]

本発明は、リスト形式のデータ構造を指すポインタのタ
グとして、前記データ構造内に変数が含まれていること
を示すタグと、含まれていないことを示すタグとの2種
類を設け、コンパイル時にこれらのタグを使い分けて、
変数を含まないデータ構造をタグによって識別できるよ
うにした点にある。
The present invention provides two types of pointer tags that point to a list-format data structure: a tag that indicates that a variable is included in the data structure, and a tag that indicates that the variable is not included. Use these tags properly,
The point is that data structures that do not include variables can be identified using tags.

〔発明の実施例〕[Embodiments of the invention]

第4図は本発明のプロローグ処理系を示す。プロローグ
で記述されたソースプログラムは、コンパイラでコンパ
イルされてメモリM上のコードエリア(CODE)にテ
ーブル形式で格納される。
FIG. 4 shows the prologue processing system of the present invention. The source program written in the prologue is compiled by a compiler and stored in a code area (CODE) on memory M in a table format.

プロローグの実行は、前記コンパイラより出力された結
果を蓄えるC0DEをインタプリタが解釈して行われる
。インタプリ←りは、プログラムの実行に際してワーク
エリアとして、スタックエリア(STK)及び構造体や
リストなどのコピーを作成するコピーエリア(COPY
)を使用する。
The prologue is executed by an interpreter interpreting C0DE that stores the results output from the compiler. The interpreter uses a stack area (STK) and a copy area (COPY) to create copies of structures, lists, etc. as a work area when executing a program.
).

STK及びC0PYは共にメモリM上のエリアが使用さ
れる。本実施例では、インタプリタがテーブル形式に変
換された結果を解釈、実行するインタプリタ方式を採っ
ているが、コンパイラが直接機械語を生成して、前記機
械語が実行されるコンパイラ方式でも適用できる。
Both STK and C0PY use areas on memory M. Although this embodiment uses an interpreter method in which an interpreter interprets and executes the results converted into a table format, it can also be applied to a compiler method in which a compiler directly generates machine language and executes the machine language.

第5図は、インタプリタINTPと、C0DE。FIG. 5 shows the interpreters INTP and C0DE.

STK、C0PYの各領域の関係を示す。プロローグン
ースプログラムの各節はコンパイラによって節単位にク
ローズテーブルCTと呼ばれる表形式に変換される。プ
ログラムの中のカッコの外にある名前(第2図ではan
cestor、 fatherが該当する)をファンフ
タ名と呼ぶ、コンパイラは各節の左辺のファンフタ塩が
同一のものをまとめて、プロシジャヘッドテーブルPH
Tと呼ばれる表に登録する。構造体やリスト形式のデー
タ構造を持つ節(第3図の例)は、前記データ構造をス
トラフチャテープ/L/STと呼ばれる表形式に変換し
て、該表に対してCTからポインタを結ぶ。これらの表
はコンパイラによってC0DE内に作られる。
The relationship between each area of STK and C0PY is shown. Each clause of the prologue program is converted by a compiler into a tabular format called a close table CT. The name outside the parentheses in the program (in Figure 2, an
cestor, father) is called a fan lid name.The compiler collects the fan lids with the same fan lid salt on the left side of each clause and creates a procedure head table PH.
It is registered in a table called T. For sections that have a data structure in structure or list format (example in Figure 3), convert the data structure into a table format called a structure tape/L/ST, and point to the table from the CT. tie. These tables are created in C0DE by the compiler.

リストや構造体でない節(第7図の■、■)では8Tは
作られない。
8T is not created in clauses that are not lists or structures (■, ■ in Figure 7).

ST内には実行に必要な6雅のスタックが作られる。ロ
ーカルスタックLSには節円に現われる変数が格納され
、コントロールスタックC8内には制御情報が格納され
、トレイルスタックTS内にはバックトラック操作に備
えて、LSに設定された変数のアドレスが格納される。
A stack of six characters necessary for execution is created in the ST. The local stack LS stores variables that appear in the nodal circle, the control stack C8 stores control information, and the trail stack TS stores the addresses of variables set in the LS in preparation for backtracking operations. Ru.

もちろん、スタックの分割方法は他にもあり、その場合
にも、本発明を適用できる。
Of course, there are other methods of dividing the stack, and the present invention can be applied to those cases as well.

C0PYは、プロローグの実行時にC0DE内の構造体
やリスト形式のデータ構造STをコピーする領域として
使用される。このエリア内には、本発明の実施例では3
2ビット以上の整数、浮動小数点数をも格納する。これ
らは、すべてポインタによってLSに結ばれる。
C0PY is used as an area for copying the structure in C0DE and the list-format data structure ST when executing the prologue. Within this area, there are three
It also stores integers and floating point numbers of 2 bits or more. These are all connected to the LS by pointers.

プロローグの実行は、インタプリタによって行われる。Execution of the prologue is performed by the interpreter.

インタプリタは質問(右辺だけから成り、左辺を持たな
い節)が入力されると、該質問と同一のファンク名を持
つ節をC0DE同の表を検索し、同一のファンタ名を持
つ節が存在する場合、該節のカッコ内の引数と前記質問
内の引数とが一致するか、又は一方が変数の場合には値
を代入する。全ての引数について、一部又は代入が行わ
れた場合には前記節の右辺を新たな質問として同様の処
理を実行する。上述した処理はユニフィケーションと呼
ばれ、インタプリタの基本的な処理である。質問と同一
のファンフタ名が存在しない場合、又は引数のいずれか
が不一致であった場合、該ユニフィケーションは失敗す
る。
When the interpreter receives a question (a clause consisting of only the right-hand side and no left-hand side), the interpreter searches the C0DE table for a clause with the same funk name as the question, and finds a clause with the same fanta name. If the argument in parentheses of the clause matches the argument in the question, or if one of them is a variable, assign a value. If a portion or substitution has been made for all the arguments, the same process is executed with the right side of the clause as a new question. The above-mentioned process is called unification, and is the basic process of an interpreter. If the same fan lid name as the question does not exist, or if any of the arguments do not match, the unification will fail.

質問″″qOC″に対して同一の7アンフタ名qを持つ
節”q (y、 Z、 a、 b、 c ]) ニーr
(Y)。
Clause q with the same 7 amphata name q for the question ``qOC'' (y, Z, a, b, c ]) Knee r
(Y).

S■”を考える。この質問及び節ともに引数は1個だけ
で、質問の引数は変数″″X”、節の引数は変数“Y”
、@Z”を含むリスト“(Y、Z、a。
Consider "S". Both the question and the clause have only one argument, the question's argument is the variable ""X", and the clause's argument is the variable "Y".
, @Z” is a list “(Y, Z, a.

b、c〕”であるから、前記リストのコピーが必要とな
る。尚、〔〕はリストを示す。a、b、cは定数(アト
ム)とした。
b, c]'', it is necessary to copy the above list. Note that [] indicates a list. a, b, and c are constants (atoms).

第6図はC0DEとC0PYとの関係を示す図である。FIG. 6 is a diagram showing the relationship between C0DE and C0PY.

第6図で、各テーブル内の各要素は、各6該要素のデー
タ形式を示すタグ部とデータを保持するデータ部とから
成る。タグ”var“は変数を示し、タグ″″atm”
は定数(アトム)を示し、タグ”undf”はC0PY
にコピーされた未バイト変数(未だ値が代入されていな
い変数)を示し、タグ”1st”は該タグを含む要素が
リストへのポインタであり、かつ該リストのデータ構造
内に変数が含まれることを示し、タグclst″は該タ
グを含む要素がリストへのポインタであり、かつ該リス
トのデータ構造内に変数が含まれていな    ゛いこ
とを示す。
In FIG. 6, each element in each table consists of a tag section indicating the data format of the element and a data section holding data. The tag "var" indicates a variable, and the tag ""atm"
indicates a constant (atom), and the tag “undf” is C0PY
Indicates an unbyte variable (a variable to which no value has been assigned yet) copied to , and the tag "1st" indicates that the element containing the tag is a pointer to a list, and the variable is included in the data structure of the list. The tag "clst" indicates that the element containing the tag is a pointer to a list, and the data structure of the list does not contain any variables.

リストの一要素は、Carセルとcdrセルと呼ばれる
2つのセルのペアとして形成される。リスト内の要素は
ポインタで連結されている。carセル、cdrセルと
もにタグを持っており、リストへのポインタを格納する
セルは1st”又は″clst”のタグを持つ。リスト
のある要素にポインタで連結される先のリスト内のいず
れかの要素の中に変数が含まれている場合、前記ポイン
タのタグは”1st’であり、ポインタで連結される先
のリストの全ての要素の中に変数が含まれていない場合
、前記ポインタのタグは@elst”である。第6図に
示すリストでは変数Zがリスト内に含まれる最終の変数
であるから、変数ZのCarセルは、”clst” タ
グを持つポインタである。
An element of the list is formed as a pair of two cells called a Car cell and a cdr cell. Elements in the list are linked by pointers. Both car cells and cdr cells have tags, and cells that store pointers to lists have tags ``1st'' or ``clst.'' If the variable is included in the element, the tag of the pointer is "1st", and if the variable is not included in all the elements of the list linked by the pointer, the tag of the pointer is "1st". is "@elst". In the list shown in FIG. 6, variable Z is the last variable included in the list, so the Car cell of variable Z is a pointer with a "clst" tag.

リストのコピー処理では、前記”clst’  タグを
持つポインタまでコピーが行われ、それ以降のリスト要
素のコピーは行われカい。コンパイラは、リスト中の変
数の位置を調べ、変数が含まれているリストへのポイン
タには’1st”のタグを付加し、変数が含まれないリ
ストへのポインタは、”clst” のタグを付加する
In list copy processing, copying is performed up to the pointer with the above-mentioned "clst" tag, and subsequent list elements are not copied.The compiler checks the position of the variable in the list and checks if the variable is included. A tag of '1st' is added to a pointer to a list that contains variables, and a tag of 'clst' is added to a pointer to a list that does not include variables.

第1図はリストのコピーを行う処理フローを示す。処理
610ではC0DEからCarセルを読出し、処理62
0で該carセルをC0PYに書込む。処理630では
C0DEからcarセルを読出す。処理640では該c
drセルのタグが′″clst”であるか判定し、Yl
lil:8では処理670に、NOでは処理650に分
岐する。処理650では、前記cdrセルがリストの終
了を示しているか、又は更にリストが続くかをタグ部で
判定し、更にリストが続く(タグが1st)場合には処
理660に、リストが続かない場合は処理680に分岐
する。処理660では、前記cdrセルのタグ部をその
ままにしてデータ部を次にC0PYに書込むcarセル
のアドレスに変更してC0PYに書込み、処理610に
戻ることにより、更にリスト内要素のコピー処理を進め
る。処理670では、読出したcdrセルをC0PYK
書込み、終了する。処理680では、読出したcdrセ
ルをC0PYに書込み、終了する。
FIG. 1 shows a processing flow for copying a list. In process 610, the Car cell is read from C0DE, and in process 62
Write the car cell to C0PY with 0. In process 630, the car cell is read from C0DE. In process 640, the c
Determine whether the tag of the dr cell is ``clst'' and select Yl
If lil:8, the process branches to process 670, and if NO, the process branches to process 650. In process 650, the tag part determines whether the cdr cell indicates the end of the list or whether the list continues. If the list continues (the tag is 1st), the process goes to process 660; if the list does not continue, the process goes to process 660. Branches to process 680. In process 660, the tag part of the cdr cell is left as is, the data part is changed to the address of the car cell to be written next to C0PY, and the address is written to C0PY, and the process returns to process 610, thereby further copying the elements in the list. Proceed. In process 670, the read cdr cell is converted to C0PYK.
Write and exit. In process 680, the read cdr cell is written to C0PY, and the process ends.

リスト構造のコピー方式を第7図、第8図で説明する。A list structure copy method will be explained with reference to FIGS. 7 and 8.

第7図及び第8図はクローズテーブル(CT)とストラ
フチャテーブル(ST)との関係を示している。CT内
には引数に対応して、前記引数を表わすセルが置かれる
。引数がリストの場合には、前記リストに対応する8T
が作られる。
FIGS. 7 and 8 show the relationship between the close table (CT) and the structure table (ST). Cells representing the arguments are placed in the CT in correspondence with the arguments. If the argument is a list, 8T corresponding to the list
is made.

また、該STを指すポインタがCT内のセルに置かれる
Also, a pointer pointing to the ST is placed in a cell within the CT.

第7図は、前記構造体が変数を含む場合のSTとポイン
タの関係を示している。CT内のセルに置かれた前記ポ
インタは、該ポインタが指すリストのST以降のリスト
の要素内に少くとも1つ以上の変数を含むリストである
ことを示すタグ1stを持つ。インタプリタは、変数と
前記リストのユニフィケーションに於いて、前記タグ1
stにより、前記リスト内に変数が含まれていることを
認識して、第1図で示される前記リストのコピー処理を
行う。
FIG. 7 shows the relationship between ST and pointers when the structure includes variables. The pointer placed in a cell in CT has a tag 1st indicating that the list pointed to by the pointer is a list containing at least one variable in an element of the list after ST. The interpreter, in the unification of the variable and the list,
st, it is recognized that a variable is included in the list, and the copy process of the list shown in FIG. 1 is performed.

第8図はリスト内に変数を含まない場合の前記リストの
STと該STを指すポインタの関係を示している。前記
ポインタは、前記ポインタが指すリストのST以降のリ
スト内要素に変数を含まな ′いことを示すタグcls
tを持つ。インタプリタは、ユニフィケーションにおい
て、前記タグclstによυリスト内に変数が含まれて
いないことを認識し、前記リストのコピー処理は行わな
い。
FIG. 8 shows the relationship between the ST of the list and the pointer pointing to the ST when the list does not include any variables. The pointer has a tag cls indicating that the list elements after ST of the list pointed to by the pointer do not include variables.
have t. During unification, the interpreter recognizes that no variable is included in the υ list based on the tag clst, and does not copy the list.

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

本発明によれば、変数を含むリスト形式のデータ構造の
コピー処理において、最後に現われた変数以降のリスト
内要素のコピーが不要となるため、記憶容lトを削減で
き、メモ゛リアクセス回数をも削減できた。
According to the present invention, when copying a list-format data structure that includes variables, it is not necessary to copy the elements in the list after the last variable that appears, so the storage capacity can be reduced and the number of memory accesses can be reduced. was also reduced.

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

第1図は本発明の実施例図、第2図、第3図はプロロー
グで記述されたプログラムの具体例を示す図、第4図は
本発明の主体処理図、第5図はインタプリタを中心とす
る動作説明図、第6図はC0DEとC0PYとの関係を
示す図、第7図。 第8図はりストコピーの説明図である。 纂 1 困 ′第Z口 ■   Lncestor (x 、工)  ;  −
1’(lLre−3↑(人、アブ■  a、TLcts
tor−(x、Y): −fLre*t(x、x)、a
wes↑or(z、工)第 3 口 L(3[ヒ、x、、d、c]):づ(X〕。 第 キロ ¥J50 ′禅5  6  rコ ′¥i7 口 C0aIi: ′fJ gロ ア Co1ヒ
Figure 1 is an example diagram of the present invention, Figures 2 and 3 are diagrams showing a specific example of a program written in a prologue, Figure 4 is a diagram of the main processing of the present invention, and Figure 5 focuses on the interpreter. FIG. 6 is an explanatory diagram of the operation, and FIG. 7 is a diagram showing the relationship between C0DE and C0PY. FIG. 8 is an explanatory diagram of beam copy. -
1'(lLre-3↑(person, Abu ■ a, TLcts
tor-(x, Y): -fLre*t(x, x), a
wes↑or(z, 工) 3rd mouth L (3 [hi, x,, d, c]): zu (X). Lower Co1 Hi

Claims (1)

【特許請求の範囲】 1、リスト形式のデータ構造を有し且つ該リスト形式の
データ構造の中に含まれる変数が共有して使用される構
成の、導出原理に基づく述語論理形プログラムの処理に
際し、上記リスト形式のデータ構造のコピーを作成する
コピー方法において、リストのデータ構造を指すポイン
タ内に含まれるタグとして該データ構造内に変数が含ま
れているか否かを示すタグを設けておくと共に、上記プ
ログラムコンパイル時に変数を含むか否かを上記タグを
みることによって確認し、変数を含むタグの場合のみそ
の時のデータ構造をコピーさせたプログラム内のリスト
形式のデータ構造のコピー方法。 2、上記導出原理に基づく述語論理形プログラムとはプ
ロロープ言語によるプログラムとする特許請求の範囲第
1項記載のコピー方法。
[Claims] 1. When processing a predicate logical form program based on the derivation principle, which has a list-format data structure and has a configuration in which variables included in the list-format data structure are shared. In the copying method for creating a copy of the list-format data structure described above, a tag indicating whether a variable is included in the data structure is provided as a tag included in the pointer pointing to the list data structure, and A method for copying a list-format data structure in a program, in which whether or not a variable is included is checked by looking at the tag when the program is compiled, and only in the case of a tag containing a variable, the data structure at that time is copied. 2. The copying method according to claim 1, wherein the predicate logical form program based on the derivation principle is a program written in a prolope language.
JP23662884A 1984-11-12 1984-11-12 Copying method of data structure of list format in program Pending JPS61115138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23662884A JPS61115138A (en) 1984-11-12 1984-11-12 Copying method of data structure of list format in program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23662884A JPS61115138A (en) 1984-11-12 1984-11-12 Copying method of data structure of list format in program

Publications (1)

Publication Number Publication Date
JPS61115138A true JPS61115138A (en) 1986-06-02

Family

ID=17003441

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23662884A Pending JPS61115138A (en) 1984-11-12 1984-11-12 Copying method of data structure of list format in program

Country Status (1)

Country Link
JP (1) JPS61115138A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62139047A (en) * 1985-12-13 1987-06-22 Agency Of Ind Science & Technol Tag system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62139047A (en) * 1985-12-13 1987-06-22 Agency Of Ind Science & Technol Tag system

Similar Documents

Publication Publication Date Title
Kennedy et al. Typed fusion with applications to parallel and sequential code generation
Gries et al. Some ideas on data types in high-level languages
Paul et al. On time versus space II
van Emden An Interpreting Algorithm for Prolog Programs.
JPS61115138A (en) Copying method of data structure of list format in program
Brooks A theoretical analysis of the role of documentation in the comprehension of computer programs
JPS6155736A (en) Prologue machine
JP2590127B2 (en) PROLOG processing method
Symes Manipulation of data structures in a numerical analysis problem solving system: NAPSS
KR970011897B1 (en) Words interpretating device
Schwartz et al. A semantic view of ALGOL 68
JPH0258129A (en) Logical type program processing system
Arpita Magnifying Data Structures
JPH0612523B2 (en) How to copy structure in program
Buy et al. Liveness Analysis and the Automatic Generation of Concurrent Programs.
JPS60256847A (en) Unification processing circuit
Tveter An automatic programming system
Raimundo et al. Compact lists for tabled evaluation
JPS63104133A (en) Tree searching system for logical language processing system
JPH02178845A (en) Precompiling system for data base operation language
Hansen The impact of storage management on plex processing language implementation
JPS61148536A (en) Information processing system
JPH02308333A (en) Coding system for logical language
JPS63197235A (en) Unifying system for logical variable
Symes Manipulation of Data Structure in a Numerical Analysis Problem Solving Systems