Applications of Logic Programming in Software Engineering
Appeared in Volume 8/1, February 1995
P.Ciancarini and Leon Sterling
Several efforts have been devoted in the past and are currently being devoted to the design of new mechanisms to control inference improving the execution speed. One of the most notable projects was the Japanese Fifth Generation project, centered upon designing and building new hardware able to execute logic as machine language.
The end of the Fifth Generation project marks a crucial point in the history of Logic Programming. The evaluation of the results of the project has generated a debate centered around the effective applicability of such a technology in industrial contexts. A relevant feature of the debate is the influence of Logic Programming on software engineering research and practice.
In an era of increasing software costs, software engineers need to investigate new methods and techniques, to reduce the costs and the complexities of the software lifecycle, and to face and solve the problems presented by new software systems. Logic languages have proven adequate for `declarative programming', deductive database implementation, expert systems development, AI applications, and more generally as general-purpose tools for exploratory and nondeterministic programming. Being a logic-based language, Prolog can provide a mathematically based framework for symbolic evaluation and automatic deduction.
From a software engineer's perspective, logic languages, especially Prolog, have been advertised as tools useful for executable specification and/or rapid prototyping, often confusing the two activities. Also, in a number of projects logic programming environments have been successfully used to build rule-based tools for software engineers, e.g., expert systems for helping with maintenance of software systems, or generators of test suites.
Hence, a formal specification language should exhibit a clear formal semantics and a programming logic able to support reasoning about specifications. First order logic is widely accepted as a general-purpose reasoning tool for specification formalisms. Prolog is a special form of first-order logic that can be used as an executable specification language. In short, Prolog can be easily used for rapid prototyping of specifications, that run as reasonably efficient programs.
In general, a logic language is a good specification language because it is a very high-level `declarative' language and moreover it is executable, easy to use, and expressive. Being based on logic, it allows both writing high-level specifications and reasoning about them. However, modern Prolog programming systems have lost part of the declarative power of logic, sacrificing it to efficiency. Large efforts are devoted today to define new logic languages that improve on the clarity and expressiveness of Prolog's semantics, while retaining an acceptable performance when executed.
This section included the following papers:
"Design of Redundant Formal Specifications by Logic programming: Merging Formal Text and Good Comments", by Sophie Renault and Pierre Deransart (INRIA Rocquencourt, France). This paper suggests the use of "formal comments" inside normal logic programs: a specification is defined as the union of both the logic program and the comments that state properties of the program itself. Such properties concern completeness and correctness of the specification itself, and can be automatically checked.
"An Intelligent LOTOS interpreter in AMLOG", by A. Togashi, G.Mansfield, and N. Shiratori (Tohoku Univ., Japan). AMLOG is a logic and functional language: here it is used to build a LOTOS interpreter. LOTOS is a standard specification language well known in the field of protocol design and validation. The authors show how the equational logic that is at the basis of AMLOG is useful to refine, execute and reason with LOTOS specifications.
"Transformational Development of Logic Programs from Executable Specifications", by M. Fromherz and N. Fuchs (XEROX PARC, USA and Univ. of Zurich, Switzerland). The authors advocate the use of Explore/L, an object-oriented extension of Prolog, for writing executable specifications that are modular and reusable.
"Specifying industrial real-time systems in a logical framework," by E.Ciapessoni, E.Corsetti, M.Migliorati, and E.Ratto (CISE, Italy). This work describes a real application of TRIO, a logic language based on temporal logic to be able to reason on real-time systems. The application concerns automation of control systems for electricity production, transport and distribution.
"Executable Requirements Specifications in a Logic Specification Language SPILL-2", by F. Kluzniak and M.Milkowska (Univ. of Warsaw, Poland). SPILL-2 is the second version of an executable typed logic language that is an extension of the language Goedel. A SPILL-2 program consists of type declarations, predicates defined by rules, and a number of queries that are used to test the specification.
"Z Specifications: Syntactic Sugar for Prolog?", by L. Sterling and T. Turnidge (Case Western Univ., USA). Z is a well known non-executable specification language based on set theory and first order logic. Sterling and Turnidge illustrate a novel approach to the animation of Z specifications, a topic that has been studied by several researchers.
Logic programming is an interesting technology for software process modeling, for several reasons. First, several routine development activities in the software process can be defined by rules which are immediate to express within logic programming. In fact, a few initial proposals in the field aimed at animating a software process using a Prolog program with some embedded development rules. Second, a modern programming environment for a logic language can be easily used as a project database, usually implementing a number of special primitives to explicitly support process programs. Last, and by no means least, there is a trend toward more complex programming environments, called process-centered development environments, that should be able to "enact" software processes, i.e. to constrain and drive the activity of a group of programmers. Some parallel logic languages are being used to build this kind of environment.
The papers presented in this session were:
"Applications of Logic Programming in Software Process Modeling", by P.Ciancarini (Univ. of Bologna, Italy). Ciancarini presented a survey of software process modeling languages based on rules. It was intended as an introduction to the systems discussed in the succeeding papers, and to the context and problems they attack.
"SPELL: A Logic Programming Language for Process Modeling", by M. Nguyen and R. Conradi (Norwegian Institute of Technology, Norway). SPELL is the process modeling language of the EPOS system. EPOS is a software engineering environment offering integrated software and process configuration management. EPOS is centered upon a project database whose user interface has been programmed in SPELL.
"A Prolog-based Semantics of a Dedicated Process Modeling Language", by G. Junkermann (Univ. of Dortmund, Germany). Prolog is used to animate a graphical process modeling language, based on entity-relationship diagrams and on Statecharts, used in the Merlin process-centered software development environment.
"Pandora: a Temporal Logic Based Process Engine", by P. Lago and G. Malnati (Politecnico di Torino, Italy). A combination of logic programming and temporal logic of traces is used to reason about software processes. Pandora is a logic language to write rule-based event-driven process programs, which drive the evolution of the software process.
The field of formal methods is currently the subject of much study. Here logic programming seems to be a strong candidate to offer a complete formal method. The amalgamation of computation and theorem proving seems a plus for formal methods advocates.
The workshop proceedings have been published as Technical Report CES-94-18 at
Case Western Reserve University. Most papers are also available via FTP
Moreover, a selection of papers presented at the workshop will be published in a special issue of the International Journal of Software Engineering and Knowledge Engineering.
P.Ciancarini Univ. of Bologna, Italy Email: firstname.lastname@example.org Leon Sterling Case Western Reserve University, USA Email: email@example.com