public static boolean resolveOneSlotReferenceP(Proposition proposition, KeyValueList variabletypestable) {
    { Stella_Object firstargument = (proposition.arguments.theArray)[0];
      Stella_Object predicate = null;

      { Surrogate testValue000 = Stella_Object.safePrimaryType(firstargument);

        if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
          { PatternVariable firstargument000 = ((PatternVariable)(firstargument));

            { List types = ((List)(variabletypestable.lookup(firstargument000)));

              if (types != null) {
                predicate = Logic.inferPredicateFromOperatorAndTypes(proposition.operator, ((List)(variabletypestable.lookup(firstargument000))));
              }
            }
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
          { LogicObject firstargument000 = ((LogicObject)(firstargument));

            { Surrogate roottype = Logic.safeLogicalType(firstargument000);

              if (roottype != null) {
                predicate = Logic.inferPredicateFromOperatorAndTypes(proposition.operator, List.list(Cons.cons(roottype, Stella.NIL)));
              }
            }
          }
        }
        else {
        }
      }
      if (predicate != null) {
        if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(predicate), Logic.SGT_STELLA_SLOT)) {
          { Slot predicate000 = ((Slot)(predicate));

            { Surrogate returntype = Logic.unwrapWrappedType(predicate000.slotBaseType);

              if (!Logic.booleanTypeP(returntype)) {
                proposition.kind = Logic.KWD_FUNCTION;
                if (Logic.variableP((proposition.arguments.theArray)[(proposition.arguments.length() - 1)])) {
                  { PatternVariable lastargument = ((PatternVariable)((proposition.arguments.theArray)[(proposition.arguments.length() - 1)]));

                    Skolem.updateSkolemType(lastargument, returntype);
                  }
                }
              }
              proposition.operator = Logic.mostGeneralEquivalentSlotref(predicate000.slotSlotref);
              Proposition.evaluateNewProposition(proposition);
              return (true);
            }
          }
        }
        else {
        }
      }
      return (false);
    }
  }