File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
LabsTranslate/templates/lnt Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,16 @@ function canProceed(a: Agent): Bool is
8282 end var
8383end function
8484
85+ function existsRunningAgent(sys: Sys): Bool is
86+ var check: Bool, n: Nat in
87+ check := false;
88+ for n := 0 while ((n < MAXCOMPONENTS) and (not(check))) by n := n + 1 loop
89+ check := check or not(sys.agents[n].pc[0] == 0)
90+ end loop;
91+ return check
92+ end var
93+ end function
94+
8595function existsEnabledAgent (sys: Sys): Bool is
8696 var check: Bool, n: Nat in
8797 check := false;
@@ -125,7 +135,7 @@ process MAIN [{%- if simulation -%}o:Any, {% endif %}monitor:any] is
125135 {%- if simulation -%}
126136 o(sys);
127137 {%- endif -%}
128- if not(existsEnabledAgent(sys)) and not(existsSystemTransition(sys)) then
138+ if existsRunningAgent(sys) and not(existsEnabledAgent(sys)) and not(existsSystemTransition(sys)) then
129139 monitor("deadlock"); --vacuous pass
130140 stop
131141 end if;
You can’t perform that action at this time.
0 commit comments