Beispiel #1
0
        public IReadOnlyCollection <Transition> AnalyzeTransitions(State source, Action action, IEnumerable <State> targets)
        {
            var codeContractsRunner = new CodeContractsRunner(workingDir, ccCheckDefaultArgs, libPaths, typeToAnalyze);

            var transitionQueries   = queryGenerator.CreateTransitionQueries(source, action, targets);
            var queryAssembly       = CreateQueryAssembly(transitionQueries);
            var evaluator           = new QueryEvaluator(codeContractsRunner, queryAssembly);
            var feasibleTransitions = evaluator.GetFeasibleTransitions(transitionQueries);

            unprovenQueriesCount += evaluator.UnprovenQueries;

            return(feasibleTransitions);
        }
Beispiel #2
0
        protected ISet <Action> ActionsThatAreAlwaysDisabled(State source, Action action, IEnumerable <Action> actions,
                                                             CodeContractsRunner codeContractsRunner)
        {
            Contract.Requires(source != null);
            Contract.Requires(action != null);
            Contract.Requires(actions.Any());
            Contract.Requires(codeContractsRunner != null);

            var targetNegatedPreconditionQueries = queryGenerator.CreateNegativeQueries(source, action, actions);

            generatedQueriesCount += targetNegatedPreconditionQueries.Count;
            var queryAssembly   = CreateQueryAssembly(targetNegatedPreconditionQueries);
            var evaluator       = new QueryEvaluator(codeContractsRunner, queryAssembly);
            var disabledActions = new HashSet <Action>(evaluator.GetDisabledActions(targetNegatedPreconditionQueries));

            unprovenQueriesCount += evaluator.UnprovenQueries;
            return(disabledActions);
        }