Chiusura silenziosa - Tomawock/Elaborato_aloritmi_19_20_BT GitHub Wiki

Pseudocodice relativo alla chiusura silenzisa

Silence Closure(behavioral_state_graph, initial_state)

silent_closure = SilentClosure()
silent_closure = recorsive(behavioral_state_graph, initial_state, silent_closure)

ricorsive(behavioral_state_graph, initial_state, silent_closure):

for (parent_node, transition, child_node) in behavioral_state_graph do
  if parent_node == initial_state do
    if transition.obs=='ε' do
      silent_closure.subgraph.append(parent_node:transition,child_node)
      return ricorsive(behavioral_state_graph, child_node, silent_closure)
    else do
      silent_closure.transizioni_uscenti.append(parent_node, transition, child_node)
      return silent_closure