Visual Prolog

Article on other languages:

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire
Visual Prolog

IDE Screenshot
Developed by Prolog Development Center
Latest release 7.1 / 14 December 2007; 340 days ago
OS MS Windows 2000/XP/Vista
Type Programming language
License Proprietary
Website www.visual-prolog.com

Visual Prolog, also formerly known as PDC Prolog and Turbo Prolog, is a strongly typed object-oriented extension of Prolog. As Turbo Prolog it was marketed by Borland, but it is now developed and marketed by the Danish firm Prolog Development Center (PDC) that originally developed it. Visual Prolog can build Microsoft Windows GUI-applications, console applications, DLLs (dynamic link libraries), and CGI-programs. It can also link to COM components and to databases by means of ODBC.

Visual Prolog is compiled rather than interpreted, as is traditional for logic languages. This provides for an execution speed closer to an optimized C++ program than to an unoptimized C++ program[1], and the important improvement of converting traditional prolog-typical runtime-errors to compiler warnings, which ensures a better robustness of the finished applications.

The core of Visual Prolog are Horn clauses, pattern matching and controlled non-determinism like in traditional Prolog, but unlike traditional Prolog, Visual Prolog has always been strongly and statically typed. Since version 6.0 the language has been fully object-oriented, and in version 7.0 parametric polymorphism was introduced.

In the 'Towers of Hanoi' example, the Prolog inference engine figures out how to move a stack of any number of progressively smaller disks, one at a time, from the left ('left') pole to the right pole ('right') in the described way, by means of a center ('center') pole as transit, so that there's never a bigger disk on top of a smaller disk. The predicate 'hanoi' takes an integer = the number of disks, as an initial argument. In real-life, Visual Prolog is especially suited for intricate problems, such as resource planning, etc. As the example shows, Visual prolog can be used for quick 'programming in the small,' but it is mostly employed for industrial-strength large applications.

Contents

Hanoi Example

 hanoi 
    
       hanoi : unsigned . 
  hanoi 
 
 hanoi 
    
       pole = string. 
 
    
       hanoi :- move, , , . 
 
     
       move : unsigned , pole , pole , pole . 
    
       move, _, _, _ :- !. 
       move, , ,  :- 
           move-, , , , 
           stdio::writef, , , 
           move-, , , . 
  hanoi 
 
 
   console::init, 
   hanoi::hanoi.

References

Books about Visual Prolog

External links

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net