anchor.diff:          end,
       %% Create analysis_options
       AnalysisOptions = [{preb, Preb}, {include, Include}],
  -    %% Start the log manager and attach the event handler below.
  -    _ = log:start(),
  -    _ = log:attach(?MODULE, Options),
       %% Start the analysis
  -    AnalysisRet = sched:analyze(Target, Files, AnalysisOptions),
  -    %% Save result to a snapshot
  -    Selection = snapshot:selection(1, 1),
  -    snapshot:export(AnalysisRet, Files, Selection, Output),
  -    %% Stop event handler
  -    log:stop(),
  -    true.
  -
  -
  -%%%----------------------------------------------------------------------
  -%%% Show Commnad
  -%%%----------------------------------------------------------------------
  -
  -%% @spec show(options()) -> 'true'
  -%% @doc: Examine Concuerror results with the given options.
  --spec show(options()) -> 'true'.
  -show(Options) ->
  -    %% Disable error logging messages.
  -    ?tty(),
  -    %% Get snapshot file
  -    File =
  -        case lists:keyfind(snapshot, 1, Options) of
  -            {snapshot, S} -> S;
  -            false ->
  -                io:format("~s: no snapshot file specified\n", [?APP_STRING]),
  -                init:stop(1)
  -        end,
  -    %% Get index of errors to examine
  -    Indexes1 =
  -        case lists:keyfind(number, 1, Options) of
  -            {number, N} -> N;
  -            false -> all
  -        end,
  -    Indexes2 =
  -        case lists:keyfind(all, 1, Options) of
  -            {all} -> all;
  -            false -> Indexes1
  -        end,
  -    %% Get details option
  -    Details =
  -        case lists:keyfind(details, 1, Options) of
  -            {details} -> true;
  -            false -> false
  -        end,
  -    %% Start the log manager and attach the event handler below.
  -    _ = log:start(),
  -    _ = log:attach(?MODULE, ['noprogress' | Options]),
  -    %% Load snapshot
  -    snapshot:cleanup(),
  -    case snapshot:import(File) of
  -        ok -> continue;
  -        Snapshot ->
  -            Modules = snapshot:get_modules(Snapshot),
  -            Files = lists:map(fun filename:absname/1, Modules),
  -            AnalysisRet = snapshot:get_analysis(Snapshot),
  -            %% Instrument and load the files
  -            %% Note: No error checking here.
  -            {ok, Bin} = instr:instrument_and_compile(Files),
  -            ok = instr:load(Bin),
  -            log:log("\n"),
  -            %% Detach event handler
  -            log:detach(?MODULE, []),
  -            showAux(AnalysisRet, Indexes2, Details),
  -            instr:delete_and_purge(Files)
  -    end,
  -    snapshot:cleanup(),
  -    %% Stop event handler
  -    log:stop(),
  -    true.
  -
  -showAux({error, analysis, {_Target, RunCount}, Tickets}, Indexes, Details) ->
  -    TickLen = length(Tickets),
  -    io:format("Checked ~w interleaving(s). ~w errors found.\n\n",
  -        [RunCount, TickLen]),
  -    NewIndexes = uIndex(Indexes, TickLen),
  -    KeyTickets = lists:zip(lists:seq(1, TickLen), Tickets),
  -    NewTickets = selectKeys(NewIndexes, KeyTickets, []),
  -    lists:foreach(fun(T) -> showDetails(Details, T) end, NewTickets);
  -showAux({error, instr, {_Target, _RunCount}}, _Indexes, _Details) ->
  -    io:format("Instrumentation error.\n");
  -showAux({ok, {_Target, RunCount}}, _Indexes, _Details) ->
  -    io:format("Checked ~w interleaving(s). No errors found.\n", [RunCount]).
  -
  -%% Take the indexes from command line and create a sorted list
  -uIndex(all, TickLen) ->
  -    lists:seq(1, TickLen);
  -uIndex(Indexes, TickLen) ->
  -    Fun = fun(I) ->
  -            case I of
  -                {From, 'end'} -> lists:seq(From, TickLen);
  -                {From, To}  -> lists:seq(From, To);
  -                Number -> Number
  -            end
  -          end,
  -    Indexes1 = lists:map(Fun, Indexes),
  -    Indexes2 = lists:flatten(Indexes1),
  -    lists:usort(Indexes2).
  -
  -%% Keep only this elements whose keys are in Keys list
  -%% Both lists are sorted by keys
  -selectKeys(_Indexes, [], Acc) ->
  -    lists:reverse(Acc);
  -selectKeys([], _Tickets, Acc) ->
  -    lists:reverse(Acc);
  -selectKeys([I | Is], [{I,_T}=Tick | Tickets], Acc) ->
  -    selectKeys(Is, Tickets, [Tick | Acc]);
  -selectKeys(Indexes, [_ | Tickets], Acc) ->
  -    selectKeys(Indexes, Tickets, Acc).
  +    sched:analyze(Target, Files, AnalysisOptions).
  +
  +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
   %% Show details about each ticket
   showDetails(false, {I, Ticket}) ->
  
positive.code: %%%----------------------------------------------------------------------
  %%% Types
  %%%----------------------------------------------------------------------
  
  %% Log event handler internal state.
  %% The state (if we want have progress bar) contains
  
negative.code:                   'log' | 'nolog'}.
  
  %% Command line options
  -type option() ::
        {'target',  sched:analysis_target()}
      | {'files',   [file()]}
      | {'output',  file()}
      | {'include', [file()]}
      | {'noprogress'}
      | {'nolog'}
      | {'preb',    sched:bound()}
      | {'gui'}
      | {'help'}.
  
  -type options() :: [option()].
  
  %%%----------------------------------------------------------------------
  %%% UI functions
  