public static Cons createSkolemPropositionsQuery(Cons inheritedprops, Description description, KeyValueMap mapping) {
    { HashSet createdskolems = null;
      Cons skolemprops = Stella.NIL;
      Cons filteredpropsindices = Stella.NIL;

      { Object old$Module$000 = Stella.$MODULE$.get();
        Object old$Context$000 = Stella.$CONTEXT$.get();

        try {
          Native.setSpecial(Stella.$MODULE$, ((Module)(Stella.$MODULE$.get())));
          Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
          { Keyword testValue000 = description.proposition.kind;

            if (testValue000 == Logic.KWD_AND) {
              createdskolems = HashSet.newHashSet();
              { Stella_Object skolem = null;
                Cons iter000 = ((List)(mapping.lookup(Logic.KWD_CREATED_SKOLEMS))).theConsList;

                for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
                  skolem = iter000.value;
                  createdskolems.insert(((Skolem)(skolem)));
                }
              }
              { Proposition iprop = null;
                Cons iter001 = inheritedprops;
                int ipropindex = Stella.NULL_INTEGER;
                int iter002 = 0;
                Proposition dprop = null;
                Vector vector000 = ((Vector)(description.proposition.arguments));
                int index000 = 0;
                int length000 = vector000.length();
                Cons collect000 = null;

                loop001 : for (;(!(iter001 == Stella.NIL)) &&
                          (index000 < length000); 
                      iter001 = iter001.rest,
                      iter002 = iter002 + 1,
                      index000 = index000 + 1) {
                  iprop = ((Proposition)(iter001.value));
                  ipropindex = iter002;
                  dprop = ((Proposition)((vector000.theArray)[index000]));
                  if (!Proposition.propositionReferencesTermsP(iprop, createdskolems)) {
                    filteredpropsindices = Cons.cons(IntegerWrapper.wrapInteger(ipropindex), filteredpropsindices);
                    continue loop001;
                  }
                  if (collect000 == null) {
                    {
                      collect000 = Cons.cons(dprop, Stella.NIL);
                      if (skolemprops == Stella.NIL) {
                        skolemprops = collect000;
                      }
                      else {
                        Cons.addConsToEndOfConsList(skolemprops, collect000);
                      }
                    }
                  }
                  else {
                    {
                      collect000.rest = Cons.cons(dprop, Stella.NIL);
                      collect000 = collect000.rest;
                    }
                  }
                }
              }
              filteredpropsindices = filteredpropsindices.reverse();
              if (!(filteredpropsindices == Stella.NIL)) {
                { Description self001 = Description.newDescription();

                  self001.ioVariables = description.ioVariables;
                  self001.proposition = Logic.conjoinPropositions(skolemprops);
                  description = self001;
                }
                Description.computeInternalVariables(description);
              }
            }
            else if ((testValue000 == Logic.KWD_ISA) ||
                ((testValue000 == Logic.KWD_FUNCTION) ||
                 (testValue000 == Logic.KWD_PREDICATE))) {
            }
            else {
            }
          }
          return (Cons.consList(Cons.cons(QueryIterator.initializeQueryIterator(Logic.allocateQueryIterator(), description, Vector.newVector(description.arity())), Cons.cons(filteredpropsindices, Stella.NIL))));

        } finally {
          Stella.$CONTEXT$.set(old$Context$000);
          Stella.$MODULE$.set(old$Module$000);
        }
      }
    }
  }