* @param instancename
   * @return List
   */
  public static List getRulesForRelation(String modulename, String instancename) {
    { edu.isi.powerloom.PlIterator iter = edu.isi.powerloom.PLI.sGetRules(GuiServer.guiNameToPlName(instancename), modulename, null);
      List rules = List.newList();

      { Proposition rule = null;
        edu.isi.powerloom.PlIterator iter000 = iter;
        Cons collect000 = null;

        while (iter000.nextP()) {
          rule = ((Proposition)(iter000.value));
          if (collect000 == null) {
            {
              collect000 = Cons.cons(rule, Stella.NIL);
              if (rules.theConsList == Stella.NIL) {
                rules.theConsList = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(rules.theConsList, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(rule, Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      return (rules.sort(Native.find_java_method("edu.isi.powerloom.logic.Proposition", "propositionLessThanP", new java.lang.Class [] {Native.find_java_class("edu.isi.powerloom.logic.Proposition"), Native.find_java_class("edu.isi.powerloom.logic.Proposition")})));
    }
  }