14,017 research outputs found

    Proceedings of the Workshop on the lambda-Prolog Programming Language

    Get PDF
    The expressiveness of logic programs can be greatly increased over first-order Horn clauses through a stronger emphasis on logical connectives and by admitting various forms of higher-order quantification. The logic of hereditary Harrop formulas and the notion of uniform proof have been developed to provide a foundation for more expressive logic programming languages. The λ-Prolog language is actively being developed on top of these foundational considerations. The rich logical foundations of λ-Prolog provides it with declarative approaches to modular programming, hypothetical reasoning, higher-order programming, polymorphic typing, and meta-programming. These aspects of λ-Prolog have made it valuable as a higher-level language for the specification and implementation of programs in numerous areas, including natural language, automated reasoning, program transformation, and databases

    O'CIAO an object oriented programming model using CIAO Prolog

    Full text link
    There have been several previous proposals for the integration of Object Oriented Programming features into Logic Programming, resulting in much support theory and several language proposals. However, none of these proposals seem to have made it into the mainstream. Perhaps one of the reasons for these is that the resulting languages depart too much from the standard logic programming languages to entice the average Prolog programmer. Another reason may be that most of what can be done with object-oriented programming can already be done in Prolog through the meta- and higher-order programming facilities that the language includes, albeit sometimes in a more cumbersome way. In light of this, in this paper we propose an alternative solution which is driven by two main objectives. The first one is to include only those characteristics of object-oriented programming which are cumbersome to implement in standard Prolog systems. The second one is to do this in such a way that there is minimum impact on the syntax and complexity of the language, i.e., to introduce the minimum number of new constructs, declarations, and concepts to be learned. Finally, we would like the implementation to be as straightforward as possible, ideally based on simple source to source expansions

    Applied logic : its use and implementation as a programming tool

    Get PDF
    The first Part of the thesis explains from first principles the concept of "logic programming" and its practical application in the programming language Prolog. Prolog is a simple but powerful language which encourages rapid, error-free programming and clear, readable, concise programs. The basic computational mechanism is a pattern matching process ("unification") operating on general record structures ("terms" of logic). IThe ideas are illustrated by describing in detail one sizable Prolog program which implements a simple compiler. The advantages and practicability of using Prolog for "real" compiler implementation are discussed. The second Part of the thesis describes techniques for implementing Prolog efficiently. In particular it is shown how to compile the patterns involved in the matching process into instructions of a low-level language. This idea has actually been implemented in a compiler (written in Prolog) from Prolog to DECsystem-10 assembly language. However the principles involved are explained more abstractly in terms of a "Prolog Machine". The code generated is comparable in speed with that produced by existing DEC10 Lisp compilers. Comparison is possible since pure Lisp can be viewed as a (rather restricted) subset of Prolog. It is argued that structured data objects, such as lists and trees, can be manipulated by pattern matching using a "structure 'sharing" representation as efficiently as by conventional selector and constructor functions operating on linked records in "heap" storage. Moreover the pattern matching formulation actually helps the implementor to produce a better implementation

    The ciao prolog system

    Get PDF
    Ciao is a public domain, next generation multi-paradigm programming environment with a unique set of features: Ciao offers a complete Prolog system, supporting ISO-Prolog, but its novel modular design allows both restricting and extending the language. As a result, it allows working with fully declarative subsets of Prolog and also to extend these subsets (or ISO-Prolog) both syntactically and semantically. Most importantly, these restrictions and extensions can be activated separately on each program module so that several extensions can coexist in the same application for different modules. Ciao also supports (through such extensions) programming with functions, higher-order (with predicate abstractions), constraints, and objects, as well as feature terms (records), persistence, several control rules (breadth-first search, iterative deepening, ...), concurrency (threads/engines), a good base for distributed execution (agents), and parallel execution. Libraries also support WWW programming, sockets, external interfaces (C, Java, TclTk, relational databases, etc.), etc. Ciao offers support for programming in the large with a robust module/object system, module-based separate/incremental compilation (automatically -no need for makefiles), an assertion language for declaring (optional) program properties (including types and modes, but also determinacy, non-failure, cost, etc.), automatic static inference and static/dynamic checking of such assertions, etc. Ciao also offers support for programming in the small producing small executables (including only those builtins used by the program) and support for writing scripts in Prolog. The Ciao programming environment includes a classical top-level and a rich emacs interface with an embeddable source-level debugger and a number of execution visualization tools. The Ciao compiler (which can be run outside the top level shell) generates several forms of architecture-independent and stand-alone executables, which run with speed, efficiency and executable size which are very competive with other commercial and academic Prolog/CLP systems. Library modules can be compiled into compact bytecode or C source files, and linked statically, dynamically, or autoloaded. The novel modular design of Ciao enables, in addition to modular program development, effective global program analysis and static debugging and optimization via source to source program transformation. These tasks are performed by the Ciao preprocessor ( ciaopp, distributed separately). The Ciao programming environment also includes lpdoc, an automatic documentation generator for LP/CLP programs. It processes Prolog files adorned with (Ciao) assertions and machine-readable comments and generates manuals in many formats including postscript, pdf, texinfo, info, HTML, man, etc. , as well as on-line help, ascii README files, entries for indices of manuals (info, WWW, ...), and maintains WWW distribution sites

    Possible Extensions to the Byrd Box Tracer Aimed at Experts Discussion paper for poster presentation at PPIG 1992

    Get PDF
    We argue for the need of a study on how experienced users make use of the Prolog tracing facilities. We know that a lot of time is spent tracing programs during the programming development phase and that often the first attempt to find a bug fails. We divide Prolog bugs into conceptual bugs , related to the problem being solved rather than to the Prolog programming language, and mistakes, related mainly to the syntax of Prolog. We argue that the most Prolog bugs arise from failed unifications, and that a lot of time writing their own debuggers in order to find their conceptual bugs, since they find the tracing facilities inadequate for this purpose. Three changes to Byrd Box trace are suggested in order to enhance the understanding of unification and help experts to find unification bugs quicker. The first change, is to use some techniques from abstract interpretation to make recursive calls condensed into a few lines in the trace. The second idea, is to allow for conditional skipping, where the expert can ask to see a goal before or after a certain goal has unified or failed ( can also be seen in the TPM [Eisenstadt and Brayshaw 88]). The third idea, is to allow the expert to only see calls that affects a certain data structure that is being built or decomposed. The last change to the tracer might possibly allow the expert to find some of her conceptual bugs as well

    Automatic generation of descriptions for Prolog programs

    Get PDF
    It is often hard for students and newcomers used to imperative languages to learn a declarative language such as Prolog. One of their main difficulties is understanding the procedural component of Prolog. Despite being a declarative language, Prolog allows for the creation of procedures whose structure is very different from the more common imperative languages. To tackle this issue, we try to facilitate code comprehension of procedural Prolog through the generation of formal and natural descriptions. First, we represent the workflow of Prolog encoded procedures through formal descriptions similar to imperative languages. To do this, we identify programming patterns that represent the basic blocks of certain classes of Prolog programs. Then we view more complex Prolog programs as coherent compositions of instances of the basic patterns. By using formal templates, we formally describe these individual patterns into an intermediate formal language. Afterwards, we generate natural language descriptions by using templates to describe the formal constructs. Using this two-step approach, we obtain two descriptions (one formal and one in natural language) that are both explanatory of the original program.Normalmente é difícil para alunos e iniciantes que estão habituados a linguagens imperativas, aprender uma linguagem declarativa como o Prolog. Uma das suas principais dificuldades é entender a componente procedimental do Prolog. Apesar de ser uma linguagem declarativa, o Prolog permite a criação de procedimentos cuja estrutura é bastante diferente da usada nas linguagens imperativas. Para abordar este problema tentámos facilitar a compreensão de código do Prolog procedimental através da geração de descrições formais e em linguagem natural. Primeiro, representamos a lógica dos procedimentos em Prolog através de descrições formais similares a linguagens imperativas. Para isto, identificamos os padrões que representam os blocos básicos de certas classes de programas. Depois, consideramos os programas mais complexos como composições destes padrões básicos. Através da utilização de templates formais, descrevemos formalmente estes padrões individuais numa linguagem formal intermédia. Seguidamente, geramos descrições em linguagem natural utilizando templates para descrever os construtos formais. Ao usar esta abordagem de dois passos obtemos duas descrições (uma formal e uma em linguagem natural) que são ambas explanatórias do programa original
    corecore