protected override bool ParseOption(string name, CommandLineParseState ps)
        {
            if (name == "sequential")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    Debug.Assert(PipelineString == null);
                    PipelineString = ps.args[ps.i];
                }

                return(true);
            }

            if (name == "parallel")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    Pipeline.Sequential = false;
                    Debug.Assert(PipelineString == null);
                    PipelineString = ps.args[ps.i];
                }

                return(true);
            }

            if (name == "noHoudini")
            {
                Pipeline.RunHoudini = false;
                return(true);
            }

            if (name == "writeKilledInvariantsToFile")
            {
                WriteKilledInvariantsToFile = true;
                return(true);
            }

            if (name == "replaceLoopInvariantAssertions")
            {
                ReplaceLoopInvariantAssertions = true;
                return(true);
            }

            if (name == "enableBarrierDivergenceChecks")
            {
                EnableBarrierDivergenceChecks = true;
                return(true);
            }

            return(base.ParseOption(name, ps));
        }
        protected override bool ParseOption(string name, CommandLineParseState ps)
        {
            var args = ps.args;

            switch (name)
            {
            case "warnDeadCode":
                WarnDeadCode = true;
                Mode         = Modes.Block;
                return(true);

            case "generateTestMode":
                if (ps.ConfirmArgumentCount(1))
                {
                    Mode = args[ps.i] switch {
                        "None" => Modes.None,
                        "Block" => Modes.Block,
                        "Path" => Modes.Path,
                        _ => throw new Exception("Invalid value for testMode")
                    };
                }
                return(true);

            case "generateTestSeqLengthLimit":
                var limit = 0;
                if (ps.GetNumericArgument(ref limit))
                {
                    SeqLengthLimit = (uint)limit;
                }
                return(true);

            case "generateTestTargetMethod":
                if (ps.ConfirmArgumentCount(1))
                {
                    TargetMethod = args[ps.i];
                }
                return(true);

            case "generateTestInlineDepth":
                var depth = 0;
                if (ps.GetNumericArgument(ref depth))
                {
                    TestInlineDepth = (uint)depth;
                }
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Parses the command line options.
        /// </summary>
        /// <param name="name">The name of the option.</param>
        /// <param name="ps">The command line parsing state.</param>
        /// <returns>True if the parsing was successful.</returns>
        protected override bool ParseOption(string name, CommandLineParseState ps)
        {
            if (name == "detailedLogging")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    DetailedLogging = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "disableInspection")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    DisableInspection = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "disableGridBarriers")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    DisableGridBarriers = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "useAxioms")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    UseAxioms = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "sourceLanguage")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    SourceLanguage = ps.args[ps.i] == "cl" ? SourceLanguage.OpenCL : SourceLanguage.CUDA;
                }
                return(true);
            }

            return(base.ParseOption(name, ps));
        }
        protected override bool ParseOption(string name, CommandLineParseState ps)
        {
            if (name == "sourceLanguage")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    if (ps.args[ps.i] == "cl")
                    {
                        SourceLanguage = SourceLanguage.OpenCL;
                    }
                    else if (ps.args[ps.i] == "cu")
                    {
                        SourceLanguage = SourceLanguage.CUDA;
                    }
                }

                return(true);
            }

            if (name == "blockHighestDim")
            {
                int highestDim = BlockHighestDim;
                ps.GetNumericArgument(ref highestDim, 3);
                BlockHighestDim = highestDim;
                return(true);
            }

            if (name == "gridHighestDim")
            {
                int highestDim = GridHighestDim;
                ps.GetNumericArgument(ref highestDim, 3);
                GridHighestDim = highestDim;
                return(true);
            }

            if (name == "debugGPUVerify")
            {
                DebugGPUVerify = true;
                return(true);
            }

            if (name == "onlyIntraGroupRaceChecking")
            {
                OnlyIntraGroupRaceChecking = true;
                return(true);
            }

            if (name == "raceChecking")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    if (ps.args[ps.i] == "ORIGINAL")
                    {
                        RaceInstrumentationUtil.RaceCheckingMethod = RaceCheckingMethod.ORIGINAL;
                    }
                    else if (ps.args[ps.i] == "SINGLE")
                    {
                        RaceInstrumentationUtil.RaceCheckingMethod = RaceCheckingMethod.WATCHDOG_SINGLE;
                    }
                    else if (ps.args[ps.i] == "MULTIPLE")
                    {
                        RaceInstrumentationUtil.RaceCheckingMethod = RaceCheckingMethod.WATCHDOG_MULTIPLE;
                    }
                }

                return(true);
            }

            if (name == "displayLoopAbstractions")
            {
                DisplayLoopAbstractions = true;
                return(true);
            }

            return(base.ParseOption(name, ps));  // defer to superclass
        }
        /// <summary>
        /// Process the option and modify "ps" accordingly.
        /// Return true if the option is one that is recognized.
        /// </summary>
        protected virtual bool ParseOption(string name, CommandLineParseState ps)
        {
            Contract.Requires(name != null);
              Contract.Requires(ps != null);

              switch (name) {
            case "help":
            case "?":
              if (ps.ConfirmArgumentCount(0)) {
            HelpRequested = true;
              }
              return true;
            case "attrHelp":
              if (ps.ConfirmArgumentCount(0)) {
            AttrHelpRequested = true;
              }
              return true;
            default:
              break;
              }
              return false;  // unrecognized option
        }
        /// <summary>
        /// Parses the command line options.
        /// </summary>
        /// <param name="name">The name of the option.</param>
        /// <param name="ps">The command line parsing state.</param>
        /// <returns>True if the parsing was successful.</returns>
        protected override bool ParseOption(string name, CommandLineParseState ps)
        {
            if (name == "detailedLogging")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    DetailedLogging = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "logClauses")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    LogClauses = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "disableInspection")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    DisableInspection = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "useAxioms")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    UseAxioms = bool.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "loopDepthWeight")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    LoopDepthWeight = int.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "gridBarrierWeight")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    GridBarrierWeight = int.Parse(ps.args[ps.i]);
                }
                return(true);
            }
            else if (name == "solverType")
            {
                if (ps.ConfirmArgumentCount(1))
                {
                    SolverType = (Solver.SolverType)Enum.Parse(typeof(Solver.SolverType), ps.args[ps.i]);
                }
                return(true);
            }

            return(base.ParseOption(name, ps));
        }