示例#1
0
        internal Explorer(
            ExplorationContext explorationContext,
            IContextFactory smtContextFactory,
            StartingNodeInfo startingNode,
            IEntryPointRecognizer finalNodeRecognizer,
            ISymbolicHeapFactory heapFactory,
            Action <ExplorationResult> resultCallback)
        {
            // TODO: Solve this marginal case directly in the ExplorationContext
            Contract.Requires(!finalNodeRecognizer.IsFinalNode(startingNode.Node));

            this.context             = explorationContext;
            this.startingNode        = startingNode;
            this.finalNodeRecognizer = finalNodeRecognizer;
            this.heapFactory         = heapFactory;
            this.resultCallback      = resultCallback;

            this.smtContextHandler = new SmtContextHandler(smtContextFactory);

            var rootPath = new Path(
                ImmutableArray <Path> .Empty,
                0,
                this.startingNode.Node,
                ImmutableArray <FlowEdge> .Empty);
            var rootState = new ExplorationState(
                rootPath,
                CallSiteStack.Empty,
                this.smtContextHandler.CreateEmptySolver(rootPath, this.startingNode, heapFactory));

            this.AddState(rootState);
        }
 private SmtSolverHandler(
     SmtContextHandler contextHandler,
     ISolver smtSolver,
     PathConditionHandler pathConditionHandler)
 {
     this.contextHandler       = contextHandler;
     this.smtSolver            = smtSolver;
     this.pathConditionHandler = pathConditionHandler;
 }
 public ExecutionModelCreator(
     PathConditionHandler pathConditionHandler,
     SmtContextHandler smtContextHandler,
     IModel smtModel,
     IHeapModelRecorder heapModelRecorder)
     : base(pathConditionHandler)
 {
     this.smtContextHandler = smtContextHandler;
     this.smtModel          = smtModel;
     this.heapModelRecorder = heapModelRecorder;
 }
        internal SmtSolverHandler(
            SmtContextHandler contextHandler,
            ISolver smtSolver,
            Path path,
            StartingNodeInfo startingNode,
            ISymbolicHeapFactory heapFactory)
            : this(
                contextHandler,
                smtSolver,
                null)
        {
            var heap = heapFactory.Create(new SolverSymbolicHeapContext(this));

            this.pathConditionHandler = new PathConditionHandler(contextHandler, smtSolver, path, startingNode, heap);
            this.pathConditionHandler.ProcessStartingNode();
        }
        public PathConditionHandler(
            SmtContextHandler smtContextHandler,
            ISolver smtSolver,
            Path path,
            StartingNodeInfo startingNode,
            ISymbolicHeap heap)
            : base(path, startingNode, smtContextHandler)
        {
            Contract.Requires(smtSolver != null);
            Contract.Requires(heap != null);

            this.smtSolver = smtSolver;
            this.Heap      = heap;

            this.smtSolver.Push();
            this.Heap.PushState();
        }
示例#6
0
        public PathVariableVersionHandler(
            Path path,
            StartingNodeInfo startingNode,
            SmtContextHandler smtContextHandler)
            : this()
        {
            Contract.Requires(path != null);
            Contract.Requires(startingNode != null);
            Contract.Requires(smtContextHandler != null);

            this.startingNode           = startingNode;
            this.callStack              = new Stack <LocalFlowVariableOverlay <int> >();
            this.variableVersions       = new FlowGraphsVariableOverlay <VariableVersionInfo>(() => new VariableVersionInfo());
            this.callExtensionKindStack = new Stack <CallExtensionKind>();
            this.Path = path;
            this.SmtContextHandler = smtContextHandler;
        }