Abstract
In our previous paper, we have proposed a framework for automatically translating tree-processing programs into stream-processing programs. However, in writing programs that require buffering of input data, a user has to explicitly use buffering primitives which copy data from input stream to memory or copy constructed trees from memory to an output stream. Such explicit insertion of buffering primitives is often cumbersome and worsens the readability of the program. We overcome the above-mentioned problems by developing an algorithm which, given any simply-typed tree-processing program, automatically inserts buffering primitives. The resulting program is guaranteed to be well-typed under our previous ordered-linear type system, so that the program can be further transformed into an equivalent stream-processing program using our previous framework.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bray, T., Paoli, J., Sperberg-McQueen, C.M., Maler, E.: Extensible markup language (XML) 1.0 (second edition). Technical report, World Wide Web Consortium (October 2000), http://www.w3.org/TR/REC-xml
Fülöp, Z.: On attributed tree transducers. Acta Cybernetica 5, 261–280 (1981)
Ganzinger, H., Giegerich, R.: Attribute coupled grammars. In: Proceedings of the ACM SIGPLAN 1984 Symposium on Compiler Construction (1984)
Hosoya, H., Pierce, B.C.: XDuce: A typed XML processing language. ACM Transactions on Internet Technology (TOIT) 3(2), 117–148 (2003)
Hosoya, H., Vouillon, J., Pierce, B.C.: Regular expression types for XML. In: Proceedings of the International Conference on Functional Programming (ICFP), pp. 11–22 (September 2000)
Kodama, K.: Derivation of XML stream processor based on ordered linear type. Master’s thesis, Tokyo Institute of Technology (March 2005)
Kodama, K., Suenaga, K., Kobayashi, N.: Translation of tree-processing programs into stream-processing programs based on ordered linear type. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 41–56. Springer, Heidelberg (2004)
Nakano, K.: Composing stack-attributed tree transducers. Technical Report METR–2004–01, Department of Mathematical Informatics, University of Tokyo, Japan (2004)
Nakano, K.: An Implementation Scheme for XML Transformation Languages Through Derivation of Stream Processors. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 74–90. Springer, Heidelberg (2004)
Nakano, K., Nishimura, S.: Deriving event-based document transformers from tree-based specifications. In: van den Brand, M., Parigot, D. (eds.) Electronic Notes in Theoretical Computer Science, vol. 44, Elsevier Science Publishers, Amsterdam (2001)
Nishimura, S., Nakano, K.: XML stream transformer generation through program composition and dependency analysis. Science of Computer Programming 54, 257–290 (2004)
Polakow, J.: Ordered linear logic and applications. PhD thesis, Carnegie Mellon University, Available as Technical Report CMU-CS-01-152 (June 2001)
Rehof, J., Mogensen, T.: Tractable constraints in finite semilattices. Science of Computer Programming 35(2), 191–221 (1999)
Suenaga, K., Kobayashi, N., Yonezawa, A.: Extension of type-based approach to generation of stream-processing programs by automatic insertion of buffering primitives. Full paper, Available from http://www.yl.is.s.u-tokyo.ac.jp/~kohei/doc/paper/lopstr05-full.pdf
Benzaken, V., Castagna, G., Frisch, A.: CDuce: An XML-centric general-purpose language. In: Proceedings of the ACM International Conference on Functional Programming (2003)
W3C. Document Object Model (DOM) Level 1 Specification (October 1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Suenaga, K., Kobayashi, N., Yonezawa, A. (2006). Extension of Type-Based Approach to Generation of Stream-Processing Programs by Automatic Insertion of Buffering Primitives. In: Hill, P.M. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2005. Lecture Notes in Computer Science, vol 3901. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11680093_7
Download citation
DOI: https://doi.org/10.1007/11680093_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-32654-0
Online ISBN: 978-3-540-32656-4
eBook Packages: Computer ScienceComputer Science (R0)