public LimitLoopBoundScheduler(IStateScheduler underlyingScheduler, BigInteger loopBound) { this.UnderlyingScheduler = underlyingScheduler; this.LoopBound = loopBound; if (this.LoopBound < 0) { throw new ArgumentException("Invalid loop bound"); } this.StateToCurrentLoops = new Dictionary <ExecutionState, ExecutionStateNestedLoopInfo>(); this.ProgramLoopInfo = null; // Set elsewhere this.Executor = null; // Set elsewhere }
public void ReceiveExecutor(Executor executor) { this.Executor = executor; // Guard just in case the Executor calls us again. This can // happen if there are multiple entry points. if (this.ProgramLoopInfo == null) { this.ProgramLoopInfo = new ProgramLoopInfo(executor.TheProgram); // Register the callbacks we need executor.BasicBlockChanged += Executor_BasicBlockChanged; executor.ForkOccurred += Executor_ForkOccurred; executor.ImplementationEntered += Executor_ImplementationEntered; } // Give the underlying executor access to the scheduler UnderlyingScheduler.ReceiveExecutor(executor); }