* wrap/python/cgi/ltl2tgba.in (print_stats): New function. Call

it to display the size of the generalized and degeneralized
automata.
This commit is contained in:
Alexandre Duret-Lutz 2004-02-02 19:29:56 +00:00
parent 834ce05235
commit 26cf0145b7
2 changed files with 25 additions and 1 deletions

View file

@ -1,6 +1,6 @@
#!@PYTHON@
# -*- python -*-
# Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6),
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
#
@ -56,6 +56,21 @@ def escaped_print_set(dict, what):
del s
print '</pre>'; sys.stdout.flush()
def print_stats(automaton):
stats = spot.stats_reachable(automaton)
print "<p>", stats.states,
if stats.states == 1:
print " state,",
else:
print " states,",
print stats.transitions,
if stats.transitions == 1:
print " transition",
else:
print " transitions",
print "</p>"
sys.stdout.flush()
print "Content-Type: text/html"
print
@ -188,6 +203,8 @@ elif trans_fm:
print 'done.</p>'
sys.stdout.flush()
print_stats(automaton)
if show_automaton_dot:
print '<pre>'; sys.stdout.flush()
s = spot.ostringstream()
@ -210,6 +227,7 @@ if show_automaton_gif:
if show_degen_dot or show_degen_gif:
print '<H3>Degeneralized automaton</H3>'
degen = spot.tgba_tba_proxy(automaton)
print_stats(degen)
if show_degen_dot:
print '<pre>'; sys.stdout.flush()
s = spot.ostringstream()