ltl2tgba.html: Add testing automata options.

* wrap/python/ajax/ltl2tgba.html, wrap/python/ajax/protocol.txt,
wrap/python/ajax/spot.in: Here.
This commit is contained in:
Alexandre Duret-Lutz 2012-06-26 19:37:07 +02:00
parent 27a2de331f
commit 852cd0d553
3 changed files with 72 additions and 11 deletions

View file

@ -70,23 +70,48 @@
$("#ltl3ba-U").attr('checked', true); $("#ltl3ba-U").attr('checked', true);
} }
}) })
$("#to-s").change(function() {
if ($(this).is(':checked')) {
$("#to-l").removeAttr('checked');
}
})
$("#to-l").change(function() {
if ($(this).is(':checked')) {
$("#to-s").removeAttr('checked');
}
})
$("#tf-t,#tf-g").change(function() {
if ($(this).is(':checked')) {
$("#to-l,#to-s").removeAttr('disabled');
}
})
$("#tf-a").change(function() {
if ($(this).is(':checked')) {
$("#to-l,#to-s").attr('disabled', true);
}
})
function hideOrShowPanels(output, duration) { function hideOrShowPanels(output, duration) {
switch (output) switch (output)
{ {
case 'f': case 'f':
$('#translator-tabs,#autsimp-tabs,#run-tabs').hide(duration); $('#translator-tabs,#autsimp-tabs,#run-tabs,#tester-tabs').hide(duration);
break; break;
case 'm': case 'm':
$('#autsimp-tabs,#run-tabs').hide(duration); $('#autsimp-tabs,#run-tabs').hide(duration);
$('#translator-tabs').show(duration); $('#translator-tabs,#tester-tabs').show(duration);
break; break;
case 'a': case 'a':
$('#translator-tabs,#autsimp-tabs').show(duration); $('#translator-tabs,#autsimp-tabs').show(duration);
$('#run-tabs,#tester-tabs').hide(duration);
break;
case 't':
$('#translator-tabs,#autsimp-tabs,#tester-tabs').show(duration);
$('#run-tabs').hide(duration); $('#run-tabs').hide(duration);
break; break;
case 'r': case 'r':
$('#translator-tabs,#autsimp-tabs,#run-tabs').show(duration); $('#translator-tabs,#autsimp-tabs,#run-tabs').show(duration);
$('#tester-tabs').hide(duration);
break; break;
} }
} }
@ -125,7 +150,7 @@
this.value=value.join(','); this.value=value.join(',');
} }
}); });
$("#brcheckbox").change(); $("#brcheckbox,#tf-a").change();
$.spotvars.autoupdate = true; $.spotvars.autoupdate = true;
$.spotvars.internalchange = false; $.spotvars.internalchange = false;
var o = $('input[name="o"]').val(); var o = $('input[name="o"]').val();
@ -506,17 +531,17 @@ an identifier: <span class="formula">aUb</span> is an atomic proposition, unlike
</label><br> </label><br>
</div> </div>
<div id="tabs-ot"> <div id="tabs-ot">
Translate the (simplified) formula as:<br> Translate the (simplified) formula into a Büchi automaton, and then convert it into:<br>
<label class="rtip" title="Instead of reading valuations of all atomic propositions testing automata only watch the changes to these valuation. A transitions labeled by <span class='formula'>a</span> may be crossed only if these atomic proposition change in the system. Additionally, testing automata have two acceptance conditions: states can be Büchi accepting or livelock accepting (or both, or none)."> <label class="rtip" title="Instead of reading valuations of all atomic propositions testing automata only watch the changes to these valuation. A transitions labeled by <span class='formula'>a</span> may be crossed only if these atomic proposition change in the system. Additionally, testing automata have two acceptance conditions: states can be Büchi accepting or livelock accepting (or both, or none).">
<INPUT type="radio" name="tf" value="t"> <INPUT id="tf-t" type="radio" name="tf" value="t">
a Testing Automaton (TA) a Testing Automaton (TA)
</label><br> </label><br>
<label class="rtip" title="GTA are testing automata extended with multiple Büchi acceptance conditions."> <label class="rtip" title="GTA are testing automata extended with multiple Büchi acceptance conditions.">
<INPUT type="radio" name="tf" value="g"> <INPUT id="tf-g" type="radio" name="tf" value="g">
a Generalized Testing Automaton (GTA) a Generalized Testing Automaton (GTA)
</label><br> </label><br>
<label class="rtip" title="TGTA are similar to TGBA except instead of reading valuations of all atomic propositions testing automata only watch the changes to these valuation. They have multiple Büchi acceptance conditions on transitions, but no livelock acceptance."> <label class="rtip" title="TGTA are similar to TGBA except instead of reading valuations of all atomic propositions testing automata only watch the changes to these valuation. They have multiple Büchi acceptance conditions on transitions, but no livelock acceptance.">
<INPUT type="radio" name="tf" value="a" checked> <INPUT id="tf-a" type="radio" name="tf" value="a" checked>
a Transition-based Generalized Testing Automaton (TGTA) a Transition-based Generalized Testing Automaton (TGTA)
</label><br> </label><br>
</div> </div>
@ -644,6 +669,23 @@ an identifier: <span class="formula">aUb</span> is an atomic proposition, unlike
<INPUT type="text" maxlength="40" name="eo" value=""> <INPUT type="text" maxlength="40" name="eo" value="">
</div> </div>
</div> </div>
<div id="tester-tabs" class="ui-widget ui-widget-content ui-corner-all collapsible shadow">
<h3 class="ui-widget-header ui-corner-all head">Testing Automaton Options<span class="ui-icon ui-icon-circle-arrow-n ftip">Fold</span></h3>
<div>
<label class="rtip" title="Divert all livelock accepting paths to a single livelock acceptance state.">
<INPUT id="to-l" type="checkbox" name="to" value="l">
use a catch-all livelock state
</label><br>
<label class="rtip" title="Ensure that all livelock accepting states are also Büchi-accepting, so that the testing automaton can be tested for emptiness in a single pass.">
<INPUT id="to-s" type="checkbox" name="to" value="s" checked>
produce a single-pass testing automaton
</label><br>
<label class="rtip" title="Merge bisimilar states in the final testing automaton.">
<INPUT type="checkbox" name="to" value="m" checked>
merge bisimilar states
</label><br>
</div>
</div>
</FORM> </FORM>
<div id="results" class="ui-widget ui-widget-content ui-corner-all collapsible shadow"> <div id="results" class="ui-widget ui-widget-content ui-corner-all collapsible shadow">
<h3 id="results-head" class="ui-widget-header ui-corner-all head">Results<span class="ui-icon ui-icon-circle-arrow-n restip">Fold</span></h3> <h3 id="results-head" class="ui-widget-header ui-corner-all head">Results<span class="ui-icon ui-icon-circle-arrow-n restip">Fold</span></h3>

