public static void handleArgumentTypeViolation(Proposition proposition, Stella_Object arg, Surrogate requiredtype) {
    if (((Keyword)(Logic.$TYPECHECKMODE$.get())) == Logic.KWD_POST_TYPE_VIOLATIONS) {
      Proposition.postToCheckTypesAgenda(proposition);
    }
    else if (((Keyword)(Logic.$TYPECHECKMODE$.get())) == Logic.KWD_REPORT_TYPE_VIOLATIONS) {
      { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

        try {
          Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
          {
            Stella.STANDARD_WARNING.nativeStream.println("WARNING: Type check violation on argument `" + arg + "' in proposition");
            Stella.STANDARD_WARNING.nativeStream.println("   " + proposition + ".");
            Stella.STANDARD_WARNING.nativeStream.println("   Argument must have type `" + requiredtype.symbolName + "'.");
          }
;
          Logic.helpSignalPropositionError(Stella.STANDARD_WARNING, Logic.KWD_WARNING);

        } finally {
          Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
        }
      }
    }
    else if (((Keyword)(Logic.$TYPECHECKMODE$.get())) == Logic.KWD_SIGNAL_TYPE_VIOLATIONS) {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        { Object old$PrintreadablyP$001 = Stella.$PRINTREADABLYp$.get();

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            {
              stream000.nativeStream.println("ERROR: Type check violation on argument ``" + arg + "'' in proposition");
              stream000.nativeStream.println("   `" + proposition + "'.");
              stream000.nativeStream.println("   Argument must have type ``" + requiredtype.symbolName + "''..");
            }
;
            Logic.helpSignalPropositionError(stream000, Logic.KWD_ERROR);

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$001);
          }
        }
        throw ((PropositionError)(PropositionError.newPropositionError(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    else if (((Keyword)(Logic.$TYPECHECKMODE$.get())) == Logic.KWD_AUTOMATICALLY_FIX_TYPE_VIOLATIONS) {
      { Proposition isaproposition = Logic.assertIsaProposition(arg, requiredtype);

        KeyValueList.setDynamicSlotValue(isaproposition.dynamicSlots, Logic.SYM_LOGIC_ASSERTED_BY_TYPE_CHECKERp, Stella.TRUE_WRAPPER, Stella.FALSE_WRAPPER);
      }
    }
    else {
      { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

        stream001.nativeStream.print("`" + ((Keyword)(Logic.$TYPECHECKMODE$.get())) + "' is not a valid case option");
        throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
      }
    }
  }