JP2003233499A - Method for aspect oriented programming with multiple semantic levels - Google Patents

Method for aspect oriented programming with multiple semantic levels

Info

Publication number
JP2003233499A
JP2003233499A JP2003006816A JP2003006816A JP2003233499A JP 2003233499 A JP2003233499 A JP 2003233499A JP 2003006816 A JP2003006816 A JP 2003006816A JP 2003006816 A JP2003006816 A JP 2003006816A JP 2003233499 A JP2003233499 A JP 2003233499A
Authority
JP
Japan
Prior art keywords
stage
code block
propagator
programming
loop
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
JP2003006816A
Other languages
Japanese (ja)
Other versions
JP4346316B2 (en
Inventor
John O Lamping
オー ランピング ジョン
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.)
Xerox Corp
Original Assignee
Xerox Corp
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 Xerox Corp filed Critical Xerox Corp
Publication of JP2003233499A publication Critical patent/JP2003233499A/en
Application granted granted Critical
Publication of JP4346316B2 publication Critical patent/JP4346316B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/316Aspect-oriented programming techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for aspect oriented programming with multiple semantic levels. <P>SOLUTION: Some aspects need access to more information than information available at a basic level in conjunction with program data for one or a plurality of objects. An aspect of aspect oriented systems, a method and an environment checks results of calculation at one stage. The aspect only affects the following calculation stage, as a consequence, no circulation exists. The aspect, furthermore, implements local or global analysis at each stage and can propagate non-local information. A method for aspect oriented programming can eliminate or decrease a 'macro' style programming, therefore, the programming becomes easy by manipulating results of the several calculation stages without manipulating code blocks. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、汎用の意味不変コ
ンストラクト言語を使用したアスペクト指向プログラミ
ングのための方法およびシステムに関する。
FIELD OF THE INVENTION The present invention relates to methods and systems for aspect-oriented programming using a general purpose semantic invariant construct language.

【0002】[0002]

【従来の技術】現在、複雑なソフトウェア・システムを
構成する際の主要な概念は、オブジェクト指向プログラ
ミング・パラダイムである。オブジェクト指向プログラ
ミングの背後にある考え方は、ソフトウェア・システム
をクラス、オブジェクト、メソッド(すなわち関数)な
どの小さなモジュラー・ユニットに細分するものであ
る。コンパイル時、オブジェクト指向プログラミングで
使用される各モジュラー・ユニットは、別々のコード・
ブロックにおよそ対応する。これらのコード・ブロック
は他のブロックの構造に関係なく実行されるので、不要
な冗長な演算がしばしば生じる。したがって、メソッド
同士が「話す」ことができれば、ソフトウェア・システ
ムの速度全体を向上させることができる。時間に依存す
る大きなソフトウェア・システムの中には、メソッド同
士が「話す」ことから大きな利益を得ることができるも
のがある。
BACKGROUND OF THE INVENTION Currently, the main concept in constructing complex software systems is the object-oriented programming paradigm. The idea behind object-oriented programming is to subdivide the software system into smaller modular units such as classes, objects, methods (or functions). At compile time, each modular unit used in object-oriented programming has a separate code
Approximately corresponds to a block. Since these blocks of code execute regardless of the structure of other blocks, unnecessary redundant operations often occur. Therefore, if the methods can "talk" to each other, the overall speed of the software system can be increased. Some large time-dependent software systems can benefit greatly from methods "talking" to each other.

【0003】アスペクト指向プログラミングでは、プロ
グラマは、オブジェクト指向プログラミングと同様に、
抽象化および分解を用いて大きな問題をより小さい管理
可能な下位部分に分割することができる。ただし、問題
は、関数に基づく分解ではなくアスペクトに基づく分解
に従って細分する。アスペクトは、メソッド間の「会
話」を容易にする。さらに、アスペクト同士が「話す」
または横断することができ、その結果、横断的な実行可
能プログラムが得られる。
In aspect-oriented programming, programmers, like object-oriented programming,
Abstraction and decomposition can be used to break a large problem into smaller manageable sub-parts. However, the problem is subdivided according to aspect-based decomposition rather than function-based decomposition. Aspects facilitate "conversation" between methods. Furthermore, the aspects “talk” to each other
Or it can be traversed, resulting in a traversable executable program.

【0004】[0004]

【特許文献1】米国特許第5,882,593号[Patent Document 1] US Pat. No. 5,882,593

【0005】[0005]

【発明が解決しようとする課題】既存の様々な汎用アス
ペクト指向プログラミング技法によれば、基本プログラ
ムの演算をインターセプトおよび調停することが可能で
ある。しかし、これらの技法は、オブジェクトまたはメ
ソッドの基本レベルで現在利用可能なプログラム・デー
タの限られた同じ視点によって制限される点で、制約を
受ける。アスペクトには、1つまたは複数のオブジェク
トのプログラム・データに関して、基本レベルで利用可
能な情報よりも多くの情報へのアクセスを必要とするも
のもある。
According to various existing general-purpose aspect-oriented programming techniques, it is possible to intercept and arbitrate the operations of a basic program. However, these techniques are limited in that they are limited by the same limited view of program data currently available at the base level of objects or methods. Some aspects require access to more information about the program data of one or more objects than is available at the base level.

【0006】以上に示したアスペクト指向プログラミン
グの例のコンテキストでは、アスペクトの目的およびそ
の要件に循環があるせいで、望まれる多くの実装形態
で、従来のアスペクト指向プログラミング技法の実施に
明白な困難があることは明らかである。すなわち、特定
のアスペクトは、そのアスペクトが必要とするデータを
得るための計算にアクセスする必要がある。しかし、ア
スペクト自体が計算に影響を及ぼす。言い換えれば、ア
スペクトは、その演算を実施するために、アスペクトが
それに対して後で何をするかによって少なくとも部分的
に決定されることになるオブジェクトまたはモジュール
によって何かを見る必要がある。
In the context of the example aspect-oriented programming presented above, there are obvious difficulties in implementing conventional aspect-oriented programming techniques in many desirable implementations, due to the circular nature of the purpose of the aspect and its requirements. It is clear that there is. That is, a particular aspect needs access to the calculations to obtain the data that the aspect requires. However, the aspect itself affects the calculation. In other words, the aspect needs to look at something by an object or module to perform its operation, which will be determined, at least in part, by what the aspect will do to it later.

【0007】[0007]

【課題を解決するための手段】オブジェクトがオブジェ
クト指向プログラム中の独特のコード・セットであるの
と同様に、「アスペクト」は、アスペクト指向プログラ
ム中の独特のコード・セットである。本発明によるシス
テム、メソッド、およびアスペクト指向プログラミング
言語環境の、様々な例示的実施形態では、アスペクト
は、1段階で計算結果を調べる。このアスペクトは、後
続の計算段階だけに影響を及ぼし、したがって循環は存
在しない。
An "aspect" is a unique code set in an aspect-oriented program, just as an object is a unique code set in an object-oriented program. In various exemplary embodiments of systems, methods, and aspect-oriented programming language environments according to this invention, an aspect examines the results of a computation in one step. This aspect only affects the subsequent calculation stages, so there is no cycle.

【0008】本発明の一つの側面によれば、データ処理
デバイスを操作する命令にコンパイル可能なプログラミ
ング要素を単純化する方法であって、プログラミング要
素が少なくとも1つの部分を有し、前記方法が、プログ
ラミング要素を、その少なくとも1つの部分がすべて第
1段階に達するまで単純化して、現段階の単純化済みプ
ログラミング要素を生み出す工程と、現段階の単純化済
みプログラミング要素について少なくとも1つのプロパ
ゲータを決定することであって、プロパゲータがプログ
ラミング要素中に記述される工程と、決定した少なくと
も1つのプロパゲータを使用して、少なくとも1つのプ
ロジェクションを現段階の単純化済みプログラミング要
素に関連付ける工程と、現段階の単純化済みプログラミ
ング要素および関連するプロジェクションに少なくとも
部分的に基づいて、現段階の単純化済みプログラミング
要素を、その少なくとも1つの部分がすべて次の段階に
達するまで単純化して、次段階の単純化済みプログラミ
ング要素を生み出す工程とを含む。
According to one aspect of the invention, a method for simplifying a programming element compilable into instructions for operating a data processing device, the programming element having at least one part, said method comprising: Determining the process of simplifying the programming elements until at least one part of them all reaches the first stage to produce the current stage simplified programming elements and at least one propagator for the current stage simplified programming elements Where the propagator is described in the programming element, and using at least one propagator determined, associating at least one projection with the current simplified programming element, and Computerized programming elements and functions Based at least in part on the projection to simplify the current stage simplified programming element until all of at least one part of it reaches the next stage to produce the next stage simplified programming element. Including.

【0009】[0009]

【発明の実施の形態】図1に、従来のアスペクト指向プ
ログラミング環境100の例示的な一実施形態を示す。
図1には特に、従来のアスペクト指向プログラミング言
語を使用してどのようにプログラミング要素が実行可能
ソフトウェア・モジュールに変換されるかを示す。図1
に示すように、1つまたは複数の高レベル・コンピュー
タ・プログラミング要素120が、アスペクト指向ウィ
ーバ(weaver)110に提供される。アスペクト
指向プログラミング環境100内のアスペクト指向ウィ
ーバ110は、高レベル・コンピュータ・プログラム要
素120のそれぞれを1つまたは複数の実行可能モジュ
ールにコンパイルする。アスペクト指向ウィーバ110
は、静的と動的のいずれかとすることができる。自動ア
スペクト指向ウィーバ110は、静的な織込みプロセス
(weaving process)を実装する。静的
な織込みプロセスは、クラス・ソース・コードなどの高
レベル・プログラミング要素120中のジョイン・ポイ
ントにアスペクト特有のステートメントを挿入すること
により、このような高レベル・プログラミング要素12
0を修正する。本質的に、アスペクト指向ウィーバ11
0は、所望のアスペクト・コードをクラスにインライン
する。この結果、高度に最適化された織込みコード(w
oven code)が得られる。
DETAILED DESCRIPTION OF THE INVENTION FIG. 1 illustrates an exemplary embodiment of a conventional aspect-oriented programming environment 100.
In particular, FIG. 1 shows how a programming element is converted into an executable software module using a conventional aspect-oriented programming language. Figure 1
As shown in FIG. 1, one or more high level computer programming elements 120 are provided to the aspect oriented weaver 110. Aspect-oriented weaver 110 within aspect-oriented programming environment 100 compiles each high-level computer program element 120 into one or more executable modules. Aspect-oriented weaver 110
Can be either static or dynamic. The automatic aspect-oriented weaver 110 implements a static weaving process. The static weaving process inserts aspect-specific statements at join points in high-level programming elements 120, such as class source code, to allow such high-level programming elements 12 to
Correct 0. In essence, an aspect-oriented weaver 11
0 inlines the desired aspect code in the class. This results in a highly optimized weave cord (w
an open code) is obtained.

