private void SetInicialSetSplitting() { NODES_SET notEndDFANodes = NODES_SET.CreateNodesSet(); NODES_SET endDFANodes = NODES_SET.CreateNodesSet(); if (DFANodes.Count != 0) { foreach (NODE node in DFANodes) { if (node.nodeType == NODE_TYPE.END) { endDFANodes.nodesSet.Add(node); node.assignedSet = endDFANodes; } else { notEndDFANodes.nodesSet.Add(node); node.assignedSet = notEndDFANodes; } node.edges.OrderBy(edge => edge.transitionCharacter); } DFASets.Add(notEndDFANodes); DFASets.Add(endDFANodes); } }
private void Perform_DFAMinimization() { bool existedChange = true; SetInicialSetSplitting(); if (DFASets.Count != 0) { while (existedChange) { List <NODES_SET> newNodeSets = new List <NODES_SET>();; existedChange = false; foreach (NODES_SET dfaNodesSet in DFASets) { existedChange |= Perform_SetSplitting(dfaNodesSet, newNodeSets); } foreach (NODES_SET newDFANodesSet in newNodeSets) { DFASets.Add(newDFANodesSet); } } Get_DFAFromDFASets(); } }