* @return boolean
   */
  public static boolean constantP(Stella_Object objectref) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(objectref);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_LITERAL_WRAPPER)) {
        { LiteralWrapper objectref000 = ((LiteralWrapper)(objectref));

          return (true);
        }
      }
      else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
        { Surrogate objectref000 = ((Surrogate)(objectref));

          return (Logic.constantP(objectref000.surrogateValue));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_THING)) {
        { Thing objectref000 = ((Thing)(objectref));

          return (Logic.testIsaP(objectref000, Logic.SGT_STELLA_LITERAL) ||
              Logic.testIsaP(objectref000, Logic.SGT_PL_KERNEL_KB_SCALAR));
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
        { LogicObject objectref000 = ((LogicObject)(objectref));

          return (Logic.testIsaP(objectref000, Logic.SGT_STELLA_LITERAL) ||
              Logic.testIsaP(objectref000, Logic.SGT_PL_KERNEL_KB_SCALAR));
        }
      }
      else {
        return (false);
      }
    }
  }