956 research outputs found
Data Structures and Data Types in Object-Oriented Databases
The possibility of finding a static type system for object-oriented programming languages was initiated by Cardelli [Car88, CW85] who showed that it is possible to express the polymorphic nature of functions such a
A Pattern Calculus for Rule Languages: Expressiveness, Compilation, and Mechanization
This paper introduces a core calculus for pattern-matching in production rule languages: the Calculus for Aggregating Matching Patterns (CAMP). CAMP is expressive enough to capture modern rule languages such as JRules, including extensions for aggregation. We show how CAMP can be compiled into a nested-relational algebra (NRA), with only minimal extension. This paves the way for applying relational techniques to running rules over large stores. Furthermore, we show that NRA can also be compiled back to CAMP, using named nested-relational calculus (NNRC) as an intermediate step. We mechanize proofs of correctness, program size preservation, and type preservation of the translations using modern theorem-proving techniques. A corollary of the type preservation is that polymorphic type inference for both CAMP and NRA is NP-complete. CAMP and its correspondence to NRA provide the foundations for efficient implementations of rules languages using databases technologies
Polymorphism and Inference in Database Programming
The polymorphic type system of ML can be extended in two ways to make it the appropriate basis of a database programming language. The first is an extension to the language of types that captures the polymorphic nature of field selection; the second is a technique that generalizes relational operators to arbitrary data structures. The combination provides a statically typed language in which relational databases may be cleanly represented as typed structures. As in ML types are inferred, which relieves the programmer of making the rather complicated type assertions that may be required to express the most general type of a program that involving field selection and generalized relational operators. These extensions may also be used to provide static polymorphic typechecking in object-oriented languages and databases. A problem that arises with object-oriented databases is the apparent need for dynamic typechecking when dealing with queries on heterogeneous collections of objects. An extension of the type system needed for generalized relational operations can also be used for manipulating collections of dynamically typed values in a statically typed language. A prototype language based on these ideas has been implemented. While it lacks a proper treatment of persistent data, it demonstrates that a wide variety of database structures can be cleanly represented in a polymorphic programming language
A Pattern Calculus for Rule Languages: Expressiveness, Compilation, and Mechanization (Artifact)
This artifact contains the accompanying code for the ECOOP 2015 paper: "A Pattern Calculus for Rule Languages: Expressiveness, Compilation, and Mechanization". It contains source files for a full mechanization of the three languages presented in the paper: CAMP (Calculus for Aggregating Matching Patterns), NRA (Nested Relational Algebra) and NNRC (Named Nested Relational Calculus). Translations between all three languages and their attendant proofs of correctness are included. Additionally, a mechanization of a type system for the main languages is provided, along with bidirectional proofs of type preservation and proofs of the time complexity of the various compilers
Polymorphism and Type Inference in Database Programming
The polymorphic type system of ML can be extended in two ways that make it appropriate as the basis of a database programming language. The first is an extension to the language of types that captures the polymorphic nature of field selection; the second is a technique that generalizes relational operators to arbitrary data structures. The combination provides a statically typed language in which relational databases may be cleanly represented as typed structures. As in ML types are inferred, which relieves the programmer of making the rather complicated type assertions that may be required to express the most general type of a program that involves field selection and generalized relational operators.
It is also possible to use these ideas to implement various aspects of object-oriented databases. By implementing database objects as reference types and generating the appropriate views - sets of structures with identity - we can achieve a degree of static type checking for object-oriented databases. Moreover it is possible to exploit the type system to check the consistency of object-oriented classes (abstract data types with inheritance). A prototype language based on these ideas has been implemented. While it lacks some important practical features, it demonstrates that a wide variety of database structures can be cleanly represented in a polymorphic programming language
The design and implementation of a relational programming system.
The declarative class of computer languages consists mainly of two paradigms
- the logic and the functional. Much research has been devoted in recent years
to the integration of the two with the aim of securing the advantages of both
without retaining their disadvantages. To date this research has, arguably, been
less fruitful than initially hoped. A large number of composite functional/logical
languages have been proposed but have generally been marred by the lack of a
firm, cohesive, mathematical basis. More recently new declarative paradigms,
equational and constraint languages, have been advocated. These however do
not fully encompass those features we perceive as being central to functional and
logic languages. The crucial functional features are higher-order definitions, static
polymorphic typing, applicative expressions and laziness. The crucial logic features are ability to reason about both functional and non-functional relationships
and to handle computations involving search.
This thesis advocates a new declarative paradigm which lies midway between
functional and logic languages - the so-called relational paradigm. In a relationallanguage program and data alike are denoted by relations. All expressions
are relations constructed from simpler expressions using operators which form
a relational algebra. The impetus for use of relations in a declarative language
comes from observations concerning their connection to functional and logic programming. Relations are mathematically more general than functions modelling
non-functional as well as functional relationships. They also form the basis of
many logic languages, for example, Prolog.
This thesis proposes a new relational language based entirely on binary relations, named Drusilla. We demonstrate the functional and logic aspects of
Drusilla. It retains the higher-order objects and polymorphism found in modern functional languages but handles non-determinism and models relationships
between objects in the manner of a logic language with notion of algorithm being composed of logic and control elements. Different programming styles -
functional, logic and relational- are illustrated.
However, such expressive power does not come for free; it has associated with
it a high cost of implementation. Two main techniques are used in the necessarily
complex language interpreter. A type inference system checks programs to ensure
they are meaningful and simultaneously performs automatic representation selection for relations. A symbolic manipulation system transforms programs to improve.
efficiency of expressions and to increase the number of possible representations
for relations while preserving program meaning
- …