Using PDC and LPA Prolog
together with Assemblerby George A. Stathis (c) 2002In this site you can...
- Grab some really interesting professional Prolog source-code (for both compilers):
Using LPA's gfx-grafics for more flexible Windows menus
Some useful LPA routines using built-in LPA Prolog predicates
Some useful PDC routines using built-in PDC/Visual Prolog predicates
A system of attribute-unifications hand-coded in Pure Assembler for PDC/Visual Prolog
- Download a Visual Prolog 32-bit DLL (full of optimised ASM) callable from LPA Prolog
and learn how to write your own 32-bit DLL using Visual Prolog 5.* & TASM Assembler
and see examples of assembly language routines linked to PDC/Visual Prolog, as well as
old code
- Discover how you can (re-)use source code written for one compiler within the other:
"Emulating PDC/Visual Prolog built-in predicates within LPA/Win Prolog" and
"Emulating certain LPA/Win Prolog built-in predicates within PDC/Visual Prolog"
- Understand LPA's innovations: LPA Prolog RAM buffers are more efficient than Strings
- Understand PDC's innovations: Certain "PDC-specific" optimisations and innovations
- Read a -highly personalised- "Introduction" to the contents of this site (which follows):
- Jump to my other web-sites -to enjoy my Music Compositions, Soundfonts, Artwork, etc.
INTRODUCTION1) Where "the problem" (and the solution) began...
Today's explosive availability of Raw Dictionary Information downloadable through the Internet is (unfortunately) NOT matched by a correspondingly abundant and mature Source Code - Base for Dictionary Processing.
Moreover, despite the increasing availability of free source code for Lexical Processing, most of this source code caters for its own internal needs and custom-made dictionaries, rather than for general public needs to tame Raw Lexical Information.
A lot of lexical data available on-line today was ("once upon a time" - in the pre-web era) either unavailable or else partially available in error-ridden forms. So I had to write special software using PDC Prolog as well as Pure Assembler routines linked to it, e.g. for merging multiple "raw word-definition lists" with specialised dictionaries, ending up with machine-readable lexicons that were finally digested by my software-dictionary product (HyperLEX) cooking and serving them to a (pre-web) public! In this "early lexical cookery process", I discovered ways of extracting useful information from originally (almost) useless sources, such as Page Data from scanners (using the error-ridden OCR software of the early nineties) or text-form lexicons with incompatible internal structures, most of them begging for clever human intervention (or... more clever A.I. software!)
2) PDC PROLOG and VISUAL PROLOGMy chosen favourite software methodology has been "mixed language programming" in (at least) two main programming languages -both of them extremely powerful, but in different ways:
1) a very fast "slave language" (Assembler, the fastest one possible!)In fact, PDC Prolog was created with speed and efficiency considerations, from the beginning. It broke away from established standards and conventions (at the time it was created) solely for the purpose of achieving more practical and speedy results. It was the only low-cost Prolog compiler which generated efficient executablees, capable of seriously competing with 'C' compilers. Moreover, it has always been easy to link Assembly language routines within PDC compilers, and my old PDC compiler 3.31 is still useful for many tasks today: It still creates fast programs, with assembly language routines easily mixed into them, in a few minutes. In my humble opinion, it's a grossly underestimated Software Development product, much ahead of its time (1990-1993). PDC Prolog's successor, Visual Prolog, followed in the mid/late nineties, and has been my favourite for many new reasons.and
2) a powerful and expressive "master language" (PDC/Visual Prolog)
These two linked together offered the best of each other's worlds:
Assembler Speed and Efficiencytogether with
PDC/Visual Prolog's High-Level ("A.I.") Expressiveness.
2) A very personal interlude... Unfortunately, I'm a man of many skills, many talents, and... many problems, at the same time! E.g. My mother died in April 1998, and I was initially, simply unable (those days) to go on with heavy software development work, even though my software product (HyperLEX) still existed and had acquired a new potential of serious semi-automatic translation, instead of mere word- translations. I was about to complete a multi- year- A.I. project (of size comparable to "Systran" today) when lots of bad things happened (death of mother, financial betrayal by elder brother, my company's closure due to heavy taxation & software theft, separation from close ones, etc). These (objectively sad) events made me react with much creativity, and some depression as well at the time (1998). But I recovered quickly, and a 19-track music CD followed, ignored by Greek music companies but quite successful in the MP3 communities of the internet. I nearly became a musician and a professional composer as a result, but simply couldn't stand composing... trash-music for a living, as most Greek composers do nowadays in a country whose musical tastes are still very backward. Still, it felt nice to see my music rise to No.6 of the world's Top 10 Charts for electronic music (in www.iuma.com).
Well, after a long "musical interlude" I returned to state-of-the-art software work thanks to PDC (who had kindly donated to me their Visual Prolog compiler a few years back) as well as -more recently- LPA (for whom I had the pleasure of working, for a short period of time in early 2001 in their premisses, located in a beautiful rare part of South London).My ex-boss Clive Spencer of LPA remarked: "There are very few Prolog programmers left, and none of them have got any money" despite the fact that Prolog was a language much ahead of its time; still quite ahead of its time!
3) LPA Win-Prolog
So, recently I had close encounters with yet another very good Prolog compiler, LPA Win-Prolog, excellent in both expressiveness and efficiency, particularly for Windows 32-bit programming.
LPA Prolog is not "yet another Prolog dialect" but a proper "Standard Prolog", aspiring to Edinburgh specifications. It includes those meta-programming facilities which PDC/Visual Prolog lacks (or can handle only by tedious extra programming). LPA Prolog also has efficient unique built-in predicates (e.g. see my page "LPA Prolog RAM buffers more efficient than Strings").
Interestingly, I ended up using these two Prolog compilers together at the same time, linked a little indirectly with DLL's called by LPA Prolog, but developed in VISUAL Prolog 5.1 with numerous Pure Assembler subroutines sprinkled internally as *.OBJ-files within these PDC DLLs. All this is somewhat weird-sounding, but extremely powerful as a Development Environment.
Using the techniques described in this site, I am now happily able to revive and re-release HyperLEX 2002, an enhanced and particularly innovative new version of my dictionary HyperLEX - which was THE best software dictionary in Greece during the early nineties: The only one with "true HyperText", amazing speed, and "real speech", at a time (1991) when most other lexical software was... crawling. HyperLEX 2002 now has outstanding new innovative features - that place it (once again) within the "Top Quality Range" of World dictionary software, not just the very small software market of Greece.
- and all this, thanks to... both LPA and PDC!