Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Prolog for REBOL was: Generating words and global variable space

 [1/4] from: fsievert:uos at: 23-Mar-2001 18:28


Hi! Interesting. I already wrote a simple Prolog-Interpreter, maybe you like the ideas I used. I am not renaming the words but using own contexts for them. Try it with the latest /Core xper, if you want. There are a few no longer needed parts (because RT repaired a few GC-Bugs :))) Have a look at http://proton.cl-ki.uni-osnabrueck.de/REBOL/reblog.r And try
>> do http://proton...../reblog.r >> pl-interact
REBlog >> assert(a(X):-b(X)). ('. ('assert (:- ('a X) ('b X))) 'trace) X = X Retry?y == no REBlog >> assert(b(test)). ('. ('assert ('b 'test)) 'trace) == yes REBlog >> a(X). ('. ('a X) 'trace) X = test Retry?y == no CU, Frank

 [2/4] from: dankelg8::cs::man::ac::uk at: 24-Mar-2001 15:20


Hi Frank, Using separate conexts is a nice idea :) Thanks! Your interpreter works fine for all my basic tests except one: test: { fact(0,1). fact(N,F) :- N > 0, N1 is N-1, fact(N1,F1), F is N * F1. }
>> consult test >> pl-interact
REBLog>> fact(5,X). *CRASH* Gisle On Fri, 23 Mar 2001, Frank Sievertsen wrote:

 [3/4] from: dankelg8:cs:man:ac at: 24-Mar-2001 15:39


On Fri, 23 Mar 2001, Frank Sievertsen wrote:
> Hi! > > Interesting. I already wrote a simple Prolog-Interpreter .... <chop>
Hi Frank, Would it be a lot of work to implement cut and negation in your interpreter? Gisle

 [4/4] from: fsievert:uos at: 24-Mar-2001 18:12


No! This is absolutly not a lot of work, because it is already implemented. I released the wrong (an old) version of REBlog. I uploaded a newer version (which passes your test, too, i think). And it should support cut. But it has a lot of debug-output and I have not tested all features. Download: http://proton.cl-ki.uni-osnabrueck.de/REBOL/reblog.r I will release a better version next week. CU, Frank On Sat, 24 Mar 2001, Gisle Dankel wrote: