80 likes | 163 Views
An ide for teaching and learning prolog. Using Prolog Development Tools ( ProDT ). Installation. Need Eclipse (Works on Windows, Linux, and Mac OS) Download the plug-in from: http://prodevtools.sourceforge.net Follow the installation and configuration instructions from the website
E N D
An ide for teaching and learning prolog Using Prolog Development Tools (ProDT)
Installation • Need Eclipse (Works on Windows, Linux, and Mac OS) • Download the plug-in from: http://prodevtools.sourceforge.net • Follow the installation and configuration instructions from the website • Need a Prolog interpreter to complete the plug in configuration (SWI, B, or XSB) • Check the features section for screenshotsand additional help
Implementation • Create new Prolog project in Eclipse • Ensure that an interpreter is selected • Add a file to the project source and name it filename.pl • Add source code such as: • abs(X,X) :- X >= 0, !. • abs(-X,Y) :- Y is X * -1. • To run the file, right click and select ProDT ->Consult in Console
Errors • Errors are underlined and found automatically after saving the file • Hovering the mouse over the error gives a tip on the problem • Good learning tool for becoming familiar with the language and the syntax
Trace • Trace can be used in the console to show how Prolog computes the code. • Good for teaching • Shows the process Prolog runs to get answers • Use command: trace. • Run function • Progress by hitting the enter key • Good for bug squashing
Trace in Action First function fails, second function runs and computes the correct answer.
Conclusion • Eclipse is a good solution • Platform independent • Consult in Console • Error Tracking • Trace/Debugging • Graphical User Interface • Easy to use • Questions? brett.hattaway@gmail.com