[ Reference Manual | Alphabetic Index ]


C-Prolog compatibility package   [more]


.(?, ?, ?)
No description available
abolish(?, ?)
No description available
arg(?, ?, ?)
No description available
No description available
current_functor(?, ?)
No description available
current_predicate(?, ?)
No description available
No description available
No description available
No description available
No description available
No description available
No description available
instance(?, ?)
No description available
No description available
log(?, ?)
No description available
log10(?, ?)
No description available
No description available
No description available
prompt(?, ?)
No description available
No description available
No description available
No description available


reexport cio
reexport eclipse_language
except get / 1, put / 1, instance / 2, abolish / 1, arg / 3, macro(if / 2, _, _)

Other Exports

export op(0, xfx, of)
export op(0, xfx, with)
export op(0, xfy, do)
export op(0, xfx, @)
export op(0, fx, -?->)
export macro(with / 2, = / 2, [])
export macro(of / 2, = / 2, [])
export syntax_option(nl_in_quotes)
export syntax_option(no_blanks)
export syntax_option(no_array_subscripts)
export syntax_option(limit_arg_precedence)
export syntax_option(doubled_quote_is_quote)
export syntax_option(bar_is_no_atom)
export syntax_option(bar_is_semicolon)
export syntax_option(no_attributes)
export syntax_option(no_curly_arguments)
export syntax_option(blanks_after_sign)
export chtab(36, lower_case)
export chtab(92, symbol)
export chtab(128, string_quote)
export chtab(34, list_quote)
export chtab(96, symbol)
export op(300, xfx, mod)
export op(500, fx, +)
export op(500, fx, -)
export op(900, fy, spy)
export op(900, fy, nospy)


One of the requirements during the development of ECLiPSe has been the aim of minimising the work required to port traditional Prolog programs to ECLiPSe. A de-facto standard for many years was the C-Prolog dialect, often referred to as Edinburgh Prolog. Therefore, many of the non standard predicates in C-Prolog have also been included in ECLiPSe. It is of course impossible to achieve total compatibility between the two systems. To assist in making the changes necessary to run a C-Prolog program on the current version of ECLiPSe, we describve here the predicates available in the C-Prolog compatibility library and summarise the principal differences between ECLiPSe Prolog and C-Prolog.

Most of the C-Prolog predicates are also ECLiPSe built-in predicates and so they can be always accessed.

Please note that this text does not detail the functionality of C-Prolog, refer to the C-Prolog documentation for this information.

The effect of the compatibility library is local to the module where it is loaded. For maximum compatibility, a C-Prolog program should be wrapped in a separate module starting with a directive like

    :- module(mymodule, [], cprolog).
In this case, Eclipse-specific language constructs will not be available.

If the compatibility package is loaded into a standard module, e.g. like

    :- module(mymixedmdule).
    :- use_module(library(cprolog)).
then C-Prolog and Eclipse language features can be used together. However, ambiguities must be resolved explicitly and confusion may arise from the different meaning of quotes in Eclipse vs C-Prolog.

Note that the C-Prolog compatibility package includes the cio library (for see/1, seeing/1, seen/0, skip/1, tab/1, tell/1, telling/1, told/0).

The following C-Prolog predicates are not available in ECLiPSe, or the corresponding predicates have a different semantics:

assert/2, asserta/2, assertz/2, clause/3
ECLiPSe does not support database references for clauses.
This is not supported. ECLiPSe provides the macro facility for transforming input terms (see chapter 13).
'LC'/0, 'NOLC'/0
These are not supported in ECLiPSe.

The following differences remain even with the compatibility package:

Database References
ECLiPSe provides database references only for terms in the indexed database, not for program clauses.
C-Prolog has a tendency to "prefer" integers over real numbers. For instance, under C-Prolog when the call X is 4.0/2.0 is made, X is instantiated to an integer. This behaviour does not occur in ECLiPSe. The order of integers and reals in the standard order is different.
In C-Prolog there is a bug regarding the operator not -- it binds closer than its precedence declaration.
Strings are simulated in C-Prolog by lists. Under C-Prolog mode, ECLiPSe provides this functionality -- double-quoted strings are parsed as lists of integers. This can cause confusion when pure ECLiPSe predicates are used in C-Prolog mode, e.g. substring/3 will not accept double-quoted items, since they are lists, not ECLiPSe strings. The built-in string_list/2 converts between both representations.
consult/1, reconsult/1
These are implemented by simply calling the ECLiPSe predicate compile/1. By default all compiled procedures are static. Procedures on which assert/1 etc. will be applied, have to be declared as dynamic using dynamic/1. The notation [-File] for reconsult/1 is not supported.
This is similar to the ECLiPSe predicate get/1, but control characters and blank spaces are skipped.
This is similar to the ECLiPSe predicate put/1, but it first applies arithmetic evaluation to its argument.
Needed for evaluating heapused in arithmetic expressions. It returns the sum of code heap and general heap usage.
Note that this compatibility predicate redefines the ECLiPSe builtin of the same name but different meaning (which is no longer available in C-Prolog mode). It is implemented using the ECLiPSe predicate referenced_record/2.
log/2, log10/2
These are not predicates in C-Prolog (arithmetic functors), but in ECLiPSe they are needed for evaluating log/1 and log10/1 in arithmetic expressions.
corresponds to the DEC-10 Prolog predicate
The list below describes the syntax differences between ECLiPSe and C-Prolog. The following C-Prolog properties are simulated by the compatibility package: The following properties of original C-Prolog are not simulated by the compatibility package:


See Also

library(cio), library(quintus)
Generated from cprolog.eci on 2022-04-24 18:55