to write rule-based systems. Moreover, the characteristics of the runtime environment, such as
concurrency model, “behaviour”-based programming, fault-tolerance support, whose effectiveness
has already been demonstrated, are able to provide a general-purpose programming and execution
platform much more interesting than that of Prolog and LISP. As for rule-based programming, the
syntax and semantics of Erlang present three interesting characteristics:
1. Symbols and primitive types (i.e. atoms and tuples) are well suited to represent facts of a
knowledge base.
2. Function clauses, written as predicates on parameters, which if matched activate the clause,
fit well in the representation of the precondition part of a rule; at the same time, the function
body can represent the action part.
3. The use of pattern matching facilitates the implementation of rule-handling algorithms, also
improving processing performances.
Following these intuitions, the authors started a research project aimed at verifying the ability
of Erlang to realize rule-processing systems, in order to offer a more complete runtime environ-
ment for Erlang programs and expanding the application fields of this language with new areas.
As a result, a software library called ERESYE (ERlang Expert SYstem Engine) has been written.
ERESYE gives a programmer the ability to write rule engines, each featuring its own knowledge
base and a set of rules. These rules are written as Erlang functions, using the standard Erlang
syntax.
ERESYE is enriched with the possibility of handling ontologies [17], by allowing the definition
of the “universe of discourse” by means of class hierarchies; such classes can be included in rules
through classical object-based abstractions.
In addition, ERESYE supports fault-tolerance since an engine is an instance of the gen server
behaviour and can thus be included in a supervisor tree.
ERESYE is part of the agent platform eXAT [3, 24, 16, 15, 14], but its characteristics make it
suitable for both agent-based applications and general-purpose contexts. An API is made avail-
able, allowing any Erlang application to interact with an ERESYE engine. Moreover, an ERESYE
engine, thanks to its structure and API functions, can also serve as a Linda-like coordination infras-
tructure [10], in order to support coordination in Erlang programs.
The paper is structured as follows. Section 2 describes the main features of the tools currently
available to write rule processing systems, focusing in particular on CLIPS [2]. It then provides
an overview of RETE [19], the matching algorithm currently used in all of these tools. Section 3
describes ERESYE, showing its architecture and the basic functionality, and highlighting the way
in which an ontology can be written and handled. Section 4 presents some examples. Section 5
compares CLIPS with ERESYE. Section 6 concludes the paper.