Quintus Prolog Homepage WELCOME TO
Quintus Prolog
The Industry Standard
  Quintus Home > Embeddability
Quintus Prolog programs can be<br>intergrated in software <br>written in other languages

Quintus Prolog programs can be
intergrated in software
written in other languages

Embeddability

Embeddabilitymeans that a Quintus Prolog program can be fully and cleanly integrated with software written in other languages.
Prolog does not need to be in command of all parts of a program. The specific features of Quintus Prolog that support embeddability are:


Calling Prolog from other languages. Most Prolog systems, including Quintus, allow Prolog to call routines in other languages, but Quintus Prolog modules can be linked with code written in other languages and called as subroutines. In particular, C/C++ functions can call Quintus Prolog predicates. Thus, each language can call the other, allowing greater freedom in organizing multi-language programs.

Under Windows 98/ME/NT/2000/XP, it is possible to build DLLs containing Prolog code to be linked dynamically into applications, and a Visual Basic interface, using this mechanism, is provided.

Data Structure Interaccess. Quintus Prolog's compound terms can be passed to C/C++ functions, and a library of C/C++ functions is provided for testing, unifying, comparing and constructing Prolog terms in C/C++ programs. Quintus Prolog's arithmetic evaluation allows access to elements of C/C++ data structures, and a built-in predicate assign/2 allows assignment into C/C++ data structures.

Open OS Interface. The main interfaces between Quintus Prolog and the operating system are user-visible. That is, I/O and memory management interfaces are documented functions, and their C source code is provided. These functions can be replaced as needed, in applications that need to control I/O or memory management.

Discontiguous Memory Management. Many Prolog systems require the programmer to specify the maximum sizes of various stacks used by Prolog and to allocate the space for these stacks in advance. In contrast, Quintus Prolog allocates and frees memory according to the needs of the program, and it reallocates space between its various internal stacks when appropriate.

Discontiguous stacks support embedding Prolog in applications that require their own memory management strategies.

Under Windows 98/ME/NT/2000/XP, Quintus Prolog takes advantage of the Sparse Memory ManagementAPI. This allows memory freed by the Prolog system to be shared with other processes.