cgi: fix displaying of TA and GTA
* wrap/python/ajax/spot.in (print_stats): Do not call sub_stats_reachable on testing automata.
This commit is contained in:
parent
abb5170565
commit
0b21af5893
1 changed files with 17 additions and 8 deletions
|
|
@ -298,8 +298,12 @@ def render_formula(f):
|
||||||
spot.dotty(dotsrc, f)
|
spot.dotty(dotsrc, f)
|
||||||
render_dot_maybe(dotsrc.str(), False)
|
render_dot_maybe(dotsrc.str(), False)
|
||||||
|
|
||||||
def print_stats(automaton, detinfo = False):
|
def print_stats(automaton, detinfo = False, ta = False):
|
||||||
stats = spot.sub_stats_reachable(automaton)
|
if ta: # TA/GTA
|
||||||
|
stats = spot.stats_reachable(automaton)
|
||||||
|
detinfo = False
|
||||||
|
else:
|
||||||
|
stats = spot.sub_stats_reachable(automaton)
|
||||||
unbufprint("<p>%d state" % stats.states)
|
unbufprint("<p>%d state" % stats.states)
|
||||||
if stats.states > 1:
|
if stats.states > 1:
|
||||||
unbufprint("s")
|
unbufprint("s")
|
||||||
|
|
@ -309,11 +313,16 @@ def print_stats(automaton, detinfo = False):
|
||||||
unbufprint(" (deterministic)")
|
unbufprint(" (deterministic)")
|
||||||
else:
|
else:
|
||||||
unbufprint(" (%d nondeterministic)" % nondet)
|
unbufprint(" (%d nondeterministic)" % nondet)
|
||||||
unbufprint(", %d edge%s (%d transition%s)"
|
if not hasattr(stats, 'sub_transitions'):
|
||||||
% (stats.transitions,
|
unbufprint(", %d transition" % stats.transitions)
|
||||||
's' if stats.transitions > 1 else '',
|
if stats.transitions > 1:
|
||||||
stats.sub_transitions,
|
unbufprint("s")
|
||||||
's' if stats.sub_transitions > 1 else ''))
|
else:
|
||||||
|
unbufprint(", %d edge%s (%d transition%s)"
|
||||||
|
% (stats.transitions,
|
||||||
|
's' if stats.transitions > 1 else '',
|
||||||
|
stats.sub_transitions,
|
||||||
|
's' if stats.sub_transitions > 1 else ''))
|
||||||
if hasattr(automaton, 'number_of_acceptance_conditions'):
|
if hasattr(automaton, 'number_of_acceptance_conditions'):
|
||||||
count = automaton.number_of_acceptance_conditions()
|
count = automaton.number_of_acceptance_conditions()
|
||||||
if count > 0:
|
if count > 0:
|
||||||
|
|
@ -715,7 +724,7 @@ if output_type == 't':
|
||||||
issba, True, singlepass, livelock)
|
issba, True, singlepass, livelock)
|
||||||
if bisimulation:
|
if bisimulation:
|
||||||
tautomaton = spot.minimize_ta(tautomaton)
|
tautomaton = spot.minimize_ta(tautomaton)
|
||||||
dont_run_dot = print_stats(tautomaton)
|
dont_run_dot = print_stats(tautomaton, ta = True)
|
||||||
render_automaton(tautomaton, dont_run_dot, issba)
|
render_automaton(tautomaton, dont_run_dot, issba)
|
||||||
tautomaton = 0
|
tautomaton = 0
|
||||||
degen = 0
|
degen = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue