B-prolog : limited number of vars ? - PROLOG
This is a discussion on B-prolog : limited number of vars ? - PROLOG ; Hi !
I wanted to generalize a bp program thats solves things on a 3x3
board.
I saw in the B-Prolog doc that (even multidimensional) array was
provided.
However It was easier for me to generate B-Prolog source programs
from ...
-
B-prolog : limited number of vars ?
Hi !
I wanted to generalize a bp program thats solves things on a 3x3
board.
I saw in the B-Prolog doc that (even multidimensional) array was
provided.
However It was easier for me to generate B-Prolog source programs
from another language instead of learning more Prolog features.
So I wrote an OCaml program :
http://fabrice.marchant.free.fr/B-Prolog/wrPl.ml
that generated B-Prolog programs for any rectangular board test /
number of tested cells ( Game of Life / still lives, allways ).
The generated .pl worked fine up to a 7x7 board with 9 alive cells :
http://fabrice.marchant.free.fr/B-Prolog/auto779.pl
However :
http://fabrice.marchant.free.fr/B-Prolog/auto88-10.pl
that has 64 vars, can't compile.
Please are number of vars or some line length limitation with B-
Prolog ?
Thanks for any tip,
Fabrice
-
Re: B-prolog : limited number of vars ?
"Ecirbaf" <fabrice.marchant@orange.fr> wrote in message
news:1194272220.023170.13070@v3g2000hsg.googlegroups.com...
>
> However :
> http://fabrice.marchant.free.fr/B-Prolog/auto88-10.pl
> that has 64 vars, can't compile.
>
> Please are number of vars or some line length limitation with B-
> Prolog ?
There is no limit on the number of variables included in a clause. Actually,
since registers are abounded in version 7.0, you'll never experience
register overflow.
I had no problem compiling your program on my notebook (Windows XP).
| ?- cl('auto88-10')
Compiling::auto88-10.pl
compiled in 15 milliseconds
loading::auto88-10.out
What OS are you using?
Cheers,
Neng-Fa
-
Re: B-prolog : limited number of vars ?
> There is no limit on the number of variables included in a clause. Actually,
> since registers are abounded in version 7.0, you'll never experience
> register overflow.
>
> I had no problem compiling your program on my notebook (Windows XP).
>
> | ?- cl('auto88-10')
> Compiling::auto88-10.pl
> compiled in 15 milliseconds
> loading::auto88-10.out
Many thanks !
This way, with cl(), you said, it now works.
Maybe the issue com from the fact I used '[]' :
B-Prolog Version 7.0, All rights reserved, (C) Afany Software
1994-2007.
Type 'help' for usage.
| ?- [auto88-10]
*** error(type_error,compile(auto88-10))
Or 'compile()':
| ?- compile(auto88-10)
no
| ?-
> What OS are you using?
The problem occurred with debian linux Lenny for this question (but
I'm just upgrading to debian Sid today.)
Thanks again for your valuable help.
Regards,
Fabrice
-
Re: B-prolog : limited number of vars ?
"Ecirbaf" <fabrice.marchant@orange.fr> wrote in message
news:1194280904.489070.174860@o80g2000hse.googlegroups.com...
>
> This way, with cl(), you said, it now works.
>
> Maybe the issue com from the fact I used '[]' :
It has nothing to do with cl or compile or []. In Prolog (I have to say most
Prolog systems), you have to single-quote a file name if the file name has a
hyphen (or any other special character) in it because a term like a-b is not
an atom but a structure.
Hope this is the quickest way for you to learn Prolog:-).
Cheers,
Neng-Fa
-
Re: B-prolog : limited number of vars ?
On Nov 5, 6:35 pm, "Neng-Fa Zhou" <nz...@acm.org> wrote:
> "Ecirbaf" <fabrice.march...@orange.fr> wrote in message
>
> news:1194280904.489070.174860@o80g2000hse.googlegroups.com...
>
>
>
> > This way, with cl(), you said, it now works.
>
> > Maybe the issue com from the fact I used '[]' :
>
> It has nothing to do with cl or compile or []. In Prolog (I have to say most
> Prolog systems), you have to single-quote a file name if the file name has a
> hyphen (or any other special character) in it because a term like a-b is not
> an atom but a structure.
I should have thought to '-' as a special char by myself.
> Hope this is the quickest way for you to learn Prolog:-).
Apologize, I only wanted to learn a bit the langage : just enough to
see if it was useful to solve some problems and it is, indeed. That
makes desire to learn Prolog more deeply and to read some docs...
Regards,
Fabrice
Similar Threads
-
By Application Development in forum c++
Replies: 11
Last Post: 12-12-2007, 09:24 AM
-
By Application Development in forum PROLOG
Replies: 4
Last Post: 09-26-2007, 07:07 AM
-
By Application Development in forum Javascript
Replies: 9
Last Post: 09-14-2007, 04:06 AM
-
By Application Development in forum Theory
Replies: 2
Last Post: 07-14-2006, 03:04 PM
-
By Application Development in forum PROLOG
Replies: 1
Last Post: 08-10-2005, 04:08 AM