32 research outputs found

    Static and Dynamic Coupling Attribute Evaluators

    Get PDF
    Projet CHARMESeveral years ago, the notion of attribute coupled grammars was introduced by Gan­zin­ger and Giegerich,[.ganzinger giegerich montreal.] together with their descriptional composition. The latter works essentially at the specification level, i.e., it produces an attribute grammar which specifies the composition of two attribute coupled grammars. We introduce a new approach to this composition of attribute coupled grammars. It no longer works at the specification level but rather at the evaluator level. It produces a special kind of attribute evaluator, called {\em coupling evaluator}. We present both a static version and a dynamic version of coupling evaluators. Both versions retain the good property of descriptional composition that intermediate trees are not physically constructed. In addition---and this is the main advantage of our approach, compared with descriptional composition---, it is possible to build separately the dynamic coupling evaluator of each attribute coupled grammar; in other words we achieve real {\em separate compilation\/} of AG modules

    Correctness Preserving Transformations on a Multipass Occam Compiler

    Get PDF
    The verification of a compiler may be a substantial task. However, by introducing correctness preserving program transformations some automated assistance becomes available. The idea is to specify an initial multipass compiler, to verify it in the usual way and then, while preserving the overall correctness result, to transform it into a more efficient single pass compiler. This transformation process may be performed using the fold/unfold framework of Burstall and Darlington and automation is provided by the Flagship Programming Environment. We illustrate this transformation process on a compiler for a subset of Occam

    属性付き記号的木変換器の合成

    Get PDF
     関数プログラミングでは,関数間で受け渡される中間的な計算結果に関するコストを削減するため,2つの関数の連続する適用を,中間的な計算結果を介さない1つの関数の適用で置き換える関数融合と呼ばれる最適化が重要である.蓄積引数を伴う再帰プログラムを関数融合により最適化するには,属性付き木変換器の合成アルゴリズムを応用する手法が有効であることが知られている.しかしこの手法は,2つの関数がいずれもパターンマッチのガード式を扱う場合には対応していない.また,従来の木変換器は,有限の領域しか扱えないため,無限の領域に関する条件を記述したガード式を扱うことができない.これらの問題点を解決するため,本論文では,最も基本的な木変換器を無限の領域に対応させた記号的木変換器と同様の拡張手法を,属性付き木変換器に対して行うことで,無限の領域を扱うことが可能な属性付き記号的木変換器を提案する.そして,属性付き記号的木変換器で表現できる計算のクラスが記号的木変換器のクラスより大きいことを示す.さらに,記号的木変換器の合成で用いる手法を属性付き木変換器の合成アルゴリズムに取り入れることで,属性付き記号的木変換器の合成アルゴリズムを構成し,その正当性を証明する.証明では,属性付き記号的木変換器を,見かけ上等価な属性付き木変換器へ符号化することで,属性付き木変換器の合成アルゴリズムの正当性に帰着する.電気通信大学201

    XML stream transformer generation through program composition and dependency analysis

    Get PDF
    AbstractXML stream transformation, which sequentially processes the input XML data on the fly, makes it possible to process large sized data within a limited amount of memory. Though being efficient in memory-use, stream transformation requires stateful programming, which is error-prone and hard to manage.This paper proposes a scheme for generating XML stream transformers. Given an attribute grammar definition of transformation over an XML tree structure, we systematically derive a stream transformer in two steps. First, an attribute grammar definition of the XML stream transformation is inferred by applying a program composition method. Second, a finite state transition machine is constructed through a dependency analysis. Due to the closure property of the program composition method, our scheme also allows modular construction of XML stream transformers.We have implemented a prototype XML stream transformer generator, called altSAX. The experimental results show that the generated transformers are efficient in memory consumption as well as in execution time

    XML stream transformer generation through program composition and dependency analysis

    Get PDF
    AbstractXML stream transformation, which sequentially processes the input XML data on the fly, makes it possible to process large sized data within a limited amount of memory. Though being efficient in memory-use, stream transformation requires stateful programming, which is error-prone and hard to manage.This paper proposes a scheme for generating XML stream transformers. Given an attribute grammar definition of transformation over an XML tree structure, we systematically derive a stream transformer in two steps. First, an attribute grammar definition of the XML stream transformation is inferred by applying a program composition method. Second, a finite state transition machine is constructed through a dependency analysis. Due to the closure property of the program composition method, our scheme also allows modular construction of XML stream transformers.We have implemented a prototype XML stream transformer generator, called altSAX. The experimental results show that the generated transformers are efficient in memory consumption as well as in execution time

    Linear Bounded Composition of Tree-Walking Tree Transducers: Linear Size Increase and Complexity

    Get PDF
    Compositions of tree-walking tree transducers form a hierarchy with respect to the number of transducers in the composition. As main technical result it is proved that any such composition can be realized as a linear bounded composition, which means that the sizes of the intermediate results can be chosen to be at most linear in the size of the output tree. This has consequences for the expressiveness and complexity of the translations in the hierarchy. First, if the computed translation is a function of linear size increase, i.e., the size of the output tree is at most linear in the size of the input tree, then it can be realized by just one, deterministic, tree-walking tree transducer. For compositions of deterministic transducers it is decidable whether or not the translation is of linear size increase. Second, every composition of deterministic transducers can be computed in deterministic linear time on a RAM and in deterministic linear space on a Turing machine, measured in the sum of the sizes of the input and output tree. Similarly, every composition of nondeterministic transducers can be computed in simultaneous polynomial time and linear space on a nondeterministic Turing machine. Their output tree languages are deterministic context-sensitive, i.e., can be recognized in deterministic linear space on a Turing machine. The membership problem for compositions of nondeterministic translations is nondeterministic polynomial time and deterministic linear space. The membership problem for the composition of a nondeterministic and a deterministic tree-walking tree translation (for a nondeterministic IO macro tree translation) is log-space reducible to a context-free language, whereas the membership problem for the composition of a deterministic and a nondeterministic tree-walking tree translation (for a nondeterministic OI macro tree translation) is possibly NP-complete

    Algebraic fusion of functions with an accumulating parameter and its improvement

    Full text link
    corecore