public static Cons getRoleNamesAndValues(Stella_Object instanceref) {
    { Stella_Object instance = Logic.getInstance(instanceref);
      KeyValueList table = KeyValueList.newKeyValueList();

      if (instance == null) {
        return (null);
      }
      { Proposition p = null;
        Iterator iter000 = ((Iterator)(Logic.allTrueDependentPropositions(instance, null, true).concatenate(Logic.allTrueDependentPropositions(instance, null, true), Stella.NIL)));

        while (iter000.nextP()) {
          p = ((Proposition)(iter000.value));
          if ((p.arguments.length() == 2) &&
              Stella_Object.eqlP((p.arguments.theArray)[0], instance)) {
            { Symbol relation = Symbol.internSymbolInModule(((Surrogate)(p.operator)).symbolName, ((Module)(((Surrogate)(p.operator)).homeContext)), true);
              Stella_Object filler = Logic.valueOf((p.arguments.theArray)[1]);

              if (filler != null) {
                { Cons bucket = ((Cons)(table.lookup(relation)));

                  if (bucket == null) {
                    table.insertAt(relation, Cons.consList(Cons.cons(filler, Stella.NIL)));
                  }
                  else {
                    table.insertAt(relation, Cons.cons(filler, bucket));
                  }
                }
              }
            }
          }
        }
      }
      { Cons result = Stella.NIL;

        { Stella_Object key = null;
          Stella_Object value = null;
          KvCons iter001 = table.theKvList;

          for (;iter001 != null; iter001 = iter001.rest) {
            key = iter001.key;
            value = iter001.value;
            result = Cons.cons(Cons.cons(key, ((Cons)(value)).concatenate(Stella.NIL, Stella.NIL)), result);
          }
        }
        return (result);
      }
    }
  }