Open samwalrus opened 8 years ago
The program contains syntax errors in at least two places and you give no clue how you start the trace session. Without details I cannot reproduce this.
I don't know what the syntax errors are, prolog does does not give any errors when loading the file. I am trying to debug the program as I know it does not work.
I just load the file from the command line: prolog -s 'my_file.pl'
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.9) Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?- gtrace. % The graphical front-end will be used for subsequent tracing true.
[trace] ?- genarcs(1,[0,1],T), maplist(sep,T,Arcs,). T = [t(arc(1, 0, 1), [1, 0, 1])], Arcs = [arc(1, 0, 1)] ; T = [t(arc(1, 1, 1), [1, 1, 1])], Arcs = [arc(1, 1, 1)] ; T = [t(arc(1, 1, 1), [1, 1, 1]), t(arc(1, 0, 1), [1, 0, 1])], Arcs = [arc(1, 1, 1), arc(1, 0, 1)] ; T = [t(arc(1, 0, 1), [1, 0, 1]), t(arc(1, 1, 1), [1, 1, 1])], Arcs = [arc(1, 0, 1), arc(1, 1, 1)] ;
at this point the system hangs and I abort by pressing ctrl-c a I then try the goal again:
[trace] ?- genarcs(1,[0,1],T), maplist(sep,T,Arcs,). T = [t(arc(1, 0, 1), [1, 0, 1])], Arcs = [arc(1, 0, 1)] ; T = [t(arc(1, 1, 1), [1, 1, 1])], Arcs = [arc(1, 1, 1)] ; [Thread 1 (main) at Sun Oct 18 09:52:00 2015] pl-write.c:1040: writePrimitive: Assertion failed: 0 C-stack trace labeled "assert_fail": [0] PL_strtod() at ??:? [0x7f9ca7a097f0] [1] __assert_fail() at ??:? [0x7f9ca79ce2c1] [2] destroyXR() at ??:? [0x7f9ca79c9489] [3] destroyXR() at ??:? [0x7f9ca79c9c7b] [4] destroyXR() at ??:? [0x7f9ca79ca340] [5] destroyXR() at ??:? [0x7f9ca79cb250] [6] utf8_strncmp() at ??:? [0x7f9ca7a02c01] [7] PL_next_solution() at ??:? [0x7f9ca7965145] [8] PL_call_predicate() at ??:? [0x7f9ca796e3bc] [9] pl_pce_init() at ??:? [0x7f9ca5a8fb0d] [10] pl_pce_init() at ??:? [0x7f9ca5a8fb90] [11] PL_next_solution() at ??:? [0x7f9ca796517f] [12] PL_call_predicate() at ??:? [0x7f9ca796e3bc] [13] pl_pce_init() at ??:? [0x7f9ca5a8fb0d] [14] pl_pce_init() at ??:? [0x7f9ca5a8fb90] [15] PL_next_solution() at ??:? [0x7f9ca796517f] [16] pl_skip_list3_va() at ??:? [0x7f9ca79a1fa3] [17] pl_skip_list3_va() at ??:? [0x7f9ca79a215d] [18] PL_next_solution() at ??:? [0x7f9ca7965248] [19] PL_interrupt() at ??:? [0x7f9ca79c00c4] [20] PL_interrupt() at ??:? [0x7f9ca79bfb63] [21] PL_next_solution() at ??:? [0x7f9ca796c6e4] [22] pl_skip_list3_va() at ??:? [0x7f9ca79a1b2e] [23] pl_skip_list3_va() at ??:? [0x7f9ca79a22b0] [24] PL_toplevel() at ??:? [0x7f9ca795f14d] [25] prolog(main+0x2d) [0x40083d] [26] __libc_start_main() at /build/buildd/eglibc-2.19/csu/libc-start.c:321 [0x7f9ca7371ec5] [27] prolog(+0x881) [0x400881] Aborted (core dumped)
Ah. It is GitHub's wiki syntax that breaks the program ... Added ....
around it and now the program is readable and syntactically correct. The abort
is a quite vital piece of the info. With
that it reproduces (at least one time) I'll have a look. The required interaction might make it a
little hard to track :(
Hmm. I found two bugs in the gui tracer, but I'm unsure whether or not this particular one is fixed. You may want to try the latest git version.
Using SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.9) Ubuntu When trying to graphically debug a program prolog crashes.
The query is: ?- genarcs(1,[0,1],T), maplist(sep,T,Arcs,).
The error: [trace] ?- genarcs(1,[0,1],T), maplist(sep,T,Arcs,). T = [t(arc(1, 0, 1), [1, 0, 1])], Arcs = [arc(1, 0, 1)] ; T = [t(arc(1, 1, 1), [1, 1, 1])], Arcs = [arc(1, 1, 1)] ; [Thread 1 (main) at Sat Oct 17 18:39:46 2015] pl-write.c:1040: writePrimitive: Assertion failed: 0 C-stack trace labeled "assert_fail": [0] PL_strtod() at ??:? [0x7fc33e48d7f0] [1] __assert_fail() at ??:? [0x7fc33e4522c1] [2] destroyXR() at ??:? [0x7fc33e44d489] [3] destroyXR() at ??:? [0x7fc33e44dc7b] [4] destroyXR() at ??:? [0x7fc33e44e340] [5] destroyXR() at ??:? [0x7fc33e44f250] [6] utf8_strncmp() at ??:? [0x7fc33e486c01] [7] PL_next_solution() at ??:? [0x7fc33e3e9145] [8] PL_call_predicate() at ??:? [0x7fc33e3f23bc] [9] pl_pce_init() at ??:? [0x7fc33c513b0d] [10] pl_pce_init() at ??:? [0x7fc33c513b90] [11] PL_next_solution() at ??:? [0x7fc33e3e917f] [12] PL_call_predicate() at ??:? [0x7fc33e3f23bc] [13] pl_pce_init() at ??:? [0x7fc33c513b0d] [14] pl_pce_init() at ??:? [0x7fc33c513b90] [15] PL_next_solution() at ??:? [0x7fc33e3e917f] [16] pl_skip_list3_va() at ??:? [0x7fc33e425fa3] [17] pl_skip_list3_va() at ??:? [0x7fc33e42615d] [18] PL_next_solution() at ??:? [0x7fc33e3e9248] [19] PL_interrupt() at ??:? [0x7fc33e4440c4] [20] PL_interrupt() at ??:? [0x7fc33e443b63] [21] PL_next_solution() at ??:? [0x7fc33e3f06e4] [22] pl_skip_list3_va() at ??:? [0x7fc33e425b2e] [23] pl_skip_list3_va() at ??:? [0x7fc33e4262b0] [24] PL_toplevel() at ??:? [0x7fc33e3e314d] [25] prolog(main+0x2d) [0x40083d] [26] __libc_start_main() at /build/buildd/eglibc-2.19/csu/libc-start.c:321 [0x7fc33ddf5ec5] [27] prolog(+0x881) [0x400881] Aborted (core dumped)
The program is: