1 / 11

GNU Common Lisp and GNU Prolog for Windows

GNU Common Lisp and GNU Prolog for Windows. Programming Language Course Materials. This slide is provided by PL TAs: 方士偉 , 陳奕辰 , 葉喬之 , 林冠辰. GNU Common Lisp. for Windows. GNU Common Lisp for Windows. Download GNU Common Lisp from:

kyros
Download Presentation

GNU Common Lisp and GNU Prolog for Windows

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GNU Common Lisp andGNU Prologfor Windows Programming Language Course Materials This slide is provided by PLTAs: 方士偉,陳奕辰,葉喬之,林冠辰 Department of Computer Science, NCTU

  2. GNU Common Lisp for Windows Department of Computer Science, NCTU

  3. GNU Common Lisp for Windows • Download GNU Common Lisp from: ftp://ftp.gnu.org/pub/gnu/gcl/binaries/stable/gcl_2.6.6.mingw32_cltl1_japi_20050210.exe • Simply just Install and Run it~ • Notice: • The prompt symbol would be ‘>’ or ‘>>’ Department of Computer Science, NCTU

  4. An Example • Let’s say that we have defined a simple function memberTest written in a file, named memberTest.lisp (defun memberTest(e L) (if (null L) nil (if (equal e (first L)) t (memberTest e (rest L)) ) ) ) • Place the file under the this path (for default setting): C:\Program Files\GCL-2.6.6-CLtL1\bin\ Department of Computer Science, NCTU

  5. An Example (Cont’d) • Run GNU Common Lisp • To load your file, type in (load “memberTest.lisp”) • To compile your file, type in (compile-file “memberTest.lisp”) • To load a compiled lisp program, type in (load “memberTest”) Department of Computer Science, NCTU

  6. An Example (Cont’d) Loading Using function memberTest Using function memberTest Department of Computer Science, NCTU

  7. GNU Prolog for Windows Department of Computer Science, NCTU

  8. GNU Prolog for Windows • Download GNU Prolog from: ftp://gprolog.univ-paris1.fr/pub/gprolog/setup-gprolog-1.3.1.exe • Simply just Install and Run it~ Department of Computer Science, NCTU

  9. An Example • Let’s say that we have defined a simple function factorial written in a file, named factorial.pl factorial(0,1). factorial(A,B):- A>0, C is A-1, factorial(C,D), B is A*D. Department of Computer Science, NCTU

  10. An Example (Cont’d) • Run GNU Prolog console • To load your file, click [File] → [Consult…] on the upper side of the console window. Then find out and load your factorial.pl file. • Then, it’s done! Department of Computer Science, NCTU

  11. An Example (Cont’d) Using function factorial Department of Computer Science, NCTU

More Related