【0010】図1には、汎用アスペクト指向プログラミ
ング言語環境100のアスペクト指向ウィーバ110に
1つまたは複数の高レベル・プログラミング要素120
が入力されるのが示されている。第1段階で、アスペク
ト指向ウィーバ110は、織込みコードすなわち混ざり
合ったコードを生み出す。図1に示すように、高レベル
・コンピュータ・プログラミング要素120のうちの1
つからのプログラミング・ブロック122は、変数12
3と、変数123の1つまたは複数に作用する1つまた
は複数のプロセスまたはメソッド124とに細分され
る。次いでアスペクト指向ウィーバ110は、このプロ
グラミング・ブロック122を調べ、このプログラミン
グ・ブロック122の様々なプロセス124の1つまた
は複数の内部で1つまたは複数の変数123が重複する
箇所を決定する。次いでアスペクト指向ウィーバ110
は、コードを結合して、すなわち「織り込んで」、混ざ
り合ったソース・コード・ブロック130を生み出す。
Referring to FIG. 1, one or more high level programming elements 120 are provided in an aspect oriented weaver 110 of a general aspect oriented programming language environment 100.
Is shown entered. In the first stage, the aspect-oriented weaver 110 produces a woven or blended code. One of the high-level computer programming elements 120, as shown in FIG.
Programming block 122 from variable 12
3 and one or more processes or methods 124 that act on one or more of the variables 123. The aspect-oriented weaver 110 then examines the programming block 122 and determines where one or more variables 123 overlap within one or more of the various processes 124 of the programming block 122. Then aspect-oriented weaver 110
Combines, or "weaves," the code into a mixed source code block 130.

【0011】織込みプロセスの第2段階で、結合したま
たは織り込んだプログラム・コード・ブロック130を
1つまたは複数の実行可能モジュール140にコンパイ
ルする。図1に示すように、この第2段階では、アスペ
クト指向ウィーバ110は、織込みコード・ブロック1
30のうちの1つをとる。アスペクト指向ウィーバ11
0は、この織込みコード・ブロック130の織り込まれ
た変数131および織り込まれたプロセス133を、1
つまたは複数の実行可能モジュール140にコンパイル
する。
The second stage of the weaving process compiles the combined or interwoven program code blocks 130 into one or more executable modules 140. As shown in FIG. 1, in this second stage, the aspect-oriented weaver 110 uses the woven code block 1
Take one of thirty. Aspect-oriented weaver 11
0 sets the woven variables 131 and the woven process 133 of this woven code block 130 to 1
Compile into one or more executable modules 140.

【0012】様々な例示的実施形態で、本発明によるシ
ステムおよび方法は、エイブルソン、サスマン、サスマ
ンによる「The Structure and In
terpretation of Computer
Programs」に記述されているScheme言語
など、ラムダ算法に基づく言語に対して機能する。この
言語では、基本演算は関数生成および関数適用である。
関数はラムダ式で生成され、通常これは「lambda
(var*)exp」の形式である。例えば、式「la
mbda(xy)(+(*2x)y)」は、その第1の
引数を2倍にしてから、2倍にした第1の引数をその第
2の引数に加える関数を定義する。「exp」の部分は
ラムダ式の本体と呼ばれ、「var*」の部分はその引
数と呼ばれる。関数は「fnarg*」の形式の適用式
によって適用されるが、「fn」は適用される関数を指
し、「arg*」は引数である。「fn」の部分は、ラ
ムダ式でもよく、あるいは関数を評価する式ならどんな
ものでもよい。計算は、ラムダ式の適用を簡約すること
によって継続する。ラムダ式を簡約することは一般に、
それらの変数の出現にそれらの引数を代入することによ
って行う。
In various exemplary embodiments, the systems and methods according to this invention are described by Ableson, Sussman, and Sussman in “The Structure and In”.
termination of Computer
It works for languages based on lambda algorithm, such as the Scheme language described in "Programs". In this language, the basic operations are function generation and function application.
The function is generated by a lambda expression, which is usually "lambda
(Var *) exp ”. For example, the expression "la
mbda (xy) (+ (* 2x) y) "defines a function that doubles its first argument and then adds the doubled first argument to its second argument. The "exp" part is called the body of the lambda expression, and the "var *" part is called its argument. The function is applied by an application formula of the form "fnarg *", where "fn" refers to the function to be applied and "arg *" is an argument. The "fn" part may be a lambda expression or any expression that evaluates a function. The calculation continues by reducing the application of the lambda equation. Simplifying lambda expressions is generally
By substituting those arguments for the appearance of those variables.

【0013】プログラミング言語は、式の値の考え方を
中心に構築される。プログラム・モジュールは本質的
に、式を値に変換することによって実行される。という
のは、値はプログラム・モジュールの実行中に順に回す
ことができるが、式はそうすることができないからであ
る。変数は、値を生み出す式に束縛されるのではなく、
これらの値に束縛される。式が評価された後で、変数が
束縛され、変数への後続の参照は、値だけにアクセスす
ることができる。
Programming languages are built around the idea of expression values. A program module essentially executes by converting an expression into a value. Values can be rotated in sequence during the execution of a program module, but expressions cannot. Variables are not bound to expressions that produce values,
You are bound to these values. After the expression is evaluated, the variable is bound and subsequent references to the variable can only access the value.

【0014】しかし本発明は、アスペクト指向プログラ
ミングにおいて、決定または計算された値だけではな
く、値がどのように計算または決定されたかに関係する
他の何らかの新生エンティティが、情報のクリティカル
な要素である場合があることを発見した。値の抽象化に
よって廃棄されるいくつかの新生エンティティがクリテ
ィカルな情報である場合があるので、関数に関数の引数
の値だけを提供すれば十分であるとは限らない。
However, in the present invention, in aspect-oriented programming, not only the determined or calculated value, but some other emerging entity that is related to how the value is calculated or determined is a critical element of information. I have found that there are cases. Providing a function with only the values of the function's arguments is not always sufficient, as some emerging entities that are discarded by the value abstraction may be critical information.

【0015】プログラム・ブロックに関するちょうどよ
い種類の情報だけを保存して、そのプログラム・ブロッ
クに関する残りの情報は単純化する、プログラミング言
語またはプログラミング言語環境が必要とされている。
当然、本発明によれば、「ちょうどよい」ものは、どん
なプログラム要素が情報を使用しているかに応じて異な
ることになる。値だけよりも多くの情報が必要とされる
とき、本発明によるシステム、メソッド、およびアスペ
クト指向プログラミング環境は、必要とされる情報だけ
を提供すべきである。
There is a need for a programming language or programming language environment that stores only just the right kind of information about a program block and simplifies the rest of the information about that program block.
Of course, according to the invention, the "just right" will depend on what program element is using the information. When more information is needed than just values, the system, method, and aspect-oriented programming environment according to the present invention should provide only the information needed.

【0016】式を評価するときは、値だけが欲しいとき
もあるが、より多くの情報が必要なときもある。例え
ば、ループの結果であるアレイだけが欲しいときもあ
り、アレイが特定のループまたは関数の結果であること
を知ることが重要なときもある。言い換えれば、式はア
レイを意味するときもあり、アレイだけよりも多くのも
のを意味するときもある。本発明によるシステム、方
法、およびプログラミング環境では、これらのあり得る
意味のそれぞれを、式の意義(significanc
e)と呼ぶ。式の値は、情報提供が最も少ない意義であ
る。その他の意義はどれも、値によって取り込まれる情
報よりも多くの情報を取り込むことになる。
When evaluating an expression, sometimes we want only the value, but sometimes we need more information. For example, sometimes we want only the array that is the result of a loop, and sometimes it is important to know that the array is the result of a particular loop or function. In other words, an expression may mean an array or more than just an array. In the system, method, and programming environment according to the present invention, each of these possible meanings is represented by a significance of the expression.
e). The value of the expression is the least informative meaning. Any other significance will capture more information than is captured by value.

【0017】本発明によるプログラミング・システム、
方法、およびプログラミング環境は、意義の概念を、計
算が作用することのできるものに変える。本発明による
プログラミング・システム、方法、およびプログラミン
グ環境では、計算プロセスは、式をその意義のカノニカ
ル表現になるまで単純化するものと考えることができ
る。当然、効率的な実装形態は、中間式をそれぞれ明示
的に構築することを避けるが、このような実装形態が行
う作業は、連続する中間式の間を進む作業に似ている。
A programming system according to the invention,
Methods, and programming environments, transform the notion of meaning into something that computations can act upon. In the programming system, method, and programming environment according to the present invention, a computational process can be thought of as simplifying an expression to a canonical representation of its meaning. Naturally, an efficient implementation avoids explicitly constructing each intermediate expression, but the work done by such an implementation is similar to working between successive intermediate expressions.

【0018】計算の各ステップは、結果としての最終的
な意義を保存するので有効である。2つの意義に違いが
ある場合は、この2つの意義は同じ単純化ステップを許
可しないことになる。
Each step of the calculation is useful because it preserves the resulting final meaning. If there are differences between the two meanings, the two meanings will not allow the same simplification step.

【0019】本発明は、任意の2つの意義の違いが、ど
の計算単純化ステップがこの2つの意義によって許可さ
れるかという点だけにあると認識するシステム、方法、
およびプログラミング環境を実現する。このことは、式
の意義を決定することが、その意義によって許可される
計算単純化を実施することと等価であることを意味す
る。さらに、いくつかの意義が、より多くの情報を提供
するものからより少ない情報を提供するものまで順序付
けられる場合は、これらの意義を順に決定することがで
きる。これは、まず最も多くの情報を提供する意義によ
って許可される単純化を実施し、次いで、次に多くの情
報を提供する意義によって許可される単純化を実施し、
以下同様にすることを含む。
The present invention recognizes that the difference between any two meanings lies only in which computational simplification steps are allowed by these two meanings.
And realize programming environment. This means that determining the significance of an expression is equivalent to performing the computational simplification permitted by that significance. Moreover, if some of the meanings are ordered from more informative to less informative, then these meanings can be determined in order. This first performs the simplifications allowed by the most informative significance, and then the simplifications permitted by the more informative meaning,
The same shall apply hereinafter.

【0020】個別に書かれた各ライブラリがそれ自体の
意義を導入できるようにし、これらの導入された意義を
そのプログラム中で使用できることが望ましいので、す
べての意義に対する総合的な順序は必要ないことを理解
されたい。この結果、あらゆる意義は対応する処理段階
を有することになる。したがって、計算は、連続的な諸
段階を通して式を単純化することに対応し、各段階は、
連続的な意義の1つについての、式のカノニカル表現で
ある。
It is desirable that each individually written library be able to introduce its own meanings and use these introduced meanings in the program, so there is no need for a total order for all meanings. I want you to understand. As a result, every significance has a corresponding processing step. Therefore, the calculation corresponds to simplifying the equation through successive steps, each step being
A canonical representation of an expression for one of its serial significance.

【0021】本発明によるシステム、方法、およびプロ
グラミング環境はまた、ある意義で利用可能な情報にア
クセスするだけでなく、いずれかの意義に対してどの単
純化を行うべきかを指定する言語コンストラクトも必要
とする。さらに、どの単純化を行うべきかを決定するこ
とは、どの関数呼出しを展開すべきかを決定することを
含む。後述するように、本発明によるシステムおよび方
法は、どの段階で関数を簡約すべきかを指定するプログ
ラミング形式を導入する。本質的にラムダ式は、簡約さ
れる段階まではデータ・オブジェクトのようにふるま
う。簡約された時点で、ラムダ式は関数のようにふるま
う。
The system, method, and programming environment in accordance with the present invention also provide language constructs that specify which simplifications should be made for which meaning, as well as accessing information that is available in that sense. I need. In addition, determining which simplifications to make involves determining which function calls to expand. As described below, the system and method according to the present invention introduces a programming form that specifies at which stage the function should be reduced. In essence, lambda expressions behave like data objects until they are reduced. When reduced, the lambda expression behaves like a function.

