Maybe this is another bug?

View: New views
2 Messages — Rating Filter:   Alert me  

Maybe this is another bug?

by Dave Sworin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

 

    It seems that if I put the following (bad) code in a file and try to compile it, that gprolog goes into an infinite loop.  I have only tried this on Fedora Core 4.  A predicate without arguments is fine, but not with empty parentheses.  This is fine with me.  However, I am an old C programmer and did this by accident in a much larger file.  I'm not sure this is a bug, but maybe you want to fix it.  By-the-way, the problem does not occur if a predicate does not preceed it in the file.  For example, without the predicate mypred/1 below, the bug does not occur.  Can you reproduce this problem also?

 

Dave

----------------------------------------------

 

mypred(ARG1) :-
    ARG1 is 2 + 4.

 

test_case() :-
    true.

 

----------------------------------------------
[daves@johnldobson infinite_loop_bug]$ gprolog
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- ['testcase.pl'].
compiling /home/daves/.../testcase.pl for byte code...
/home/daves/.../testcase.pl:5:11: syntax error: expression expected
<== USER TYPED CONTROL-C HERE BECAUSE CPU METER WAS AT 100%
Prolog interruption (h for help) ? a
execution aborted
| ?-



_______________________________________________
Bug-prolog mailing list
Bug-prolog@...
http://lists.gnu.org/mailman/listinfo/bug-prolog

Re: Maybe this is another bug?

by Jasper Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using the latest 'unstable' version under Ubuntu 8.04 and this bug
does not occur -- compilation fails because of the syntax error, same as
yours, but then it exits and goes back to the ?- prompt.
        --Jasper

Dave Sworin wrote:

> Hello,
>
>  
>
>     It seems that if I put the following (bad) code in a file and try to
> compile it, that gprolog goes into an infinite loop.  I have only tried
> this on Fedora Core 4.  A predicate without arguments is fine,
> but not with empty parentheses.  This is fine with me.  However, I am an
> old C programmer and did this by accident in a much larger file.  I'm
> not sure this is a bug, but maybe you want to fix it.  By-the-way, the
> problem does not occur if a predicate does not preceed it in the file.  
> For example, without the predicate mypred/1 below, the bug does not
> occur.  Can you reproduce this problem also?
>
>  
>
> Dave
>
> ----------------------------------------------
>
>  
>
> mypred(ARG1) :-
>     ARG1 is 2 + 4.
>
>  
>
> test_case() :-
>     true.
>
>  
>
> ----------------------------------------------
> [daves@johnldobson infinite_loop_bug]$ gprolog
> GNU Prolog 1.3.0
> By Daniel Diaz
> Copyright (C) 1999-2007 Daniel Diaz
> | ?- ['testcase.pl'].
> compiling /home/daves/.../testcase.pl for byte code...
> /home/daves/.../testcase.pl:5:11: syntax error: expression expected
> <== USER TYPED CONTROL-C HERE BECAUSE CPU METER WAS AT 100%
> Prolog interruption (h for help) ? a
> execution aborted
> | ?-
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bug-prolog mailing list
> Bug-prolog@...
> http://lists.gnu.org/mailman/listinfo/bug-prolog



_______________________________________________
Bug-prolog mailing list
Bug-prolog@...
http://lists.gnu.org/mailman/listinfo/bug-prolog
LightInTheBox - Buy quality products at wholesale price!