From 153962aa9d148e294efd1952087690b89163b050 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 20 Feb 2004 21:51:39 +0000 Subject: [PATCH] * wrap/python/cgi/ltl2tgba.in: Present the options in a table. --- ChangeLog | 2 + wrap/python/cgi/ltl2tgba.in | 101 +++++++++++++++++++++++------------- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7bf014a90..7da654ff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-02-20 Alexandre Duret-Lutz + * wrap/python/cgi/ltl2tgba.in: Present the options in a table. + * wrap/python/cgi/ltl2tgba.in: Remove the "print dot" options, add a "dot source" source behind each picture instead. Do not run `dot' on big automata. diff --git a/wrap/python/cgi/ltl2tgba.in b/wrap/python/cgi/ltl2tgba.in index 54881a73b..4d48e3d4a 100644 --- a/wrap/python/cgi/ltl2tgba.in +++ b/wrap/python/cgi/ltl2tgba.in @@ -167,25 +167,34 @@ LTL-to-Büchi translator""" formula = form.getfirst('formula', '') -options = [ - ('opt_exprop', 'optimize determinism (FM only)', 1), - ('opt_symb_merge', - 'merge states with same symbolic successor representation (FM only)', 1), - ('show_parse', 'show traces during parsing', 0), + + +options = [( + 'Common options', 0, [ ('show_formula_png', 'draw the formula', 0), ('show_automaton_png', 'draw Büchi automaton', 1), ('show_degen_png', 'draw degeneralized Büchi automaton', 0), - ('show_dictionnay', 'print BDD dictionary', 0), - ('show_relation_set', - 'print the transition relation as a BDD set (LaCIM only)', 0), - ('show_relation_png', - 'draw the transition relation (LaCIM only)', 0), - ('show_acceptance_set', - 'print the acceptance relation as a BDD set (LaCIM only)', 0), - ('show_acceptance_png', - 'draw the acceptance relation (LaCIM only)', 0), ('show_lbtt', 'convert automaton for LBTT', 0), - ] + ]), ( + 'Debugging options', 0, [ + ('show_parse', 'show traces during parsing', 0), + ('show_dictionnay', 'print BDD dictionary', 0), + ]), ( + 'Couvreur/FM options', 1, [ + ('opt_exprop', 'optimize determinism', 1), + ('opt_symb_merge', + 'merge states with same symbolic successor representation', 1), + ]), ( + 'Couvreur/Lacim options', 1, [ + ('show_relation_set', + 'print the transition relation as a BDD set', 0), + ('show_relation_png', + 'draw the transition relation', 0), + ('show_acceptance_set', + 'print the acceptance relation as a BDD set', 0), + ('show_acceptance_png', + 'draw the acceptance relation', 0), + ])] default_translator = 'trans_fm'; translators = [ @@ -193,10 +202,13 @@ translators = [ ('trans_lacim', 'Convreur/LaCIM'), ] -print """

+print ("""

Formula to translate: -
+
""" + % (myself, cgi.escape(formula, True))) +if not filled: + print """

Use alphanumeric identifiers or double-quoted strings for atomic propositions, and parentheses for grouping.
Identifiers cannot start with the letter of a prefix operator (F, @@ -258,10 +270,11 @@ an indentifier: aUb is an atomic proposition, unlike -

-Translator:
""" % (myself, cgi.escape(formula, True)) +

""" +column = [[], []] +column[0].append("Algorithm") trans = form.getfirst("trans", default_translator) for opt, desc, in translators: if trans == opt: @@ -269,27 +282,43 @@ for opt, desc, in translators: else: str = "" globals()[opt] = str - print '%s
' % (opt, str, - desc) + s = '%s' + column[0].append(s % (opt, str, desc)) -print """ -Options:
""" +print """
""" -for opt, desc, arg, in options: - if formula: - val = int(form.getfirst(opt, 0)) - else: - val = arg - if val: - str = "checked" - else: - str = "" - globals()[opt] = val - print '%s
' % (opt, str, - desc) -print '
' +for opt_group, opt_column, opt_list in options: + column[opt_column].append("" + opt_group + "") + for opt, desc, arg, in opt_list: + if formula: + val = int(form.getfirst(opt, 0)) + else: + val = arg + if val: + str = " checked" + else: + str = "" + globals()[opt] = val + s = '%s' + column[opt_column].append(s % (opt, str, desc)) + +print '' +width = range(len(column)) +depth = 0 +for i in width: + depth = max(len(column[i]), depth) +for d in range(depth): + print '' + for i in width: + if d < len(column[i]): + print column[i][d] + print '' +print '
' + +print '' if not filled: + print_footer() sys.exit(0) reset_alarm()