content: // DO NOT EDIT THIS FILE! IT IS AUTOMATICALLY GENERATED FROM FILE "src/Utilities.gold"
  import gold.*;
  import gold.structures.*;
  import gold.structures.automaton.*;
  import gold.structures.bag.*;
  import gold.structures.collection.*;
  import gold.structures.deque.*;
  import gold.structures.disjointset.*;
  import gold.structures.graph.*;
  import gold.structures.heap.*;
  import gold.structures.list.*;
  import gold.structures.map.*;
  import gold.structures.multimap.*;
  import gold.structures.point.*;
  import gold.structures.queue.*;
  import gold.structures.set.*;
  import gold.structures.stack.*;
  import gold.structures.tree.*;
  import gold.structures.tree.binary.*;
  import gold.structures.tree.nary.*;
  import gold.structures.tuple.*;
  import gold.structures.turingMachine.*;
  import gold.swing.*;
  import gold.swing.icon.*;
  import gold.swing.icon.ajaxload.*;
  import gold.swing.icon.famfamfam.*;
  import gold.swing.icon.gold.*;
  import gold.swing.icon.jlfgr.*;
  import gold.swing.icon.wikimedia.*;
  import gold.swing.icon.windows.*;
  import gold.swing.look.*;
  import gold.swing.util.*;
  import gold.test.*;
  import gold.test.automaton.*;
  import gold.test.general.*;
  import gold.test.graph.*;
  import gold.util.*;
  import gold.visualization.*;
  import gold.visualization.automaton.*;
  import gold.visualization.graph.*;
  import gold.visualization.quadtree.*;
  import gold.visualization.turingMachine.*;
  import gold.visualization.util.*;
  import java.lang.*;
  import org.apfloat.*;
  import static gold.util.GReflection.*;
  @SuppressWarnings("all")
  public final class Utilities {
    public static Object toSet(Object C) {
      int $line=0;
      Object $result=null;
      $try:try {
        gold.structures.set.ISet $v1=$newSet();
        $v2:for (Object x:GCollections.unmodifiableCollection(C)) {
          $v1.add(x);
        }
        $result=$v1;
        if (true) break $try;
        $line=6;
        $rethrow(new RuntimeException("The function \"toSet(C:Object)\" did not return a value."));
      }
      catch (Throwable $throwable) {
        $rethrow($throwable,Utilities.class,"toSet",$line);
      }
      return $result;
    }
    public static Object test(IAutomaton M) {
      int $line=0;
      Object $result=null;
      $try:try {
        $line=9;
        java.util.Scanner sc=null;
        sc=$invokeConstructor(java.util.Scanner.class,new Object[]{$invokeField(System.class,"in",true,null)});
        $line=10;
        Object isTransducer=$fix($invokeMethod("isInstance",$invokeField(ITransducer.class,"class",true,null),new Object[]{M}));
        $line=11;
        while (true) {
          if (!($bool(true))) break;
          $line=12;
          System.out.println($message(new Object[]{"----------------------------"}));
          $line=13;
          System.out.println($message(new Object[]{"Input String (empty string to exit): "}));
          $line=15;
          Object string=$fix(((java.util.Scanner)sc).nextLine());
          $line=16;
          if ($opEqualY(string,"")) {
            $line=16;
            break;
          }
          $line=18;
          Object inputM=$fix(Utilities.toSet(((gold.structures.automaton.IAutomaton)M).getAlphabet()));
          $line=20;
          if ($bool($invokeMethod("containsAll",((gold.structures.automaton.IAutomaton)M).getAlphabet(),new Object[]{string}))) {
            $line=21;
            Object result=$fix(((gold.structures.automaton.IAutomaton)M).acceptsString($cast(java.lang.String.class,string)));
            $line=22;
            System.out.println($message(new Object[]{$opAdditY($opAdditY("The string was ",(($bool(result))?("accepted!"):("rejected."))),(($bool(isTransducer))?(". Output:"):("")))}));
            $line=23;
            if ($bool(isTransducer)) {
              $line=24;
              System.out.println($message(new Object[]{$invokeMethod("getOutputString",$cast(ITransducer.class,M),new Object[]{})}));
            }
          }
          else {
            $line=27;
            System.out.println($message(new Object[]{$opAdditY("Input contains invalid symbols: ",$opDiffeY(Utilities.toSet(string),inputM))}));
          }
        }
        $line=30;
        System.out.println($message(new Object[]{"Execution terminated"}));
      }
      catch (Throwable $throwable) {
        $rethrow($throwable,Utilities.class,"test",$line);
      }
      return $result;
    }
    public static Object testCodeDecode(ITransducer C, ITransducer D) {
      int $line=0;
      Object $result=null;
      $try:try {
        $line=36;
        java.util.Scanner sc=null;
        sc=$invokeConstructor(java.util.Scanner.class,new Object[]{$invokeField(System.class,"in",true,null)});
        $line=38;
        Object inputC=$fix(Utilities.toSet(((gold.structures.automaton.ITransducer)C).getInputAlphabet()));
        $line=39;
        Object inputD=$fix(Utilities.toSet(((gold.structures.automaton.ITransducer)D).getInputAlphabet()));
        $line=41;
        System.out.println($message(new Object[]{"Testing Coder-Decoder"}));
        $line=42;
        Object string=$fix(" ");
        $line=43;
        boolean $v3=false;
        while (true) {
          if ($v3) {
            if ($bool(false)) break;
          }
          $v3=true;
          $line=44;
          System.out.println($message(new Object[]{"----------------------------"}));
          $line=45;
          System.out.println($message(new Object[]{"Input string: (empty string to end)"}));
          $line=47;
          string=$fix(((java.util.Scanner)sc).nextLine());
          $line=48;
          if ($opEqualY(string,"")) {
            $line=48;
            break;
          }
          else {
            $line=50;
            Object option=$fix("");
            $line=51;
            while (true) {
              if (!(!$opMembrY(option,GCollections.asSet("1","2","3")))) break;
              $line=52;
              System.out.println($message(new Object[]{"What do you want to do?"}));
              $line=53;
              System.out.println($message(new Object[]{"1. code only?"}));
              $line=54;
              System.out.println($message(new Object[]{"2. code and decode?"}));
              $line=55;
              System.out.println($message(new Object[]{"3. decode only?"}));
              $line=57;
              option=$fix(((java.util.Scanner)sc).nextLine());
            }
            $line=59;
            Object stringOut=$fix("");
            $line=60;
            if (($opEqualY(option,"1")||$opEqualY(option,"2"))) {
              $line=62;
              if ($opSbsetY(Utilities.toSet(string),inputC)) {
                $line=63;
                Object result=$fix(((gold.structures.automaton.ITransducer)C).acceptsString($cast(java.lang.String.class,string)));
                $line=64;
                System.out.println($message(new Object[]{$opAdditY($opAdditY($opAdditY("The string was ",(($bool(result))?("accepted"):("not accepted"))),". Output: "),((gold.structures.automaton.ITransducer)C).getOutputString())}));
                $line=65;
                stringOut=$fix(((gold.structures.automaton.ITransducer)C).getOutputString());
                $line=66;
                if ($opEqualY(option,"2")) {
                  $line=67;
                  if ($opSbsetY(Utilities.toSet(stringOut),inputD)) {
                    $line=68;
                    result=$fix(((gold.structures.automaton.ITransducer)D).acceptsString($cast(java.lang.String.class,stringOut)));
                    $line=69;
                    System.out.println($message(new Object[]{$opAdditY($opAdditY($opAdditY("The coded string was ",(($bool(result))?("accepted"):("not accepted"))),". Output: "),((gold.structures.automaton.ITransducer)D).getOutputString())}));
                    $line=70;
                    Object stringOut1=$fix(((gold.structures.automaton.ITransducer)D).getOutputString());
                    $line=71;
                    System.out.println($message(new Object[]{$opAdditY($opAdditY("The decoded string is ",((!$opEqualY(stringOut1,string))?("not "):(""))),"equal to the original string.")}));
                  }
                  else {
                    $line=73;
                    System.out.println($message(new Object[]{$opAdditY("Output contains invalid symbols for the decoder: ",$opDiffeY(Utilities.toSet(stringOut),inputD))}));
                  }
                }
              }
              else {
                $line=78;
                System.out.println($message(new Object[]{$opAdditY("Input contains invalid symbols: ",$opDiffeY(Utilities.toSet(string),inputC))}));
              }
            }
            else {
              $line=81;
              if ($opSbsetY(Utilities.toSet(string),inputD)) {
                $line=82;
                Object result=$fix(((gold.structures.automaton.ITransducer)D).acceptsString($cast(java.lang.String.class,string)));
                $line=83;
                System.out.println($message(new Object[]{$opAdditY($opAdditY($opAdditY("The string was ",(($bool(result))?("accepted"):("not accepted")))," by the decoder. Output: "),((gold.structures.automaton.ITransducer)D).getOutputString())}));
              }
              else {
                $line=85;
                System.out.println($message(new Object[]{$opAdditY("Input contains invalid symbols: ",$opDiffeY(Utilities.toSet(string),inputD))}));
              }
            }
          }
        }
        $line=92;
        System.out.println($message(new Object[]{"Execution Ended"}));
      }
      catch (Throwable $throwable) {
        $rethrow($throwable,Utilities.class,"testCodeDecode",$line);
      }
      return $result;
    }
  }
  