ECLiPSe 6.0 Release Notes
Version 6.0 (Septemper 2008)
The major news for this release is a new compiler. This is accompanied by corresponding improvements in the runtime system, as well as much enhanced source-linked debugging features.
New Compiler
The compiler has been rewritten in ECLiPSe itself, replacing the original compiler which was written in C and hard to maintain and modify. As a consequence, the compilation process itself has become slower, but the generated code will usually run faster and will improve as we implement further optimizations. Performance improvements are due to the new compiler in combination with improvements in the runtime system (regarding calling conventions, inline disjunctions and indexing, variable initalisation, etc).
- New compiler invocation predicates that accept compiler options: compile(File, Options), compile_stream(Stream,Options), compile_term(Term,Options)
- Arithmetic and other simple primitives execute faster
- The compiler treats multiple clauses in the same way as inline disjunctions - both are indexed, and no performance penalty is expected when unfolding predicates.
- Additional singleton warnings: The new compiler will detect additional cases of singleton variables, namely those that occur only once in a branch of a disjunction.
- Conditional compilation directives if/1, elif/1, else/0, endif/0 are supported.
- The new compiler treats :- directives and ?- queries slightly differently. Directives may contain things that are only relevant for the compiler, e.g. module-directives or pragmas. The compiler will interpret these, and only if it cannot do so, will it call the directive as a goal. Queries on the other hand will not be inspected by the compiler, they are always called as a goal.
- Directives that are combinations of general goals and directives processed by the compiler, now generate a warning and may not work as expected. They can usually be split into directives and queries, or rewritten as a query, or rewritten using the new conditional compilation directives (see below)
- Directives are executed at compile-time and at load-time, while queries are only executed at load-time. This difference is only visible when a program is first compiled into a .eco file, and loaded later.
- The include/1 directive now has true include semantics. The [file] syntax can be used as a shorthand for include/1 if used as a compiler directive (when called as a goal, it compiles or loads the given files)
- A few optimizations that were done by the old compiler are not yet implemented in the new one, we hope to implement these in the near future.
- The dfid (depth-first-interative deepening) and occur_check compilation modes are no longer supported. Explicit occurs check is available via the iso:unify_with_occurs_check/2 predicate.
Source-linked Debugging and Breakpoints
With the availability of the new compiler, we are now able to support source-linked debugging features, namely
- Continuous source code display during tracing in tkeclipse
- Single-click breakpoint setting in tkeclipse
- Console debugger has new commands to show source (=,w)
- Breakpoints can be set by source file and line (spy command)
Libraries
Library Changes
- lib(eplex)
-
New predicates:
- eplex_verify_solution/2, lp_verify_solution/3 -- verifies that the solution returned by the solver is indeed feasible.
- eplex_get_iis/4, lp_get_iis/5 -- returns an IIS (Irreducible Infeasuble Subsystem) for an infeasible problem, if supported by the solver (currently CPLEX and Xpress). Also added infeasible handler to allow these predicates to be called when a problem is infeasible.
- lib(scattered) removed
- This library no longer exists - use discontiguous/1 declarations instead.
New Libraries
- lib(ic_global_gac)
- A new library for global constraints for lib(ic) that achieves generalized arc consistency. There is currently one constraint in this library, alldifferent/1, contributed by Helmut Simonis. This version of alldifferent/1 achieves stronger consistency than the versions of alldifferent/1 in lib(ic_global) and lib(ic).
- lib(max_flow), lib(max_flow_eplex)
- Implementation of the Ford-Fulkerson max-flow algorithm between two nodes in a graph, contributed by CrossCore Optimization.
- lib(all_min_cuts), lib(all_min_cuts_eplex)
- Implementation of the Curet et al algorithm for generating all minimum-cost cutsets between a source and a sink node in a graph. Contributed by CrossCore Optimization.
- lib(multifile)
- The implementation of the multifile directive (used for Prolog compatibility) has been factored out into this separate library.
Built-in Predicates
- Record-family: anonymous records added (record_create/1), all records are now obeying logical update semantics (implying that referenced_record/2 will never fail), database references are now handles (is_handle/1 succeeds), and the special db_reference data type does not exist any longer. Filtering is now performed for recorded/2,3 if the term is instantiated, speeding up the matching if multiple terms are recorded with the same key.
- New built-in arity/2 returns the arity of a term or the size of an one-dimensional array. Can be used as function arity/1.
- New arithmetic built-in gcd/5 which returns the Bezout equation coefficients in addition to the Greatest Common Divisor.
- New built-in read_annotated/3 which reads a term and also returns an annotated term with source position information.
- New type-testing built-in callable/1
- New formatting built-in sprintf/3 implements formatted output to a string
- Result unification of arithmetic predicates: when an arithmetic operation is called with an instantiated result argument, and this given value does not match the numeric type of the operation's result, the result is now a simple failure (used to be type error). The new behaviour is more logical, standard-conforming, and enables more compiler optimizations than the old one; it will however catch less errors.
- New flags for get_flag/3 to return more information about predicates: code_size (code size in abstract machine words), port_lines and break_lines (source position of potential and actual break points), port_calls (callee information).
- For better ISO compatibility, assertz/1 has been added as a general alias for assert/1, and retractall/1 replaces retract_all/1 (which is now deprecated).
- Improved canonical paths for Windows: canonical_path_name/3, getcwd/1: for Windows, where the letters in the same pathname are allowed to be either upper or lower cases, the canonical path now returns the original capitalisation for the letters, and is guaranteed to be unique. This requires Windows NT 4.0 or newer, and ECLiPSe will only run on older versions of Windows with recompilation that disables this feature.
Other Changes
- Predefined Operators
-
The precedence and associativity of the unary prefix operators +/1, -/1 and \ /1 have been changed to conform to the ISO definition, even when not in iso-compatibility mode. The cprolog-style compatibility libraries still provide the old style definitions:
ECLiPSe 5.10 default ECLiPSe 5.10 with lib(iso) ECLiPSe 6.0 default and lib(iso) ECLiPSe 6.0 with lib(cprolog/quintus/sictus) op(500, fx, +) op(500, fx, +) op(200, fy, +) op(500, fx, +) op(500, fx, -) op(200, fy, -) op(200, fy, -) op(500, fx, -) op(200, fx, \) op(200, fy, \) op(200, fy, \) - Module System
- tool/1 forward declarations are no longer supported. When compiling a call to a tool predicate, the tool/2 declaration must have been encountered before the call.
- Module Locking
- The module locking primitives have been revised. Modules are now locked with a lock/0 or lock_pass/1 directive, or the corresponding built-in. lock/1 and lock/2 are obsolete.
- Autoloading
- The previously obsoleted autoload/2 and autoload_tool/2 declarations are no longer available. They have been replaced by a simpler facility.
- Conditional compilation
- Conditional compilation (or other source processing) via if/1, elif/1, else/0, endif/0 directives.
- Unloading of embedded ECLiPSe
- ec_cleanup() performs a more complete cleanup, so that an embedded ECLiPSe can be unloaded without quitting the host application.
- Dynamic code
- Filtering of head arguments is now performed for dynamic code, so the execution of dynamic predicates which have many clauses should be faster, but as dynamic predicates are no longer compiled, predicates with complex body goals and few clauses may execute slower. Clause transformation is no longer performed implicitly by assert, and must be explicitly done by the user if required.
- Source Annotation-aware macro transformations
- The macro transformations defined by macro/3 can now optionally deal with source annotation information provided by the compiler, so that source information can be retained for the transformed terms.
- Command Line Options
- Command line options which the ECLiPSe runtime system does not recognise now lead to an error message. In earlier versions, they used to be ignored and passed to the application program. To pass options to the application program, always place them after a -- separator.
Supported Architectures
This release is available for the following architectures:
- Linux/x86 (Intel, AMD,...) 32-bit (i386_linux)
- Linux/x86-64 (Intel, AMD) 64-bit (x86_64_linux)
- Sparc/Solaris 32-bit (sparc_sunos5)
- Mac OS X/Intel 32-bit (i386_macosx)
- Mac OS X/Power PC 32-bit (ppc_macosx)
- Windows NT (4.0 or newer), 2000, 2003, XP, Vista 32-bit (i386_nt)