【0022】他方で、意義によって提供される追加の情
報は、簡約されない関数呼出し中に含まれる。この情報
へは、式の意義が特定の関数の適用であるかどうかをプ
ログラムがテストすることのできる形式によってアクセ
スする。式の意義は、関数のデータへのアクセス主体の
ようにふるまう。
On the other hand, the additional information provided by the semantics is included in the unreduced function call. This information is accessed in a form that allows the program to test whether the significance of the expression is the application of a particular function. The meaning of an expression behaves like that of the accessor to the data of the function.

【0023】式の意義は、式の値の決定に向けた段階な
ので、意義は常に、少なくとも値と同量の情報を含む。
しかし、式の値の決定に向けた方向にない、式に関する
他の情報にも用途がある可能性がある。これをサポート
するために、本発明によるシステム、方法、およびプロ
グラミング環境は、プロジェクションを用いてこのよう
な情報をカプセル化する。プロジェクションは、意義に
対して相対的に定義され、追加情報(通常、所与の計算
の残りにおけるその意義の役割に関する)を提供する。
プロジェクションの結果は値とすることができる。ただ
し、結果は、プロジェクションがある段階の意義とする
こともできる。これは、プロジェクションが、後で総計
算に組み込むことのできる計算断片を覚えていることが
できることを意味する。
Since the significance of a formula is a step towards the determination of the value of the formula, the significance always contains at least as much information as the value.
However, there may be applications for other information about the formula that is not directed towards determining the value of the formula. To support this, the system, method, and programming environment according to the present invention use projections to encapsulate such information. Projections are defined relative to meaning and provide additional information, usually regarding the role of that meaning in the rest of a given calculation.
The result of the projection can be a value. However, the result can also be meaningful at some stage in the projection. This means that the projection can remember a piece of calculation that can later be incorporated into the total calculation.

【0024】式の意義は基本的にその式に局所的なもの
だが、プロジェクションはこれとは異なり、より大きな
計算における式の役割を反映する。これは、フロー分析
と同種の技法を用いてプロジェクションが計算されるこ
とを意味する。これをサポートするために、本発明によ
るシステム、方法、およびプログラミング環境は、「プ
ロパゲータ」と呼ぶ機構を提供する。プロパゲータは、
マッチする意義それぞれに対して実行され、そのような
マッチする意義と、そのようなマッチする意義の引数と
の、1つまたは複数のプロジェクションを調査および更
新する。
The significance of an expression is basically local to that expression, but projections, in contrast, reflect the role of expressions in larger calculations. This means that the projection is calculated using a technique similar to flow analysis. To support this, the system, method and programming environment according to the present invention provide a mechanism called a "propagator". The propagator is
Performed for each matching significance and inspecting and updating one or more projections of such matching significance and arguments of such matching significance.

【0025】プロパゲータは、上方向と下方向の両方の
データ・フローを行うことができる。上方向プロパゲー
タは、引数プロジェクションを調べ、式全体のプロジェ
クションを更新する。対照的に、下方向プロパゲータ
は、所与の式全体のプロジェクションを調べ、引数プロ
ジェクションを更新する。
The propagator is capable of both upward and downward data flow. The upward propagator examines the argument projection and updates the projection for the entire expression. In contrast, a down-propagator examines the projection of a given expression and updates the argument projection.

【0026】プロパゲータは更新を実施するので、特定
の意義の中に埋め込まれた識別の意味を公開する。プロ
パゲータが所与の意義のプロジェクションを更新すると
き、この更新は、同じ意義への他の参照からしか見えな
い。プロパゲータは意義に対して定義されるので、意義
の識別が問題となる。
As the propagator performs the update, it exposes the meaning of the identification embedded within the particular meaning. When a propagator updates a projection of a given meaning, this update is only visible to other references to the same meaning. Since propagators are defined for meaning, identification of meaning is a problem.

【0027】図2に示すように、本発明によるシステ
ム、方法、およびプログラミング環境では、織込みプロ
セスはいくつかの段階を通して行われる。所与のプログ
ラム要素が、連続する意義段階を通して単純化される
が、これらの段階の多くはコンパイル時に行われる。異
なる程度の処理が様々な段階によって表されているが、
最も単純な織込みは、2つの段階、すなわち第1段階お
よび最終段階を生成するだけである。
As shown in FIG. 2, in the system, method, and programming environment according to the present invention, the weaving process proceeds through several stages. Although a given program element is simplified through successive semantic steps, many of these steps occur at compile time. Different degrees of processing are represented by different stages,
The simplest weaving only produces two stages, a first stage and a final stage.

【0028】図2に示すように、様々な例示的実施形態
で、第1段階は構文段階210である。この構文段階2
10では、所与の高レベル・コード・ブロック122か
らの局所的情報は廃棄されておらず、コンテキスト情報
は利用不可能である。これは、この高レベル・コード・
ブロック122の元の構文に対応する。本発明によるシ
ステム、方法、およびアスペクト指向プログラミング環
境では、アスペクト指向ウィーバ110は、高レベル・
コード・ブロック122から構文段階210を「織り込
む」。構文段階210は、織込みコード・ブロック22
0を含む。次いで構文段階210は、構文段階210で
生成した織込みコード・ブロック220を次の中間段階
230に出力する。次の中間段階230は、アスペクト
指向ウィーバ110によって織込みコード・ブロック2
20から織り込まれる。各段階210、230、25
0、270の後、段階210、230、または250に
対応する織込みコード・ブロック220、240、また
は260中で定義された1つまたは複数のプロパゲータ
が実行されて、その段階210、230、または250
で定義されるプロジェクションが決定される。次いで、
これらのプロジェクションは、後続の段階230、25
0、および270でそれぞれ利用可能である。
As shown in FIG. 2, in various exemplary embodiments, the first stage is the syntax stage 210. This syntax stage 2
At 10, local information from a given high level code block 122 has not been discarded and context information is unavailable. This is this high level code
Corresponds to the original syntax of block 122. In the system, method, and aspect-oriented programming environment according to the present invention, the aspect-oriented weaver 110 is
"Weave" syntax step 210 from code block 122. The syntax step 210 is the weave code block 22.
Including 0. The syntax stage 210 then outputs the weave code block 220 generated in the syntax stage 210 to the next intermediate stage 230. The next intermediate stage 230 is the weaving code block 2 by the aspect-oriented weaver 110.
Woven from 20. Each stage 210, 230, 25
After 0, 270, one or more propagators defined in the weave code block 220, 240, or 260 corresponding to the step 210, 230, or 250 are executed to that step 210, 230, or 250.
The projection defined by is determined. Then
These projections follow the subsequent steps 230, 25.
0 and 270 respectively.

【0029】図2に示すように、第1段階210が織り
込まれた後で、第1の中間段階230が織り込まれる。
これは、高レベル・コード・ブロック122に含まれる
プログラム・コードをさらに最適化することにつなが
る。前と同様、この第1の中間段階230の織込みコー
ド・ブロック240は、次の中間段階に入力される。最
後の中間段階250が前の中間段階(図示せず)から織
込みコード・ブロック245を受け取るまで、これが繰
り返し行われる。
As shown in FIG. 2, after the first stage 210 is woven, the first intermediate stage 230 is woven.
This leads to further optimization of the program code contained in the high level code block 122. As before, the weave code block 240 of this first intermediate stage 230 is input to the next intermediate stage. This is repeated until the last intermediate stage 250 receives the weave cord block 245 from the previous intermediate stage (not shown).

【0030】図2に示すように、最後の中間段階250
で、すべての最適化織込みが完了する。この最後の中間
段階250から出力される織込みコード・ブロック26
0が、最終織込み段階270に入力される。最終織込み
段階270は、処理済み値の段階である場合が多いこと
を理解されたい。次いで、最終織込み段階270から出
力される織込みコード280が、実行可能プログラム・
モジュールに、または実行可能プログラム・モジュール
のセットにコンパイルされる。
As shown in FIG. 2, the final intermediate stage 250
This completes all optimized weaving. The weave code block 26 output from this last intermediate stage 250.
0 is input to the final weaving stage 270. It should be appreciated that the final weaving stage 270 is often a processed value stage. The weaving code 280 output from the final weaving step 270 is then executed by the executable program
Compiled into modules or a set of executable program modules.

【0031】式が値に簡約されていないときであって、
その式の適用を簡約すべきかどうかを本発明によるシス
テム、方法、およびプログラミング環境が知る必要があ
るとき、本発明によるシステム、方法、およびプログラ
ミング環境は、その式を現段階中に簡約すべきでないと
推定する。
When the expression is not reduced to a value,
When the system, method, and programming environment according to the present invention need to know whether the application of the expression should be reduced, the system, method, and programming environment according to the present invention should not reduce the expression during the current stage. It is estimated that

【0032】プロパゲータが完全に実行されるように、
プロパゲータは、プログラムまたはプログラム要素セッ
トが中間段階にある間は、プログラムまたはプログラム
要素セットと距離を置いた関係を維持する。プロパゲー
タは、プログラムまたはプログラム要素セットからの、
意義に束縛された変数を有することになる。しかしプロ
パゲータは、制約された方式でしかこれらの変数を使用
することができない。最初にプロパゲータは、プロパゲ
ータが動作する段階まで論理的に実行されるが、これら
の変数の束縛にはアクセスできない。すなわち、このよ
うな変数は本質的に、未束縛の変数として扱われる。次
いで、プログラムまたはプログラム要素セットから、各
変数が適切な意義に束縛され、プロパゲータは実行を終
了する。しかし、プロパゲータは一般に、プログラムま
たはプログラム要素セットに束縛された変数に後の意義
を要求することができない。後の意義にアクセスしよう
としても、やはりこのような変数を未束縛と見なすこと
になる。プロパゲータがその結果として意義を出力でき
るようにするために、プロパゲータは、後述する特別な
形式を用いて、プロパゲータがアクセスしている意義以
上に単純化すべきでないコードを囲むことができる。
In order for the propagator to run completely,
The propagator maintains a distance relationship with the program or program element set while the program or program element set is in an intermediate stage. A propagator is a program or set of program elements that
You will have variables bound to meaning. However, propagators can only use these variables in a constrained manner. Initially, the propagator is logically executed until the propagator operates, but the bindings of these variables are inaccessible. That is, such variables are essentially treated as unbound variables. From the program or set of program elements, each variable is then bound to the appropriate meaning and the propagator ends execution. However, propagators generally cannot demand later meaning for variables bound to a program or set of program elements. If you try to access later meanings, you will still see such variables as unbound. To allow the propagator to output the resulting meaning, the propagator can use a special form described below to enclose code that should not be oversimplified beyond what the propagator is accessing.

