public static boolean checkStrictTypeP(Stella_Object self, Surrogate type, boolean shallowP) {
    shallowP = shallowP;
    if ((type == null) ||
        ((self == null) ||
         (type == Logic.SGT_STELLA_THING))) {
      return (true);
    }
    if ((type == Logic.SGT_STELLA_BOOLEAN) &&
        ((self == Logic.TRUE_PROPOSITION) ||
         (self == Logic.FALSE_PROPOSITION))) {
      return (true);
    }
    { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

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

          return (true);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_STELLA_LITERAL_WRAPPER)) {
        { LiteralWrapper self000 = ((LiteralWrapper)(self));

          if (Stella_Object.isaP(type.surrogateValue, Logic.SGT_STELLA_CLASS) &&
              Surrogate.subtypeOfP(Logic.logicalType(self000), type)) {
            return (true);
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
        { Proposition self000 = ((Proposition)(self));

          if (Stella_Object.isaP(type.surrogateValue, Logic.SGT_STELLA_CLASS) &&
              Surrogate.subtypeOfP(Logic.logicalType(self000), type)) {
            return (true);
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_QUANTITY_LOGIC_WRAPPER)) {
        { QuantityLogicWrapper self000 = ((QuantityLogicWrapper)(self));

          return (true);
        }
      }
      else {
      }
    }
    return (Logic.testIsaP(self, type) ||
        Logic.logicalSubtypeOfP(Logic.logicalType(self), type));
  }