public static List getPropositionsForInstanceAndRelation(String modulename, String instancename, String relationname) {
    { String expressionstring = "(" + GuiServer.guiNameToPlName(relationname) + " " + GuiServer.guiNameToPlName(instancename);
      Description relation = ((Description)(edu.isi.powerloom.PLI.sGetRelation(GuiServer.guiNameToPlName(relationname), modulename, null)));
      int arity = relation.arity();
      List result = List.newList();

      { int i = Stella.NULL_INTEGER;
        int iter000 = 2;
        int upperBound000 = arity;
        boolean unboundedP000 = upperBound000 == Stella.NULL_INTEGER;

        for (;unboundedP000 ||
                  (iter000 <= upperBound000); iter000 = iter000 + 1) {
          i = iter000;
          i = i;
          expressionstring = expressionstring + " NULL";
        }
      }
      expressionstring = expressionstring + ")";
      { Proposition prop = null;
        edu.isi.powerloom.PlIterator iter001 = edu.isi.powerloom.PLI.sGetPropositions(expressionstring, modulename, null);
        Cons collect000 = null;

        while (iter001.nextP()) {
          prop = ((Proposition)(iter001.value));
          if (collect000 == null) {
            {
              collect000 = Cons.cons(prop, Stella.NIL);
              if (result.theConsList == Stella.NIL) {
                result.theConsList = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(result.theConsList, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(prop, Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      return (result.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")})));
    }
  }