3,094 research outputs found
Logic programming in the context of multiparadigm programming: the Oz experience
Oz is a multiparadigm language that supports logic programming as one of its
major paradigms. A multiparadigm language is designed to support different
programming paradigms (logic, functional, constraint, object-oriented,
sequential, concurrent, etc.) with equal ease. This article has two goals: to
give a tutorial of logic programming in Oz and to show how logic programming
fits naturally into the wider context of multiparadigm programming. Our
experience shows that there are two classes of problems, which we call
algorithmic and search problems, for which logic programming can help formulate
practical solutions. Algorithmic problems have known efficient algorithms.
Search problems do not have known efficient algorithms but can be solved with
search. The Oz support for logic programming targets these two problem classes
specifically, using the concepts needed for each. This is in contrast to the
Prolog approach, which targets both classes with one set of concepts, which
results in less than optimal support for each class. To explain the essential
difference between algorithmic and search programs, we define the Oz execution
model. This model subsumes both concurrent logic programming
(committed-choice-style) and search-based logic programming (Prolog-style).
Instead of Horn clause syntax, Oz has a simple, fully compositional,
higher-order syntax that accommodates the abilities of the language. We
conclude with lessons learned from this work, a brief history of Oz, and many
entry points into the Oz literature.Comment: 48 pages, to appear in the journal "Theory and Practice of Logic
Programming
Abstract State Machines 1988-1998: Commented ASM Bibliography
An annotated bibliography of papers which deal with or use Abstract State
Machines (ASMs), as of January 1998.Comment: Also maintained as a BibTeX file at http://www.eecs.umich.edu/gasm
Description and Optimization of Abstract Machines in a Dialect of Prolog
In order to achieve competitive performance, abstract machines for Prolog and
related languages end up being large and intricate, and incorporate
sophisticated optimizations, both at the design and at the implementation
levels. At the same time, efficiency considerations make it necessary to use
low-level languages in their implementation. This makes them laborious to code,
optimize, and, especially, maintain and extend. Writing the abstract machine
(and ancillary code) in a higher-level language can help tame this inherent
complexity. We show how the semantics of most basic components of an efficient
virtual machine for Prolog can be described using (a variant of) Prolog. These
descriptions are then compiled to C and assembled to build a complete bytecode
emulator. Thanks to the high level of the language used and its closeness to
Prolog, the abstract machine description can be manipulated using standard
Prolog compilation and optimization techniques with relative ease. We also show
how, by applying program transformations selectively, we obtain abstract
machine implementations whose performance can match and even exceed that of
state-of-the-art, highly-tuned, hand-crafted emulators.Comment: 56 pages, 46 figures, 5 tables, To appear in Theory and Practice of
Logic Programming (TPLP
Source Code Verification for Embedded Systems using Prolog
System relevant embedded software needs to be reliable and, therefore, well
tested, especially for aerospace systems. A common technique to verify programs
is the analysis of their abstract syntax tree (AST). Tree structures can be
elegantly analyzed with the logic programming language Prolog. Moreover, Prolog
offers further advantages for a thorough analysis: On the one hand, it natively
provides versatile options to efficiently process tree or graph data
structures. On the other hand, Prolog's non-determinism and backtracking eases
tests of different variations of the program flow without big effort. A
rule-based approach with Prolog allows to characterize the verification goals
in a concise and declarative way.
In this paper, we describe our approach to verify the source code of a flash
file system with the help of Prolog. The flash file system is written in C++
and has been developed particularly for the use in satellites. We transform a
given abstract syntax tree of C++ source code into Prolog facts and derive the
call graph and the execution sequence (tree), which then are further tested
against verification goals. The different program flow branching due to control
structures is derived by backtracking as subtrees of the full execution
sequence. Finally, these subtrees are verified in Prolog.
We illustrate our approach with a case study, where we search for incorrect
applications of semaphores in embedded software using the real-time operating
system RODOS. We rely on computation tree logic (CTL) and have designed an
embedded domain specific language (DSL) in Prolog to express the verification
goals.Comment: In Proceedings WLP'15/'16/WFLP'16, arXiv:1701.0014
- …