next up previous contents index
Next: Command Line Arguments Up: The CLP() Programmer's Manual Previous: Some Programming Techniques

Using the System

 

The user interface of compiled CLP( tex2html_wrap_inline4020 ) is very much like that of a usual Edinburgh-style Prolog interpreter. In other words, it is quite possible to use this system while almost completely ignoring the fact that it is compiler-based. In fact, there is no such thing as an interpreted mode and all code (static and dynamic) is compiled. All goals are compiled (quickly) before being executed, and any consulted file is immediately compiled. The rulebase is available for inspection (except for protected rules) and can be modified dynamically as long as the relevant relations have been declared to be dynamic as described below. Normally the user will find that consulted files take a little longer than usual to be read in (because they are being compiled) and that programs will usually run much more quickly and use less space than in an interpreter. Symbolic debugging is still possible, as are all other aspects of interactive programming. However, the user may also take special advantage of the compiler by creating clam files that contain compiled CLP( tex2html_wrap_inline4020 ) code that can be loaded extremely quickly and do not include the overhead of the original program text, although this rules out certain operations.   In short, the system is intended to get the best of both worlds by combining the flexibility of an interpreter with the efficiency of a compiler. The experienced PROLOG user may want to skip directly to Section 4.6 which illustrates many of the features, syntax and user interface of CLP( tex2html_wrap_inline4020 ) using an example session.


tabular644

The first operation CLP( tex2html_wrap_inline4020 ) performs is to load the distinguished library file init.clpr.   This file must either be in the current working directory, or in a directory whose path name is defined via the environment variable CLPRLIB,    or in a directory whose path name is specified during installation. This last alternative is explained in Chapter 6.




next up previous contents index
Next: Command Line Arguments Up: The CLP() Programmer's Manual Previous: Some Programming Techniques

Alan Borning
Fri Oct 8 12:51:18 PDT 1999