244 research outputs found
Towards high-level execution primitives for and-parallelism: preliminary results
Most implementations of parallel logic programming rely on complex low-level machinery which is arguably difflcult to implement and modify. We explore an alternative approach aimed at taming that complexity by raising core parts of the implementation to the source language level for the particular case of and-parallelism. Therefore, we handle a signiflcant portion of the parallel implementation mechanism at the Prolog level with the help of a comparatively small number of concurrency-related primitives which take care of lower-level tasks such as locking, thread management, stack set management, etc. The approach does not eliminate altogether modiflcations to the abstract machine, but it does greatly simplify them and it also facilitates experimenting with different alternatives. We show how this approach allows implementing both restricted and unrestricted (i.e., non fork-join) parallelism. Preliminary experiments show that the amount of performance sacriflced is reasonable, although granularity control is required in some cases. Also, we observe that the availability of unrestricted parallelism contributes to better observed speedups
Amalia -- A Unified Platform for Parsing and Generation
Contemporary linguistic theories (in particular, HPSG) are declarative in
nature: they specify constraints on permissible structures, not how such
structures are to be computed. Grammars designed under such theories are,
therefore, suitable for both parsing and generation. However, practical
implementations of such theories don't usually support bidirectional processing
of grammars. We present a grammar development system that includes a compiler
of grammars (for parsing and generation) to abstract machine instructions, and
an interpreter for the abstract machine language. The generation compiler
inverts input grammars (designed for parsing) to a form more suitable for
generation. The compiled grammars are then executed by the interpreter using
one control strategy, regardless of whether the grammar is the original or the
inverted version. We thus obtain a unified, efficient platform for developing
reversible grammars.Comment: 8 pages postscrip
Recommended from our members
A uniform architecture for parsing and generation
The use of a single grammar for both parsing and generation is an idea with a certain elegance, the desirability of which several researchers have noted. In this paper, we discuss a more radical possibility: not only can a single grammar be used by different processes engaged in various "directions" of processing, but one and the same language-processing architecture can be used for processing the grammar in the various modes. In particular, parsing and generation can be viewed as two processes engaged in by a single parameterized theorem prover for the logical interpretation of the formalism. We discuss our current implementation of such an architecture, which is parameterized in such a way that it can be used for either purpose with grammars written in the PATR formalism. Furthermore, the architecture allows fine tuning to reflect different processing strategies, including parsing models intended to mimic psycholinguistic phenomena. This tuning allows the parsing system to operate within the same realm of efficiency as previous architectures for parsing alone, but with much greater flexibility for engaging in other processing regimes.Engineering and Applied Science
FIT-PROLOG : a functional/relational language comparison
The programming languages FIT and PROLOG are compared as examples of functional and relational programming, respectively. This leads to some proposals concerning both languages.
As an introductory tutorial, PROLOG facts, questions, variables, conjunctions, and rules are reformulated in FIT.
A natural equivalence between functions and relations is exploited for their interchangeable FIT use. An ESCVAL operator is proposed which causes relation calls to return values of request variables and thus permits their function-like nesting. Function calls with request variables are introduced, showing a sense in which FIT functions are more general than PROLOG relations. Higher-order functions and relations are demonstrated to be available in FIT but not in PROLOG.
PROLOG structures and FIT compounds differ mainly in the fixed arity of the former and the variable length of the latter. FIT's compounds can also be interpreted as function calls that return themselves in normalized form.
Pattern matching in PROLOG [FIT] treats list heads and tails asymmetrically [symmetrically] and doesn't [does] allow for non-deterministic results. While PROLOG generalizes pattern-data matching to pattern-pattern unification. FIT generalizes it to adapter-data fitting.
PROLOG's Horn clauses in FIT become implicit fitters: Facts become special implicit adapters and rules become special implicit transformers; for PROLOG II constraints, transformers with LOCAL bodies or invocation adapters with COM[POSE-TRA]FO expressions can be used. While PROLOG interprets clauses in textual order, FIT interprets them in a specificity order which is modifiable by a SECURE operator. Although PROLOG's cut operator is not used in FIT, a proposal is made to distinguish the specification of clause ordering [by FIT's SECURE operator] and the specification of clause abandoning [by an EXCLUSIVE operator corresponding to 'initial'-restricted cuts]. EXCLUSIVE-marked COMFO-constrained rules are then used for functional and relational representations of guarded commands.
A comparison of the list processing capabilities of both languages exemplifies how FIT's adapters can make relational programming more concise than PROLOG’s Horn clauses. The representation of sets as lists without duplicates leads to difficulties with PROLOG's standard intersection and union predicates, which can be overcome by representing them as the self-normalizing CLASS data structure in FIT.
Possible reasons for the poor readability of Warren's PROLOG serialise predicate are discussed and an alternative FIT function is formulated which shows the inherent simplicity of this problem. McDermott's PROLOG quadrat predicate is transformed into a more concise and readable ESCVAL form, which in turn is transformed into a corresponding FIT ESCVAL form and into a functional FIT form. Fermat's equation is formulated relationally, showing that for principal reasons some relations can not be used in all ways allowed by PROLOG's notation, a problem that does not arise in a corresponding functional FIT formulation
SICStus MT - A Multithreaded Execution Environment for SICStus Prolog
The development of intelligent software agents and other
complex applications which continuously interact with their
environments has been one of the reasons why explicit concurrency has
become a necessity in a modern Prolog system today. Such applications
need to perform several tasks which may be very different with respect
to how they are implemented in Prolog. Performing these tasks
simultaneously is very tedious without language support.
This paper describes the design, implementation and evaluation of a
prototype multithreaded execution environment for SICStus Prolog. The
threads are dynamically managed using a small and compact set of
Prolog primitives implemented in a portable way, requiring almost no
support from the underlying operating system
Lightweight compilation of (C)LP to JavaScript
We present and evaluate a compiler from Prolog (and extensions) to JavaScript which makes it possible to use (constraint) logic programming to develop the client side of web applications while being compliant with current industry standards. Targeting JavaScript makes (C)LP programs executable in virtually every modern computing device with no additional software requirements from the point of view of the user. In turn, the use of a very high-level language facilitates the development of high-quality, complex software. The compiler is a back end of the Ciao system and supports most of its features, including its module system and its rich language extension mechanism based on packages. We present an overview of the compilation process and a detailed description of the run-time system, including the support for modular compilation into separate JavaScript code. We demonstrate the maturity of the compiler by testing it with complex code such as a CLP(FD) library written in Prolog with attributed variables. Finally, we validate our proposal by measuring the performance of some LP and CLP(FD) benchmarks running on top of major JavaScript engines
Parallelizing irregular and pointer-based computations automatically: perspectives from logic and constraint programming
Irregular computations pose sorne of the most interesting and challenging problems in automatic parallelization. Irregularity appears in certain kinds of numerical problems and is pervasive in symbolic applications. Such computations often use dynamic data structures, which make heavy use of pointers. This complicates all the steps of a parallelizing compiler, from independence detection to task partitioning and placement. Starting in the mid 80s there has been significant progress in the development of parallelizing compilers for logic proÂgramming (and more recently, constraint programming) resulting in quite capable paralleÂlizers. The typical applications of these paradigms frequently involve irregular computations, and make heavy use of dynamic data structures with pointers, since logical variables represent in practice a well-behaved form of pointers. This arguably makes the techniques used in these compilers potentially interesting. In this paper, we introduce in a tutorĂal way, sorne of the
problems faced by parallelizing compilers for logic and constraint programs and provide pointers to sorne of the significant progress made in the area. In particular, this work has resulted in a series of achievements in the areas of inter-procedural pointer aliasing analysis for independence detection, cost models and cost analysis, cactus-stack memory management, techniques for managing speculative and irregular computations through task granularity control and dynamic task allocation such as work-stealing schedulers), etc
Recommended from our members
The AND/OR process model for parallel interpretation of logic programs
Current techniques for interpretation of logic programs involve a sequential search of a global tree of procedure invocations. This dissertation introduces the AND/OR Process Model, a method for interpretation by a system of asychronous, independent processes that communicate only by messages. The method makes it possible to exploit two distinct forms of parallelism. OR parallelism is obtained from evaluating nondeterministic choices in parallel. AND parallelism arises in the execution of deterministic fuctions, such as matrix multiplication of divide and conquer algorithms, that are inherently parallel. The two forms of parallelism can be exploited at the same time. This means AND parallelism can be applied to clauses that are composed of several nondeterministic components, and it can recover from incorrect choices in the solution of these components. In addition to defining parallel computations, the model provides a more defined procedural semantics for logic programs; that is, parallel interpreters based on this model are able to generate answers to queries that cause standard interpreters to go into an infinite loop. The interpretation method is intended to form the theoretical framework of a highly parallel non von Neumann computer architecture; the dissertation concludes with a discussion of issues involved in implementing the abstract interpreter on a multiprocessor
- …