public static Stella_Object argumentBoundTo(Stella_Object self) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
        { PatternVariable self000 = ((PatternVariable)(self));

          { Stella_Object value = (((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentPatternRecord.variableBindings.theArray)[(self000.boundToOffset)];

            if ((value == null) &&
                (((Stella_Object)(Stella_Object.accessInContext(self000.variableValue, self000.homeContext, false))) != null)) {
              value = Logic.valueOf(self000);
              if (Logic.skolemP(value)) {
                return (null);
              }
              PatternVariable.bindVariableToValueP(self000, value, true);
            }
            return (value);
          }
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate self000 = ((Surrogate)(self));

          return (Logic.valueOf(self000));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_DESCRIPTION)) {
        { Description self000 = ((Description)(self));

          if ((((Vector)(KeyValueList.dynamicSlotValue(self000.dynamicSlots, Logic.SYM_LOGIC_EXTERNAL_VARIABLES, null))) != null) &&
              Proposition.containsOperatorP(self000.proposition, Logic.SGT_PL_KERNEL_KB_HOLDS)) {
            { Description temp000 = Description.findDuplicateDescription(self000);

              { Description value000 = ((temp000 != null) ? temp000 : self000);

                return (value000);
              }
            }
          }
          return (Logic.valueOf(self000));
        }
      }
      else {
        return (Logic.valueOf(self));
      }
    }
  }