%======================================== %======================================== min_all :- wdict(A), forall( member(W,A), wshow(W,2)). %----------------------------------------------------- % I/O Utilities % %----------------------------------------------------- writenl(A) :- writeq(A), nl. writeseqnl(List) :- writeseq(List), nl. writeseq([]) :- !. writeseq([A | Rest]) :- write(A), write(' '), writeseq(Rest). %----------------------------------------------------- % Convert different types to a string. % %----------------------------------------------------- to_string(T,S) :- number(T),!, number_string(T,S). to_string(T,S) :- atom(T),!, atom_string(T,S). to_string(T,T) :- srting(T). %------------------------------------------------------------------------------------- % Utility for timing a goal. %------------------------------------------------------------------------------------- cpuT(Goal,T) :- ms(Goal,T).