%%% Module load.
:- use_module(library(lists)).
% Main.
main :- (current_prolog_flag(argv, [_, FILE|FUNCTIONS]),
(access_file(FILE, read) ->
main(FILE, FUNCTIONS);
writeln('ERROR: cant find file'(FILE)));
writeln('ERROR: arguments number')),
halt.
% Check the file.
main(FILE, FUNCTIONS) :- open(FILE, read, S),
read_stream_to_codes(S, TEXT),
strtolines(LINES, TEXT, []),
findcontracts(CONTS, LINES, []),
findall(X, finddefinitions(X, TEXT, _), FUNCS),
(is_set(CONTS) ->
(is_set(FUNCS) ->
(sort(CONTS, SORTCONTS),