I have an university assignment where my goal is to create a GUI for an expert system created in Turbo Prolog. Is there any common way to do this? Or is there a way that, for example, a Java application can call the Prolog application and import its results? Or should I port my application to Visual Prolog? Thanks in advance.
GUI for a Turbo Prolog application
1.4k Views Asked by Egor AtThere are 2 best solutions below
On
The "native" approach for a GUI with Turbo Prolog was the DOS-based Borland Graphics Interface (BGI). This library is not per se compatible with MS Windows, but you don't indicate what operating system you are targeting with this application.
If you are targeting Windows and want to use BGI graphics, then it's possible you'll find this Windows-port of BGI usable.
If you've never used BGI calls before in Turbo Prolog, then it is perhaps attractive to upgrade to Visual Prolog, which PDC maintains with current releases of MS Windows. The building blocks for a user-interface are very much at hand in the Visual Prolog IDE.
Added: I once built a graphical prototype of a warehouse/logistic system, displaying where specific items are located on a warehouse floor, using Turbo Prolog and BGI calls. So this could be done, I think, for your "university assignment". Less work than cooking up a way for Java to call Turbo Prolog, although there are several Prolog implementations that either interface with or are written in Java. GNU Prolog for Java is free and open source, for example.
Converting from Turbo Prolog to ISO Prolog is not all that hard, unless you are using an external database or other feature intrinsic to Turbo Prolog. Basically you just need to strip out the domain and predicate declarations peculiar to Turbo Prolog, and you'll likely have something that can be tested and run under a wide range of ISO Prolog implementations. If your expert system does use an external database, you'll find it attractive to convert to an internal database (fact clauses) that gets dynamically populated using consult/1 and/or assertz/1.
Well, there is XPCE which is quite nice but I am not 100% sure whether you will be able to use it in Turbo Prolog or you would have to make some modifications; however, since porting is not out of question I guess you could use it.
This is a very useful (imho) FAQ/Guide about XPCE
Some other options from swi-prolog's page about graphics: