testgi :- %assertz(user:library_directory('.')),
graphiso_init,
prob_get_number_of_colours(5),
print(start_graph1),nl,flush_output(user_output),
prob_start_graph(5),
prob_set_colour_of_node(0,1),
prob_set_colour_of_node(1,1),
prob_set_colour_of_node(2,2),
prob_set_colour_of_node(3,2),
prob_set_colour_of_node(4,2),
prob_add_edge(0,1),
prob_add_edge(1,2),
prob_add_edge(2,3),
prob_exists_graph(X),
print(prob_exists_graph1(X)),nl,
print('^ Should be negative number'),nl,
(X== -1 -> print('OK'),nl ; print('ERROR'),nl,halt(1)),
flush_output(user_output),
print(start_graph2),nl,flush_output(user_output),
prob_start_graph(5),
prob_set_colour_of_node(0,1),
prob_set_colour_of_node(1,1),
prob_set_colour_of_node(2,2),
prob_set_colour_of_node(3,2),
prob_set_colour_of_node(4,2),
prob_add_edge(0,1),
prob_add_edge(1,4),
prob_add_edge(4,3),
prob_exists_graph(Y),
print(prob_exists_graph2(Y)),nl,
print('^ Should be positive number'),nl,
(Y==1 -> print('OK'),nl ; print('ERROR'),nl,halt(1)),
flush_output(user_output),
print(start_graph3),nl,flush_output(user_output),
prob_start_graph(5),
prob_set_colour_of_node(0,1),
prob_set_colour_of_node(1,1),
prob_set_colour_of_node(2,2),
prob_set_colour_of_node(3,2),
prob_set_colour_of_node(4,1), /* <== */
prob_add_edge(0,1),
prob_add_edge(1,4),
prob_add_edge(4,3),
prob_exists_graph(Z),
print(prob_exists_graph3(Z)),nl,
print('^ Should be negative number'),nl,
(Z== -2 -> print('OK'),nl ; print('ERROR'),nl,halt(1)),
flush_output(user_output).