From 5c17bafad22901b46a912301e275c48cec8effb1 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 6 Jun 2025 14:40:37 +0200 Subject: SDKBehaviourModel: get_trace: deal with q→q loops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/behaviour.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/behaviour.py') diff --git a/lib/behaviour.py b/lib/behaviour.py index d243b26..626d3c2 100644 --- a/lib/behaviour.py +++ b/lib/behaviour.py @@ -94,6 +94,7 @@ class SDKBehaviourModel: while current_state != "__end__": next_states = delta[current_state] + states_seen.add(current_state) next_states = list(filter(lambda q: q not in states_seen, next_states)) if len(next_states) == 0: @@ -101,7 +102,7 @@ class SDKBehaviourModel: f"get_trace({name}, {param_dict}): found infinite loop at {trace}" ) - if len(next_states) > 1 and current_state in self.transition_guard: + if len(next_states) > 1 and self.transition_guard[current_state]: matching_next_states = list() for candidate in next_states: for condition in self.transition_guard[current_state][candidate]: @@ -127,7 +128,6 @@ class SDKBehaviourModel: (next_state,) = next_states trace.append(next_state) - states_seen.add(current_state) current_state = next_state return trace -- cgit v1.2.3