【0033】プログラマが、様々な演算をアレイに対し
て実施するコードを書きたいと思っているとする。通
常、プログラマは、各アレイにわたってループして新し
いアレイを生み出すコードを書くことになる。プログラ
マは、様々なプリミティブ演算を行うルーチンを定義
し、次いで、定義したプリミティブ演算を使用する高レ
ベル演算を構築する。プログラマは、あるルーチンの出
力アレイを別のルーチンの入力アレイとして使用するこ
とはしばしばある。この場合、プログラマは、融合ルー
プを使用して結合演算を行いたい。これは、普通の関数
プログラミングでは行うことができない。というのは、
第2の演算を実行できるようになる前に第1の演算を実
行しなければからである。ループ融合を自動的に行うオ
プティマイザもあるであろうが、オプティマイザは通
常、不明瞭である。したがって、様々な例示的実施形態
で、先に概説したシステム、方法、およびプログラミン
グ環境を使用して、プリミティブ演算のライブラリを生
み出すことができる。このライブラリ中では、演算はど
のように相互と融合するかを知っており、ライブラリ・
ルーチンが組み合わせて使用されるときに融合が起こ
る。したがって、様々な例示的実施形態で、先に概説し
たシステム、方法、およびプログラミング環境によれ
ば、ライブラリ・プログラマが、ルーチンが共に融合す
るように定義することができる。
Suppose a programmer wants to write code that performs various operations on an array. Typically, the programmer will write code that loops over each array to produce a new array. The programmer defines routines that perform various primitive operations and then builds high level operations that use the defined primitive operations. Programmers often use the output array of one routine as the input array of another. In this case, the programmer would like to use a fused loop to perform the join operation. This cannot be done with ordinary functional programming. I mean,
This is because the first operation must be executed before the second operation can be executed. Some optimizers will automatically perform loop fusion, but optimizers are usually ambiguous. Thus, in various exemplary embodiments, the systems, methods, and programming environments outlined above can be used to generate a library of primitive operations. In this library we know how operations merge with each other,
Fusion occurs when the routines are used in combination. Thus, in various exemplary embodiments, the systems, methods, and programming environments outlined above allow a library programmer to define routines to fuse together.

【0034】様々な例示的実施形態で、先に概説したシ
ステム、方法、およびプログラミング環境は、ライブラ
リ・ルーチンがループ融合を行えるようになるにはどの
機能を最低必要とするかを尋ねることにより、ループ融
合に適用することができる。概して言えば、潜在的なル
ープは、「自分の入力が、あるループによって計算され
たことになる場合は、そのループの内部演算およびそれ
が作用したことになるアレイを与えよ。そうすれば、そ
れを自分のループ中で使用する。」と尋ねることができ
る必要がある。このように言う擬似コードの例は以下の
とおりである。 (define pointwise (lambda (fn arg) (case arg ((ptw-loop inner-fn inner-arg) (inner-fn inner-arg) (ptw-loop (lambda (x) (fn (inner-fn x))) inner-arg)) (else (ptw-loop fn arg)))))
In various exemplary embodiments, the systems, methods, and programming environments outlined above allow loop fusion by asking which features a library routine requires at a minimum to be able to perform loop fusion. Can be applied to. Generally speaking, a potential loop is: "If your input is to be computed by a loop, give the internal operations of that loop and the array on which it worked. Should be used in my loop. ” An example of such pseudo-code is as follows: (define pointwise (lambda (fn arg) (case arg ((ptw-loop inner-fn inner-arg) (inner-fn inner-arg) (ptw-loop (lambda (x) (fn (inner-fn x)) ) inner-arg)) (else (ptw-loop fn arg)))))

【0035】ここで、「pointwise」は、アレ
イにわたって関数をマッピングする関数だが、「poi
ntwise」は、ループ融合について知っている。こ
のケース形式は、「(ptw−loop inner−
fn inner−arg)の形式の式によって「ar
g」が計算されたことになるか?」と言っている。構文
「(inner−fn inner−arg)」は、パ
ターン定数である「ptw−loop」に対して、「i
nner−fn」および「inner−arg」がパタ
ーン変数であることを示す。引数がマッチする場合は、
内部ループの関数は、「pointwise」からの関
数で構成されるべきである。この場合、構成された関数
を使用して単一ループを実施すべきである。そうでない
場合は、単純なループを使用する。具体的には、以下に
示すように「ptw−loop」を定義して、実際のル
ープを実施することができる。
Here, "pointwise" is a function that maps a function over the array, but "pointwise" is
ntwise "knows about loop fusion. This case format is "(ptw-loop inner-
fn inner-arg), the expression "ar
Is "g" calculated? "they said. The syntax "(inner-fn inner-arg)" is "i" for the pattern constant "ptw-loop".
It indicates that "nner-fn" and "inner-arg" are pattern variables. If the arguments match,
The function of the inner loop should consist of the functions from "pointwise". In this case, a single loop should be implemented using the constructed function. If not, use a simple loop. Specifically, "ptw-loop" can be defined as shown below to implement the actual loop.

【0036】以下のライブラリ・コードが式と共に使用
される場合は、「double−plus」の実装は、
各要素を2倍にしてから1を足す単一ループであるべき
である。
If the following library code is used with an expression, the implementation of "double-plus" is:
There should be a single loop that doubles each element and then adds 1.

【0037】「pointwise」の定義の鍵は、ケ
ース・ステートメントの意味「...によって「ar
g」が計算されたことになるか」の中の「ことになる」
である。このケースは、引数を計算したことになるルー
プをテストする必要がある。具体的には、「point
wise」は、得られるアレイまでずっと見ることな
く、ループによって計算される関心のある情報を、その
引数の表面的な構造を通して見ることを欲する。
The key to the definition of "pointwise" is the case statement meaning "...
"It will be" in "Is g calculated?"
Is. In this case we need to test the loop that would have computed the arguments. Specifically, "point
The "wise" wants to see through the superficial structure of its argument the information of interest computed by the loop, without ever looking at the resulting array.

【0038】したがって、「pointwise」は、
関数とマクロとの間の何かである必要がある。具体的に
は、「pointwise」は、それが関心を持つ情報
を見ることができるように、その引数が部分的に処理さ
れるようにする必要がある。しかし、「pointwi
se」の引数が完全に評価されると、「pointwi
se」が関心を持つまさにその情報を除去することにつ
ながるので、「pointwise」はそうしたくはな
い。したがって、様々な例示的実施形態で、先に概説し
た本発明によるシステム、方法、およびプログラミング
環境は、これらの両極間の処理レベルを認識し、認識し
たこれらの処理レベルへのアクセスを提供する。
Therefore, "pointwise" is
It needs to be something between a function and a macro. Specifically, a "pointwise" needs to have its arguments partially processed so that it can see the information of interest. However, "pointwi
When the argument of “se” is completely evaluated, “pointwi
"pointwise" does not want to do so, as it leads to the removal of exactly that information of interest to "se". Thus, in various exemplary embodiments, the systems, methods, and programming environments according to the present invention outlined above are aware of the processing levels between these extremes and provide access to those recognized processing levels.

【0039】以下、本発明によるシステム、方法、およ
びプログラミング環境の基本的な形式、すなわちステー
トメントおよび/またはコンストラクトを示す。本発明
によるシステム、方法、およびプログラミング環境の
「case」ステートメントの一般的な形式は以下のと
おりである。case stage value (model (var*) exp*)* [(else exp)]
In the following, the basic forms, statements and / or constructs, of the system, method and programming environment according to the invention will be shown. The general form of a "case" statement for systems, methods, and programming environments according to this invention is as follows. case stage value (model (var *) exp *) * [( else exp)]

【0040】「case」ステートメントでは、各モデ
ルは式である。変数は、モデル中では解放されており、
式中では束縛されている。値は、連続して各モデルと比
較される。値にマッチする第1のモデルでは、その式が
ケースの値として選択される。式はモデルの変数にアク
セスすることができ、これらの変数は束縛されてマッチ
を形成する。
In the "case" statement, each model is an expression. The variable is released in the model,
It is bound in the formula. The values are compared with each model in succession. In the first model that matches the value, the expression is selected as the case value. The expression can access variables in the model, which are bound to form a match.

【0041】比較は、指定の意義の値とモデルとの間で
論理的に行われる。比較は、指定の処理段階の後は行わ
れない。また、式の単純化はゆっくりと行われる。
The comparison is made logically between the value of the specified significance and the model. The comparison is not done after the specified processing stage. Also, the simplification of the formula is done slowly.

【0042】以下に示す「if」ステートメントは、ス
テートメント「case value exp1 (nil ( ) exp3) (else
exp2))」に対する追加の構文構造を提供する。
The "if" statement shown below is equivalent to the statement "case value exp1 (nil () exp3) (else
provide additional syntax structure for exp2)) ".

【0043】if exp1 exp2 exp3 以下に示す「deconstruct」ステートメント
は、ステートメント「case stage value (model (var*)
exp*) (else (error))」に対する追加の構文構造を提
供する。deconstruct stage value model (var*) exp*
If exp1 exp2 exp3 The "destruct" statement shown below is the statement "case stage value (model (var *)
exp *) (else (error)) ". deconstruct stage value model (var *) exp *

【0044】ステートメント「reduction s
tage」は、「exp」の値の呼出しを指定の段階で
簡約すべきであることを指定する。reduction-stage stage exp
The statement "reductions
“Tage” specifies that the invocation of the value of “exp” should be reduced at the specified stage. reduction-stage stage exp

【0045】適用ステートメントは、関数の本体がその
簡約段階に達したときに簡約されることを表す。このス
テートメントにはキーワードがないが、単に関数「f
n」を示す式で始まる。fn exp*
The apply statement indicates that the body of the function is reduced when it reaches its reduction stage. This statement has no keywords, but just the function "f
n ”. fn exp *

【0046】「lambda」ステートメントは、以下
の関数を定義する。lambda (var* [.var] [=> var]) exp*
The "lambda" statement defines the following function: lambda (var * [.var] [=> var]) exp *

【0047】形式「=>var」は、表される変数を定
義される関数の結果に束縛するのに使用される。
The form "=>var" is used to bind the represented variable to the result of the defined function.

【0048】ステートメント「stage」は、段階を
宣言し、宣言した段階が所与の段階よりも後であること
を定義する。stage name [:below stage]
The statement "stage" declares a stage and defines that the declared stage is after a given stage. stage name [: below stage]

【0049】ステートメント「projection」
は、段階に関する情報を提供するプロジェクションを宣
言する。projection name :depends-on stage
Statement "projection"
Declares a projection that provides information about the stage. projection name: depends-on stage

【0050】ステートメント「propagator」
は、プロパゲータを生成する関数を宣言するように働
く。propagator stage [:bottom-up | :top-down] function
The statement "propagator"
Works to declare a function that creates a propagator. propagator stage [: bottom-up |: top-down] function

【0051】一般に、プロパゲータは、いくつかの項の
プロジェクションを調べ、その他を更新することにな
る。プロジェクタの動作は、プロパゲータが調べたが更
新はしなかったプロジェクションによって決まると仮定
される。これらのプロジェクションがこの段階で動作す
る他のプロパゲータによって変更された場合は、このプ
ロパゲータは再実行される。「:bottom−up」
および「:top−down」のヒントは、再計算の必
要を最小限に抑えるための、プロパゲータを実行する最
も効率的な順番を識別する。
In general, the propagator will look at the projections of some terms and update others. The behavior of the projector is assumed to depend on the projections that the propagator has examined, but not updated. If these projections are modified by another propagator operating at this stage, this propagator will be rerun. ": Bottom-up"
And the ": top-down" hints identify the most efficient order in which to execute the propagator to minimize the need for recomputation.

