Jump to content

Visual Prolog

From Wikipedia, the free encyclopedia
Visual Prolog
Paradigmmulti-paradigm:logical,functional,object-oriented,imperative,declarative,generic,concurrent
DeveloperPDC A/S
Stable release
11 build 1105 / January 11, 2024;8 months ago(2024-01-11)
Typing disciplinestatic,strong,inferred
OSWindows
LicenseProprietary
Websitewww.visual-prolog.com

Visual Prolog,previously known asPDC PrologandTurbo Prolog,is a strongly typed object-oriented extension ofProlog.It was marketed byBorlandas Turbo Prolog (version 1.0 in 1986 and version 2.0 in 1988). It is now developed and marketed by the Danish firm PDC that originally created it. Visual Prolog can buildMicrosoft WindowsGUI-applications,console applications,DLLs(dynamic link libraries), andCGI-programs. It can also link toCOM componentsand todatabasesby means ofODBC.

Visual Prolog contains acompilerwhich generatesx86andx86-64machine code. Unlike standard Prolog, programs written in Visual Prolog arestatically typed.This allows some errors to be caught at compile-time instead of run-time.

History

[edit]
VersionNew features
Version 11introduces suspending predicates for asynchronous programming[1]
Version 10introduces object expressions, support for master/slave processes,Microsoft EdgewebView2 control and some support forDirect2D+DirectWrite+Windows Imaging Component.[2]
Version 9introduces bounded polymorphism, extension predicates, threadsafe lock free fact databases, named parameters.[3]
Version 8introduces presenters, for more user friendly data presentation in debugger and running program.[4]
Version 7.5contains http server and LALR(1) parser generator.[5]
Version 7.4can generate 64 bit windows code.[6]
Version 7.3introduced generic classes and interfaces (seeGeneric programming), guardedmonitors.[7]
Version 7.2introduced anonymous predicates (a logical pendant toanonymous functions) and namespaces.[8]
Version 7.0introducedparametric polymorphism.
Sinceversion 6.0the language has been fullyobject-oriented.

Hanoi example

[edit]

In theTowers of Hanoiexample, 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 pole to the right pole in the described way, by means of a center as transit, so that there's never a bigger disk on top of a smaller disk. The predicatehanoitakes an integer indicating the number of disks as an initial argument.

classhanoi
predicates
hanoi:(unsignedN).
endclasshanoi

implementhanoi
domains
pole=left;center;right.

clauses
hanoi(N):-move(N,left,center,right).

classpredicates
move:(unsignedN,poleA,poleB,poleC).
clauses
move(0,_,_,_):-!.
move(N,A,B,C):-
move(N-1,A,C,B),
stdio::writef("move a disc from % pole to the % pole\n",A,C),
move(N-1,B,A,C).
endimplementhanoi

goal
console::init(),
hanoi::hanoi(4).

Reception

[edit]

Bruce F. WebsterofBYTEpraised Turbo Prolog in September 1986, stating that it was the first Borland product to excite him as much as Turbo Pascal did. He liked the user interface and low price, and reported that twoBYUprofessors stated that it was superior to the Prolog they used at the university. While questioning the market demand for the language, Webster concluded that "Turbo Prolog may be as significant a leap in software design as Turbo Pascal represented three years ago", and recommended it to those "at all interested in artificial intelligence, databases, expert systems, or new ways of thinking about programming".[9]Another author in the magazine that month wrote that the language's nonstandard, more structured syntax as making "source listings much more readable than those of standard Prolog". While stating that it had "many good features", he stated that Turbo Prolog's "Turbo Pascal flavor in its compiler and strong data typing... create an identity problem for the language". Describing it as "Turbo Paslog", the author concluded that he does "not recommend it if you are seriously considering becoming a Prolog programmer".[10]The magazine in 1989 listed Turbo Prolog 2.0 as among the "Distinction" winners of the BYTE Awards, approving of how Borland had "developed a system for real-world applications programming".[11]

Books about Visual Prolog

[edit]
  • Thomas W. de Boer,A Beginners Guide to Visual Prolog
  • Eduardo Costa,Visual Prolog for Tyros
  • Giovanni Torrero,VISUAL PROLOG PER PRINCIPIANTIItalian113 pages (pdf)
  • Randall Scott, A Guide to Artificial Intelligence with Visual Prolog,ISBN978-1-4327-4936-1

See also

[edit]

References

[edit]
[edit]