Exemplo n.º 1
0
 private void ASpecCheck(List<Tuple<int, int, int>> implEdges)
 {
     Dictionary<int, HashSet<int>> initialConstraints = new Dictionary<int, HashSet<int>>();
     initialConstraints[initialState] = new HashSet<int>(new int[] { 0 });
     foreach (var finalState in finalStates)
     {
         initialConstraints[finalState] = new HashSet<int>(new int[] { 1 });
     }
     SimulationRelation<int, int, int> x = new SimulationRelation<int, int, int>(implEdges, ASpec, initialConstraints);
     Dictionary<int, HashSet<int>> simulationRelation = x.ComputeSimulationRelation();
     if (simulationRelation[initialState].Count == 0)
     {
         civlTypeChecker.Error(impl, string.Format("Implementation {0} fails simulation check A at layer {1}. An action must be preceded by a yield.\n", impl.Name, currLayerNum));
     }
 }
Exemplo n.º 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));
     }
 }