【0052】プロパゲータが見る項は、ラムダ定義、ラ
ムダ変数、適用、およびケース形式である。ラムダ式が
簡約されている場合、プロパゲータは、簡約の結果を見
ることになる。これにより、プログラム・ツリーは効果
的に有向グラフに変わる。具体的には、ラムダ本体の中
でラムダ変数を参照した各ポイントで、実際の引数が、
すべて変数使用であったものの間で共用されて現れるこ
とになる。プロパゲータからは、意義に束縛された変数
が見られることはなく、意義だけしか見られないことを
理解されたい。
The terms seen by the propagator are lambda definition, lambda variable, application, and case form. If the lambda expression is reduced, the propagator will see the result of the reduction. This effectively turns the program tree into a directed graph. Specifically, at each point in the lambda body that referenced the lambda variable, the actual argument is
All will be shared among those that used variables. It should be understood from the propagator that there are no variables bound to meaning, only meaning.

【0053】ステートメント「update」は、プロ
パゲータの実行中だけに現れることのある形式を定義す
る。update old new
The statement "update" defines a form that may appear only during the execution of the propagator. update old new

【0054】このステートメントは、プロパゲータが適
用される段階における項プロジェクションを評価すべき
「old」の値を、「new」の値で更新する。
This statement updates the value of "old" with the value of "new" which should evaluate the term projection at the stage where the propagator is applied.

【0055】ステートメント「same freque
ncy」は、プロパゲータの実行中だけに生じることの
ある形式を定義する。same-frequency exp
The statement "same request"
"ncy" defines a format that can occur only during the execution of the propagator. same-frequency exp

【0056】このステートメントは、式評価の頻度とプ
ロパゲータが扱っている項の頻度が同じである場合に真
を返す。
This statement returns true if the frequency of expression evaluation and the frequency of terms handled by the propagator are the same.

