Skip to content

Commit

Permalink
Fixed entry_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 26, 2023
1 parent 5710d9a commit 027152a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion witness2ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ def extract_metadata(witnessfile, c_file):

entry_nodes = list(nx.get_node_attributes(witness, "entry").keys())
if len(entry_nodes) == 0:
raise KnownErrorVerdict("No entry node")
entry_nodes = list(set([u for u, deg in witness.in_degree() if not deg]) - set([u for u, deg in witness.out_degree() if not deg]))
if len(entry_nodes) == 0:
raise KnownErrorVerdict("No entry node")

if len(entry_nodes) > 1:
raise KnownErrorVerdict("Multiple entry nodes")

node = entry_nodes[0]

Expand Down

0 comments on commit 027152a

Please sign in to comment.