Next: Scattered
Up: Libraries
Previous: Ptags
  Index
Subsections
Quintus Prolog Compatibility Package
ECLiPSe includes a Quintus Prolog compatibility package to ease the task of
porting Quintus Prolog applications to ECLiPSe Prolog.
This package does not provide the user with a system
completely compatible to Quintus Prolog, however it provides
most of the Quintus built-in predicates, moreover some
of the Quintus library predicates are available in the ECLiPSe library.
This package includes the C-Prolog compatibility package
(see Appendix A.6).
Please note that this appendix does not detail the functionality
of Quintus Prolog, refer to the Quintus Prolog documentation for
this information.
The Quintus Prolog compatibility package can be accessed by issuing
the directive
:- use_module(library(quintus)).
The effect of the compatibility library is local to the module where it
is loaded (except for the redefinition of some global event handlers).
The directive must therefore be given in every module that wants to
use the compatibility mode.
The Quintus package includes the C-Prolog one.
The following Quintus predicates which differ from ECLiPSe
predicates are available:
- 'C'/3
- for grammar rules
- absolute_file_name/2
-
- atom_chars/2
-
- character_count/2
-
- current_input/1
-
- current_key/2
-
- current_module/2
-
- current_output/1
-
- expand_term/2
-
This predicate is dummy, since the ECLiPSe macro facility works
on every input term, provided that the flag macro_expansion
is set to on.
- float/1
-
- flush_output/1
-
- format/2, 3
-
- gc/0
-
- get0/2
-
This predicate is identical to get/2 in ECLiPSe.
- help/1
-
This is the normal ECLiPSe help/1 predicate.
- incore/1
-
- integer/2
-
- is_digit/1
-
- is_lower/1
-
- is_upper/1
-
- line_count/2
-
- manual/0
-
- meta_predicate/1
-
This predicate is not available, as Quintus' method of passing the
module information to meta predicates differs substantially from
the ECLiPSe more general concept of tools (see Section 9.6.4).
Only the operator definition for this functor is available.
- module/2
-
- multifile/1
-
This is implemented by declaring the predicates as dynamic, so to obtain
more efficient programs it is better to put all clauses of the same procedure
into one file (or to concatenate all files where multifile predicates occur).
- no_style_check/1
-
- nogc/0
-
- nospyall/0
-
- number_chars/2
-
- numbervars/3
-
- open_null_stream/1
-
- otherwise/0
-
- portray_clause/1
-
- predicate_property/2
-
The property interpreted is not provided.
The property exported is returned if the predicate is exported
or global.
Use of get_flag/3 should be preferred.
- prolog_flag/2, 3
-
There are some differences in the flags, as they are mostly simulated with
the ECLiPSe flags:
- not all the character escapes used in the Quintus Prolog are available
- gc_margin is taken as the ECLiPSe flag gc_interval
(see Section 19.2)
- setting gc_trace to on sets also gc to on
- public/1
- synonym for global/1
- put/2
-
- put_line/1
-
- retractall/1
-
- set_input/1
-
- set_output/1
-
- source_file/1, 2
-
- statistics/0, 2
-
these predicates are slightly different than in Quintus, see
the description of the ECLiPSe statistics/2 predicate.
The predicate statistics/2 also accepts all Quintus values
in the Quintus mode,
but for stack_shifts is always returns zeros.
statistics/0 returns only Quintus values when in Quintus mode.
- stream_code/2
-
- stream_position/2, 3
-
- style_check/1
-
- term_expansion/2
-
- ttyflush/0, ttyget/1, ttyget0/1, ttynl/0, ttyput/1, ttyskip/1, ttytab/1
-
these predicates work with the stdout stream
- unix/1
-
- unknown/2
-
- version/0
-
Note that line_position/2 is not implemented.
To perform sophisticated output formatting, printf/2,3 or
string streams can be used.
Syntax differences
The list below describes the syntax differences between ECLiPSe and Quintus
Prolog.
The following properties of Quintus Prolog are simulated by the
compatibility package:
- A blank is not allowed between the functor and
the opening bracket.
- single (resp. double) quote must be doubled between single (resp.
double) quote.
- The symbol | (bar) is recognised as an alternative
sign for a disjunction and it acts as an operator.
- newline is allowed between quotes.
The following Quintus properties are not simulated:
- the symbol
- a clause can not be ended by end of file.
- signed numbers: explicitly positive numbers are structures.
- a real with an exponent must have a floating point.
- a space is allowed before the decimal point and the exponent sign.
- the definition of the escape sequence is more extended than in ECLiPSe.
- spy/1 and nospy/1 accept as arguments lists,
rather than comma-separated terms like in ECLiPSe.
Next: Scattered
Up: Libraries
Previous: Ptags
  Index
1999-08-06