Add count_nondet_states(aut) and is_deterministic(aut).
* src/tgbaalgos/isdet.cc, src/tgbaalgos/isdet.hh: New files. * src/tgbaalgos/Makefile.am: Add them. * wrap/python/spot.i: Wrap them. * wrap/python/ajax/spot.in: Display count of nondeterministic states. * src/tgbatest/ltl2tgba.cc (-kt): Likewise. * NEWS: Upadte.
This commit is contained in:
parent
45e93ea16c
commit
04b5e37055
7 changed files with 183 additions and 6 deletions
|
|
@ -300,11 +300,17 @@ def render_formula(f):
|
|||
spot.dotty(dotsrc, f)
|
||||
render_dot_maybe(dotsrc.str(), False)
|
||||
|
||||
def print_stats(automaton):
|
||||
def print_stats(automaton, detinfo = False):
|
||||
stats = spot.stats_reachable(automaton)
|
||||
unbufprint("<p>%d state" % stats.states)
|
||||
if stats.states > 1:
|
||||
unbufprint("s")
|
||||
if detinfo:
|
||||
nondet = spot.count_nondet_states(automaton)
|
||||
if nondet == 0:
|
||||
unbufprint(" (deterministic)")
|
||||
else:
|
||||
unbufprint(" (%d nondeterministic)" % nondet)
|
||||
unbufprint(", %d transition" % stats.transitions)
|
||||
if stats.transitions > 1:
|
||||
unbufprint("s")
|
||||
|
|
@ -314,8 +320,8 @@ def print_stats(automaton):
|
|||
unbufprint(", %d acceptance condition" % count)
|
||||
if count > 1:
|
||||
unbufprint("s")
|
||||
acc = automaton.all_acceptance_conditions()
|
||||
unbufprint(": " + spot.bdd_format_accset(automaton.get_dict(), acc))
|
||||
acc = automaton.all_acceptance_conditions()
|
||||
unbufprint(": " + spot.bdd_format_accset(automaton.get_dict(), acc))
|
||||
else:
|
||||
unbufprint(", no acceptance condition (all cycles are accepting)")
|
||||
unbufprint("</p>\n")
|
||||
|
|
@ -674,7 +680,7 @@ if output_type == 'a':
|
|||
unbufprint('<div class="neverclaim">%s</div>' % cgi.escape(s.str()))
|
||||
del s
|
||||
else: # 't' or 's'
|
||||
dont_run_dot = print_stats(degen)
|
||||
dont_run_dot = print_stats(degen, True)
|
||||
render_automaton(degen, dont_run_dot, issba)
|
||||
degen = 0
|
||||
automaton = 0
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ namespace std {
|
|||
#include "tgbaalgos/safety.hh"
|
||||
#include "tgbaalgos/sccfilter.hh"
|
||||
#include "tgbaalgos/stats.hh"
|
||||
#include "tgbaalgos/isdet.hh"
|
||||
#include "tgbaalgos/simulation.hh"
|
||||
|
||||
#include "tgbaparse/public.hh"
|
||||
|
|
@ -272,6 +273,7 @@ using namespace spot;
|
|||
%include "tgbaalgos/safety.hh"
|
||||
%include "tgbaalgos/sccfilter.hh"
|
||||
%include "tgbaalgos/stats.hh"
|
||||
%include "tgbaalgos/isdet.hh"
|
||||
%include "tgbaalgos/simulation.hh"
|
||||
|
||||
%include "tgbaparse/public.hh"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue