anchor.diff:      {_, false, _} -> {false, bad_message_name};
       {_, _, false} -> {false, bad_payload_types}
     end;
  -can_receive(_Message, MonitorNode) ->
  +can_receive_at(_Message, MonitorNode) ->
     {false, bad_node_type, MonitorNode}.
   
   
  -can_send(Message, MonitorNode = {Id, send_node, Info}) ->
  +can_send_at(Message, MonitorNode = {Id, send_node, Info}) ->
     {Recipients, MessageName, PayloadTypes} = Info,
     CorrectRecipients = lists:sort(Recipients) == lists:sort(message:message_recipients(Message)),
     CorrectMessageName = message:message_name(Message) == MessageName,
  
positive.code:                {} end), {}, Transitions),
    io:format("}", []).
  
  %generate_monitor(LocalProtocol = {local_protocol, _, _, _, _, Interactions}, RunningID, States, Transitions) ->
  %  {}.
    % Generates a monitor for the local protocol block. This basically involves
    % doing a fold over the interactions.
    %lists:foldl(fun (Interaction, {RunningID, Ss, Ts}) ->
    %                generate_monitor(Interaction, RunningID, Ss, Ts) end,
    %            RunningID, States, Transitions);
    %
  % We can't do monitors for other AST constructs (ie global types)
  %generate_monitor(LocalAST, _, _, _) ->
  %  {error, monitor_undefined, LocalAST}.
  
  
  % Checks whether we can send or receive at this point
  can_receive(Message, MonitorNode = {Id, receive_node, Info}) ->
    {Sender, MessageName, PayloadTypes} = Info,
    CorrectSender = message:message_sender(Message) == Sender,
    CorrectMessageName = message:message_name(Message) == MessageName,
  
negative.code: -module(monitor_gen).
  -compile(export_all).
  -define(LOCAL_PROTOCOL_FILE, "test.scr").
  
  % monitor_gen: Functions for generating and manipulating FSM-based monitors.
  
  % monitor_instance: A monitor instance for a local protocol.
  % Specifies the protocol name, the role to which the protocol has been
  % projected, the current state in the monitor, and the state and transition
  % tables.
  -record(monitor_instance, {protocol_name,
                             role_name,
                             current_state = 0,
                             states,
                             transitions}).
  
  % Generates a monitor from a Scribble AST.
  %
  