示例#1
0
        private void BSpecCheck(List <Tuple <int, int, int> > implEdges)
        {
            Dictionary <int, HashSet <int> > initialConstraints = new Dictionary <int, HashSet <int> >();

            initialConstraints[initialState] = new HashSet <int>(new int[] { 1 });
            foreach (var finalState in finalStates)
            {
                initialConstraints[finalState] = new HashSet <int>(new int[] { 0 });
            }
            SimulationRelation <int, int, int> x = new SimulationRelation <int, int, int>(implEdges, BSpec, initialConstraints);
            Dictionary <int, HashSet <int> >   simulationRelation = x.ComputeSimulationRelation();

            if (simulationRelation[initialState].Count == 0)
            {
                moverTypeChecker.Error(impl, string.Format("Implementation {0} fails simulation check B at layer {1}. An action must be succeeded by a yield.\n", impl.Name, currLayerNum));
            }
        }
示例#2
0
        private void CSpecCheck(List <Tuple <int, int, int> > implEdges)
        {
            Dictionary <int, HashSet <int> > initialConstraints = new Dictionary <int, HashSet <int> >();

            foreach (Block block in loopHeaders)
            {
                if (!IsTerminatingLoopHeader(block))
                {
                    initialConstraints[absyToNode[block]] = new HashSet <int>(new int[] { 0 });
                }
            }
            SimulationRelation <int, int, int> x = new SimulationRelation <int, int, int>(implEdges, CSpec, initialConstraints);
            Dictionary <int, HashSet <int> >   simulationRelation = x.ComputeSimulationRelation();

            if (simulationRelation[initialState].Count == 0)
            {
                moverTypeChecker.Error(impl, string.Format("Implementation {0} fails simulation check C at layer {1}. Transactions must be separated by a yield.\n", impl.Name, currLayerNum));
            }
        }