View file

@ -100,6 +100,12 @@ Automaton simplifications (pick many)
as=wd WDBA minimiztion as=wd WDBA minimiztion
as=ds Direct Simulation reduction as=ds Direct Simulation reduction
Testing Automaton options (pick many)
to=l add a catch-all livelock state
to=s produce single-pass variant
to=m merge bisimilar states
Global options Global options
g=8 Enable UTF-8 output. g=8 Enable UTF-8 output.

View file

@ -655,16 +655,29 @@ if output_type == 'a':
# Testing automaton Output # Testing automaton Output
if output_type == 't': if output_type == 't':
livelock = False
singlepass = False
bisimulation = False
for to in form.getlist('to'):
if to == 'l':
livelock = True
elif to == 's':
singlepass = True
elif to == 'm':
bisimulation = True
propset = spot.atomic_prop_collect_as_bdd(f, automaton) propset = spot.atomic_prop_collect_as_bdd(f, automaton)
if ta_type == 'a': if ta_type == 'a':
tautomaton = spot.tgba_to_tgta(degen, propset) tautomaton = spot.tgba_to_tgta(degen, propset)
tautomaton = spot.minimize_tgta(tautomaton) if bisimulation:
tautomaton = spot.minimize_tgta(tautomaton)
issba = False
else: else:
tautomaton = spot.tgba_to_ta(degen, propset, tautomaton = spot.tgba_to_ta(degen, propset,
False, False, False, False) issba, True, singlepass, livelock)
tautomaton = spot.minimize_ta(tautomaton) if bisimulation:
tautomaton = spot.minimize_ta(tautomaton)
dont_run_dot = print_stats(tautomaton) dont_run_dot = print_stats(tautomaton)
render_automaton(tautomaton, dont_run_dot, False) render_automaton(tautomaton, dont_run_dot, issba)
tautomaton = 0 tautomaton = 0
degen = 0 degen = 0
automaton = 0 automaton = 0