private void CheckAndAddLayers(Absy node, QKeyValue attributes, int enclosingProcLayerNum) { List <int> attrs = RemoveDuplicatesAndSort(FindLayers(attributes)); if (attrs.Count == 0) { Error(node, "layer not present"); return; } LayerRange upperBound = FindLayerRange(); absyToLayerNums[node] = new HashSet <int>(); foreach (int layerNum in attrs) { if (layerNum > enclosingProcLayerNum) { Error(node, "The layer cannot be greater than the layer of enclosing procedure"); } else if (upperBound.Contains(layerNum)) { absyToLayerNums[node].Add(layerNum); } else { Error(node, string.Format("A variable being accessed in this specification is unavailable at layer {0}", layerNum)); } } }
private void CheckLayerExistence(LayerRange layerRange, string nodeName) { foreach (int layer in witnessFunction.layers) { if (!layerRange.Contains(layer)) { Error(string.Format("{0} does not exist at layer {1}", nodeName, layer)); } } }