Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 private SmtSolverHandler(
     SmtContextHandler contextHandler,
     ISolver smtSolver,
     PathConditionHandler pathConditionHandler)
 {
     this.contextHandler       = contextHandler;
     this.smtSolver            = smtSolver;
     this.pathConditionHandler = pathConditionHandler;
 }
Ejemplo n.º 3
0
 public ExecutionModelCreator(
     PathConditionHandler pathConditionHandler,
     SmtContextHandler smtContextHandler,
     IModel smtModel,
     IHeapModelRecorder heapModelRecorder)
     : base(pathConditionHandler)
 {
     this.smtContextHandler = smtContextHandler;
     this.smtModel          = smtModel;
     this.heapModelRecorder = heapModelRecorder;
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 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;
        }