135 research outputs found
Four relational programs
Relational programming is a style of programming in which entire relations are manipulated as data and in which programs are also considered relations. Extensive use is made of higher-order, finite and infinite relations and functions. This report demonstrates the relational programming language RPL by using it to develop four programs: (1) computing work frequencies from text; (2) minimizing deterministic finite state automata; (3) Gaussian elimination; and (4) a simple data processing example involving updating an employee file. Appendix A shows transcripts of executions of the programs on the Brown and Mitton interpreter. The reader is presumed to be familiar with RPL. for convenience, however, Appendix B contains the RPL grammar, and Appendix C describes the language accepted by the Brown and Mitton interpreterRelational programming, functional programming, relations, relational algebra,
relational calculus, applicative programming, logic programming, combinator,
very-high level language, Gaussian elimination, finite state automata,
higher order functionsSupported by Contract from the Office of Naval Research.http://archive.org/details/fourrelationalpr00maclN0001485WR24057N
Relational Programming in miniKanren: Techniques, Applications, and Implementations
Thesis (Ph.D.) - Indiana University, Computer Sciences, 2009The promise of logic programming is that programs can be written
relationally, without distinguishing between input
and output arguments. Relational programs are remarkably
flexible—for example, a relational type-inferencer also performs
type checking and type inhabitation, while a relational theorem prover
generates theorems as well as proofs and can even be used as a simple
proof assistant.
Unfortunately, writing relational programs is difficult, and requires
many interesting and unusual tools and techniques. For example, a
relational interpreter for a subset of Scheme might use nominal
unification to support variable binding and scope, Constraint Logic
Programming over Finite Domains (CLP(FD)) to implement relational
arithmetic, and tabling to improve termination behavior.
In this dissertation I present miniKanren, a family
of languages specifically designed for relational programming, and
which supports a variety of relational idioms and techniques. I show
how miniKanren can be used to write interesting relational programs,
including an extremely flexible lean tableau theorem prover and a
novel constraint-free binary arithmetic system with strong termination
guarantees. I also present interesting and practical techniques used
to implement miniKanren, including a nominal unifier that uses
triangular rather than idempotent substitutions and a novel
“walk”-based algorithm for variable lookup in triangular
substitutions.
The result of this research is a family of languages that supports a
variety of relational idioms and techniques, making it feasible and
useful to write interesting programs as relations
Applying relational algebra and RelView to coalition formation
We present an application of relational algebra to coalition formation. This leads to speciïŹcations, which can be executed with the help of the RelView tool after a simple translation into the tool's programming language. As an example we consider a simpliïŹcation of the situation in Poland after the 2001 elections.RelView; relational algebra; coalition formation; feasible government; dominance; stable government
A Relational Derivation of a Functional Program
This article is an introduction to the use of relational calculi in deriving programs. Using the relational caluclus Ruby, we derive a functional program that adds one bit to a binary number to give a new binary number. The resulting program is unsurprising, being the standard quot;, but the derivation illustrates a number of points about working with relations rather than with functions
A multi-set extended relational algebra: a formal approach to a practical issue
The relational data model is based on sets of tuples, i.e. it does not allow duplicate tuples an a relation. Many database languages and systems do require multi-set semantics though, either because of functional requirements or because of the high costs of duplicate removal in database operations. Several proposals have been presented that discuss multi-set semantics. As these proposals tend to be either rather practical, lacking the formal background, or rather formal, lacking the connection to database practice, the gap between theory and practice has not been spanned yet. This paper proposes a complete extended relational algebra with multi-set semantics, having a clear formal background and a close connection to the standard relational algebra. It includes constructs that extend the algebra to a complete sequential database manipulation language that can either be used as a formal background to other multi-set languages like SQL, or as a database manipulation language on its own. The practical usability of the latter option has been demonstrated in the PRISMA/DB database project, where a variant of the language has been used as the primary database languag
Applications of Relations and Graphs to Coalition Formation
A stable government is by definition not dominated by any other government. However, it may happen that all governments are dominated. In graph-theoretic terms this means that the dominance graph does not possess a source. In this paper we are able to deal with this case by a clever combination of notions from different fields, such as relational algebra, graph theory, social choice and bargaining theory, and by using the computer support system RelView for computing solutions and visualizing the results. Using relational algorithms, in such a case we break all cycles in each initial strongly connected component by removing the vertices in an appropriate minimum feedback vertex set. So, we can choose an un-dominated government. To achieve unique solutions, we additionally apply social choice rules. The main parts of our procedure can be executed using the RelView tool. Its sophisticated implementation of relations allows to deal with graph sizes that are sufficient for practical applications of coalition formation.Graph Theory, RELVIEW, Relational Algebra, Dominance, Stable Government
- âŠ