
tool debug-adapter is { /* All kinds of adapters */ }

process TIDE-ADAPTER (A : debug-adapter) is
let
  Process : proc(<debug-adapter>, <int>),
  Port    : term,
  Cond    : term,
  Action  : term,
  Expr    : term,
  Result  : term,
  Tag     : term,
  Enabled : term,
  Rule    : int,
  Pid     : int,
  Name    : term
in
  snd-msg(adapter-connected(A)) .
  (
    rec-msg(evaluate(proc(A, Pid?), Expr?)) .
    snd-eval(A, evaluate(Pid, Expr)) .
    rec-value(A, evaluated(Result?)) .
    snd-msg(evaluated(proc(A, Pid), Result))
    +
    rec-msg(create-rule(proc(A, Pid?), Port?, Cond?, Action?, Tag?, Enabled?)) .
    snd-eval(A, create-rule(Pid, Port, Cond, Action, Tag, Enabled)) .
    rec-value(A, rule-created(Rule?)) .
    snd-msg(rule-created(proc(A, Pid), Rule))
    +
    rec-msg(enable-rule(proc(A, Pid?), Rule?)) .
    snd-eval(A, enable-rule(Pid, Rule)) .
    rec-value(A, rule-enabled) .
    snd-msg(rule-enabled(proc(A, Pid)))
    +
    rec-msg(disable-rule(proc(A, Pid?), Rule?)) .
    snd-eval(A, disable-rule(Pid, Rule)) .
    rec-value(A, rule-disabled) .
    snd-msg(rule-disabled(proc(A, Pid)))
    +
    rec-msg(modify-rule(proc(A, Pid?), Rule?, Port?, Cond?, Action?, Enabled?)) .
    snd-eval(A, modify-rule(Pid, Rule, Port, Cond, Action, Enabled)) .
    rec-value(A, rule-modified) .
    snd-msg(rule-modified(proc(A, Pid)))
    +
    rec-msg(delete-rule(proc(A, Pid?), Rule?)) .
    snd-eval(A, delete-rule(Pid, Rule)) .
    rec-value(A, rule-deleted) .
    snd-msg(rule-deleted(proc(A, Pid)))
    +
    rec-event(A, event(Pid?, Rule?, Result?)) .
    snd-msg(event(proc(A, Pid), Rule, Result)) .
    snd-ack-event(A, event(Pid, Rule, Result))
    +
    rec-event(A, process-created(Pid?, Name?)) .
    snd-msg(process-created(proc(A, Pid), Name)) .
    snd-ack-event(A, process-created(Pid, Name))
    +
    rec-event(A, process-destroyed(Pid)) .
    snd-msg(process-destroyed(proc(A, Pid))) .
    snd-ack-event(A, process-destroyed(Pid))
  ) *  rec-disconnect(A) .
  snd-msg(adapter-disconnected(A))
endlet 

