Simple but crashes !

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple but crashes !

Khaled, Mahmoud

Dear GNU-Prolog team,

 

While working with GNU-Prolog with the following config:

-          version 1.4.4,

-          windows GUI console version 1.1

-          Windows 10 x64

-          GNU-Prolog x64

 

Problem description:

A simple (.pl) files makes exception and crashes the GNU-Prolog console.

 

The (.pl) file contains

 

trans(x0, a, x2).

trans(x0, a, x1).

trans(x1, b, x1).

trans(x2, a, x2).

 

reaches(XSTART, XEND) :- trans(XSTART, _ ,XEND).

reaches(XSTART, XEND) :- trans(XSTART, _ ,XMID), reaches(XMID, XEND).

 

Loading this file and running the following check makes an exception and crashes:

reaches(x2, x0).

 

I think it is because it goes into infinite search by the last line in the file but should be some how detected or avoided rather than crashing ?

 

Regards,

 

—————————————————
Mahmoud Khaled
PhD Student
Hybrid Control Systems Group,
Electrical Engineering Dept.
Technical University of Munich (TUM),
Arcisstraße 21, 80333 Munich, Germany

Tel: +49 (89) 289 - 23736
Web: http://www.hcs.ei.tum.de


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Simple but crashes !

Daniel Diaz-3
Yes it goes in an infinite loop.
You can use a list of already visited vertices to avoid such a looping in a graph.

Daniel


Le 04/05/2016 19:23, Khaled, Mahmoud a écrit :

Dear GNU-Prolog team,

 

While working with GNU-Prolog with the following config:

-          version 1.4.4,

-          windows GUI console version 1.1

-          Windows 10 x64

-          GNU-Prolog x64

 

Problem description:

A simple (.pl) files makes exception and crashes the GNU-Prolog console.

 

The (.pl) file contains

 

trans(x0, a, x2).

trans(x0, a, x1).

trans(x1, b, x1).

trans(x2, a, x2).

 

reaches(XSTART, XEND) :- trans(XSTART, _ ,XEND).

reaches(XSTART, XEND) :- trans(XSTART, _ ,XMID), reaches(XMID, XEND).

 

Loading this file and running the following check makes an exception and crashes:

reaches(x2, x0).

 

I think it is because it goes into infinite search by the last line in the file but should be some how detected or avoided rather than crashing ?

 

Regards,

 

—————————————————
Mahmoud Khaled
PhD Student
Hybrid Control Systems Group,
Electrical Engineering Dept.
Technical University of Munich (TUM),
Arcisstraße 21, 80333 Munich, Germany

Tel: +49 (89) 289 - 23736
Web: http://www.hcs.ei.tum.de



_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog