80 likes | 168 Views
Learn how to teach and learn Prolog effectively using ProDT development tools in Eclipse. Follow the installation instructions, configure the plug-in with a Prolog interpreter (SWI, B, or XSB), and create projects with ease. Find errors, get tips, and debug using the trace feature, perfect for understanding the language and its syntax. Benefit from a platform-independent, graphical user interface that makes learning Prolog fun and interactive. For any queries, contact brett.hattaway@gmail.com.
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