ltl2tgba.html: Display properties of formulas.
* src/ltlast/formula.hh, src/ltlast/formula.cc (list_formula_props): New function. * wrap/python/spot.i: Adjust to wrap list_formula_props. * wrap/python/ajax/ltl2tgba.html: Add option to display properties. * wrap/python/ajax/spot.in: Handle ff=p and display properties. * wrap/python/ajax/protocol.txt: Adjust.
This commit is contained in:
parent
62bf41cdb4
commit
3d41bf9ff1
6 changed files with 84 additions and 26 deletions
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// -*- encoding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -62,6 +63,41 @@ namespace spot
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
#define printprops \
|
||||
proprint(is_boolean, "B", "Boolean formula"); \
|
||||
proprint(is_sugar_free_boolean, "&", "without Boolean sugar"); \
|
||||
proprint(is_in_nenoform, "!", "in negative normal form"); \
|
||||
proprint(is_X_free, "x", "without X operator"); \
|
||||
proprint(is_sugar_free_ltl, "f", "without LTL sugar"); \
|
||||
proprint(is_ltl_formula, "L", "LTL formula"); \
|
||||
proprint(is_eltl_formula, "E", "ELTL formula"); \
|
||||
proprint(is_psl_formula, "P", "PSL formula"); \
|
||||
proprint(is_sere_formula, "S", "SERE formula"); \
|
||||
proprint(is_finite, "F", "finite"); \
|
||||
proprint(is_eventual, "e", "pure eventuality"); \
|
||||
proprint(is_universal, "u", "purely universal"); \
|
||||
proprint(is_syntactic_safety, "s", "syntactic safety"); \
|
||||
proprint(is_syntactic_guarantee, "g", "syntactic guarantee"); \
|
||||
proprint(is_syntactic_obligation, "o", "syntactic obligation"); \
|
||||
proprint(is_syntactic_persistence, "p", "syntactic persistence"); \
|
||||
proprint(is_syntactic_recurrence, "r", "syntactic recurrence"); \
|
||||
proprint(is_marked, "+", "marked"); \
|
||||
proprint(accepts_eword, "0", "accepts the empty word");
|
||||
|
||||
|
||||
std::list<std::string>
|
||||
list_formula_props(const formula* f)
|
||||
{
|
||||
std::list<std::string> res;
|
||||
#define proprint(m, a, l) \
|
||||
if (f->m()) \
|
||||
res.push_back(std::string(l));
|
||||
printprops;
|
||||
#undef proprint
|
||||
return res;
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
print_formula_props(std::ostream& out, const formula* f, bool abbr)
|
||||
{
|
||||
|
|
@ -74,26 +110,9 @@ namespace spot
|
|||
out << sep; out << (abbr ? a : l); \
|
||||
sep = comma; \
|
||||
}
|
||||
printprops;
|
||||
#undef proprint
|
||||
|
||||
proprint(is_boolean, "B", "Boolean formula");
|
||||
proprint(is_sugar_free_boolean, "&", "without Boolean sugar");
|
||||
proprint(is_in_nenoform, "!", "in negative normal form");
|
||||
proprint(is_X_free, "x", "without X operator");
|
||||
proprint(is_sugar_free_ltl, "f", "without LTL sugar");
|
||||
proprint(is_ltl_formula, "L", "LTL formula");
|
||||
proprint(is_eltl_formula, "E", "ELTL formula");
|
||||
proprint(is_psl_formula, "P", "PSL formula");
|
||||
proprint(is_sere_formula, "S", "SERE formula");
|
||||
proprint(is_finite, "F", "finite");
|
||||
proprint(is_eventual, "e", "pure eventuality");
|
||||
proprint(is_universal, "u", "purely universal");
|
||||
proprint(is_syntactic_safety, "s", "syntactic safety");
|
||||
proprint(is_syntactic_guarantee, "g", "syntactic guarantee");
|
||||
proprint(is_syntactic_obligation, "o", "syntactic obligation");
|
||||
proprint(is_syntactic_persistence, "p", "syntactic persistence");
|
||||
proprint(is_syntactic_recurrence, "r", "syntactic recurrence");
|
||||
proprint(is_marked, "+", "marked");
|
||||
proprint(accepts_eword, "0", "accepts the empty word");
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright (C) 2008, 2009, 2010, 2011 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// -*- encoding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -27,6 +28,7 @@
|
|||
#include <string>
|
||||
#include <cassert>
|
||||
#include "predecl.hh"
|
||||
#include <list>
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
|
@ -418,6 +420,8 @@ namespace spot
|
|||
const formula* f,
|
||||
bool abbreviated = false);
|
||||
|
||||
/// List the properties of formula \a f.
|
||||
std::list<std::string> list_formula_props(const formula* f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue