public static double dynamicallyEstimateGoalCost(Proposition goal) {
    { Keyword testValue000 = goal.kind;

      if ((testValue000 == Logic.KWD_ISA) ||
          ((testValue000 == Logic.KWD_FUNCTION) ||
           (testValue000 == Logic.KWD_PREDICATE))) {
        { GeneralizedSymbol operator = goal.operator;
          NamedDescription description = Logic.getDescription(operator);
          Stella_Object firstargvalue = null;

          if (operator == Logic.SGT_PL_KERNEL_KB_HOLDS) {
            firstargvalue = Logic.argumentBoundTo((goal.arguments.theArray)[0]);
            if (firstargvalue != null) {
              if (Stella_Object.isaP(firstargvalue, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
                description = ((NamedDescription)(firstargvalue));
              }
              else {
                description = null;
              }
            }
            else {
              return (Logic.INFERABLE_PENALTY_COST);
            }
          }
          if ((description == null) ||
              (!Description.inferableP(description))) {
            return (1.0);
          }
          else {
            return (NamedDescription.dynamicallyEstimateInferenceCost(description));
          }
        }
      }
      else if (testValue000 == Logic.KWD_IMPLIES) {
        return (Logic.SUBSET_OF_PENALTY_COST);
      }
      else {
        return (1.0);
      }
    }
  }