* wrap/python/cgi/ltl2tgba.in: Present the options in a table.

This commit is contained in:
Alexandre Duret-Lutz 2004-02-20 21:51:39 +00:00
parent 0a1fc73eed
commit 153962aa9d
2 changed files with 67 additions and 36 deletions

View file

@ -1,5 +1,7 @@
2004-02-20 Alexandre Duret-Lutz <adl@src.lip6.fr> 2004-02-20 Alexandre Duret-Lutz <adl@src.lip6.fr>
* wrap/python/cgi/ltl2tgba.in: Present the options in a table.
* wrap/python/cgi/ltl2tgba.in: Remove the "print dot" options, * wrap/python/cgi/ltl2tgba.in: Remove the "print dot" options,
add a "dot source" source behind each picture instead. Do add a "dot source" source behind each picture instead. Do
not run `dot' on big automata. not run `dot' on big automata.

View file

@ -167,25 +167,34 @@ LTL-to-B&uuml;chi translator</H1>"""
formula = form.getfirst('formula', '') formula = form.getfirst('formula', '')
options = [
('opt_exprop', 'optimize determinism (FM only)', 1),
('opt_symb_merge', options = [(
'merge states with same symbolic successor representation (FM only)', 1), 'Common options', 0, [
('show_parse', 'show traces during parsing', 0),
('show_formula_png', 'draw the formula', 0), ('show_formula_png', 'draw the formula', 0),
('show_automaton_png', 'draw Büchi automaton', 1), ('show_automaton_png', 'draw Büchi automaton', 1),
('show_degen_png', 'draw degeneralized Büchi automaton', 0), ('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), ('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'; default_translator = 'trans_fm';
translators = [ translators = [
@ -193,10 +202,13 @@ translators = [
('trans_lacim', 'Convreur/LaCIM'), ('trans_lacim', 'Convreur/LaCIM'),
] ]
print """<FORM action="%s" method="post"><P> print ("""<FORM action="%s" method="post"><P>
Formula to translate: Formula to translate:
<INPUT size=50 type="text" name="formula" value="%s"><BR> <INPUT size=50 type="text" name="formula" value="%s"><BR>"""
% (myself, cgi.escape(formula, True)))
if not filled:
print """
<p>Use alphanumeric identifiers or double-quoted strings for atomic <p>Use alphanumeric identifiers or double-quoted strings for atomic
propositions, and parentheses for grouping.<BR>Identifiers cannot propositions, and parentheses for grouping.<BR>Identifiers cannot
start with the letter of a prefix operator (<code>F</code>, start with the letter of a prefix operator (<code>F</code>,
@ -258,10 +270,11 @@ an indentifier: <code>aUb</code> is an atomic proposition, unlike
</tr> </tr>
</tbody> </tbody>
</table></td></tr></table></p> </table></td></tr></table></p>"""
Translator:<TABLE><TR><TD>""" % (myself, cgi.escape(formula, True))
column = [[], []]
column[0].append("<TH>Algorithm</TH>")
trans = form.getfirst("trans", default_translator) trans = form.getfirst("trans", default_translator)
for opt, desc, in translators: for opt, desc, in translators:
if trans == opt: if trans == opt:
@ -269,27 +282,43 @@ for opt, desc, in translators:
else: else:
str = "" str = ""
globals()[opt] = str globals()[opt] = str
print '<INPUT type="radio" name="trans" value="%s" %s>%s<br>' % (opt, str, s = '<TD><INPUT type="radio" name="trans" value="%s" %s>%s</TD>'
desc) column[0].append(s % (opt, str, desc))
print """</TD></TR></TABLE> print """</TD></TR></TABLE><TABLE>"""
Options:<TABLE><TR><TD>"""
for opt, desc, arg, in options: for opt_group, opt_column, opt_list in options:
if formula: column[opt_column].append("<TH>" + opt_group + "</TH>")
val = int(form.getfirst(opt, 0)) for opt, desc, arg, in opt_list:
else: if formula:
val = arg val = int(form.getfirst(opt, 0))
if val: else:
str = "checked" val = arg
else: if val:
str = "" str = " checked"
globals()[opt] = val else:
print '<INPUT type="checkbox" name="%s" value="1" %s>%s<br>' % (opt, str, str = ""
desc) globals()[opt] = val
print '</TD></TR></TABLE><INPUT type="submit" value="Send"></FORM>' s = '<TD><INPUT type="checkbox" name="%s" value="1"%s>%s</TD>'
column[opt_column].append(s % (opt, str, desc))
print '<TABLE>'
width = range(len(column))
depth = 0
for i in width:
depth = max(len(column[i]), depth)
for d in range(depth):
print '<TR>'
for i in width:
if d < len(column[i]):
print column[i][d]
print '</TR>'
print '</TABLE>'
print '<INPUT type="submit" value="Send"></FORM>'
if not filled: if not filled:
print_footer()
sys.exit(0) sys.exit(0)
reset_alarm() reset_alarm()