Combining Relational Algebra, SQL, and Constraint Programming
The goal of this paper is to provide a strong interaction between constraint programming and relational DBMSs. To this end we propose extensions of standard query languages such as relational algebra (RA) and SQL, by adding constraint solving capabilities to them. In particular, we propose non-deterministic extensions of both languages, which are specially suited for combinatorial problems. Non-determinism is introduced by means of a guessing operator, which declares a set of relations to have an arbitrary extension. This new operator results in languages with higher expressive power, able to express all problems in the complexity class NP. Some syntactical restrictions which make data complexity polynomial are shown. The effectiveness of both languages is demonstrated by means of several examples.
KeywordsCombinatorial Problem Constraint Program Expressive Power Hamiltonian Path Relational Algebra
Unable to display preview. Download preview PDF.
- 4.M. Cadoli and A. Schaerf. Compiling problem specifications into SAT. In Proceedings of the European Symposium On Programming (ESOP 2001), volume 2028 of LNAI, pages 387–401. Springer-Verlag, 2001.Google Scholar
- 6.R. Fagin. Generalized First-Order Spectra and Polynomial-Time Recognizable Sets. In R. M. Karp, ed., Complexity of Computation, pages 43–74. AMS, 1974.Google Scholar
- 7.R. Fourer, D. M. Gay, and B. W. Kernigham. AMPL: A Modeling Language for Mathematical Programming. International Thomson Publishing, 1993.Google Scholar
- 9.G. Gottlob, P. Kolatis, and T. Schwentick. Existential second-order logic over graphs: Charting the tractability frontier. In Proc. of FOCS 2000. IEEE CS Press, 2000.Google Scholar
- 14.R. Ramakrishnan. Database Management Systems. McGraw-Hill, 1997.Google Scholar
- 15.P. Van Hentenryck. The OPL Optimization Programming Language. The MITPress, 1999.Google Scholar