【0057】これが意味することの例として、以下の式
を考えてみる。 (let ((x (+1 2))) (lambda (y) (*xy))
As an example of what this means, consider the following equation. (let ((x (+1 2))) (lambda (y) (* xy))

【0058】「let」コマンドまたは演算は、最も早
い処理段階で展開されることを理解されたい。ここで、
乗算項の引数の1つは、加算演算である。ラムダが介在
するので、この加算演算は、乗算演算と同じ回数にわた
って実行されることにはならない。プロパゲータは、こ
れに反応できる必要がある。実行頻度が異なる場合は他
に、あるケース・ブランチ中の項がケース外の変数を参
照するときにも生じる。
It should be appreciated that "let" commands or operations are expanded at the earliest processing stage. here,
One of the arguments of the multiplication term is an addition operation. Due to the intervening lambda, this addition operation will not be executed as many times as the multiplication operation. The propagator needs to be able to react to this. In addition, when the execution frequency is different, it occurs when a term in a case branch refers to a variable outside the case.

【0059】別の見方では、プロパゲータがランタイム
の前に実行されるので、プロパゲータの1つの呼出し
が、それが処理する意義の多くの呼出しに対応すること
がある。これは、プロパゲータが処理するすべての下位
項が主要項の呼出しごとに1度呼び出される限りは問題
ではない。しかし、例が示すように、常にそうであると
は限らない。プロパゲータは、異なる頻度の意義に関連
する情報を更新する際は注意する必要がある。「sam
e frequency」ステートメントは、プロパゲ
ータがこの状況を検出する方法を提供する。
Another view is that since the propagator is executed before run time, one invocation of the propagator may correspond to many invocations that it makes sense to handle. This is not a problem as long as all the subordinate terms processed by the propagator are called once per invocation of the main term. But, as the example shows, this is not always the case. Propagators need to be careful when updating information related to different frequency implications. "Sam
The "e frequency" statement provides a way for the propagator to detect this situation.

【0060】図3乃至5に、ループ融合を実施するため
のサンプル・コード・セグメントを示す。このサンプル
・コードは、あるループの結果が他のいくつかのループ
によって使用される場合の、すべてではないが多くを扱
うものである。
3-5 show sample code segments for performing loop fusion. This sample code deals with many, but not all, cases where the results of one loop are used by some other loops.

【0061】行1〜3は、フロー処理が作用することの
できる種々の情報を記述する。この情報は、単純化の最
も少ないレベルにおける、式についての異なる3つの意
義と項についての固有の識別子とを含む。行2は、この
値をハッシュ・テーブルから得るためのキーを定義す
る。行3は、おそらく他にもある中でこの値を計算する
ことになるループを定義する。共用を可能にするため
に、行3で定義されるプロジェクションは、このループ
によって計算される値のうちの1つだけについてループ
を保持することになる。他の値に対するプロジェクショ
ンは、このループによって計算される他の何らかの値に
ついての(loop−referencevalue)
を保持することになる。この連鎖に従うことにより、最
終的にはこのループを保持する値に至る。
Lines 1 to 3 describe various information that the flow process can act upon. This information includes three different meanings for expressions and unique identifiers for terms at the least level of simplification. Line 2 defines the key to get this value from the hash table. Line 3 defines a loop that will probably calculate this value among other things. To allow sharing, the projection defined in line 3 will hold the loop for only one of the values calculated by this loop. Projections to other values are (loop-referencevalue) for some other value calculated by this loop.
Will hold. Following this chain eventually leads to a value that holds this loop.

【0062】行4〜6は、トップ・レベル関数を定義す
る。行7〜(終わり)は、簡約されたpointwis
e演算を定義するサブルーチン・ライブラリを定義す
る。行8は、トップ・レベルのラムダ式を簡約できるよ
うにし、効果的にand!の定義をマクロにする。行1
1〜39は、各形式をその値を計算するループで装飾す
るプロパゲータを定義する。行37が実行されたとき
は、これは、このケースが「pointwise」でな
いことを示し、留意されるように出力が必要であるよう
にする。行39〜46は、値を計算するpointwi
seループを返す。これは、必要ならトリビアルなルー
プを作ることを含む。行43および44は、簡約をルー
プ融合後に簡約可能にする。行47〜50は、値がルー
プによって計算された場合にそのループを返すことを示
す。行51〜57は、引数を計算するためのループを保
持するcomputing−loopを伴う値を返す。
行58〜69は、結果に対するこの形式の需要を記録す
る。行70〜79は、引数に対する実際のアレイが必要
とされることを示す。
Lines 4-6 define the top level function. Lines 7- (end) are reduced pointwis
Define a subroutine library that defines the e operation. Line 8 allows for reduction of top-level lambda expressions, effectively and! Make the definition of a macro. Line 1
1 to 39 define propagators that decorate each format with a loop that calculates its value. When line 37 is executed, this indicates that this case is not "pointwise", and as noted, the output is needed. Lines 39-46 are the pointwis that calculate the value.
Returns a se loop. This involves making trivial loops if necessary. Rows 43 and 44 allow the reduction to be reduced after loop fusion. Lines 47-50 indicate to return the loop if the value was calculated by the loop. Lines 51-57 return a value with a computing-loop holding a loop for computing the arguments.
Rows 58-69 record this type of demand for results. Lines 70-79 indicate that the actual array for the argument is required.

【0063】行80〜100では、pointwise
ループの構造すなわち「ptw−loop」が、複数の
値でループを生成することを含めて融合を容易にするよ
うに設計される。これを可能にするために、入力および
出力にはキーで名前が付けられ、これにより、名前付け
は融合の下でも変化する必要はない。これらのキーは、
ループ融合時の間だけ存在する。すなわち、これらのキ
ーは、ランタイムまでには単純化されて取り去られるこ
とになる。行93では、ステートメント「fn」が、キ
ー/値の対のリストと、それに対するキー/値の対の増
補リストをとる。「入力」は、「fn」によって期待さ
れるIDを含めた、キー/アレイの対のリストである。
「出力」は、キーのリストであり、これらのキーは、f
nが出力するキーの中になければならない。ループは、
アレイの対応要素にわたって関数をマッピングし、出力
ID中の各キーに対するエントリを有するキー/アレイ
の対のリストを返す。行101〜103は、前段階でプ
ロパゲータによって構築された、その結果を計算するル
ープから、正しい結果を返すためのpointwise
演算を定義する。
In lines 80-100, the pointwise
The structure of the loop or "ptw-loop" is designed to facilitate fusion, including creating loops with multiple values. To allow this, the inputs and outputs are named with keys, so that the naming does not have to change under fusion. These keys are
Exists only during loop fusion. That is, these keys will be simplified away by runtime. In line 93, the statement "fn" takes a list of key / value pairs and an augmented list of key / value pairs for it. "Input" is a list of key / array pairs, including the IDs expected by "fn".
"Output" is a list of keys, these keys are f
n must be in the output key. Loop
Maps the function across the corresponding elements of the array and returns a list of key / array pairs with an entry for each key in the output ID. Lines 101-103 are the pointwise for returning the correct result from the loop that calculates the result, which was constructed by the propagator in the previous stage.
Define the operation.

【0064】行104〜117は、2つのpointw
iseループの作業を結合して行ってそれらの入力およ
び出力を結合するループを返す。行115は、内部定義
された関数がループ融合後に簡約可能であることを示
す。行118〜125は、対のリスト中にキーがあると
推定して、リスト中でキーを検索する。行119は、こ
れがランタイム前に行われることを示す。行126およ
び127は、2つのリストをマージする動作が、リスト
中でIDを見つける動作と同様にしてコード化されるこ
とを示す。
Lines 104-117 are the two pointtws.
Combines the work of the ise loops and returns a loop that combines their inputs and outputs. Line 115 indicates that the internally defined function is reducible after loop fusion. Lines 118-125 presume that there is a key in the list of pairs and search for the key in the list. Line 119 indicates that this is done before runtime. Lines 126 and 127 show that the act of merging two lists is coded similarly to the act of finding an ID in the lists.

【0065】ウィーバの基本動作は次のとおりである。
プログラムから開始する。プログラムのすべての部分が
第1段階に達するまで、プログラムを単純化する。この
段階についてのプロパゲータを実行して、単純化された
プログラムをプロジェクションで装飾する。次に、プロ
グラムのすべての部分が次の段階に達するまで、プログ
ラムをもう少し単純化する。この単純化の間、前段階か
らの単純化済みプログラムと、プロパゲータによって加
えられる装飾は、さらに単純化されたプログラムがどの
ようなものかを決定するのに利用可能なデータである。
このプロセスを、プログラムの最終段階に達するまで繰
り返す。プログラムの各部分は、各段階で意義を有す
る。問題は、プログラムのこのような部分のいずれかを
ある段階から次の段階まで簡約して、その部分が次の段
階でその意義を正しく示すようにしなければならないか
どうかである。
The basic operation of the weaver is as follows.
Start from the program. Simplify the program until all parts of the program have reached the first stage. Run the propagator for this stage to decorate the simplified program with projections. Then simplify the program a bit more until all parts of the program reach the next stage. During this simplification, the simplified program from the previous step and the decorations added by the propagator are the data that can be used to determine what the further simplified program looks like.
This process is repeated until the final stage of the program is reached. Each part of the program has significance at each stage. The question is whether or not any such part of the program must be reduced from one stage to the next so that the part justifies its significance at the next stage.

【0066】図6に、本発明によるシステム、方法、お
よびプログラミング環境を用いた、プログラムのコンパ
イル中または織込み中における図2に示した段階間の関
係の例示的な一実施形態を示す。図6に示すように、1
つまたは複数のプログラミング要素のセット120が、
コンパイルされるようにアスペクト指向ウィーバ110
に入力される。アスペクト指向ウィーバ110は、1つ
または複数のプログラミング要素のセット120に共通
の変数および演算があるかどうか調べ、1つまたは複数
のプログラミング要素120を適切な意義に簡約する命
令310を与える。図6に示すように、1つまたは複数
のプログラミング要素のセット120中で、3つの意義
A、B、Cが識別される。3つの意義A、B、Cは、図
2に関して先に概説した第1段階210に対応する第1
段階の分析の結果として生成される、第1段階織込みコ
ード・ブロック320に組み込まれる。
FIG. 6 illustrates an exemplary embodiment of the relationship between the stages shown in FIG. 2 during program compilation or weaving using the system, method, and programming environment according to the present invention. As shown in FIG.
A set 120 of one or more programming elements
Aspect-oriented weaver 110 to be compiled
Entered in. Aspect-oriented weaver 110 examines for common variables and operations in one or more sets 120 of programming elements and provides instructions 310 that condense one or more programming elements 120 to the proper meaning. As shown in FIG. 6, three meanings A, B, C are identified in the set 120 of one or more programming elements. The three implications A, B, and C are the first corresponding to the first stage 210 outlined above with respect to FIG.
It is incorporated into the first stage weave code block 320, which is generated as a result of the stage analysis.

【0067】次に、アスペクト指向ウィーバ110は、
プロパゲータ間可視性パス325に沿って命令を送るこ
とにより、プロジェクタ330を呼び出す。プロジェク
タ330は、第1段階織込みコード・ブロック320を
調べ、意義A、B、Cのうちのどれが次の織込み中に更
新可能かを決定する。例えば、図6に示す例示的な実施
形態では、プロジェクタ330は、意義AおよびBが更
新可能と識別する。プロジェクタ330は、意義Aおよ
びBに対する更新が未来にあればそれらを実施するため
に、プロジェクタ/プロパゲータ・パス327に沿って
プロパゲータ335を生み出す。次いで、アスペクト指
向ウィーバ110は次の織込み段階に進む。
Next, the aspect-oriented weaver 110
The projector 330 is invoked by sending a command along the inter-propagator visibility path 325. The projector 330 examines the first stage weave code block 320 to determine which of the meanings A, B, C can be updated during the next weave. For example, in the exemplary embodiment shown in FIG. 6, projector 330 identifies meanings A and B as updatable. Projector 330 spawns propagator 335 along projector / propagator path 327 to implement updates to meanings A and B, if any, in the future. The aspect-oriented weaver 110 then proceeds to the next weaving stage.

【0068】第2の織込み段階では、図2に関して先に
概説したように、アスペクト指向ウィーバ110は、第
1段階織込みコード・ブロック320を第2段階または
中間段階の分析への入力として使用する。アスペクト指
向ウィーバ110は、第1段階織込みコード・ブロック
320を調べて、共通の変数および/または演算があれ
ば識別し、第1段階織込みコード・ブロック320を適
切な意義に簡約する命令332を送る。図6に示すよう
に、第1段階織込みコード・ブロック320中で、3つ
の意義D、E、Fが識別される。3つの意義D、E、F
は、図2に関して先に概説した中間段階230に対応す
る第2段階の分析の結果として生成される、第2段階織
込みコード・ブロック340に組み込まれる。
In the second weaving stage, the aspect-oriented weaver 110 uses the first stage weaving code block 320 as an input to the second stage or intermediate stage analysis, as outlined above with respect to FIG. The aspect-oriented weaver 110 examines the first stage weave code block 320 to identify any common variables and / or operations and sends instructions 332 that reduce the first stage weave code block 320 to the appropriate meaning. . As shown in FIG. 6, in the first stage weave code block 320, three meanings D, E, F are identified. Three meanings D, E, F
Is incorporated into the second stage weave code block 340, which is generated as a result of the second stage analysis corresponding to the intermediate stage 230 outlined above with respect to FIG.

【0069】再びアスペクト指向ウィーバ110は、プ
ロパゲータ間可視性パス345に沿って命令を送ること
により、プロジェクタ350を呼び出す。プロジェクタ
350は、未来の織込みによってもたらされるかもしれ
ない意義が第2段階織込みコード・ブロック340中に
あるかどうか調べる。例えば、図6に示す例示的な実施
形態では、プロジェクタ350は、意義Eがこの基準に
合うと決定する。プロジェクタ350は、プロジェクタ
/プロパゲータ・パス347を使用して、意義Eについ
てのプロパゲータ355を生み出す。次いでプロパゲー
タ355は、プロパゲータ間可視性パス337を使用し
てプロパゲータ335と通信して、更新すべきものがあ
るかどうかを決定する。この特定の例では、共通の重要
性はない。すなわち、第1段階織込みコード・ブロック
320と第2段階織込みコード・ブロック340の両方
で継続する意義はない。したがって更新は必要ない。
Again, the aspect-oriented weaver 110 calls the projector 350 by sending a command along the inter-propagator visibility path 345. The projector 350 checks to see if there is any significance in the second stage weave code block 340 that may be brought about by future weaving. For example, in the exemplary embodiment shown in FIG. 6, projector 350 determines that significance E meets this criterion. Projector 350 uses projector / propagator path 347 to produce propagator 355 for significance E. Propagator 355 then communicates with propagator 335 using inter-propagator visibility path 337 to determine if there is something to update. In this particular example, they have no common significance. That is, it is meaningless to continue in both the first stage weave code block 320 and the second stage weave code block 340. Therefore no update is necessary.

【0070】続いて第3の織込み段階で、アスペクト指
向ウィーバ110は、第2段階織込みコード・ブロック
340を最後の段階の分析への入力として使用する。前
述のように、アスペクト指向ウィーバ110は、第2段
階織込みコード・ブロック340を調べて、共通の変数
および/または演算があれば識別し、第2段階織込みコ
ード・ブロック340を適切な意義に簡約する命令34
2を送る。図6に示すように、第2段階織込みコード・
ブロック340中で、3つの意義A、G、Hが識別され
る。3つの意義A、G、Hは、図2に関して先に概説し
た最終段階270に対応する第3段階の分析の結果とし
て生成される、第3段階織込みコード・ブロック360
に組み込まれる。
Subsequently, in the third weaving stage, the aspect-oriented weaver 110 uses the second stage weaving code block 340 as an input to the final stage analysis. As described above, the aspect-oriented weaver 110 examines the second stage weave code block 340 to identify any common variables and / or operations and reduces the second stage weave code block 340 to an appropriate meaning. Instruction 34
Send 2. As shown in FIG. 6, the second stage weaving cord
In block 340, three senses A, G, H are identified. The three meanings A, G, H are generated as a result of the third stage analysis corresponding to the final stage 270 outlined above with respect to FIG. 2, the third stage weave code block 360.
Incorporated into.

【0071】次いで、アスペクト指向ウィーバ110
は、相互運用性パス365に沿って命令を送ることによ
り、第3のプロジェクタ370を呼び出す。プロジェク
タ370は、意義AおよびHが更新可能と決定する。プ
ロジェクタ370は、意義AおよびHについてのプロパ
ゲータ375を、プロジェクタ/プロパゲータ・パス3
67に沿って生み出す。次いでプロパゲータ375は、
プロパゲータ間可視性パス357に沿ってプロパゲータ
355と通信する。プロパゲータ375は、第2段階コ
ード・ブロック340と第3段階コード・ブロック36
0との間に共通の意義がなく、更新が必要ないと決定す
る。
Next, the aspect-oriented weaver 110
Calls the third projector 370 by sending a command along the interoperability path 365. Projector 370 determines that meanings A and H are updatable. Projector 370 provides propagator 375 for significance A and H to projector / propagator path 3
Produce along 67. Then the propagator 375
Communicate with the propagator 355 along an inter-propagator visibility path 357. Propagator 375 includes second stage code block 340 and third stage code block 36.
There is no common meaning with 0, and it is determined that updating is not necessary.

【0072】プロパゲータ375はまた、別のプロパゲ
ータ間可視性パス377に沿ってプロパゲータ335と
も通信し、第1段階織込みコード・ブロック320と第
3段階織込みコード・ブロック360との間で意義Aが
共通であると決定する。次いでプロパゲータ375は、
第1段階織込みコード・ブロック320および第3段階
織込みコード・ブロック360中の、意義Aへの参照す
べてを更新する。これにより、織込みコードが後に正し
く実行されることが確実になる。前述のようにこのプロ
セスは、すべてのコードが完全に織り込まれ、したがっ
て完全に最適化されるまで継続する。
The propagator 375 also communicates with the propagator 335 along another inter-propagator visibility path 377, sharing the meaning A between the first stage weave code block 320 and the third stage weave code block 360. To determine. Then the propagator 375
Update all references to meaning A in first stage weave code block 320 and third stage weave code block 360. This ensures that the weaving code will be executed correctly later. As mentioned above, this process continues until all code is fully woven and thus fully optimized.

【0073】図7に、ループ融合の例についての織込み
プロセスを示す。アスペクト指向ウィーバ110は、高
レベル・プログラム・コード・ブロック420を読み込
む命令410を構文段階430に与える。この高レベル
・プログラム・コード・ブロック420は、織込みプロ
セスの第1段階すなわち構文段階430で第1段階コー
ド・ブロックとして使用されるように提供される。次い
で、アスペクト指向ウィーバ110は、構文段階430
で第1段階コード・ブロック420を調べて、第1段階
コード・ブロック420全体で共通の変数および演算を
識別する。アスペクト指向ウィーバ110は、命令43
5を使用して構文段階430を制御する。この例では、
構文段階430と最終段階480との間に2つの中間段
階がある。構文段階430から出力された織込みコード
・ブロック440は、第1の中間段階450に入力され
るが、この例示的な実施形態では、この第1の中間段階
450はループ構造段階と呼ぶことができる。
FIG. 7 illustrates the weaving process for the loop fusion example. Aspect-oriented weaver 110 provides instructions 410 to syntax stage 430 to read high level program code block 420. This high level program code block 420 is provided for use as the first stage code block in the first or syntactic stage 430 of the weaving process. The aspect-oriented weaver 110 then proceeds to the syntax stage 430.
The first stage code block 420 is examined to identify variables and operations that are common throughout the first stage code block 420. Aspect-oriented weaver 110 uses command 43
5 is used to control the syntax stage 430. In this example,
There are two intermediate stages between the syntax stage 430 and the final stage 480. The weave code block 440 output from the syntax stage 430 is input to the first intermediate stage 450, which in this exemplary embodiment may be referred to as the loop construction stage. .

【0074】次に、アスペクト指向ウィーバ110は、
第1段階織込みコード・ブロック440を調べ、ループ
構造段階450に命令455を与える。ループ構造段階
450の間の処理で、第1段階コード・ブロック420
のループによって計算されるアレイの候補ループ構造が
公開される。ループ構造段階は、第2段階織込みコード
・ブロック460を出力する。ループ構造はアレイにわ
たって明示的なマッピング関数を実施するので、残念な
がら、特定ループの値をループ構造段階450から直接
計算することはできない。この状況では、ランタイム前
に内部ループ関数を簡約する方が望ましい。したがっ
て、ループ構造を簡約済みループに変形する必要があ
る。この変形は、計算段階470によって実現される。
Next, the aspect-oriented weaver 110
The first stage weave code block 440 is examined, and instructions 455 are provided to the loop construction stage 450. During the loop construction stage 450, the first stage code block 420
The candidate loop structure of the array calculated by the loop of is published. The loop construction stage outputs the second stage weave code block 460. Unfortunately, the value of a particular loop cannot be calculated directly from the loop structure stage 450 because the loop structure implements an explicit mapping function across the array. In this situation it is preferable to reduce the inner loop function before runtime. Therefore, it is necessary to transform the loop structure into a reduced loop. This transformation is realized by the calculation stage 470.

【0075】続いてアスペクト指向ウィーバ110は、
第2段階織込みコード・ブロック460に含まれるルー
プ構造を簡約する命令475を計算段階470に与え
る。これに応答して、計算段階470は、第3段階織込
みコード・ブロック480を出力する。これは、完全に
織り込まれた最終的な段階である。この最終段階コード
・ブロック480はまた、値段階コード・ブロック48
0とも呼ぶ。次いで、最終段階コード・ブロック480
は、コンパイラ490に出力される。コンパイラ490
は、信号チャネル495を介したアスペクト指向ウィー
バ110の制御下で、完全に織り込まれた値段階ブロッ
ク480をコンパイルして、実行可能コード・ブロック
500を形成する。実行可能コード・ブロック500
は、コンパイラ490から出力される。
Next, the aspect-oriented weaver 110
Instructions 475 are provided to the calculation stage 470 to reduce the loop structure contained in the second stage weave code block 460. In response, calculation stage 470 outputs a third stage weave code block 480. This is the final stage, fully woven. This final stage code block 480 is also the value stage code block 48.
Also called 0. Then final stage code block 480
Is output to the compiler 490. Compiler 490
Compiles a fully interwoven value stage block 480 under control of the aspect-oriented weaver 110 via signal channel 495 to form an executable code block 500. Executable code block 500
Is output from the compiler 490.

【0076】問題は、ライブラリがループを融合する度
に、ライブラリは、その引数のループの新しい作業実行
を必要とする場合があることである。引数が共用される
場合、重複する計算が生じる。これに対する解決法の1
つは、引数が共用される場合にはループを融合しないこ
とである。別の解決法は、共用される引数の使用すべて
を反映する単一のループを生成することである。
The problem is that each time the library fuses a loop, it may need a new working execution of its argument loop. If the arguments are shared, then duplicate calculations occur. One solution to this
The first is to not fuse loops when arguments are shared. Another solution is to create a single loop that reflects all the usage of shared arguments.

【0077】前述の解決法のいずれかを採用する場合、
引数がプログラム中の他の箇所でどのように使用される
かに関する情報を知ることが必要である。すなわち、ラ
イブラリ・コードは、その直接の引数だけでなく、より
広いコンテキストに関するいくらかの情報にアクセスで
きる必要がある。ライブラリ・コードは、その引数に関
係する何らかのデータ・フロー情報を必要とする。これ
には、より多くの言語機能が必要である。
If one of the above solutions is adopted,
It is necessary to know some information about how the arguments are used elsewhere in the program. That is, the library code needs to have access to some information about the wider context, not just its direct arguments. The library code needs some data flow information related to its arguments. This requires more language features.

【0078】より単純な回答を実現するには、引数が共
用されるなら融合しない場合に、ライブラリ・コード
は、「自分に渡されようとしている引数が他の箇所でも
使用されるか?」といったように尋ねる必要がある。こ
の質問には、どの段階かにかかわらず、単にその引数を
計算するコードを見るだけでは回答できないことを理解
されたい。この質問への回答は、引数がどのように計算
されるかではなく、どのように使用されるかにある。さ
らに、この質問への回答は、引数識別の認識、すなわ
ち、同じ引数が他の箇所で使用されることが意味するも
のの認識に依拠する。
To achieve a simpler answer, if the arguments are not shared if they are shared, the library code asks, "is the argument being passed to me used elsewhere?" Need to ask. It should be understood that this question cannot be answered at any stage simply by looking at the code that computes its argument. The answer to this question is not how the arguments are calculated, but how they are used. Furthermore, the answer to this question relies on the recognition of argument identification, ie what the same argument means to be used elsewhere.

【0079】したがって、これをサポートするために、
様々な例示的実施形態で、先に概説したシステム、方
法、およびプログラミング環境は、項プロジェクション
の概念をサポートする。プロジェクションは、項に関す
る情報を提供する。この情報は通常、項自体からは入手
不可能だがその使用のコンテキストからは入手可能な情
報である。したがって、様々な例示的実施形態で、先に
概説したシステム、方法、およびプログラミング環境
は、プロジェクション・コンテキスト情報を計算するた
めに、別のコンストラクトとして前述のプロパゲータを
導入する。プロパゲータは、適切な段階の項と照合さ
れ、次いで項または項の下位項のプロジェクションに関
する情報を公開することができる形式である。最初、プ
ロジェクションの値は、項が空のコンテキスト中で見ら
れることを意味するデフォルトに設定される。プロパゲ
ータが実行される中で、プロパゲータはコンテキストの
ピクチャを埋める。したがってプロパゲータは、命令的
にコード化される間、項のコンテキストに関する限界を
インクリメンタルに上げるように動作する。
Therefore, to support this,
In various exemplary embodiments, the systems, methods, and programming environments outlined above support the notion of term projection. The projection provides information about the section. This information is usually not available in the section itself, but in the context of its use. Thus, in various exemplary embodiments, the systems, methods, and programming environments outlined above introduce the aforementioned propagator as a separate construct to compute projection context information. A propagator is a format that can be matched to the appropriate stage terms and then published information about the projection of the term or sub-terms of the term. Initially, the projection value is set to the default, which means that the term is found in the empty context. As the propagator executes, the propagator fills the picture in context. Thus, the propagator operates to incrementally raise the bounds on the context of a term while being imperatively coded.

【0080】以下の擬似コードは、項が2回以上使用さ
れるかどうかを計算する。
The following pseudo code calculates if a term is used more than once.

【0081】この例が機能するようにするには、新しい
段階として、ループ融合段階の前に実施される動作段階
を導入する必要がある。ループの結合である「doub
le」のような定義は、この段階で簡約され、それによ
り、ループ結果の使用が見えるようになる。このように
すれば、長い範囲のフロー分析は必要ない。問題となる
のはプログラマが関心を持つプロシージャだけなので、
いくつかのプロシージャを通して1つの形式に従う必要
はない。ループ構造決定時に形式構造へのアクセスを有
するプロシージャが、それを直接受け取るプロシージャ
である。
In order for this example to work, it is necessary to introduce a new stage, the operating stage, which is carried out before the loop fusion stage. "Doub," which is a combination of loops
Definitions such as "le" are reduced at this stage, which makes the use of loop results visible. In this way, long range flow analysis is not required. The only problem is the procedure that the programmer is interested in,
It is not necessary to follow one format through several procedures. The procedure that has access to the formal structure when determining the loop structure is the procedure that receives it directly.

【0082】ただし、この機構は、長い範囲のフロー分
析を実施することもできる。これは、途中で情報を蓄積
してプロパゲートすることによって行う。実際、この機
構は、図2および6に関して先に論じたような、共有の
第2の手法すなわち単一の大きな融合ループの生成を表
すのに十分なものである。
However, this mechanism is also capable of performing long range flow analysis. This is done by accumulating information and propagating along the way. In fact, this mechanism is sufficient to represent a shared second approach, the generation of a single large fusion loop, as discussed above with respect to FIGS.

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

【図1】 プログラミング間の従来の関係を示す図であ
る。
FIG. 1 illustrates a conventional relationship between programming.

【図2】 本発明のシステムおよび方法による、意味ベ
ースのアスペクト指向プログラミング環境でプログラミ
ング要素の様々な段階によって表される種々の処理程度
の例示的な一実施の形態である。
FIG. 2 is an exemplary embodiment of various degrees of processing represented by various stages of programming elements in a semantic-based aspect-oriented programming environment in accordance with the systems and methods of this invention.

【図3】 本発明によるシステムおよび方法を用いてル
ープ融合を達成するためのプログラムの例示的な擬似コ
ード・リストである(図3乃至5でひとつの疑似コード
・リストを示す)。
FIG. 3 is an exemplary pseudo code listing of a program for achieving loop fusion using the systems and methods according to this invention (one pseudo code listing is shown in FIGS. 3-5).

【図4】 本発明によるシステムおよび方法を用いてル
ープ融合を達成するためのプログラムの例示的な擬似コ
ード・リストである(図3乃至5でひとつの疑似コード
・リストを示す)。
FIG. 4 is an exemplary pseudo code listing of a program for achieving loop fusion using the systems and methods according to this invention (one pseudo code listing is shown in FIGS. 3-5).

【図5】 本発明によるシステムおよび方法を用いてル
ープ融合を達成するためのプログラムの例示的な擬似コ
ード・リストである(図3乃至5でひとつの疑似コード
・リストを示す)。
FIG. 5 is an exemplary pseudo code listing of a program for achieving loop fusion using the systems and methods according to this invention (one pseudo code listing is shown in FIGS. 3-5).

【図6】 図2に示した段階間の関係の例示的な一実施
の形態をより詳細に示す図である。
FIG. 6 illustrates in more detail one exemplary embodiment of the relationship between the stages shown in FIG.

【図7】 本発明のシステムおよび方法による意味ベー
スのアスペクト指向プログラミング環境をループ融合動
作に適用したときの例示的な一結果を示す図である。
FIG. 7 illustrates an exemplary result of applying a semantic-based aspect-oriented programming environment to loop fusion operations according to the systems and methods of this invention.

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

110 アスペクト指向ウィーバ、120 プログラミ
ング要素、122 高レベル・コード・ブロック、21
0 構文段階(第1段階)、220,240,245,
260 織込みコード・ブロック、230 第1の中間
段階、250最後の中間段階、270 最終織込み段
階、320 第1段階織込みコード・ブロック、32
5,337,345,377 プロパゲータ間可視性パ
ス、327,347,367 プロジェクタ/プロパゲ
ータ・パス、330,350,370 プロジェクタ、
335,355,375 プロパゲータ、340 第2
段階織込みコード・ブロック、360 第3段階織込み
コード・ブロック、365相互運用性パス、420 第
1段階コード・ブロック、430 構文段階、450
第1の中間段階、ループ構造段階、440 第1段階織
込みコード・ブロック、460 第2段階織込みコード
・ブロック、470 計算段階、480 最終段階コー
ド・ブロック、第3段階織込みコード・ブロック、値段
階コード・ブロック、490 コンパイラ、495 信
号チャネル、500 実行可能コード・ブロック。
110 Aspect Oriented Weaver, 120 Programming Elements, 122 High Level Code Blocks, 21
0 syntax stage (first stage), 220, 240, 245,
260 weave cord block, 230 first intermediate stage, 250 last intermediate stage, 270 final weave stage, 320 first stage weave cord block, 32
5,337,345,377 Inter-propagator visibility path, 327,347,367 Projector / propagator path, 330,350,370 projector,
335, 355, 375 propagator, 340 second
Stage Woven Code Block, 360 Third Stage Woven Code Block, 365 Interoperability Path, 420 First Stage Code Block, 430 Syntax Stage, 450
First intermediate stage, loop construction stage, 440 first stage weave code block, 460 second stage weave code block, 470 calculation stage, 480 final stage code block, third stage weave code block, value stage code Blocks, 490 Compiler, 495 Signal Channels, 500 Executable Code Blocks.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 データ処理デバイスを操作する命令にコ
ンパイル可能なプログラミング要素を単純化する方法で
あって、プログラミング要素が少なくとも1つの部分を
有し、前記方法が、 プログラミング要素を、その少なくとも1つの部分がす
べて第1段階に達するまで単純化して、現段階の単純化
済みプログラミング要素を生み出す工程と、 現段階の単純化済みプログラミング要素について少なく
とも1つのプロパゲータを決定することであって、プロ
パゲータがプログラミング要素中に記述される工程と、 決定した少なくとも1つのプロパゲータを使用して、少
なくとも1つのプロジェクションを現段階の単純化済み
プログラミング要素に関連付ける工程と、 現段階の単純化済みプログラミング要素および関連する
プロジェクションに少なくとも部分的に基づいて、現段
階の単純化済みプログラミング要素を、その少なくとも
1つの部分がすべて次の段階に達するまで単純化して、
次段階の単純化済みプログラミング要素を生み出す工程
とを含むことを特徴とする方法。
1. A method for simplifying a programming element that is compilable into instructions for operating a data processing device, the programming element having at least one portion, the method comprising: Determining all at least one propagator for the current simplified programming element by simplifying until all parts have reached the first phase, the programming being performed by the propagator. Associating at least one projection with a current simplified programming element using at least one propagator determined in the element; and the current simplified programming element and associated projections. To Based in part even without a simplified pre programming elements present stage, at least one portion is simplified until all reach the next stage,
Producing a next step simplified programming element.
【請求項2】 プログラミング要素を、データ処理デバ
イスを操作する命令にコンパイル可能な複数の織込みコ
ード・ブロックに変換する方法であって、 (a)プログラミング要素中で、少なくとも1つの共通
の変数と少なくとも1つの共通のプロセスとのうちの少
なくとも1つを識別する工程と、 (b)識別した、少なくとも1つの共通の変数と少なく
とも1つの共通のプロセスとのうちの少なくとも1つに
基づいて、プログラミング要素を少なくとも1つの意義
に簡約する工程と、 (c)少なくとも1つの意義を第1の織込みコード・ブ
ロックに組み込むこと、 (d)組み込んだ意義のうち、方法の後続のステップで
更新可能なものを0個、1個、または複数決定する工程
と、 (e)決定の結果に基づいて、第1の織込みコード・ブ
ロックの決定された更新可能な意義に対して任意の所望
の更新を実施するのに使用できるプロパゲータを呼び出
す工程と、 工程(a)〜(e)を少なくとも1回繰り返して、直前
に生み出された織込みコード・ブロックに基づいて後の
織込みコード・ブロックを生み出す工程とを含み、さら
に、 (f)前に生み出された少なくとも1つの織込みコード
・ブロックのプロパゲータと通信して、前記前に生み出
された少なくとも1つの織込みコード・ブロックの意義
のいずれかが後の織込みコード・ブロックと共通かどう
かを決定する工程と、および (g)少なくとも1つの後の織込みコード・ブロックお
よび前に生み出された少なくとも1つの織込みコード・
ブロック中で、後の織込みコード・ブロックと前記前に
生み出された少なくとも1つの織込みコード・ブロック
とに共通の意義があればそれを更新する工程とを含むこ
とを特徴とする方法。
2. A method of converting a programming element into a plurality of woven code blocks compilable into instructions for operating a data processing device, comprising: (a) at least one common variable and at least in the programming element. Identifying at least one of the one common process, and (b) programming element based on the identified at least one of the at least one common variable and the at least one common process. To at least one meaning, (c) incorporating at least one meaning into the first weaving code block, (d) incorporating the meaning that can be updated in a subsequent step of the method. Based on the step of determining 0, 1 or more, and (e) the result of the determination, the first weaving code block Invoking a propagator that can be used to perform any desired update to the determined updatable significance of the process, and repeating steps (a)-(e) at least once, resulting in the immediately preceding Producing a subsequent weave code block based on the weave code block, further comprising: (f) communicating with a propagator of at least one previously produced weave code block to produce the previously produced weave code block. Determining if any of the meanings of the at least one weave code block are common to the subsequent weave code block, and (g) at least one subsequent weave code block and at least one previously produced Two weaving cords
Updating any subsequent weaving code blocks and the at least one previously produced weaving code block in the block, if they have a common meaning.
JP2003006816A 2002-01-16 2003-01-15 A method for aspect-oriented programming with multiple semantic levels Expired - Fee Related JP4346316B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US10/046,200 US7140007B2 (en) 2002-01-16 2002-01-16 Aspect-oriented programming with multiple semantic levels
US10/046,200 2002-01-16

Publications (2)

Publication Number Publication Date
JP2003233499A true JP2003233499A (en) 2003-08-22
JP4346316B2 JP4346316B2 (en) 2009-10-21

Family

ID=27658132

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003006816A Expired - Fee Related JP4346316B2 (en) 2002-01-16 2003-01-15 A method for aspect-oriented programming with multiple semantic levels

Country Status (2)

Country Link
US (1) US7140007B2 (en)
JP (1) JP4346316B2 (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7143407B2 (en) * 2001-07-26 2006-11-28 Kyocera Wireless Corp. System and method for executing wireless communications device dynamic instruction sets
GB0229669D0 (en) * 2002-12-19 2003-01-29 Ibm A method for capturing computer application diagnostics
JP3966518B2 (en) * 2004-03-12 2007-08-29 インターナショナル・ビジネス・マシーンズ・コーポレーション Program analysis apparatus, analysis method thereof, and program
US20060069759A1 (en) * 2004-06-28 2006-03-30 International Busines Machines Corporation Programmatic server page re-tooling
US20060149550A1 (en) * 2004-12-30 2006-07-06 Henri Salminen Multimodal interaction
US20060156418A1 (en) * 2005-01-10 2006-07-13 Ibm Corporation Method and apparatus for preventing unauthorized access to data
GB0510657D0 (en) * 2005-05-25 2005-06-29 Ibm Generating an application software library
US20070157073A1 (en) * 2005-12-29 2007-07-05 International Business Machines Corporation Software weaving and merging
US20070257354A1 (en) * 2006-03-31 2007-11-08 Searete Llc, A Limited Liability Corporation Of The State Of Delaware Code installation decisions for improving aggregate functionality
US8739137B2 (en) * 2006-10-19 2014-05-27 Purdue Research Foundation Automatic derivative method for a computer programming language
US8020143B2 (en) * 2007-01-10 2011-09-13 International Business Machines Corporation Remote aspect advising for an aspect-oriented program
US8452882B2 (en) * 2007-05-18 2013-05-28 Red Hat, Inc. Method and an apparatus to validate a web session in a proxy server
US8489740B2 (en) * 2007-05-18 2013-07-16 Red Hat, Inc. Method and an apparatus to generate message authentication codes at a proxy server for validating a web session
US8103495B2 (en) * 2007-08-08 2012-01-24 Microsoft Corporation Feature oriented protocol modeling
US20090198496A1 (en) * 2008-01-31 2009-08-06 Matthias Denecke Aspect oriented programmable dialogue manager and apparatus operated thereby
US20090249021A1 (en) * 2008-03-26 2009-10-01 Morris Robert P Method And Systems For Invoking An Advice Operation Associated With A Joinpoint
US8103607B2 (en) * 2008-05-29 2012-01-24 Red Hat, Inc. System comprising a proxy server including a rules engine, a remote application server, and an aspect server for executing aspect services remotely
US7881304B2 (en) * 2008-05-29 2011-02-01 Red Hat, Inc. Using distributed aspects to reorder online application workflows
US8180854B2 (en) * 2008-05-29 2012-05-15 Red Hat, Inc. Aspect services
US9910688B2 (en) * 2008-11-28 2018-03-06 Red Hat, Inc. Implementing aspects with callbacks in virtual machines
JP5613255B2 (en) * 2009-11-25 2014-10-22 テレフオンアクチーボラゲット エル エム エリクソン(パブル) Application server and method for managing services
US10241761B2 (en) * 2014-12-29 2019-03-26 Nvidia Corporation System and method for compiler support for compile time customization of code

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3781814A (en) * 1971-10-07 1973-12-25 Raytheon Co Method and apparatus for applying source language statements to a digital computer
US5822593A (en) * 1996-12-06 1998-10-13 Xerox Corporation High-level loop fusion
US6233610B1 (en) 1997-08-27 2001-05-15 Northern Telecom Limited Communications network having management system architecture supporting reuse
US6018625A (en) 1997-08-27 2000-01-25 Northern Telecom Limited Management system architecture and design method to support reuse
US6745384B1 (en) * 1998-05-29 2004-06-01 Microsoft Corporation Anticipatory optimization with composite folding
US6539390B1 (en) * 1999-07-20 2003-03-25 Xerox Corporation Integrated development environment for aspect-oriented programming
US6467086B1 (en) * 1999-07-20 2002-10-15 Xerox Corporation Aspect-oriented programming
US7441232B2 (en) * 1999-11-08 2008-10-21 British Telecommunications Public Limited Company Task management

Also Published As

Publication number Publication date
US20030149959A1 (en) 2003-08-07
JP4346316B2 (en) 2009-10-21
US7140007B2 (en) 2006-11-21

Similar Documents

Publication Publication Date Title
JP4346316B2 (en) A method for aspect-oriented programming with multiple semantic levels
KR950001416B1 (en) Program processing system and method
US6078744A (en) Method and apparatus for improving compiler performance during subsequent compilations of a source program
US6530079B1 (en) Method for optimizing locks in computer programs
US5142681A (en) APL-to-Fortran translators
US7143388B1 (en) Method of transforming software language constructs to functional hardware equivalents
US7565364B1 (en) Annotation processor discovery
US8122440B1 (en) Method and apparatus for enumerating external program code dependencies
WO2002093383A2 (en) System and method for combinatorial test generation in a compatibility testing environment
Odersky Functional nets
US6009273A (en) Method for conversion of a variable argument routine to a fixed argument routine
US20070074185A1 (en) Identifier expressions
Danelutto et al. Introducing parallelism by using REPARA C++ 11 attributes
Gestwicki et al. Interactive visualization of Java programs
EP2181387A1 (en) A programming environment with support for handle and non-handle user-created classes
US8762974B1 (en) Context-sensitive compiler directives
JP2001166946A (en) Method and device for compiling source code by flattening hierarchy
US20060107258A1 (en) Program, program code optimization method, program code compile method, program code, and information processing system
EP0692115B1 (en) System for conversion of loop functions to continuation-passing style
US5404531A (en) Method and apparatus for compiler processing on program related to data transfer and calculation, and method of managing memory
Oliveira et al. From circus to jcsp
US6233732B1 (en) Compiling system using intermediate codes to store a plurality of values
Oliveira et al. A tactic language for refinement of state-rich concurrent specifications
JPH09282174A (en) Program execution method
Papaefstathiou et al. An introduction to the layered characterisation for high performance systems

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060111

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090127

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090422

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090616

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090714

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120724

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130724

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees