Prolog |
All I have here at present are some library files, mainly of use for LPA Prolog on Windows machines, and some implementations of Lisp. Library filesThese are mainly conversions of the Edinburgh Prolog library files,
targetted at LPA Prolog. However, I've extended the
Lisp implementationsI have two implementations of Lisp. The Lisp interpreter is a simple interpreter of a small subset of Lisp. It does, however, accept standard Lisp syntax input, including all the brackets. A sample interaction might go something like: | ?- lisp. Welcome to Pro-Lisp! This is a miniscule Lisp interpreter, written in Prolog > (cons 1 nil) ( 1 ) > (defun my_second (lst) (car (cdr lst))) MY_SECOND > (my_second '(a b c)) B > quit Terminating Pro-Lisp yes The Lisp compiler is a more complex beast. It uses
There are a two of files of examples:
Other programsThis is an implementation of Djirkstra's shortest-path algorithm. It works on both directed and undirected graphs. Graphs are defined by a separate predicate that will enumerate nodes adjacent to a given node. It uses the ordered sets module to maintain the list of nodes to explore in order of cost. Colin Barker has written another version, also for LPA Prolog. More Prolog stuff found in comp.lang.prolog and the FAQs. |
Maths & Computing Faculty Computing Department website |
This page maintained by Neil Smith (N.Smith@open.ac.uk)