Re: please make the following prolog program



naznadi@xxxxxxxxx wrote:
please make the following prolog program

i hav try .but require result not come
my predicatelike this
plz find out mistake from it.




listtran([],[]).
listtran([Ha/Ta],[Hb/Tb]):-tran(Ha,Hb),listtran(Ta,Tb).

the given question is this:
> [...]


you have a syntax error when constructing lists. just use the pipe symbol | instead of slash / . if you google for "prolog lists" you will find eg. http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_7.html where the list syntax is described in more detail.

hth Martin
.



Relevant Pages

  • Re: Macros
    ... int x=2; ... which is a syntax error. ... mistake & thanks for clearing the doubt. ...
    (comp.lang.c)
  • Re: malloc vs new
    ... Google Broken Beta to post without forcing it to provide proper ... Mistake number one b is doing so where your post makes no ... Mistake number two is that this is still a syntax error in C. C++ is ...
    (comp.lang.c)
  • Re: finalize()
    ... public void doIt(); ... My mistake, I mean there is a syntax error in the implementation. ... There should not be a semicolon there. ...
    (comp.lang.java.programmer)
  • sql syntax error
    ... I am getting a syntax error from the following; ... I am wanting to track those who sign into the db. ... Can anyone see the mistake made in this? ... *** John ...
    (microsoft.public.access.formscoding)