Beispiel #1
0
        private void EnumerateDefs()
        {
            foreach (KeyValuePair <long, ICollection <long> > nodeVariablesPair in Assignments)
            {
                long uNodeId = nodeVariablesPair.Key;

                foreach (long variable in nodeVariablesPair.Value)
                {
                    long def = (long)(DefsCount++);
                    DefToVarMap[def] = variable;

                    if (!CFG.IsSourceNode(uNodeId))
                    {
                        Ensure.That(NodeToVarMap.ContainsKey(uNodeId)).IsFalse();
                        NodeToVarMap[uNodeId] = variable;
                    }

                    AppHelper.TakeValueByKey(
                        VarToDefsMap,
                        variable,
                        () => new List <long>())
                    .Add(def);

                    AppHelper.TakeValueByKey(
                        NodeToDefsSet,
                        uNodeId,
                        () => new List <long>())
                    .Add(def);

                    DefToNodeMap[def] = uNodeId;
                }
            }
        }