review articles
Doi: 10.1145/1721654.1721675
Combining the paradigm features of both
logic and functional programming makes
for some powerful implementations.
By SERGio Antoy AnD miChAEL hAnuS
functional
Logic
Programming
the eVOLUtiOn OF programming languages is the
stepwise introduction of abstractions hiding the
underlying computer hardware and the details of
program execution. Assembly languages introduce
mnemonic instructions and symbolic labels for hiding
machine codes and addresses. Fortran introduces
arrays and expressions in standard mathematical
notation for hiding registers. Algol-like languages
introduce structured statements for hiding gotos and
jump labels. Object-oriented languages introduce
visibility levels and encapsulation for hiding the
representation of data and the management of
memory. Along these lines, declarative languages—
the most prominent representatives of which are
functional and logic languages—hide the order of
evaluation by removing assignment and other control
statements. A declarative program is a set of logical
statements describing properties of the application
domain. The execution of a declarative program is the
computation of the value(s) of an expression with
respect to these properties. Thus, the
programming effort shifts from encoding the steps for computing a result to
structuring the application data and
the relationships between the application components.
Declarative languages are similar
to formal specification languages,
but with a significant difference: they
are executable. The language that describes the properties of the application domain is restricted to ensure
the existence of an efficient evaluation
strategy. Different formalisms lead to
different classes of declarative languages. Functional languages are based on
the notion of mathematical function; a
functional program is a set of functions
that operate on data structures and are
defined by equations using case distinction and recursion. Logic languages
are based on predicate logic; a logic
program is a set of predicates defined
by restricted forms of logic formulas,
such as Horn clauses (implications).
Both kinds of languages have similar motivations but provide different
features. For example, functional languages provide efficient, demand-driven evaluation strategies that support
infinite structures, whereas logic languages provide nondeterminism and
predicates with multiple input/output
modes that offer code reuse. Since all
these features are useful for developing software, it is worthwhile to amal-
key insights
Professionals involved in software
development should follow the
potential capabilities of functional
logic programming, as it is an emerging
programming paradigm offering novel
ways to develop software.
functional logic programming supports
specification, prototyping, and
application programming within a single
language. it is the basis of a practical
and convenient approach to produce
high-quality software.
functional logic programming is terse
yet clear, supports rapid development by
avoiding some tedious tasks, and allows
incremental refinements to improve
efficiency. it makes programming fun
without sacrificing reliability.