Using double borders for acceptance states in SBAs.
* src/tgbaalgos/dotty.hh (dotty_reachable): Take a new assume_sba argument. * src/tgbaalgos/dotty.cc (dotty_bfs): Take a new mark_accepting_states arguments. (dotty_bfs::process_state): Check if a state is accepting using the state_is_accepting() method for tgba_sba_proxies, or by looking at the first outgoing transition of the state. Pass the result to the dectorator. (dotty_reachable): Adjust function. * src/tgbaalgos/dottydec.hh, src/tgbaalgos/dottydec.cc, src/tgbaalgos/rundotdec.hh, src/tgbaalgos/rundotdec.cc (state_decl): Add an "accepting" argument, and use it to decorate accepting states with a double border. * src/tgbatest/ltl2tgba.cc: Keep track of whether the output is an SBA or not, so that we can tell it to dotty(). * wrap/python/ajax/spot.in: Likewise. * wrap/python/cgi-bin/ltl2tgba.in: Likewise.
This commit is contained in:
parent
2c5bae3d37
commit
e1ef47d975
10 changed files with 151 additions and 47 deletions
|
|
@ -31,7 +31,7 @@ dot_bgcolor = '-Gbgcolor=#FFFFFF00'
|
|||
|
||||
svg_output = False # FIXME: SVG output seems to be working well with
|
||||
# Firefox only. We have to figure out how
|
||||
# to get the correct size and transparent
|
||||
# to get the correct size and transparent
|
||||
# background in Chrome.
|
||||
|
||||
from CGIHTTPServer import CGIHTTPRequestHandler
|
||||
|
|
@ -124,12 +124,12 @@ def render_dot(basename):
|
|||
print '</div>'
|
||||
sys.stdout.flush()
|
||||
|
||||
def render_automaton(basename, automata, dont_run_dot, deco = False):
|
||||
def render_automaton(basename, automata, dont_run_dot, issba, deco = False):
|
||||
outfile = spot.ofstream(basename + '.txt')
|
||||
if not deco:
|
||||
spot.dotty_reachable(outfile, automata)
|
||||
spot.dotty_reachable(outfile, automata, issba)
|
||||
else:
|
||||
spot.dotty_reachable(outfile, automata, deco)
|
||||
spot.dotty_reachable(outfile, automata, issba, deco)
|
||||
del outfile
|
||||
if dont_run_dot:
|
||||
print ('<p>' + dont_run_dot + ''' to be rendered on-line. However
|
||||
|
|
@ -182,7 +182,7 @@ imgprefix = imgdir + '/' + uid
|
|||
output_type = form.getfirst('o', 'v');
|
||||
|
||||
# Version requested.
|
||||
if output_type == 'v':
|
||||
if output_type == 'v':
|
||||
print 'Spot version ' + spot.version()
|
||||
exit(0)
|
||||
|
||||
|
|
@ -221,13 +221,13 @@ if opt != spot.Reduce_None:
|
|||
|
||||
# Formula manipulation only.
|
||||
if output_type == 'f':
|
||||
formula_format = form.getfirst('ff', 'o')
|
||||
formula_format = form.getfirst('ff', 'o')
|
||||
# o = Spot, i = Spin, g = GraphViz
|
||||
|
||||
|
||||
if formula_format == 'o':
|
||||
print '<div class="formula spot-format">%s</div>' % f
|
||||
elif formula_format == 'i':
|
||||
print ('<div class="formula spin-format">'
|
||||
print ('<div class="formula spin-format">'
|
||||
+ spot.to_spin_string(f) + '</div>')
|
||||
elif formula_format == 'g':
|
||||
outfile = spot.ofstream(imgprefix + '-f.txt')
|
||||
|
|
@ -256,7 +256,7 @@ if translator == 'fm':
|
|||
elif fm == 'fl':
|
||||
fair_loop_approx = True
|
||||
automaton = spot.ltl_to_tgba_fm(f, dict,
|
||||
exprop, symb_merge,
|
||||
exprop, symb_merge,
|
||||
branching_postponement, fair_loop_approx)
|
||||
elif translator == 'la':
|
||||
automaton = spot.ltl_to_tgba_lacim(f, dict)
|
||||
|
|
@ -268,6 +268,9 @@ elif translator == 'ta':
|
|||
refined_rules = True
|
||||
automaton = spot.ltl_to_taa(f, dict, refined_rules)
|
||||
|
||||
# Should it be displayed as a SBA?
|
||||
issba = False
|
||||
|
||||
# Monitor output
|
||||
if output_type == 'm':
|
||||
automaton = spot.scc_filter(automaton)
|
||||
|
|
@ -275,7 +278,7 @@ if output_type == 'm':
|
|||
print '<div class="automata-stats">'
|
||||
dont_run_dot = print_stats(automaton)
|
||||
print '</div>'
|
||||
render_automaton(imgprefix + '-a', automaton, dont_run_dot)
|
||||
render_automaton(imgprefix + '-a', automaton, dont_run_dot, issba)
|
||||
automaton = 0
|
||||
exit(0)
|
||||
|
||||
|
|
@ -317,9 +320,11 @@ if wdba_minimize:
|
|||
automaton = minimized
|
||||
minimized = 0
|
||||
degen = False # No need to degeneralize anymore
|
||||
issba = True
|
||||
|
||||
if degen or neverclaim:
|
||||
degen = spot.tgba_sba_proxy(automaton)
|
||||
issba = True
|
||||
else:
|
||||
degen = automaton
|
||||
|
||||
|
|
@ -332,7 +337,7 @@ if output_type == 'a':
|
|||
del s
|
||||
else: # 't' or 's'
|
||||
dont_run_dot = print_stats(degen)
|
||||
render_automaton(imgprefix + '-a', degen, dont_run_dot)
|
||||
render_automaton(imgprefix + '-a', degen, dont_run_dot, issba)
|
||||
degen = 0
|
||||
automaton = 0
|
||||
exit(0)
|
||||
|
|
@ -391,13 +396,14 @@ if output_type == 'r':
|
|||
if draw_acc_run:
|
||||
deco = spot.tgba_run_dotty_decorator(ec_run)
|
||||
dont_run_dot = print_stats(ec_a)
|
||||
render_automaton(imgprefix + '-e', ec_a, dont_run_dot, deco)
|
||||
render_automaton(imgprefix + '-e', ec_a, dont_run_dot,
|
||||
issba, deco)
|
||||
del deco
|
||||
del ec_run
|
||||
del ec_res
|
||||
print '</div>'
|
||||
del ec
|
||||
del ec_a
|
||||
del ec_a
|
||||
degen = 0
|
||||
automaton = 0
|
||||
exit(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue