Abstract
This paper investigates the problem of translating set-oriented query specifications into iterative programs. The translation uses techniques of functional programming and program transformation.
We present two algorithms that generate iterative programs from algebra-based query specifications. The first algorithm translates query specifications into recursive programs. Those are simplified by sets of transformation rules before the algorithm generates the final iterative form. The second algorithm uses a two-level translation that generates iterative programs faster than the first algorithm. On the first level a small set of transformation rules performs structural simplification before the functional combination on the second level yields the final iterative form.
- 1 ASTRAHAN ET AL. SYSTEM R: Relational approach to database management. ACM Trans. Database Syst. 1, 2 (June 1976), 97-137 Google ScholarDigital Library
- 2 BACKUS, J. Can programming be liberated from the von Neumann style? A functional style and its algebra of programs. In Commun. ACM 21, 8 (Aug. 1978), 613-641. Google ScholarDigital Library
- 3 BELLEGARDE, F. Rewriting systems on FP expressions that reduce the number of sequences they yield. In ACM Symposium on LISP and Functional Programming (Austin, Tex., Aug. 1984). ACM, New York, 1984, 63-73. Google ScholarDigital Library
- 4 BIRD, R. S. The promotion and accumulation strategies in transformational programming. ACM Trans. Program. Lang. Syst. 6, 4 (Oct. 1984), 487-504. Google ScholarDigital Library
- 5 BUNEMAN, P., AND FRANKEL, R.E. An implementation technique for database query languages. ACM Trans. Database Syst. 7, 2 (June 1982), 164-186. Google ScholarDigital Library
- 6 BURSTALL, R. M., AND DARLINGTON, J. A transformation system for developing recursive programs. J. ACM 24, 1 (Jan. 1977), 44-67. Google ScholarDigital Library
- 7 CODD, E.F. A relational model of data for large shared data banks. Commun. ACM 13, 6 (June 1970), 377-387. Google ScholarDigital Library
- 8 COHEN, N.H. Source-to-source improvement of recursive programs. Ph.D. dissertation, Harvard University, May 1980.Google Scholar
- 9 COLUSSI, L. Recursion as an effective step in program development. ACM Trans. Program. Lang. Syst. 6, 1 (Jan. 1984), 55-67. Google ScholarDigital Library
- 10 DAN{ELS, D. Query compilation in a distributed database system. Tech. Rep. RJ 3432, IBM Research Laboratory, San Jose, CA, Mar. 1982.Google Scholar
- 11 DARLINGTON, J., AND BURSTALL, R.M. A system which automatically improves programs, in Acta Inf. 6, 1 (1976), 41-60.Google ScholarDigital Library
- 12 FREYTAG, J. C. Translating relational queries into iterative programs. Ph.D. dissertation, Harvard University, Sept. 1985. Google ScholarDigital Library
- 13 FREYTAO, J. C., AND GOODMAN, N. Rule-based translation of relational queries into iterative programs. In ACM-SIGMOD Conference on Management of Data (Washington, D.C.), ACM, New York, 206-214. Google ScholarDigital Library
- 14 FRIEDMAN, D. P., AND WISE, D. S. CONS should not evaluate its arguments. In Automata, Languages, and Programming, S. Michaelson and R. Milner, eds., Edinburgh University Press, Edinburgh, 1976, 257-284.Google Scholar
- 15 GIVLER, J. S., AND KIEBURTZ, R.B. Schema recognition for program transformation, in ACM Symposium on LISP and Functional Programming (Austin, Tex., Aug. 1984). ACM, New York, 1984, 74-84. Google ScholarDigital Library
- 16 HENDERSON, P., AND MORRIS, J. H. A Lazy Evaluator. In Third ACM SIGACT-SIGPLAN Symposium of Principles of Programming Languages (Atlanta, Ga., 1976). ACM, New York, 1976, 96-103. Google ScholarDigital Library
- 17 HUET, G. Confluent reductions: Abstract properties and applications of term rewriting systems. J. ACM 27, 4 (Oct. 1980), 797-821. Google ScholarDigital Library
- 18 LORIE, R. A., AND WADE, B.W. The compilation of a high level data language. Tech. Rep., IBM Research Laboratory, San Jose, CA, 1979.Google Scholar
- 19 MEYER, A. What is a model of lambda calculus? Inf. Contr. 52, (1982), 87-122.Google ScholarCross Ref
- 20 ROSENTHAL, A., AND REINER, D. An architecture for query optimization. In A CM-SIGMOD Conference on Management of Data (Orlando, Fla., 1982). ACM, New York, 1982, 246-255. Google ScholarDigital Library
- 21 SHASHA, D. Concurrent algorithms for search structures. Ph.D. dissertation, Harvard University, May 1984. Google ScholarDigital Library
- 22 STONEBRAKER, M., WONG, E., ET AL. The design and implementation of INGRES. ACM Trans. Database Syst. i, 3 (Sept. 1976), 189-222. Google ScholarDigital Library
- 23 STO~, J.E. Denotational Semantics. MIT Press, Cambridge, Ma., 1977.Google Scholar
- 24 TENNENT, R. The denotational semantics of programming languages. Commun. ACM 19, 8 {Aug. 1976), 437-453. Google ScholarDigital Library
- 25 ULLMAN, J.D. Principles of Database Systems. Computer Science Press, San Francisco, 1982. Google ScholarDigital Library
- 26 WILLIAMS, J.H. Notes on the FP Style of Functional Programming. In Functional Programming and its Applications. J. Darlington, P. Henderson, and D. A. Turner, eds. Cambridge University Press, 1982, 193-215.Google Scholar
Index Terms
- On the translation of relational queries into iterative programs
Recommendations
Translation of Object-Oriented Queries to Relational Queries
ICDE '95: Proceedings of the Eleventh International Conference on Data EngineeringProposes a formal approach for translating OODB queries to equivalent relational queries. The translation is accomplished through the use of relational predicate graphs and OODB predicate graphs. One advantage of using such a graph-based approach is ...
A Theory of Translation From Relational Queries to Hierarchical Queries
In a heterogeneous database system, a query for one type of database system (i.e., a source query) may have to be translated to an equivalent query (or queries) for execution in a different type of database system (i.e., a target query). Usually, for a ...
Comments