ltlparse: rename the main functions
parse -> parse_infix_psl parse_lbt -> parse_prefix_ltl parse_sere -> parse_infix_sere parse_boolean -> parse_infix_boolean Fixes #87. * src/ltlparse/ltlparse.yy, src/ltlparse/public.hh: Do the above changes. * doc/mainpage.dox, doc/org/tut01.org, iface/ltsmin/modelcheck.cc, src/bin/common_finput.cc, src/hoaparse/hoaparse.yy, src/kripkeparse/kripkeparse.yy, src/tests/checkpsl.cc, src/tests/checkta.cc, src/tests/complementation.cc, src/tests/consterm.cc, src/tests/emptchk.cc, src/tests/equalsf.cc, src/tests/kind.cc, src/tests/length.cc, src/tests/ltl2tgba.cc, src/tests/ltlprod.cc, src/tests/ltlrel.cc, src/tests/randtgba.cc, src/tests/readltl.cc, src/tests/reduc.cc, src/tests/syntimpl.cc, src/tests/tostring.cc, wrap/python/ajax/spot.in, wrap/python/tests/alarm.py, wrap/python/tests/interdep.py, wrap/python/tests/ltl2tgba.py, wrap/python/tests/ltlparse.py: Adjust.
This commit is contained in:
parent
aedce8101c
commit
98790f5345
29 changed files with 118 additions and 113 deletions
|
|
@ -20,13 +20,13 @@
|
|||
/// \section pointers Handy starting points
|
||||
///
|
||||
/// \li spot::ltl::formula Base class for an LTL or PSL formula.
|
||||
/// \li spot::ltl::parse Parsing a text string into a
|
||||
/// \li spot::ltl::parse_infix_psl Parsing a text string into a
|
||||
/// spot::ltl::formula.
|
||||
/// \li spot::tgba Base class for Transition-based
|
||||
/// Generalized Büchi Automaton.
|
||||
/// \li spot::twa Base class for Transition-based
|
||||
/// ω-Automata.
|
||||
/// \li spot::translator Convert a spot::ltl::formula into a
|
||||
/// spot::tgba.
|
||||
/// \li spot::kripke Base class for Kripke structures.
|
||||
/// \li spot::tgba_product On-the-fly product of two spot::tgba.
|
||||
/// \li spot::twa_product On-the-fly product of two spot::twa.
|
||||
/// \li spot::emptiness_check Base class for all emptiness-check algorithms
|
||||
/// (see also module \ref emptiness_check)
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ parser. Additionally, this give you control over how to print errors.
|
|||
{
|
||||
std::string input = "[]<>p0 || <>[]p1";
|
||||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = spot::ltl::parse(input, pel);
|
||||
const spot::ltl::formula* f = spot::ltl::parse_infix_psl(input, pel);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, input, pel))
|
||||
{
|
||||
if (f)
|
||||
|
|
@ -119,10 +119,13 @@ parser. Additionally, this give you control over how to print errors.
|
|||
: | G F p0 F G p1
|
||||
: ([](<>(p0))) || (<>([](p1)))
|
||||
|
||||
So =parse()= process the =input=, and stores any diagnostic in =pel=,
|
||||
which is a list of pairs associating each error to a location. You could
|
||||
iterate over that list to print it by yourself as you wish, or you can
|
||||
call =format_parse_errors()= to do that for you.
|
||||
So =parse_infix_psl()= processes =input=, and stores any diagnostic in
|
||||
=pel=, which is a list of pairs associating each error to a location.
|
||||
You could iterate over that list to print it by yourself as you wish,
|
||||
or you can call =format_parse_errors()= to do that for you. Note that
|
||||
as its name implies, this parser can read more than LTL formulas (the
|
||||
fragment of PSL we support is basically LTL extended with regular
|
||||
expressions).
|
||||
|
||||
If =pel= is empty, =format_parse_errors()= will do nothing and return
|
||||
false.
|
||||
|
|
@ -147,7 +150,7 @@ with the "fixed" formula if you wish. Here is an example:
|
|||
{
|
||||
std::string input = "(a U b))";
|
||||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = spot::ltl::parse(input, pel);
|
||||
const spot::ltl::formula* f = spot::ltl::parse_infix_psl(input, pel);
|
||||
// Use std::cout instead of std::cerr because we can only
|
||||
// show the output of std::cout in this documentation.
|
||||
(void) spot::ltl::format_parse_errors(std::cout, input, pel);
|
||||
|
|
@ -186,8 +189,8 @@ currently this is done manually by calling =f->clone()= and
|
|||
|
||||
** Calling the prefix parser explicitly
|
||||
|
||||
The only difference here is the call to =parse_lbt()= instead of
|
||||
=parse()=.
|
||||
The only difference here is the call to =parse_prefix_ltl()= instead of
|
||||
=parse_infix_psl()=.
|
||||
|
||||
#+BEGIN_SRC C++ :results verbatim :exports both
|
||||
#include <string>
|
||||
|
|
@ -199,7 +202,7 @@ The only difference here is the call to =parse_lbt()= instead of
|
|||
{
|
||||
std::string input = "& & G p0 p1 p2";
|
||||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = spot::ltl::parse_lbt(input, pel);
|
||||
const spot::ltl::formula* f = spot::ltl::parse_prefix_ltl(input, pel);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, input, pel))
|
||||
{
|
||||
if (f)
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ checked_main(int argc, char **argv)
|
|||
tm.start("parsing formula");
|
||||
{
|
||||
spot::ltl::parse_error_list pel;
|
||||
f = spot::ltl::parse(argv[2], pel, env, false);
|
||||
f = spot::ltl::parse_infix_psl(argv[2], pel, env, false);
|
||||
exit_code = spot::ltl::format_parse_errors(std::cerr, argv[2], pel);
|
||||
}
|
||||
tm.stop("parsing formula");
|
||||
|
|
|
|||
|
|
@ -79,11 +79,10 @@ const spot::ltl::formula*
|
|||
parse_formula(const std::string& s, spot::ltl::parse_error_list& pel)
|
||||
{
|
||||
if (lbt_input)
|
||||
return spot::ltl::parse_lbt(s, pel);
|
||||
return spot::ltl::parse_prefix_ltl(s, pel);
|
||||
else
|
||||
return spot::ltl::parse(s, pel,
|
||||
spot::ltl::default_environment::instance(),
|
||||
false, lenient);
|
||||
return spot::ltl::parse_infix_psl
|
||||
(s, pel, spot::ltl::default_environment::instance(), false, lenient);
|
||||
}
|
||||
|
||||
job_processor::job_processor()
|
||||
|
|
|
|||
|
|
@ -1212,7 +1212,7 @@ nc-formula: nc-formula-or-ident
|
|||
if (i == res.fcache.end())
|
||||
{
|
||||
spot::ltl::parse_error_list pel;
|
||||
auto f = spot::ltl::parse_boolean(*$1, pel, *res.env,
|
||||
auto f = spot::ltl::parse_infix_boolean(*$1, pel, *res.env,
|
||||
debug_level(), true);
|
||||
for (auto& j: pel)
|
||||
{
|
||||
|
|
@ -1391,7 +1391,7 @@ lbtt-acc: { $$ = 0U; }
|
|||
lbtt-guard: STRING
|
||||
{
|
||||
spot::ltl::parse_error_list pel;
|
||||
auto* f = spot::ltl::parse_lbt(*$1, pel, *res.env);
|
||||
auto* f = spot::ltl::parse_prefix_ltl(*$1, pel, *res.env);
|
||||
if (!f || !pel.empty())
|
||||
{
|
||||
std::string s = "failed to parse guard: ";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2011, 2012, 2013, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE)
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -110,7 +110,8 @@ strident "," condition "," follow_list ";"
|
|||
if (i == fcache.end())
|
||||
{
|
||||
parse_error_list pel;
|
||||
const formula* f = spot::ltl::parse(*$3, pel, parse_environment);
|
||||
const formula* f = spot::ltl::parse_infix_boolean(*$3, pel,
|
||||
parse_environment);
|
||||
for (parse_error_list::iterator i = pel.begin();
|
||||
i != pel.end(); ++i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ using namespace spot::ltl;
|
|||
|
||||
enum parser_type { parser_ltl, parser_bool, parser_sere };
|
||||
|
||||
const formula*
|
||||
static const formula*
|
||||
try_recursive_parse(const std::string& str,
|
||||
const spot::location& location,
|
||||
spot::ltl::environment& env,
|
||||
|
|
@ -125,13 +125,13 @@ using namespace spot::ltl;
|
|||
switch (type)
|
||||
{
|
||||
case parser_sere:
|
||||
f = spot::ltl::parse_sere(str, suberror, env, debug, true);
|
||||
f = spot::ltl::parse_infix_sere(str, suberror, env, debug, true);
|
||||
break;
|
||||
case parser_bool:
|
||||
f = spot::ltl::parse_boolean(str, suberror, env, debug, true);
|
||||
f = spot::ltl::parse_infix_boolean(str, suberror, env, debug, true);
|
||||
break;
|
||||
case parser_ltl:
|
||||
f = spot::ltl::parse(str, suberror, env, debug, true);
|
||||
f = spot::ltl::parse_infix_psl(str, suberror, env, debug, true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -996,7 +996,7 @@ namespace spot
|
|||
namespace ltl
|
||||
{
|
||||
const formula*
|
||||
parse(const std::string& ltl_string,
|
||||
parse_infix_psl(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env,
|
||||
bool debug, bool lenient)
|
||||
|
|
@ -1013,7 +1013,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const formula*
|
||||
parse_boolean(const std::string& ltl_string,
|
||||
parse_infix_boolean(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env,
|
||||
bool debug, bool lenient)
|
||||
|
|
@ -1030,7 +1030,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const formula*
|
||||
parse_lbt(const std::string& ltl_string,
|
||||
parse_prefix_ltl(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env,
|
||||
bool debug)
|
||||
|
|
@ -1047,7 +1047,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const formula*
|
||||
parse_sere(const std::string& sere_string,
|
||||
parse_infix_sere(const std::string& sere_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env,
|
||||
bool debug,
|
||||
|
|
@ -1068,12 +1068,12 @@ namespace spot
|
|||
parse_formula(const std::string& ltl_string, environment& env)
|
||||
{
|
||||
parse_error_list pel;
|
||||
const formula* f = parse(ltl_string, pel, env);
|
||||
const formula* f = parse_infix_psl(ltl_string, pel, env);
|
||||
std::ostringstream s;
|
||||
if (format_parse_errors(s, ltl_string, pel))
|
||||
{
|
||||
parse_error_list pel2;
|
||||
const formula* g = parse_lbt(ltl_string, pel2, env);
|
||||
const formula* g = parse_prefix_ltl(ltl_string, pel2, env);
|
||||
if (pel2.empty())
|
||||
return g;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -66,9 +66,10 @@ namespace spot
|
|||
///
|
||||
/// \warning This function is not reentrant.
|
||||
SPOT_API
|
||||
const formula* parse(const std::string& ltl_string,
|
||||
const formula* parse_infix_psl(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env = default_environment::instance(),
|
||||
environment& env =
|
||||
default_environment::instance(),
|
||||
bool debug = false,
|
||||
bool lenient = false);
|
||||
|
||||
|
|
@ -91,7 +92,7 @@ namespace spot
|
|||
///
|
||||
/// \warning This function is not reentrant.
|
||||
SPOT_API
|
||||
const formula* parse_boolean(const std::string& ltl_string,
|
||||
const formula* parse_infix_boolean(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env =
|
||||
default_environment::instance(),
|
||||
|
|
@ -118,16 +119,18 @@ namespace spot
|
|||
///
|
||||
/// \warning This function is not reentrant.
|
||||
SPOT_API
|
||||
const formula* parse_lbt(const std::string& ltl_string,
|
||||
const formula* parse_prefix_ltl(const std::string& ltl_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env = default_environment::instance(),
|
||||
environment& env =
|
||||
default_environment::instance(),
|
||||
bool debug = false);
|
||||
|
||||
/// \brief A simple wrapper to parse() and parse_lbt().
|
||||
/// \brief A simple wrapper to parse_infix_psl() and parse_prefix_ltl().
|
||||
///
|
||||
/// This is mostly meant for interactive use. It first tries parse(); if
|
||||
/// this fails it tries parse_lbt(); and if both fails it returns the errors
|
||||
/// of the first call to parse() as a parse_error exception.
|
||||
/// This is mostly meant for interactive use. It first tries
|
||||
/// parse_infix_psl(); if this fails it tries parse_prefix_ltl();
|
||||
/// and if both fails it returns the errors of the first call to
|
||||
/// parse_infix_psl() as a parse_error exception.
|
||||
SPOT_API const formula*
|
||||
parse_formula(const std::string& ltl_string,
|
||||
environment& env = default_environment::instance());
|
||||
|
|
@ -151,7 +154,7 @@ namespace spot
|
|||
///
|
||||
/// \warning This function is not reentrant.
|
||||
SPOT_API
|
||||
const formula* parse_sere(const std::string& sere_string,
|
||||
const formula* parse_infix_sere(const std::string& sere_string,
|
||||
parse_error_list& error_list,
|
||||
environment& env =
|
||||
default_environment::instance(),
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ main(int argc, char** argv)
|
|||
continue;
|
||||
|
||||
spot::ltl::parse_error_list pe;
|
||||
auto fpos = spot::ltl::parse(s, pe);
|
||||
auto fpos = spot::ltl::parse_infix_psl(s, pe);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, s, pe))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2014 Laboratoire de Recherche et Développement de
|
||||
// l'Epita (LRDE).
|
||||
// Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -85,7 +85,7 @@ main(int argc, char** argv)
|
|||
continue;
|
||||
|
||||
spot::ltl::parse_error_list pe;
|
||||
auto f = spot::ltl::parse(s, pe);
|
||||
auto f = spot::ltl::parse_infix_psl(s, pe);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, s, pe))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ int main(int argc, char* argv[])
|
|||
else if (print_formula)
|
||||
{
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(file, p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(file, p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, file, p1))
|
||||
return 2;
|
||||
|
|
@ -169,7 +169,7 @@ int main(int argc, char* argv[])
|
|||
if (formula)
|
||||
{
|
||||
spot::ltl::parse_error_list p1;
|
||||
f1 = spot::ltl::parse(file, p1);
|
||||
f1 = spot::ltl::parse_infix_psl(file, p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, file, p1))
|
||||
return 2;
|
||||
|
|
@ -227,7 +227,7 @@ int main(int argc, char* argv[])
|
|||
else
|
||||
{
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(file, p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(file, p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, file, p1))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ main(int argc, char **argv)
|
|||
ss >> expected;
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse_sere(form, p1);
|
||||
auto* f1 = spot::ltl::parse_infix_sere(form, p1);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, form, p1))
|
||||
return 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ main(int argc, char** argv)
|
|||
int runs = atoi(tokens[0].c_str());
|
||||
|
||||
spot::ltl::parse_error_list pe;
|
||||
auto f = spot::ltl::parse(tokens[1], pe);
|
||||
auto f = spot::ltl::parse_infix_psl(tokens[1], pe);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, tokens[1], pe))
|
||||
return 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Laboratoire de
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
|
||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
|
|
@ -100,7 +100,7 @@ main(int argc, char** argv)
|
|||
}
|
||||
|
||||
spot::ltl::parse_error_list p2;
|
||||
const spot::ltl::formula* f2 = spot::ltl::parse(formulas[size - 1], p2);
|
||||
auto* f2 = spot::ltl::parse_infix_psl(formulas[size - 1], p2);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, formulas[size - 1], p2))
|
||||
return 2;
|
||||
|
|
@ -109,7 +109,7 @@ main(int argc, char** argv)
|
|||
{
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(formulas[n], p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(formulas[n], p1);
|
||||
|
||||
if (check_first &&
|
||||
spot::ltl::format_parse_errors(std::cerr, formulas[n], p1))
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ main(int argc, char **argv)
|
|||
std::getline(ss, expected);
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(form, p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(form, p1);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, form, p1))
|
||||
return 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012 Laboratoire de Recherche et Developement de
|
||||
// Copyright (C) 2012, 2015 Laboratoire de Recherche et Developement de
|
||||
// l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -46,7 +46,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(argv[1], p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(argv[1], p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -958,7 +958,7 @@ checked_main(int argc, char** argv)
|
|||
{
|
||||
spot::ltl::parse_error_list pel;
|
||||
tm.start("parsing formula");
|
||||
f = spot::ltl::parse(input, pel, env, debug_opt);
|
||||
f = spot::ltl::parse_infix_psl(input, pel, env, debug_opt);
|
||||
tm.stop("parsing formula");
|
||||
exit_code = spot::ltl::format_parse_errors(std::cerr, input, pel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ main(int argc, char** argv)
|
|||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
|
||||
spot::ltl::parse_error_list pel1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(argv[1], pel1, env);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(argv[1], pel1, env);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], pel1))
|
||||
return 2;
|
||||
|
||||
spot::ltl::parse_error_list pel2;
|
||||
const spot::ltl::formula* f2 = spot::ltl::parse(argv[2], pel2, env);
|
||||
auto* f2 = spot::ltl::parse_infix_psl(argv[2], pel2, env);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[2], pel2))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Developement
|
||||
// Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et Developement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -39,7 +39,7 @@ main(int argc, char **argv)
|
|||
syntax(argv[0]);
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(argv[1], p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(argv[1], p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -872,7 +872,7 @@ main(int argc, char** argv)
|
|||
else if (input == "")
|
||||
break;
|
||||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = spot::ltl::parse(input, pel, env);
|
||||
auto* f = spot::ltl::parse_infix_psl(input, pel, env);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, input, pel))
|
||||
{
|
||||
exit_code = 1;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2012 Laboratoire de Recherche et
|
||||
// Copyright (C) 2008, 2009, 2012, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6
|
||||
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
||||
|
|
@ -75,8 +75,7 @@ main(int argc, char** argv)
|
|||
|
||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = spot::ltl::parse(argv[formula_index],
|
||||
pel, env, debug);
|
||||
auto* f = spot::ltl::parse_infix_psl(argv[formula_index], pel, env, debug);
|
||||
|
||||
exit_code =
|
||||
spot::ltl::format_parse_errors(std::cerr, argv[formula_index], pel);
|
||||
|
|
|
|||
|
|
@ -180,14 +180,14 @@ main(int argc, char** argv)
|
|||
while (input == "");
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
f1 = spot::ltl::parse(input, p1);
|
||||
f1 = spot::ltl::parse_infix_psl(input, p1);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, input, p1))
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
spot::ltl::parse_error_list p1;
|
||||
f1 = spot::ltl::parse(argv[2], p1);
|
||||
f1 = spot::ltl::parse_infix_psl(argv[2], p1);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p1))
|
||||
return 2;
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ main(int argc, char** argv)
|
|||
}
|
||||
|
||||
spot::ltl::parse_error_list p2;
|
||||
f2 = spot::ltl::parse(argv[3], p2);
|
||||
f2 = spot::ltl::parse_infix_psl(argv[3], p2);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[3], p2))
|
||||
return 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Laboratoire de
|
||||
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6
|
||||
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
||||
|
|
@ -48,13 +48,13 @@ main(int argc, char** argv)
|
|||
int opt = atoi(argv[1]);
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* ftmp1 = spot::ltl::parse(argv[2], p1);
|
||||
auto* ftmp1 = spot::ltl::parse_infix_psl(argv[2], p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p1))
|
||||
return 2;
|
||||
|
||||
spot::ltl::parse_error_list p2;
|
||||
const spot::ltl::formula* ftmp2 = spot::ltl::parse(argv[3], p2);
|
||||
auto* ftmp2 = spot::ltl::parse_infix_psl(argv[3], p2);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[3], p2))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2009, 2012 Laboratoire de Recherche et
|
||||
// Copyright (C) 2008, 2009, 2012, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -41,7 +41,7 @@ main(int argc, char **argv)
|
|||
syntax(argv[0]);
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(argv[1], p1);
|
||||
auto* f1 = spot::ltl::parse_infix_psl(argv[1], p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
||||
return 2;
|
||||
|
|
@ -52,7 +52,7 @@ main(int argc, char **argv)
|
|||
std::string f1s = spot::ltl::to_string(f1);
|
||||
std::cout << f1s << std::endl;
|
||||
|
||||
const spot::ltl::formula* f2 = spot::ltl::parse(f1s, p1);
|
||||
auto* f2 = spot::ltl::parse_infix_psl(f1s, p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, f1s, p1))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -410,12 +410,12 @@ formula = form.getfirst('f', '')
|
|||
|
||||
env = spot.default_environment.instance()
|
||||
pel = spot.empty_parse_error_list()
|
||||
f = spot.parse(formula, pel, env)
|
||||
f = spot.parse_infix_psl(formula, pel, env)
|
||||
|
||||
if pel:
|
||||
# Try the LBT parser in case someone is throwing LBT formulas at us.
|
||||
pel2 = spot.empty_parse_error_list()
|
||||
g = spot.parse_lbt(formula, pel2, env)
|
||||
g = spot.parse_prefix_ltl(formula, pel2, env)
|
||||
if pel2:
|
||||
unbufprint('<div class="parse-error">')
|
||||
err = spot.format_parse_errors(spot.get_cout(), formula, pel)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2012, 2014 Laboratoire de Recherche et Développement
|
||||
# Copyright (C) 2012, 2014, 2015 Laboratoire de Recherche et Développement
|
||||
# de l'Epita
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -44,7 +44,7 @@ P_Rbt2.moins || P_Rbt2.stop))-> G((F "map[0]==1") && (F "map[1]==1")
|
|||
|
||||
e = spot.default_environment.instance()
|
||||
p = spot.empty_parse_error_list()
|
||||
f = spot.parse(f, p, e)
|
||||
f = spot.parse_infix_psl(f, p, e)
|
||||
d = spot.make_bdd_dict()
|
||||
|
||||
spot.unblock_signal(signal.SIGALRM)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2010, 2012, 2014 Laboratoire de Recherche et
|
||||
# Copyright (C) 2010, 2012, 2014, 2015 Laboratoire de Recherche et
|
||||
# Développement de l'EPITA.
|
||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
|
||||
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
||||
|
|
@ -30,10 +30,10 @@ simp = spot.ltl_simplifier()
|
|||
|
||||
e = spot.default_environment.instance()
|
||||
p = spot.empty_parse_error_list()
|
||||
f = spot.parse('GFa', p, e)
|
||||
f = spot.parse_infix_psl('GFa', p, e)
|
||||
d = simp.get_dict()
|
||||
a = spot.ltl_to_tgba_fm(f, d)
|
||||
g = spot.parse('b&c', p, e)
|
||||
g = spot.parse_infix_boolean('b&c', p, e)
|
||||
b = simp.as_bdd(g)
|
||||
buddy.bdd_printset(b); spot.nl_cout()
|
||||
del g
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2009, 2010, 2012, 2014 Laboratoire de Recherche et
|
||||
# Copyright (C) 2009, 2010, 2012, 2014, 2015 Laboratoire de Recherche et
|
||||
# Développement de l'Epita (LRDE).
|
||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -84,7 +84,7 @@ cerr = spot.get_cerr()
|
|||
e = spot.default_environment.instance()
|
||||
p = spot.empty_parse_error_list()
|
||||
|
||||
f = spot.parse(args[0], p, e, debug_opt)
|
||||
f = spot.parse_infix_psl(args[0], p, e, debug_opt)
|
||||
if spot.format_parse_errors(cerr, args[0], p):
|
||||
exit_code = 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2009, 2010, 2012, 2014 Laboratoire de Recherche et
|
||||
# Copyright (C) 2009, 2010, 2012, 2014, 2015 Laboratoire de Recherche et
|
||||
# Développement de l'Epita (LRDE).
|
||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -29,14 +29,14 @@ p = spot.empty_parse_error_list()
|
|||
l = ['GFa', 'a U (((b)) xor c)', '!(FFx <=> Fx)', 'a \/ a \/ b \/ a \/ a'];
|
||||
|
||||
for str1 in l:
|
||||
f = spot.parse(str1, p, e, False)
|
||||
f = spot.parse_infix_psl(str1, p, e, False)
|
||||
if spot.format_parse_errors(spot.get_cout(), str1, p):
|
||||
sys.exit(1)
|
||||
str2 = str(f)
|
||||
f.destroy()
|
||||
sys.stdout.write(str2 + "\n")
|
||||
# Try to reparse the stringified formula
|
||||
f = spot.parse(str2, p, e)
|
||||
f = spot.parse_infix_psl(str2, p, e)
|
||||
if spot.format_parse_errors(spot.get_cout(), str2, p):
|
||||
sys.exit(1)
|
||||
sys.stdout.write(str(f) + "\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue