hierarchy: expose mp_class to python
* bin/common_output.cc: Move some of the printing code... * spot/tl/hierarchy.cc, spot/tl/hierarchy.hh: ... here, as new variants of mp_class... * python/spot/impl.i: ... that we can now call from Python. * python/ajax/spotcgi.in: Use those to simplify and extend the code printing class membership.
This commit is contained in:
parent
a0891fde18
commit
ebdb198b64
5 changed files with 156 additions and 105 deletions
|
|
@ -505,24 +505,20 @@ if output_type == 'f':
|
|||
for p in spot.list_formula_props(f):
|
||||
unbufprint('<li>%s</li>\n' % p)
|
||||
|
||||
# Attempt to refine the hierarchy class using WDBA minimization
|
||||
if not f.is_syntactic_safety() or not f.is_syntactic_guarantee():
|
||||
dict = spot.bdd_dict()
|
||||
automaton = spot.ltl_to_tgba_fm(f, dict, False, True)
|
||||
minimized = spot.minimize_obligation(automaton, f)
|
||||
if minimized != automaton:
|
||||
g = spot.is_terminal_automaton(minimized, None, True)
|
||||
s = spot.is_safety_automaton(minimized)
|
||||
if s and not f.is_syntactic_safety():
|
||||
unbufprint('<li>pathologic safety</li>')
|
||||
if g and not f.is_syntactic_guarantee():
|
||||
unbufprint('<li>pathologic guarantee</li>')
|
||||
if not f.is_syntactic_obligation():
|
||||
unbufprint('<li>obligation (although not syntactically)</li>')
|
||||
else:
|
||||
unbufprint('<li>not an obligation</li>')
|
||||
minimized = 0
|
||||
automaton = 0
|
||||
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>')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
|
||||
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
||||
// Laboratoire de Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique
|
||||
// de Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
|
|
@ -103,6 +103,7 @@
|
|||
#include <spot/tl/randomltl.hh>
|
||||
#include <spot/tl/length.hh>
|
||||
#include <spot/tl/ltlf.hh>
|
||||
#include <spot/tl/hierarchy.hh>
|
||||
#include <spot/tl/remove_x.hh>
|
||||
#include <spot/tl/relabel.hh>
|
||||
|
||||
|
|
@ -448,6 +449,7 @@ namespace std {
|
|||
%include <spot/tl/randomltl.hh>
|
||||
%include <spot/tl/length.hh>
|
||||
%include <spot/tl/ltlf.hh>
|
||||
%include <spot/tl/hierarchy.hh>
|
||||
%include <spot/tl/remove_x.hh>
|
||||
%include <spot/tl/relabel.hh>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue