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

> I'm writing a simple Prolog interpreter where the format of the rules are
> like this:
>
> [[father 'Bill 'Bob]]
> [[mother 'Ann 'Bob]]
>
> [[parent x y] [father x y]]
> [[parent x y] [mother x y]]
>
> [[grandparent x y] [parent x z] [parent z y]]
>
> And so on.
>
> Variables must be renamed before unification to aviod name clashes.
> For example, [[parent x y] [father x y]] could become
>              [[parent _x20 _y15] [father _x20 _y15]]
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to