* src/tgbaparse/public.hh (tgba_parse): Take two environments
instead of one : one for the atomic propositions, and one for the acceptance conditions. This way it's easy for the tools in iface/gspn/ to require some atomic proposition to be declared and allow any acceptance conditions (there is nothing to adjust in this files because of the default value of the argument). * src/tgbaparse/tgbaparse.yy: Adjust. * src/tgbatest/ltl2tgba.cc, src/tgbatest/readsave.cc, src/tgbatest/reductgba.cc, src/tgbatest/tgbaread.cc: Adjust calls.
This commit is contained in:
parent
e5481ee3ac
commit
5891679ce0
7 changed files with 42 additions and 25 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,5 +1,15 @@
|
||||||
2006-02-10 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
2006-02-10 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/tgbaparse/public.hh (tgba_parse): Take two environments
|
||||||
|
instead of one : one for the atomic propositions, and one
|
||||||
|
for the acceptance conditions. This way it's easy for
|
||||||
|
the tools in iface/gspn/ to require some atomic proposition
|
||||||
|
to be declared and allow any acceptance conditions (there is nothing
|
||||||
|
to adjust in this files because of the default value of the argument).
|
||||||
|
* src/tgbaparse/tgbaparse.yy: Adjust.
|
||||||
|
* src/tgbatest/ltl2tgba.cc, src/tgbatest/readsave.cc,
|
||||||
|
src/tgbatest/reductgba.cc, src/tgbatest/tgbaread.cc: Adjust calls.
|
||||||
|
|
||||||
* src/tgbaparse/tgbaparse.yy (acc_decl): Diagnose acceptance
|
* src/tgbaparse/tgbaparse.yy (acc_decl): Diagnose acceptance
|
||||||
conditions rejected by the environment.
|
conditions rejected by the environment.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -45,7 +45,10 @@ namespace spot
|
||||||
/// \param error_list A list that will be filled with
|
/// \param error_list A list that will be filled with
|
||||||
/// parse errors that occured during parsing.
|
/// parse errors that occured during parsing.
|
||||||
/// \param dict The BDD dictionary where to use.
|
/// \param dict The BDD dictionary where to use.
|
||||||
/// \param env The environment into which parsing should take place.
|
/// \param env The environment of atomic proposition into which parsing
|
||||||
|
/// should take place.
|
||||||
|
/// \param envacc The environment of acceptance conditions into which parsing
|
||||||
|
/// should take place.
|
||||||
/// \param debug When true, causes the parser to trace its execution.
|
/// \param debug When true, causes the parser to trace its execution.
|
||||||
/// \return A pointer to the tgba built from \a filename, or
|
/// \return A pointer to the tgba built from \a filename, or
|
||||||
/// 0 if the file could not be opened.
|
/// 0 if the file could not be opened.
|
||||||
|
|
@ -61,6 +64,8 @@ namespace spot
|
||||||
bdd_dict* dict,
|
bdd_dict* dict,
|
||||||
ltl::environment& env
|
ltl::environment& env
|
||||||
= ltl::default_environment::instance(),
|
= ltl::default_environment::instance(),
|
||||||
|
ltl::environment& envacc
|
||||||
|
= ltl::default_environment::instance(),
|
||||||
bool debug = false);
|
bool debug = false);
|
||||||
|
|
||||||
/// \brief Format diagnostics produced by spot::tgba_parse.
|
/// \brief Format diagnostics produced by spot::tgba_parse.
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
%parse-param {spot::tgba_parse_error_list& error_list}
|
%parse-param {spot::tgba_parse_error_list& error_list}
|
||||||
%parse-param {spot::ltl::environment& parse_environment}
|
%parse-param {spot::ltl::environment& parse_environment}
|
||||||
|
%parse-param {spot::ltl::environment& parse_envacc}
|
||||||
%parse-param {spot::tgba_explicit*& result}
|
%parse-param {spot::tgba_explicit*& result}
|
||||||
%parse-param {formula_cache& fcache}
|
%parse-param {formula_cache& fcache}
|
||||||
%debug
|
%debug
|
||||||
|
|
@ -175,7 +176,7 @@ acc_list:
|
||||||
}
|
}
|
||||||
else if (*$2 != "" && *$2 != "false")
|
else if (*$2 != "" && *$2 != "false")
|
||||||
{
|
{
|
||||||
formula* f = parse_environment.require(*$2);
|
formula* f = parse_envacc.require(*$2);
|
||||||
if (! result->has_acceptance_condition(f))
|
if (! result->has_acceptance_condition(f))
|
||||||
{
|
{
|
||||||
error_list.push_back(spot::tgba_parse_error(@2,
|
error_list.push_back(spot::tgba_parse_error(@2,
|
||||||
|
|
@ -195,13 +196,13 @@ acc_list:
|
||||||
acc_decl:
|
acc_decl:
|
||||||
| acc_decl strident
|
| acc_decl strident
|
||||||
{
|
{
|
||||||
formula* f = parse_environment.require(*$2);
|
formula* f = parse_envacc.require(*$2);
|
||||||
if (! f)
|
if (! f)
|
||||||
{
|
{
|
||||||
std::string s = "acceptance condition `";
|
std::string s = "acceptance condition `";
|
||||||
s += *$2;
|
s += *$2;
|
||||||
s += "' unknown in environment `";
|
s += "' unknown in environment `";
|
||||||
s += parse_environment.name();
|
s += parse_envacc.name();
|
||||||
s += "'";
|
s += "'";
|
||||||
error_list.push_back(spot::tgba_parse_error(@2, s));
|
error_list.push_back(spot::tgba_parse_error(@2, s));
|
||||||
YYERROR;
|
YYERROR;
|
||||||
|
|
@ -226,6 +227,7 @@ namespace spot
|
||||||
tgba_parse_error_list& error_list,
|
tgba_parse_error_list& error_list,
|
||||||
bdd_dict* dict,
|
bdd_dict* dict,
|
||||||
environment& env,
|
environment& env,
|
||||||
|
environment& envacc,
|
||||||
bool debug)
|
bool debug)
|
||||||
{
|
{
|
||||||
if (tgbayyopen(name))
|
if (tgbayyopen(name))
|
||||||
|
|
@ -237,7 +239,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
formula_cache fcache;
|
formula_cache fcache;
|
||||||
tgba_explicit* result = new tgba_explicit(dict);
|
tgba_explicit* result = new tgba_explicit(dict);
|
||||||
tgbayy::parser parser(error_list, env, result, fcache);
|
tgbayy::parser parser(error_list, env, envacc, result, fcache);
|
||||||
parser.set_debug_level(debug);
|
parser.set_debug_level(debug);
|
||||||
parser.parse();
|
parser.parse();
|
||||||
tgbayyclose();
|
tgbayyclose();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -306,7 +306,7 @@ main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
spot::tgba_parse_error_list pel;
|
spot::tgba_parse_error_list pel;
|
||||||
system = spot::tgba_parse(argv[formula_index] + 2,
|
system = spot::tgba_parse(argv[formula_index] + 2,
|
||||||
pel, dict, env, debug_opt);
|
pel, dict, env, env, debug_opt);
|
||||||
if (spot::format_tgba_parse_errors(std::cerr,
|
if (spot::format_tgba_parse_errors(std::cerr,
|
||||||
argv[formula_index] + 2, pel))
|
argv[formula_index] + 2, pel))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
@ -473,7 +473,7 @@ main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
spot::tgba_parse_error_list pel;
|
spot::tgba_parse_error_list pel;
|
||||||
spot::tgba_explicit* e;
|
spot::tgba_explicit* e;
|
||||||
to_free = a = e = spot::tgba_parse(input, pel, dict, env, debug_opt);
|
to_free = a = e = spot::tgba_parse(input, pel, dict, env, env, debug_opt);
|
||||||
if (spot::format_tgba_parse_errors(std::cerr, input, pel))
|
if (spot::format_tgba_parse_errors(std::cerr, input, pel))
|
||||||
{
|
{
|
||||||
delete to_free;
|
delete to_free;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -57,7 +57,7 @@ main(int argc, char** argv)
|
||||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||||
spot::tgba_parse_error_list pel;
|
spot::tgba_parse_error_list pel;
|
||||||
spot::tgba_explicit* a = spot::tgba_parse(argv[filename_index],
|
spot::tgba_explicit* a = spot::tgba_parse(argv[filename_index],
|
||||||
pel, dict, env, debug);
|
pel, dict, env, env, debug);
|
||||||
|
|
||||||
exit_code =
|
exit_code =
|
||||||
spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel);
|
spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||||
// et Marie Curie.
|
// Université Pierre et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -105,7 +105,7 @@ main(int argc, char** argv)
|
||||||
|
|
||||||
#ifdef REDUCCMP
|
#ifdef REDUCCMP
|
||||||
spot::tgba_parse_error_list pel;
|
spot::tgba_parse_error_list pel;
|
||||||
automata = spot::tgba_parse(argv[2], pel, dict, env, false);
|
automata = spot::tgba_parse(argv[2], pel, dict, env, env, false);
|
||||||
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel))
|
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel))
|
||||||
return 2;
|
return 2;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6
|
||||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
|
||||||
// et Marie Curie.
|
// Pierre et Marie Curie.
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
//
|
//
|
||||||
|
|
@ -55,7 +55,7 @@ main(int argc, char** argv)
|
||||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||||
spot::tgba_parse_error_list pel;
|
spot::tgba_parse_error_list pel;
|
||||||
spot::tgba_explicit* a = spot::tgba_parse(argv[filename_index],
|
spot::tgba_explicit* a = spot::tgba_parse(argv[filename_index],
|
||||||
pel, dict, env, debug);
|
pel, dict, env, env, debug);
|
||||||
|
|
||||||
if (spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel))
|
if (spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue