Constraint programming and database languages: a tutorial

Programming with constraints as primitives extends both deductive and object-oriented data models. This new database programming paradigm (called Constraint Query Languages or CQLS) is based on generalizing relational tu-ples to conjunctions of constraints and, thus, on bringing the programming language core data type closer to thenat-ural language specification of an application. For example, in spatial databases (where standard deductive and object-oriented data models have weaknesses) constraints can be used to define spatial point sets as generalized tuples. Most importantly, constraint data types can besupportedby I/O-efficient access, using existing multi-dimensional searching data structures. Examples ofpotential CQL applications in-elude solid modeling queries in design databases, map overlay queries in geographic databases, and similarity queries in scientific databases. This tutorial is an overview of the development of constraint programming for database applications. We examine: (1) the expressive power for various classes of constraints both linear and nonlinear, (2) calculus/ aigebra language designs combining constraints and complex objects, (3) optimization in the context of constraints, and (4) new data structures for indexing very large sets of constraints. We survey the features of constraint logic programming, deductive databases, and object-oriented databases that are preserved in CQLS and highlight some new challenging problems. 1 From Constraint Programming to Database Querying Constraint programming paradigms are inherently declarative , since they implicitly describe computations by specifying how these computations are constrained.

[1]  A. Tarski A Decision Method for Elementary Algebra and Geometry , 2023 .

[2]  M. Fischer,et al.  SUPER-EXPONENTIAL COMPLEXITY OF PRESBURGER ARITHMETIC , 1974 .

[3]  Ugo Montanari,et al.  Networks of constraints: Fundamental properties and applications to picture processing , 1974, Inf. Sci..

[4]  George E. Collins,et al.  Quantifier elimination for real closed fields by cylindrical algebraic decomposition , 1975 .

[5]  George E. Collins,et al.  Hauptvortrag: Quantifier elimination for real closed fields by cylindrical algebraic decomposition , 1975, Automata Theory and Formal Languages.

[6]  Jeanne Ferrante,et al.  A Decision Procedure for the First Order Theory of Real Addition with Order , 1975, SIAM J. Comput..

[7]  James R. Geiser,et al.  An Efficient Decision Procedure for the Theory of Rational Order , 1977, Theor. Comput. Sci..

[8]  Alan K. Mackworth Consistency in Networks of Relations , 1977, Artif. Intell..

[9]  Leonard Berman,et al.  Precise bounds for presburger arithmetic and the reals with addition: Preliminary report , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[10]  Eugene C. Freuder Synthesizing constraint expressions , 1978, CACM.

[11]  Albert R. Meyer,et al.  On time-space classes and their relation to the theory of real addition , 1978, STOC '78.

[12]  Douglas Comer,et al.  Ubiquitous B-Tree , 1979, CSUR.

[13]  Guy L. Steele,et al.  The definition and implementation of a computer programming language based on constraints , 1980 .

[14]  David Harel,et al.  Structure and complexity of relational queries , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[15]  Ivan Edward Sutherland,et al.  Sketchpad: A man-machine graphical communication system (Outstanding dissertations in the computer sciences) , 1980 .

[16]  Jeffrey D. Ullman,et al.  Principles of Database Systems , 1980 .

[17]  Alan Borning,et al.  The Programming Language Aspects of ThingLab, a Constraint-Oriented Simulation Laboratory , 1981, TOPL.

[18]  Anthony C. Klug Equivalence of Relational Algebra and Relational Calculus Query Languages Having Aggregate Functions , 1982, JACM.

[19]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[20]  J. D. Uiiman,et al.  Principles of Database Systems , 2004, PODS 2004.

[21]  E. F. Codd,et al.  A relational model of data for large shared data banks , 1970, CACM.

[22]  Chee-Keng Yap,et al.  Algebraic cell decomposition in NC , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[23]  Saharon Shelah,et al.  Fixed-point extensions of first-order logic , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[24]  Edward M. McCreight,et al.  Priority Search Trees , 1985, SIAM J. Comput..

[25]  Michael Ian Shamos,et al.  Computational geometry: an introduction , 1985 .

[26]  John H. Reif,et al.  The complexity of elementary algebra and geometry , 1984, STOC '84.

[27]  Neil Immerman,et al.  Relational Queries Computable in Polynomial Time , 1986, Inf. Control..

[28]  Catriel Beeri,et al.  On the power of languages for manipulation of complex objects , 1987, VLDB 1987.

[29]  Wm Leler,et al.  Constraint programming languages , 1987 .

[30]  Joxan Jaffar,et al.  Constraint logic programming , 1987, POPL '87.

[31]  Samuel R. Buss,et al.  The Boolean formula value problem is in ALOGTIME , 1987, STOC.

[32]  Pascal Van Hentenryck,et al.  The Constraint Logic Programming Language CHIP , 1988, FGCS.

[33]  Anthony C. Klug On conjunctive queries containing inequalities , 1988, JACM.

[34]  William Leler,et al.  Constraint programming languages: their specification and generation , 1988 .

[35]  R. Lathe Phd by thesis , 1988, Nature.

[36]  Dennis S. Arnon,et al.  Geometric Reasoning with Logic and Algebra , 1988, Artif. Intell..

[37]  Christos H. Papadimitriou,et al.  Why not negation by fixpoint? , 1988, PODS '88.

[38]  Michael Kifer,et al.  On Safety, Domain Independence, and Capturability of Database Queries (Preliminary Report) , 1988, JCDKB.

[39]  Ivan E. Sutherland,et al.  Sketchpad: a man-machine graphical communication system , 1899, AFIPS '63 (Spring).

[40]  Christoph M. Hoffmann,et al.  Geometric and Solid Modeling: An Introduction , 1989 .

[41]  Yehoshua Sagiv,et al.  Inference of Monotonicity Constraints in Datalog Programs , 1989, PODS.

[42]  Dana S. Scott,et al.  Concurrent constraint programming languages , 1989 .

[43]  Hanan Samet,et al.  The Design and Analysis of Spatial Data Structures , 1989 .

[44]  Peter van Emde Boas,et al.  Integrating Relational Databases and Constraint Languages , 1989, Comput. Lang..

[45]  Pascal Van Hentenryck Constraint satisfaction in logic programming , 1989, Logic programming.

[46]  Jan Chomicki,et al.  Relational specifications of infinite query answers , 1989, SIGMOD '89.

[47]  Peter Z. Revesz A Closed Form for Datalog Queries with Integer Order , 1990, ICDT.

[48]  Alain Colmerauer,et al.  An introduction to Prolog III , 1989, CACM.

[49]  Allen Van Gelder Deriving Constraints Among Argument Sizes in Logic Programs , 1990, PODS.

[50]  Jacques Cohen,et al.  Constraint logic programming languages , 1990, CACM.

[51]  Gabriel M. Kuper,et al.  Constraint query languages (preliminary report) , 1990, PODS '90.

[52]  Neil Immerman,et al.  On Uniformity within NC¹ , 1990, J. Comput. Syst. Sci..

[53]  Paris C. Kanellakis,et al.  Elements of Relational Database Theory , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[54]  Allen Van Gelder,et al.  Deriving constraints among argument sizes in logic programs , 1990, PODS '90.

[55]  Hamid Pirahesh,et al.  Magic conditions , 1990, PODS.

[56]  Jan Chomicki Polynomial time query processing in temporal deductive databases , 1990, PODS '90.

[57]  Serge Abiteboul,et al.  Datalog Extensions for Database Queries and Updates , 1991, J. Comput. Syst. Sci..

[58]  Marianne Baudinet,et al.  On the representation of infinite temporal data and queries (extended abstract) , 1991, PODS '91.

[59]  Martin Odersky,et al.  Constraint-based query optimization for spatial databases , 1991, PODS '91.

[60]  Yehoshua Sagiv,et al.  Inference of Inequality Constraints in Logic Programs. , 1991, PODS 1991.

