Description

 

download the 3.3 documentation !

 

1. What is CLAIRE ?

claire is a high-level functional and object-oriented language with advanced rule processing capabilities. It is intended to allow the programmer to express complex algorithms with fewer lines and in an elegant and readable manner.

To provide a high degree of expressivity, claire uses

·       a rich type system including type intervals and second-order types (with static/dynamic typing),

·       parametric classes and methods,

·       propagation rules based on events,

·       dynamic versioning that supports easy exploration of search spaces.

To achieve its goal of readability, claire uses

·       set-based programming with an intuitive syntax,

·       simple-minded object-oriented programming,

·       truly polymorphic and parametric functional programming,

·       an entity-relation approach with explicit relations, inverses and unknown values.

claire was designed for advanced applications that involve complex data modeling, rule processing and problem solving. claire was meant to be used in a C++ environment, either as a satellite (linking claire programs to C++ programs is straightforward) or as an upper layer (importing C++ programs is also easy). The key set of features that distinguishes claire from other programming languages has been dictated by our experience in solving complex optimization problems. Of particular interest are two features that distinguish CLAIRE from procedural languages such as C++ or Java:

·       Versioning: claire supports versioning of a user-selected view of the entire system. The view can be made as large (for expressiveness) or as small (for efficiency) as is necessary. Versions are created linearly and can be viewed as a stack of snapshots of the system. claire supports very efficient creation/rollback of versions, which constitutes the basis for powerful backtracking, a key feature for problem solving. Unlike most logic programming languages, this type of backtracking covers any user-defined structure, not simply a set of logic variables.

·       Event rules: claire supports rules that bind a claire expression (the conclusion) to the combination of an event and a logical condition. Whenever this event occurs, if the condition is verified, then the conclusion is evaluated. The emphasis on events is a natural evolution from rule-based inference engines and  is well suited to the description of reactive algorithms such as constraint propagation.

claire also provides automatic memory allocation/de-allocation, which would have prevented an easy implementation as a C++ library. Also, set-oriented programming is much easier with a set-oriented language like claire than with libraries. CLAIRE is seven years old and the current version reaches a new level of maturity. The version 3.2 of CLAIRE is motivated by the introduction of Java as another target language but its main feature is the handling of typed lists and sets.

claire is a high-level language that can be used as a complete development language, since it is a general purpose language, but also as a pre-processor to C++ or Java, since a claire program can be naturally translated into a C++ program (We continue to use C++ as our target language of choice, but the reader may now substitute Java to C++ in the rest of this document). claire is a set-oriented language in the sense that sets are first-class objects, typing is based on sets and control structures for manipulating sets are parts of the language kernel. Similarly, claire makes manipulating lists easy since lists are also first-class objects. Sets and lists may be typed to provide a more robust and expressive framework. claire can also be seen as a functional programming language, with full support for lambda abstraction, where functions can be passed as parameters and returned as values, and with powerful parametric polymorphism.

claire is an object-oriented language with single inheritance. As in SMALLTALK, everything that exists in claire is an object. Each object belongs to a unique class and has a unique identity. Classes are the corner stones of the language, from which methods (procedures), slots and tables (relations) are defined. Classes belong themselves to a single inheritance hierarchy. However, classes may be grouped using set union operators, and these unions may be used in most places where a class would be used, which offers an alternative to multiple inheritance. In a way similar to Modula-3, claire is a modular language that provides recursively embedded modules with associated namespaces. Module decomposition can either be parallel to the class organization (mimicking C++ encapsulation) or orthogonal (e.g., encapsulating one service among multiple classes).

claire is a typed language, with full inclusion polymorphism. This implies that one can use claire with a variety of type disciplines ranging from weak typing in a manner that is close to SMALLTALK up to a more rigid manner close to C++. This flexibility is useful to capture programming styles ranging from prototyping to production code development. The more typing information available, the more claire's compiler will behave like a statically typed language compiler. This is achieved with a rich type system, based on sets, that goes beyond types in C++. This type system provides functional types (second-order types) similar to ML, parametric types associated to parametric classes and many useful type constructors such as unions or intervals. Therefore, the same type system supports the naive user who simply wishes to use classes as types and the utility library developer who needs a powerful interface description language.

 

2. contributors

Yves Caseau

François Laburthe

Francois-Xavier Josset

S. Benilan C. Le Pape P. Novat
Th. Benoist S. Hadinger X. Pechoultres
H. Chibois A. Linz L. Segoufin
A. Demaille T. Kökeny