Professional Documents
Culture Documents
Pgina 1 de 25
October 1997
We are happy to present the Visual Prolog 5.0 Professional Version !
Contents
Installing and registering Visual Prolog Features of Visual Prolog Exploring Visual Prolog Documentation News in Visual Prolog 5.0 Potential Upgrade problems Known problems Introduction to the Prolog Language Prolog Development Center Licensee Agreement
Contacting PDC
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 2 de 25
Ordering and information: sales@pdc.dk Web: http://www.pdc.dk FTP: ftp.pdc.dk If you are using a WEB-browser: ftp://ftp.pdc.dk/ Support: Contact http://www.pdc.dk; or mail to: support@pdc.dk
General comments can be directed to:
Denmark: Prolog Development Center A/S H.J. Holstvej 3-5A, DK-2605 Broendby,Copenhagen, Phone: +45 36 72 10 22 FAX: +45 36 72 02 69 Leo Jensen: leo@pdc.dk
US: Prolog Development Center 568 14th Street Atlanta, GA 30318 Phone 800 762 2710(toll free) 404 873 1366 Fax 404 872 5243 Michael Alexander: michael@pdcatlanta.com Back to table of contents
Russia: Prolog Development Center PBOX 116 191014 St.Petersburg Russia Phone 812 272 3038 Fax 812 272 3038 Victor Yukhtenko: victor@pdc.spb.su
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 3 de 25
to solve everything with database technology, but this approach often leads to bad results in both development time and in the performance of the final system. An application developed in Prolog can have far superior performance and user friendliness along with a shorter development time. PDC's Prolog is particularly well suited for these kinds of traditional database tasks, because Visual Prolog has among its programming capabilities a full, very easy-to-use database engine. Programs created by Visual Prolog are very fast because of the highly optimizing compiler, almost as fast as C++-based applications.
X, Y, Z are here variables, which are used to specify bindings between the different relations. Variables can be any name starting with an uppercase letter.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 4 de 25
If you use a variable in the goals, Prolog will find the value for the variable: Goal father(X,"Mary"). Prolog will answer X="Mary" because it can look it up in the facts.
There is no difference between using facts and rules, for example if the goal is: Goal sister(X,"Mary"). Prolog will answer X="Sally" because "Sally" can satisfy the rule for sister.
Similarly, Prolog can use its deductive ability to find all solutions to the problem: Goal father("John",X). Prolog will answer X="Mary" X="Sally" X="Sam" The solutions are found through backtracking where all combinations are tried. This automatic backtracking mechanism combined with the built-in database (the facts) is one of Visual Prolog's most powerful tools.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 5 de 25
Code Experts that create and maintain the Prolog control code for the resources.
The greatest strength of Visual Prolog is probably the combination of the Layout tools and the Code Experts. The code experts take care of much of the work for you, meaning that you can create a new application in a few minutes, and incrementally enhance this from a prototype to your final application
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 6 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 7 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 8 de 25
components, colors, constants etc. of Visual Prolog. All these things can be readily pasted into the source code with a click of the mouse.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 9 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 10 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 11 de 25
DOMAINS DETER = none ; deter(string) NOUNP = nounp(DETER,string,RELCL) RELCL = none ; relcl(string,VERBP) VP = vp(string,string) NP = np(string) SENTENCE = sent(NOUNP,VERBP) ; question(VP,NP) TOKL =string*
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 12 de 25
Debugger
When you work with larger Prolog programs, you will find the Visual Prolog debugger an indispensable tool. The debugger works on the compiled code, and allows setting breakpoints and stepping through the code. While stepping through the code, the variable values can be inspected as well as the contents of the asserted facts.
check_diskette(S):trap(disk(S),ExitCode, errorhandler(ExitCode)).
Classes &Objects.
Often people distinguish between object-oriented and declarative programming languages, but in Visual Prolog you can use features from both paradigms. The Visual Prolog language has support for Objects and Classes in a design similar to C++ implementations.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 13 de 25
check() endclass implement aclass FACTS f(aclass) CLAUSES store():this(O), assert(f(ORef)). check():f(ORef), ORef:testpred("Check Virtual methods"), testpred(TXT):write(TXT),nl. endclass GOAL O = aclass::new(), O:check().
Portable code
The Visual Prolog system is available on, and can generate programs for, a variety of platforms. Apart from a few operating system-specific facilities and limitations, the Prolog code is portable between all of them. Functions like copying, renaming and deleting files, invoking other programs, returning the date and time, etc. work the same way on all platforms. Applications can be produced for DOS, DOS Extended, Windows 3.x, Windows 95, Windows NT, OS/2 Textmode, OS/2 Presentation Manager, SCO UNIX and Linux (the VPI is not supported under UNIX,DOS, DOS-extended or OS/2 textmode).
An Open Platform.
Visual Prolog is well designed to interface with other programming tools. Visual Prolog can generate routines callable from other languages and can itself call routines written in other languages. The interface is general and supports all compilers that generate standard .OBJ modules. Also, Visual Prolog programs can both call .DLL's and also be placed in .DLL's. By declaring Global 'prolog' predicates as being of language C calling convention, by declaring the argument types and the input/output flow patterns, it is possible to call the C routines directly (as if they were Prolog) without any special glue code between Prolog and C! This interface works in both directions, when the predicates are being declared as language C, they can be called directly from C language routines!
GLOBAL PREDICATES procedure LONG vpi_LoadDll( STRING ) - (I) language c procedure vpi_FreeDll( LONG ) - (I) language c procedure LONG vpi_GetDllProc( LONG, STRING ProcName ) - (I,I) language c
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 14 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 15 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 16 de 25
platforms.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 17 de 25
logic programming languages, inference engines, expert system shells, or program interfaces.
Installation program.
The installation program that is used to install Visual Prolog is itself written in Visual Prolog, and the source for this is included on the disk. This can be modified to create installation programs for your own applications.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 18 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 19 de 25
Another impressing demo is the LOGIDEMO example, it is a little demo example of how to do an optimization of the logistics in production and distribution of Beers. The demo looks nice because it takes advantage of the included VPI tools like GIS, GRID and the report generator.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 20 de 25
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 21 de 25
HTTP Support VIP 5.0 contains API and example programs that demonstrate the use of the Internet HyperText Transfer Protocol. This is the basic protocol used by the World Wide Web. This API can be used to create WWW client and server utilities as well as Internet Agents in Visual Prolog.
CGI Support & Examples This CGI example shows how it is possible to create Visual Prolog programs that generate dynamic WEB pages.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 22 de 25
ISAPI Support and Examples Visual Prolog's support for Microsoft's ISAPI allows high performance scripts on the Microsoft Information Server or any other HTTP Server that supports the ISAPI interface. Communication with JAVA applets We've also included some examples that illustrate how to make a Prolog server communicate with a JAVA applet. Back to tables of contents
A 32bit Visual Development Environment. Debugger that can debug Win32 applications under Win95 or Windows NT Support for generating Win32 applications to run under Win95 and Windows NT. Support for OS/2 and Presentation Manager. Support for SCO UNIX and Linux command-line text-mode applications. Source code to the Visual Development Environment. Includes the Prolog Compiler in library form to include in your own applications, for e.g. an expert system shell that translates its own language to Prolog, then compiles that to machine code. (Only this capability requires a separate runtime license- all other uses of our code are royalty-free!).
Visual Prolog ships with four manuals and a CD. A complete installation of the Professional Version consists of over 150 MB of files, which may require considerably more actual disk space depending on the drive type. A minimal installation can be done on 20MB.
You can select which parts of Visual Prolog that you wish to install, and the root directory in which to install them. To assist you in making the proper selections all the dialogs have online help. The installation program can also create a program manager group for you. Note that Visual Prolog does not install any .DLLs, modifies no pre-existing .INI files, does not alter registry, etc. In fact, you can remove Visual Prolog entirely from your computer by deleting the directory where it is installed! Note it is possible to run Visual Prolog from the RUN directory on the CD. In fact you can install Visual Prolog on your system just by copying the RUN directory to your harddisk !
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 23 de 25
If you want to install the Linux or SCO version of Visual Prolog, you should look in the SCO and LINUX subdirectories.
Registration
To receive support, updates and further information from PDC, you must send in your registration. For registration, please use registr.htm.
FAMILY - Expressing family relations in Prolog. HANOI - Towers of Hanoi written in Prolog. ROUTE - a program, that solves "travelling salesman"-problems. FWGC - The farmer/wolf/cabbage/goat problem. ZEBRA - The five houses logic puzzle. NQUEEN - How to place N queens on a chessboard.
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 24 de 25
SEN_AN - Analyzing the grammar of a sentence. WORDBREAK - Analyzing where to break words. HARDWARE - How to simulate logic hardware in Prolog. GENI - A very first expert system shell. DIFF - Symbolic differentiation. GEOBASE - Natural language interface to US geography.
DIFF illustrates how to do symbolic differentiation GEOBASE a small natural language interface to a geography database HANOI shows the moving of the towers of hanoi SEN_AN shows how to parse and analyze a sentence and display the structure of the sentence. REGISTER a little database application.
esta/esta.vpr ESTA is an expert system shell. You should try to run it and open the SANOCORD knowledge base which can investigate your overall health. sockbind/programs/ftpagent/ftpagent.vpr FTPAGENT can connect to a list of FTP sites to automatically synchronize directories on your hard disk. sockbind/programs/webagent/webagent.vpr (32bit) WEBAGENT can monitor a given WEB site, and download the content to your hard disk if anything changes, also it can, when running on some operating systems, notify you by E-mail. vpi/programs/label/label.vpr Label Expert is a little application for creating and printing labels. Try it, it is quite nice! vpi/programs/logidemo/trans.vpr Logidemo is an example program for Logistics optimization. The example is about Beer production and distribution, and shows the results on a GIS map. Try it, it is quite good! odbcbind/example/sqldemo/sqldemo.vpr A demo of the ODBC bindings and the GRID control. If you have some ODBC sources set up on your computer, you can view and edit your data. pie/pie.vpr A Prolog Interpreter implemented in the compiled Prolog language. vpi/programs/tangram/tangram.vpr TANGRAM is a fascinating little ancient Chinese puzzle game implemented in Visual Prolog. The Visual Prolog VDE, Utilities, Debugger and Installation program are also Visual Prolog applications !
file:///C:/VIP/INTRO.HTM
25/02/2012
README
Pgina 25 de 25
Documentation
The Visual Prolog documentation consists of about 900 pages of printed documentation separated into four books: Language Tutorial, Visual Development Environment, Getting Started and Visual Programming Interface. In addition a comprehensive on-line help system is included with the system. You will find the documentation for Visual Prolog in the DOC subdirectory. The documentation is supplied as MS Word 97 files. If you do not have a copy of Word 97, you can install the Word viewer from the CD or download a copy from the Microsoft WEBSite.
DOC\GETSTART.DOC - Getting started with Visual Prolog - overview. DOC\LANGUAGE.DOC - The Prolog language DOC\VDE.DOC - The Visual Development Environment. DOC\VPI.DOC - The Visual Programming Interface. Back to tables of contents
file:///C:/VIP/INTRO.HTM
25/02/2012