[61]  Martin J. Dürst,et al.  The design and analysis of spatial data structures. Applications of spatial data structures: computer graphics, image processing, and GIS , 1991 .

[62]  Yehoshua Sagiv,et al.  Inference of inequality constraints in logic programs (extended abstracts) , 1991, PODS '91.

[63]  Raghu Ramakrishnan,et al.  Magic Templates: A Spellbinding Approach To Logic Programs , 1991, J. Log. Program..

[64]  Divesh Srivastava,et al.  Pushing constraint selections , 1992, J. Log. Program..

[65]  Alon Y. Halevy,et al.  Constraints and redundancy in datalog , 1992, PODS.

[66]  R. Van der Meyden,et al.  The complexity of querying indefinite data about linearly ordered domains , 1992, PODS '92.

[67]  James Renegar,et al.  On the Computational Complexity and Geometry of the First-Order Theory of the Reals, Part I: Introduction. Preliminaries. The Geometry of Semi-Algebraic Sets. The Decision Problem for the Existential Theory of the Reals , 1992, J. Symb. Comput..

[68]  Sridhar Ramaswamy,et al.  Indexing for data models with constraints and classes (extended abstract) , 1993, PODS '93.

[69]  Peter Z. Revesz,et al.  A Closed-Form Evaluation for Datalog Queries with Integer (Gap)-Order Constraints , 1993, Theor. Comput. Sci..

[70]  Michael J. Maher,et al.  Toward Practical Constraint Databases , 1993, VLDB.

[71]  David Harel,et al.  Completeness results for recursive data bases , 1993, J. Comput. Syst. Sci..

[72]  Gabriel M. Kuper,et al.  Aggregation in Constraint Databases , 1993, PPCP.

[73]  Jennifer Widom,et al.  Constraint checking with partial information , 1994, PODS.

[74]  Sridhar Ramaswamy,et al.  Path Caching: A Technique for Optimal External Searching , 1994, PODS 1994.

[75]  Jianwen Su,et al.  Finitely representable databases (extended abstract) , 1994, PODS '94.

[76]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[77]  Jan Van den Bussche,et al.  Towards a theory of spatial database queries (extended abstract) , 1994, PODS '94.

[78]  Gabriel M. Kuper,et al.  Linear vs Polynomial Constraints in Database Query Languages , 1994, PPCP.

[79]  Peter J. Stuckey,et al.  Compiling query constraints , 1994, ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems.

[80]  Peter J. Stuckey,et al.  Compiling query constraints (extended abstract) , 1994, PODS.

[81]  Sridhar Ramaswamy,et al.  Path caching (extended abstract): a technique for optimal external searching , 1994, PODS '94.

[82]  Dina Q. Goldin,et al.  Constraint Programming and Database Query Languages , 1994, TACS.

[83]  Jan Paredaens,et al.  Towards a theory of spatial database queries (extended abstract) , 1994, PODS.

[84]  Alexander Brodsky,et al.  The LyriC language: querying constraint objects , 1995, SIGMOD '95.

[85]  Michael J. Maher,et al.  Separability of polyhedra for optimal filtering of spatial and constraint data , 1995, PODS '95.

[86]  Pierre Wolper,et al.  Handling Infinite Temporal Data , 1995, J. Comput. Syst. Sci..

[87]  Gabriel M. Kuper,et al.  Constraint Query Languages , 1995, J. Comput. Syst. Sci..

[88]  D. V. Gucht,et al.  First-order queries on finite structures over the reals , 1995, Proceedings of Tenth Annual IEEE Symposium on Logic in Computer Science.

[89]  Jan Chomicki,et al.  Measuring infinite relations , 1995, PODS '95.

[90]  Sridhar Ramaswamy,et al.  Indexing for Data Models with Constraints and Classes , 1996, J. Comput. Syst. Sci..

[91]  David A. McAllester,et al.  Solving Polynomial Systems Using a Branch and Prune Approach , 1997 .

[92]  Jianwen Su,et al.  Finitely Representable Databases , 1997, J. Comput. Syst. Sci..