anchor.diff:                              {failed, ClassificationsExplored, NewTraces}
                       end
               end
  -    end.+    end.
  +
  +%% @private
  +schedule_valid_causality(Causality, CandidateTrace0) ->
  +    CandidateTrace = message_types(CandidateTrace0),
  +
  +    % io:format("derived_schedule: ~p~n", [length(DerivedSchedule)]),
  +    % io:format("prefix_schedule: ~p~n", [length(PrefixSchedule)]),
  +    % io:format("omitted_schedule: ~p~n", [length(OmittedSchedule)]),
  +    % io:format("conditional_schedule: ~p~n", [length(ConditionalSchedule)]),
  +
  +    RequirementsMet = lists:foldl(fun(Type, Acc) ->
  +        % io:format("=> Type: ~p~n", [Type]),
  +
  +        All = lists:foldl(fun({K, V}, Acc1) ->
  +            % io:format("=> V: ~p~n", [V]),
  +
  +            case lists:member(Type, V) of 
  +                true ->
  +                    % io:format("=> Presence of ~p requires: ~p~n", [Type, K]),
  +
  +                    SearchType = case K of 
  +                        {receive_message, T} ->
  +                            {forward_message, T};
  +                        Other ->
  +                            Other
  +                    end,
  +
  +                    % io:format("=> Rewriting to look for send of same message type: ~p~n", [SearchType]),
  +
  +                    case lists:member(SearchType, CandidateTrace) of 
  +                        true ->
  +                            % io:format("=> Present!~n", []),
  +                            true andalso Acc1;
  +                        false ->
  +                            % io:format("=> NOT Present!~n", []),
  +                            false andalso Acc1
  +                    end;
  +                false ->
  +                    % io:format("=> * fallthrough: ~p not in ~p.~n", [Type, V]),
  +                    true andalso Acc1
  +            end
  +        end, Acc, dict:to_list(Causality)),
  +
  +        All andalso Acc
  +    end, true, CandidateTrace),
  +
  +    case RequirementsMet of 
  +        true ->
  +            % io:format("Causality verified.~n", []),
  +            ok;
  +        false ->
  +            % io:format("Schedule does not represent a valid schedule!~n", []),
  +            ok
  +    end,
  +
  +    RequirementsMet.
positive.code:                             case os:getenv("EXIT_ON_COUNTEREXAMPLE") of 
                                  false ->
                                      ok;
                                  "false" ->
                                      ok;
                                  _Other ->
                                      exit({error, counterexample_found})
                              end,
  
                              %% Insert result into the ETS table.
  
negative.code:     Classification.
  
  %% @private
  classify_schedule(_N, Annotations, CandidateTrace0) ->
      CandidateTrace = message_types(CandidateTrace0),
  
      Classification = lists:foldl(fun({Type, Preconditions}, Dict0) ->
          Result = lists:foldl(fun(Precondition, Acc) ->
              case Precondition of 
                  {{_, PreconditionType}, N} ->
                      Num = length(lists:filter(fun(T) -> T =:= {forward_message, PreconditionType} end, CandidateTrace)),
                      % io:format("=> * found ~p messages of type ~p~n", [Num, PreconditionType]),
                      Acc andalso Num >= N;
                  true ->
                      Acc andalso true
              end
          end, true, Preconditions),
  
          % io:format("=> type: ~p, preconditions: ~p~n", [Type, Result]),
          dict:store(Type, Result, Dict0)
      end, dict:new(), dict:to_list(Annotations)),
  
      % io:format("classification: ~p~n", [dict:to_list(Classification)]),
  
      Classification.
  
  %% @private
  ensure_preconditions_present(Causality, Annotations) ->
      %% Get all messages that are the result of other messages.
      CausalMessages = lists:foldl(fun({_, Messages}, Acc) ->
  