lib(cprolog)


    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. 
    expand_term/2 
	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. 
    Numbers 
	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. 
    Operators 
	In C-Prolog there is a bug regarding the operator not -- it
	binds closer than its precedence declaration. 
    Strings 
	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. 
    get/1
	This is similar to the ECLiPSe predicate get/1, but
	control characters and blank spaces are skipped. 
    put/1
	This is similar to the ECLiPSe predicate put/1, but it
	first applies arithmetic evaluation to its argument. 
    heapused/1
	Needed for evaluating heapused in arithmetic expressions. 
	It returns the sum of code heap and general heap usage. 
    instance/2
	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. 
    ttyput/1
    	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: 
    
	single (resp. double) quote must be doubled between single (resp. double) quotes. 
	$ is a normal character. 
	the symbol | is not an atom. 
    
    The following properties of original C-Prolog are not simulated by
    the compatibility package: 
    
	a clause can not be ended by end of file. 
	based integers are not accepted. 
	comments are not a delimiter (just ignored). 
	{} is not an atom. 
	[] can not be a functor. 
    
    

