Skip to content

Commit cb7c8ff

Browse files
committed
add make_input_comlete to GsmNode
1 parent 455db26 commit cb7c8ff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

aalpy/learning_algs/general_passive/GsmNode.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,20 @@ def node_naming(node: GsmNode):
375375
file_ext = 'dot'
376376
graph.write(path=str(path) + "." + file_ext, prog=engine, format=format)
377377

378+
def make_input_complete(self) -> List[Tuple['GsmNode', Any, Any]]:
379+
all_nodes = self.get_all_nodes()
380+
inputs = {in_sym for node in all_nodes for in_sym in node.transitions}
381+
missing_trans = []
382+
for node in all_nodes:
383+
for in_sym in inputs:
384+
transitions = node.transitions[in_sym]
385+
if len(transitions) == 0:
386+
out_sym = node.prefix_access_pair[1]
387+
missing_trans.append((node, in_sym, out_sym))
388+
t_info = TransitionInfo(node, 1, None, None)
389+
transitions[out_sym] = t_info
390+
return missing_trans
391+
378392
def add_trace(self, trace: IOTrace):
379393
curr_node: GsmNode = self
380394
for in_sym, out_sym in trace:

0 commit comments

Comments
 (0)