public static Stella_Object inferPredicateFromOperatorAndTypes(Stella_Object operator, List types) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(operator);

      if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate operator000 = ((Surrogate)(operator));

          if (Stella_Object.isaP(operator000.surrogateValue, Logic.SGT_STELLA_SLOT)) {
            { Slot slot = ((Slot)(operator000.surrogateValue));

              slot = ((Slot)(Logic.inferPredicateFromOperatorAndTypes(slot.slotName, types)));
              if (slot != null) {
                return (slot);
              }
              else {
                return (operator000.surrogateValue);
              }
            }
          }
          else {
            return (operator000.surrogateValue);
          }
        }
      }
      else if (Surrogate.subtypeOfSymbolP(testValue000)) {
        { Symbol operator000 = ((Symbol)(operator));

          { Surrogate slotref = null;

            { Surrogate type = null;
              Cons iter000 = types.theConsList;

              for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
                type = ((Surrogate)(iter000.value));
                if (Stella_Object.isaP(type.surrogateValue, Logic.SGT_STELLA_CLASS)) {
                  slotref = Surrogate.lookupSlotref(type, operator000);
                  if (slotref != null) {
                    return (slotref.surrogateValue);
                  }
                  if (Logic.logicalSubtypeOfLiteralP(type)) {
                    type = type.typeToWrappedType();
                    slotref = Surrogate.lookupSlotref(type, operator000);
                    if (slotref != null) {
                      return (slotref.surrogateValue);
                    }
                  }
                }
              }
            }
          }
        }
      }
      else {
      }
    }
    return (null);
  }