/// <summary>
 /// Reports use of external asynchrony.
 /// </summary>
 /// <param name="log">Log</param>
 internal static void ReportExternalAsynchronyUsage(Log log)
 {
     AnalysisErrorReporter.ReportGenericError(log,
                                              "Machine '{0}' is trying to use non-P# asynchronous operations. " +
                                              "This can lead to data races and is *strictly* not allowed.",
                                              log.Machine);
     Environment.Exit(1);
 }
        /// <summary>
        /// Reports a runtime only method access error.
        /// </summary>
        /// <param name="log">Log</param>
        internal static void ReportRuntimeOnlyMethodAccess(Log log)
        {
            if (log.State == null)
            {
                AnalysisErrorReporter.ReportGenericError(log,
                                                         "Method '{0}' of machine '{1}' is trying to access a P# " +
                                                         "runtime only method.", log.Method, log.Machine);
            }
            else
            {
                AnalysisErrorReporter.ReportGenericError(log,
                                                         "Method '{0}' in state {1} of machine '{2}' is trying to " +
                                                         "access a P# runtime only method.",
                                                         log.Method, log.State, log.Machine);
            }

            Environment.Exit(1);
        }
        /// <summary>
        /// Reports an explicit state initialisation error.
        /// </summary>
        /// <param name="log">Log</param>
        internal static void ReportExplicitStateInitialisation(Log log)
        {
            if (log.State == null)
            {
                AnalysisErrorReporter.ReportGenericError(log,
                                                         "Method '{0}' of machine '{1}' is trying to explicitly " +
                                                         "initialize a machine state.",
                                                         log.Method, log.Machine);
            }
            else
            {
                AnalysisErrorReporter.ReportGenericError(log,
                                                         "Method '{0}' in state {1} of machine '{2}' is trying to " +
                                                         "explicitly initialize a machine state.",
                                                         log.Method, log.State, log.Machine);
            }

            Environment.Exit(1);
        }