Ejemplo n.º 1
0
        public static IStateScheduler GetScheduler(CmdLineOpts options)
        {
            IStateScheduler scheduler = null;

            switch (options.scheduler)
            {
            case CmdLineOpts.Scheduler.DFS:
                scheduler = new DFSStateScheduler();
                break;

            case CmdLineOpts.Scheduler.BFS:
                scheduler = new BFSStateScheduler();
                break;

            case CmdLineOpts.Scheduler.UntilEndBFS:
                scheduler = new UntilTerminationBFSStateScheduler();
                break;

            case CmdLineOpts.Scheduler.AltBFS:
                scheduler = new AlternativeBFSStateScheduler();
                break;

            default:
                throw new ArgumentException("Unsupported scheduler");
            }

            if (options.PreferLoopEscapingPaths > 0)
            {
                scheduler = new LoopEscapingScheduler(scheduler);
            }

            if (options.MaxLoopDepth > 0)
            {
                scheduler = new LimitLoopBoundScheduler(scheduler, options.MaxLoopDepth);
            }

            return(scheduler);
        }
Ejemplo n.º 2
0
        public static Executor GetExecutor(Program p, IStateScheduler scheduler = null, ISolver solver = null, bool useConstantFolding = false)
        {
            if (scheduler == null)
            {
                scheduler = new DFSStateScheduler();
            }

            if (solver == null)
            {
                solver = new SimpleSolver(new DummySolver());
            }

            IExprBuilder builder = new SimpleExprBuilder(/*immutable=*/ true);

            if (useConstantFolding)
            {
                builder = new ConstantFoldingExprBuilder(new ConstantCachingExprBuilder(builder));
            }

            Executor e = new Executor(p, scheduler, solver, builder, new SimpleSymbolicPool());

            return(e);
        }