logic programming - yap prolog read predicate -


i experimenting prolog, reading "programming in prolog using iso standard, fith edition". have installed yap (yet prolog) on ubuntu 10.10 maverick rc system, installed using synaptic. running prolog within emacs23 using prolog-mode.

the following code (from chapter 5 of book) not give results in book:

/*   file   history_base.pl   */                                                     use_module(library(lists)) /* use member/2    */                    event(1505,['euclid',translated,into,'latin']).                         event(1510,['reuchlin-pfefferkorn',controversy]).                       event(1523,['christian','ii',flies,from,'denmark']).                          mywhen(x,y):-event(y,z),member(x,z).  % restoring file /usr/lib/yap/startup yap version yap-5.1.3  < reading above file yap>    ?- mywhen("denmark",d). no  not book gives!  adding file above line (from book):  hello1(event):- read(date), event(date,event). 

gives error when reading file yap

(using "consult buffer" in prolog menu in emacs):    ?-  % reconsulting /tmp/prolcomp14814qrf.pl...          syntax error @ /tmp/prolcomp14814qrf.pl, near line 3:     use_module( library( lists ) )                                                     <    ==== here ====>                                event( 1505 , [ euclid , translated ,  , latin ] ).  % reconsulted /tmp/prolcomp14814qrf.pl in module user, 0 msec 752 bytes yes    ?-  

¿any comments?

perhaps should terminate use_module(library(lists)) statement . , declare directive, i.e.:

:- use_module(library(lists)).


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -