python: render the M&P hierarchy in SVG

* python/spot/__init__.py (show_mp_hierarchy, mp_hierarchy_svg): New
functions.
* tests/python/formulas.ipynb: Illustrate show_mp_hierarchy.
* python/ajax/spotcgi.in: Use mp_hierarchy_svg.
* python/ajax/css/trans.css: Adjust for possible overflows.
* NEWS: Mention this new feature.
This commit is contained in:
Alexandre Duret-Lutz 2017-01-18 20:58:20 +01:00
parent 0e2ab5de53
commit ff4c4a7231
5 changed files with 156 additions and 18 deletions

View file

@ -42,7 +42,9 @@ div.ltl2tgba {
top:84px;
z-index:1;
}
#results-body {
overflow: auto;
}
.ltldoc {
text-align: right;
}

View file

@ -502,23 +502,11 @@ if output_type == 'f':
else:
s = str(f)
unbufprint('Properties for ' + format_formula(f, 'span') + '<ul>\n')
unbufprint('<div style="float:right">' +
spot.mp_hierarchy_svg(f) + '</div>')
for p in spot.list_formula_props(f):
unbufprint('<li>%s</li>\n' % p)
mpc = spot.mp_class(f, 'w')
if 'S' in mpc:
unbufprint('<li>safety</li>')
if 'G' in mpc:
unbufprint('<li>guarantee</li>')
if 'O' in mpc:
unbufprint('<li>obligation</li>')
if 'R' in mpc:
unbufprint('<li>recurrence</li>')
if 'P' in mpc:
unbufprint('<li>persistence</li>')
if 'T' == mpc:
unbufprint('<li>not a persistence nor a recurrence</li>')
if not f.is_syntactic_stutter_invariant():
if spot.is_stutter_invariant(f):
unbufprint('<li>stutter invariant</li>')