Commit 5216fdf4 authored by Lars Schieffer's avatar Lars Schieffer
Browse files

remove dictionary

parent 2e75be72
......@@ -184,21 +184,19 @@ def edgesByLocationOf(automaton: dict, functions: dict, inputEnable: list) -> di
if location not in edgesByLocation:
edgesByLocation[location] = {}
if label not in edgesByLocation[location]:
edgesByLocation[location][label] = {"edges": [], "amount": 0}
edgesByLocation[location][label] = []
edge = updateGuardOf(edge, automatonLocals, name, functions)
for index, destination in enumerate(edge["destinations"]):
edge["destinations"][index]["assignments"] = updateAssignmentsOf(
destination, automatonLocals, name, functions
destination, automatonLocals, name, functions,
)
edgesByLocation[location][label]["edges"].append(edge)
edgesByLocation[location][label]["amount"] += len(edge["destinations"])
edgesByLocation[location][label].append(edge)
for location in edgesByLocation:
for identifier in inputEnable:
if identifier not in edgesByLocation[location]:
loop = [selfLoop(identifier, location)]
edgesByLocation[location][identifier] = {"edges": loop, "amount": 1}
edgesByLocation[location][identifier] = [selfLoop(identifier, location)]
return edgesByLocation
......@@ -231,10 +229,10 @@ def edgesByLabelOf(edgesByLocation: dict, automaton: str) -> dict:
"""
edgesByLabel = dict()
for edges in edgesByLocation.values():
for label, information in edges.items():
for label, edges in edges.items():
if label not in edgesByLabel:
edgesByLabel[label] = []
for edge in information["edges"]:
for edge in edges:
individual = edgeHelper.unificationOf(edge, automaton)
edgesByLabel[label] += individual
return edgesByLabel
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment