code: public Value convertTo(PType to, Context ctxt) throws AnalysisException
  	{
  		if (Settings.dynamictypechecks)
  		{
  			// In VDM++ and VDM-RT, we do not want to do thread swaps half way
  			// through a DTC check (which can include calculating an invariant),
  			// so we set the atomic flag around the conversion. This also stops
  			// VDM-RT from performing "time step" calculations.
  			Value converted;
  
  			try
  			{
  				ctxt.threadState.setAtomic(true);
  				converted = convertValueTo(to, ctxt);
  			} finally
  			{
  				ctxt.threadState.setAtomic(false);
  			}
  
  			return converted;
  		} else
  		{
  			return this; // Good luck!!
  		}
  	}
docs: Performing a dynamic type conversion. This method is usually specialized by subclasses that know how to convert
  themselves to other types. If they fail, they delegate the conversion up to this superclass method which deals
  with the special cases: unions, type parameters, optional types, bracketed types and named types. If all these
  also fail, the method throws a runtime dynamic type check exception - though that may be caught, for example by
  the union processing, as it iterates through the types in the union given, trying to convert the value.
  
  @param to
  The target type.
  @param ctxt
  The context in which to make the conversion.
  @return This value converted to the target type.
  @throws AnalysisException