kill the ltl namespace

* NEWS: Mention it.
* bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc, doc/mainpage.dox,
doc/org/tut01.org, doc/org/tut02.org, doc/org/tut10.org, doc/tl/tl.tex,
iface/ltsmin/ltsmin.cc, iface/ltsmin/ltsmin.hh,
iface/ltsmin/modelcheck.cc, src/bin/autfilt.cc,
src/bin/common_aoutput.cc, src/bin/common_aoutput.hh,
src/bin/common_finput.cc, src/bin/common_finput.hh,
src/bin/common_output.cc, src/bin/common_output.hh, src/bin/common_r.hh,
src/bin/common_trans.cc, src/bin/common_trans.hh, src/bin/dstar2tgba.cc,
src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/ltlfilt.cc,
src/bin/ltlgrind.cc, src/bin/randaut.cc, src/bin/randltl.cc,
src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/kripkeparse/kripkeparse.yy, src/kripkeparse/public.hh,
src/ltlparse/fmterror.cc, src/ltlparse/ltlparse.yy,
src/ltlparse/ltlscan.ll, src/ltlparse/parsedecl.hh,
src/ltlparse/public.hh, src/parseaut/parseaut.yy,
src/parseaut/public.hh, 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/ikwiad.cc,
src/tests/kind.cc, src/tests/length.cc, src/tests/ltlprod.cc,
src/tests/ltlrel.cc, src/tests/parse.test,
src/tests/parse_print_test.cc, src/tests/randtgba.cc,
src/tests/readltl.cc, src/tests/reduc.cc, src/tests/syntimpl.cc,
src/tests/taatgba.cc, src/tests/tostring.cc, src/tests/tostring.test,
src/tl/apcollect.cc, src/tl/apcollect.hh, src/tl/contain.cc,
src/tl/contain.hh, src/tl/declenv.cc, src/tl/declenv.hh,
src/tl/defaultenv.cc, src/tl/defaultenv.hh, src/tl/dot.cc,
src/tl/dot.hh, src/tl/environment.hh, src/tl/exclusive.cc,
src/tl/exclusive.hh, src/tl/formula.cc, src/tl/formula.hh,
src/tl/length.cc, src/tl/length.hh, src/tl/mark.cc, src/tl/mark.hh,
src/tl/mutation.cc, src/tl/mutation.hh, src/tl/nenoform.cc,
src/tl/nenoform.hh, src/tl/print.cc, src/tl/print.hh,
src/tl/randomltl.cc, src/tl/randomltl.hh, src/tl/relabel.cc,
src/tl/relabel.hh, src/tl/remove_x.cc, src/tl/remove_x.hh,
src/tl/simpfg.cc, src/tl/simpfg.hh, src/tl/simplify.cc,
src/tl/simplify.hh, src/tl/snf.cc, src/tl/snf.hh, src/tl/unabbrev.cc,
src/tl/unabbrev.hh, src/twa/bdddict.cc, src/twa/bdddict.hh,
src/twa/bddprint.cc, src/twa/formula2bdd.cc, src/twa/formula2bdd.hh,
src/twa/taatgba.cc, src/twa/taatgba.hh, src/twa/twa.hh,
src/twa/twagraph.cc, src/twa/twagraph.hh, src/twaalgos/compsusp.cc,
src/twaalgos/compsusp.hh, src/twaalgos/ltl2taa.cc,
src/twaalgos/ltl2taa.hh, src/twaalgos/ltl2tgba_fm.cc,
src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/minimize.cc,
src/twaalgos/minimize.hh, src/twaalgos/neverclaim.cc,
src/twaalgos/postproc.cc, src/twaalgos/postproc.hh,
src/twaalgos/powerset.cc, src/twaalgos/powerset.hh,
src/twaalgos/randomgraph.cc, src/twaalgos/randomgraph.hh,
src/twaalgos/relabel.cc, src/twaalgos/relabel.hh,
src/twaalgos/remprop.cc, src/twaalgos/remprop.hh, src/twaalgos/stats.cc,
src/twaalgos/stats.hh, src/twaalgos/stutter.cc, src/twaalgos/stutter.hh,
src/twaalgos/translate.cc, src/twaalgos/translate.hh,
wrap/python/spot_impl.i: Remove the ltl namespace.
This commit is contained in:
Alexandre Duret-Lutz 2015-09-28 16:20:53 +02:00
parent 6ded5e75c4
commit cb39210166
137 changed files with 10771 additions and 10919 deletions

17
NEWS
View file

@ -28,9 +28,9 @@ New in spot 1.99.3a (not yet released)
* The class hierarchy for temporal formulas has been entirely * The class hierarchy for temporal formulas has been entirely
rewritten. This change is actually quite massive (~13200 lines rewritten. This change is actually quite massive (~13200 lines
removed, ~8200 lines added), and brings some nice benefits: removed, ~8200 lines added), and brings some nice benefits:
- LTL/PSL formulas are now represented by lightweight ltl::formula - LTL/PSL formulas are now represented by lightweight formula
objects (instead of ltl::formula* pointers) that perform objects (instead of pointers to children of an abstract formula
reference counting automatically. class) that perform reference counting automatically.
- There is no hierachy anymore: all operators are represented by a - There is no hierachy anymore: all operators are represented by a
single type of node in the syntax tree, and an enumerator is single type of node in the syntax tree, and an enumerator is
used to distinguish between operators. used to distinguish between operators.
@ -41,10 +41,13 @@ New in spot 1.99.3a (not yet released)
more friendly, and several algorithms that spanned a few pages more friendly, and several algorithms that spanned a few pages
have been reduced to a few lines. have been reduced to a few lines.
* The source directories ltlast/, ltlenv/, and ltlvisit/, have been * Directories ltlast/, ltlenv/, and ltlvisit/, have been merged into
merged into a single tl/ directory (for temporal logic). This is a single tl/ directory (for temporal logic). This is motivated by
motivated by the fact that these formulas are not restricted to the fact that these formulas are not restricted to LTL, and by the
LTL, and by the fact that we no longuer use the "visitor" pattern. fact that we no longuer use the "visitor" pattern.
* For similar reasons, the spot::ltl namespace has been merged
with the spot namespace.
New in spot 1.99.3 (2015-08-26) New in spot 1.99.3 (2015-08-26)

View file

@ -62,12 +62,12 @@ namespace
} }
int int
process_formula(spot::ltl::formula f, const char*, int) process_formula(spot::formula f, const char*, int)
{ {
spot::twa_graph_ptr a = trans.run(f); spot::twa_graph_ptr a = trans.run(f);
spot::twa_graph_ptr na = trans.run(spot::ltl::formula::Not(f)); spot::twa_graph_ptr na = trans.run(spot::formula::Not(f));
spot::ltl::atomic_prop_set* ap = spot::ltl::atomic_prop_collect(f); spot::atomic_prop_set* ap = spot::atomic_prop_collect(f);
bdd apdict = spot::ltl::atomic_prop_collect_as_bdd(f, a); bdd apdict = spot::atomic_prop_collect_as_bdd(f, a);
std::cout << formula << ',' << ap->size() << ','; std::cout << formula << ',' << ap->size() << ',';
stats.print(a); stats.print(a);

View file

@ -55,7 +55,7 @@ main(int argc, char** argv)
constexpr unsigned n = 10; constexpr unsigned n = 10;
// random ap set // random ap set
auto ap = spot::ltl::create_atomic_prop_set(props_n); auto ap = spot::create_atomic_prop_set(props_n);
// ap set as bdd // ap set as bdd
bdd apdict = bddtrue; bdd apdict = bddtrue;
for (auto& i: ap) for (auto& i: ap)

View file

@ -19,12 +19,12 @@
/// ///
/// \section pointers Handy starting points /// \section pointers Handy starting points
/// ///
/// \li spot::ltl::formula Base class for an LTL or PSL formula. /// \li spot::formula Base class for an LTL or PSL formula.
/// \li spot::ltl::parse_infix_psl Parsing a text string into a /// \li spot::parse_infix_psl Parsing a text string into a
/// spot::ltl::formula. /// spot::formula.
/// \li spot::twa Base class for Transition-based /// \li spot::twa Base class for Transition-based
/// ω-Automata. /// ω-Automata.
/// \li spot::translator Convert a spot::ltl::formula into a /// \li spot::translator Convert a spot::formula into a
/// spot::tgba. /// spot::tgba.
/// \li spot::kripke Base class for Kripke structures. /// \li spot::kripke Base class for Kripke structures.
/// \li spot::twa_product On-the-fly product of two spot::twa. /// \li spot::twa_product On-the-fly product of two spot::twa.

View file

@ -71,8 +71,8 @@ exceptions.
int main() int main()
{ {
print_latex_psl(std::cout, spot::ltl::parse_formula("[]<>p0 || <>[]p1")) << '\n'; print_latex_psl(std::cout, spot::parse_formula("[]<>p0 || <>[]p1")) << '\n';
spot::ltl::formula f = spot::ltl::parse_formula("& & G p0 p1 p2"); spot::formula f = spot::parse_formula("& & G p0 p1 p2");
print_lbt_ltl(std::cout, f) << '\n'; print_lbt_ltl(std::cout, f) << '\n';
print_spin_ltl(std::cout, f, true) << '\n'; print_spin_ltl(std::cout, f, true) << '\n';
return 0; return 0;
@ -110,9 +110,9 @@ Here is how to call the infix parser explicitly,:
int main() int main()
{ {
std::string input = "[]<>p0 || <>[]p1"; std::string input = "[]<>p0 || <>[]p1";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
print_latex_psl(std::cout, f) << '\n'; print_latex_psl(std::cout, f) << '\n';
return 0; return 0;
@ -152,11 +152,11 @@ with the "fixed" formula if you wish. Here is an example:
int main() int main()
{ {
std::string input = "(a U b))"; std::string input = "(a U b))";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
// Use std::cout instead of std::cerr because we can only // Use std::cout instead of std::cerr because we can only
// show the output of std::cout in this documentation. // show the output of std::cout in this documentation.
(void) spot::ltl::format_parse_errors(std::cout, input, pel); (void) spot::format_parse_errors(std::cout, input, pel);
if (f == nullptr) if (f == nullptr)
return 1; return 1;
std::cout << "Parsed formula: "; std::cout << "Parsed formula: ";
@ -194,9 +194,9 @@ of =parse_infix_psl()=.
int main() int main()
{ {
std::string input = "& & G p0 p1 p2"; std::string input = "& & G p0 p1 p2";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_prefix_ltl(input, pel); spot::formula f = spot::parse_prefix_ltl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
print_lbt_ltl(std::cout, f) << '\n'; print_lbt_ltl(std::cout, f) << '\n';
print_spin_ltl(std::cout, f, true) << '\n'; print_spin_ltl(std::cout, f, true) << '\n';
@ -236,9 +236,9 @@ For instance, let's see what happens if a PSL formulas is passed to
int main() int main()
{ {
std::string input = "{a*;b}<>->(a U (b & GF c))"; std::string input = "{a*;b}<>->(a U (b & GF c))";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
print_spin_ltl(std::cout, f) << '\n'; print_spin_ltl(std::cout, f) << '\n';
return 0; return 0;
@ -266,9 +266,9 @@ The first is to simply diagnose non-LTL formulas.
int main() int main()
{ {
std::string input = "{a*;b}<>->(a U (b & GF c))"; std::string input = "{a*;b}<>->(a U (b & GF c))";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
if (!f.is_ltl_formula()) if (!f.is_ltl_formula())
{ {
@ -296,13 +296,13 @@ prepared to reject the formula any way. In our example, we are lucky
int main() int main()
{ {
std::string input = "{a*;b}<>->(a U (b & GF c))"; std::string input = "{a*;b}<>->(a U (b & GF c))";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
if (!f.is_ltl_formula()) if (!f.is_ltl_formula())
{ {
spot::ltl::ltl_simplifier simp; spot::ltl_simplifier simp;
f = simp.simplify(f); f = simp.simplify(f);
} }
if (!f.is_ltl_formula()) if (!f.is_ltl_formula())

View file

@ -74,7 +74,7 @@ print(g.to_str('spin', True))
* C++ * C++
The =spot::ltl::relabeling_map= is just a =std::map= with a custom The =spot::relabeling_map= is just a =std::map= with a custom
destructor. destructor.
#+BEGIN_SRC C++ :results verbatim :exports both #+BEGIN_SRC C++ :results verbatim :exports both
@ -87,12 +87,12 @@ destructor.
int main() int main()
{ {
std::string input = "\"Proc@Here\" U (\"var > 10\" | \"var < 4\")"; std::string input = "\"Proc@Here\" U (\"var > 10\" | \"var < 4\")";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
spot::ltl::relabeling_map m; spot::relabeling_map m;
f = spot::ltl::relabel(f, spot::ltl::Pnn, &m); f = spot::relabel(f, spot::Pnn, &m);
for (auto& i: m) for (auto& i: m)
{ {
std::cout << "#define "; std::cout << "#define ";
@ -115,8 +115,8 @@ destructor.
** Two ways to name atomic propositions ** Two ways to name atomic propositions
Instead of =--relabel=pnn= (or =spot.Pnn=, or =spot::ltl::Pnn=), you can Instead of =--relabel=pnn= (or =spot.Pnn=, or =spot::Pnn=), you can
actually use =--relabel=abc= (or =spot.Abc=, or =spot::ltl::Abc=) to have actually use =--relabel=abc= (or =spot.Abc=, or =spot::Abc=) to have
the atomic propositions named =a=, =b=, =c=, etc. the atomic propositions named =a=, =b=, =c=, etc.
** Relabeling Boolean sub-expressions ** Relabeling Boolean sub-expressions

View file

@ -137,9 +137,9 @@ never claim is done via the =print_never_claim= function.
int main() int main()
{ {
std::string input = "[]<>p0 || <>[]p1"; std::string input = "[]<>p0 || <>[]p1";
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = spot::ltl::parse_infix_psl(input, pel); spot::formula f = spot::parse_infix_psl(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
return 1; return 1;
spot::translator trans; spot::translator trans;
trans.set_type(spot::postprocessor::BA); trans.set_type(spot::postprocessor::BA);

View file

@ -1001,7 +1001,7 @@ both right-associative, other have only $\IMPLIES$ as right-associative.
When Spot builds a formula (represented by an AST with shared When Spot builds a formula (represented by an AST with shared
subtrees) it computes a set of properties for each node. These subtrees) it computes a set of properties for each node. These
properties can be queried from any \texttt{spot::ltl::formula} properties can be queried from any \texttt{spot::formula}
instance using the following methods: instance using the following methods:
\noindent \noindent

View file

@ -323,10 +323,10 @@ namespace spot
int int
convert_aps(const ltl::atomic_prop_set* aps, convert_aps(const atomic_prop_set* aps,
const spins_interface* d, const spins_interface* d,
bdd_dict_ptr dict, bdd_dict_ptr dict,
ltl::formula dead, formula dead,
prop_set& out) prop_set& out)
{ {
int errors = 0; int errors = 0;
@ -353,7 +353,7 @@ namespace spot
enum_map[i].emplace(d->get_type_value_name(i, j), j); enum_map[i].emplace(d->get_type_value_name(i, j), j);
} }
for (ltl::atomic_prop_set::const_iterator ap = aps->begin(); for (atomic_prop_set::const_iterator ap = aps->begin();
ap != aps->end(); ++ap) ap != aps->end(); ++ap)
{ {
if (*ap == dead) if (*ap == dead)
@ -602,7 +602,7 @@ namespace spot
public: public:
spins_kripke(const spins_interface* d, const bdd_dict_ptr& dict, spins_kripke(const spins_interface* d, const bdd_dict_ptr& dict,
const spot::prop_set* ps, ltl::formula dead, const spot::prop_set* ps, formula dead,
int compress) int compress)
: kripke(dict), : kripke(dict),
d_(d), d_(d),
@ -1016,8 +1016,8 @@ namespace spot
kripke_ptr kripke_ptr
load_ltsmin(const std::string& file_arg, const bdd_dict_ptr& dict, load_ltsmin(const std::string& file_arg, const bdd_dict_ptr& dict,
const ltl::atomic_prop_set* to_observe, const atomic_prop_set* to_observe,
const ltl::formula dead, int compress, bool verbose) const formula dead, int compress, bool verbose)
{ {
std::string file; std::string file;
if (file_arg.find_first_of("/\\") != std::string::npos) if (file_arg.find_first_of("/\\") != std::string::npos)

View file

@ -57,7 +57,7 @@ namespace spot
// \a verbose whether to output verbose messages // \a verbose whether to output verbose messages
SPOT_API kripke_ptr SPOT_API kripke_ptr
load_ltsmin(const std::string& file, const bdd_dict_ptr& dict, load_ltsmin(const std::string& file, const bdd_dict_ptr& dict,
const ltl::atomic_prop_set* to_observe, const atomic_prop_set* to_observe,
ltl::formula dead = ltl::formula::tt(), formula dead = formula::tt(),
int compress = 0, bool verbose = true); int compress = 0, bool verbose = true);
} }

View file

@ -150,11 +150,11 @@ checked_main(int argc, char **argv)
if (argc != 3) if (argc != 3)
syntax(argv[0]); syntax(argv[0]);
spot::ltl::default_environment& env = spot::default_environment& env =
spot::ltl::default_environment::instance(); spot::default_environment::instance();
spot::ltl::atomic_prop_set ap; spot::atomic_prop_set ap;
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
spot::const_kripke_ptr model = nullptr; spot::const_kripke_ptr model = nullptr;
spot::const_twa_ptr prop = nullptr; spot::const_twa_ptr prop = nullptr;
@ -162,16 +162,16 @@ checked_main(int argc, char **argv)
spot::emptiness_check_instantiator_ptr echeck_inst = nullptr; spot::emptiness_check_instantiator_ptr echeck_inst = nullptr;
int exit_code = 0; int exit_code = 0;
spot::postprocessor post; spot::postprocessor post;
spot::ltl::formula deadf = nullptr; spot::formula deadf = nullptr;
spot::ltl::formula f = nullptr; spot::formula f = nullptr;
if (!dead || !strcasecmp(dead, "true")) if (!dead || !strcasecmp(dead, "true"))
{ {
deadf = spot::ltl::formula::tt(); deadf = spot::formula::tt();
} }
else if (!strcasecmp(dead, "false")) else if (!strcasecmp(dead, "false"))
{ {
deadf = spot::ltl::formula::ff(); deadf = spot::formula::ff();
} }
else else
{ {
@ -193,9 +193,9 @@ checked_main(int argc, char **argv)
tm.start("parsing formula"); tm.start("parsing formula");
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
f = spot::ltl::parse_infix_psl(argv[2], pel, env, false); f = spot::parse_infix_psl(argv[2], pel, env, false);
exit_code = spot::ltl::format_parse_errors(std::cerr, argv[2], pel); exit_code = spot::format_parse_errors(std::cerr, argv[2], pel);
} }
tm.stop("parsing formula"); tm.stop("parsing formula");
@ -366,6 +366,6 @@ main(int argc, char **argv)
auto exit_code = checked_main(argc, argv); auto exit_code = checked_main(argc, argv);
// Additional checks to debug reference counts in formulas. // Additional checks to debug reference counts in formulas.
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
exit(exit_code); exit(exit_code);
} }

View file

@ -505,7 +505,7 @@ namespace
} }
int int
process_formula(spot::ltl::formula, const char*, int) process_formula(spot::formula, const char*, int)
{ {
SPOT_UNREACHABLE(); SPOT_UNREACHABLE();
} }

View file

@ -287,7 +287,7 @@ automaton_printer::automaton_printer(stat_style input)
void void
automaton_printer::print(const spot::twa_graph_ptr& aut, automaton_printer::print(const spot::twa_graph_ptr& aut,
spot::ltl::formula f, spot::formula f,
// Input location for errors and statistics. // Input location for errors and statistics.
const char* filename, const char* filename,
int loc, int loc,

View file

@ -107,7 +107,7 @@ public:
std::ostream& std::ostream&
print(const spot::const_parsed_aut_ptr& haut, print(const spot::const_parsed_aut_ptr& haut,
const spot::const_twa_graph_ptr& aut, const spot::const_twa_graph_ptr& aut,
spot::ltl::formula f, spot::formula f,
const char* filename, int loc, double run_time) const char* filename, int loc, double run_time)
{ {
filename_ = filename ? filename : ""; filename_ = filename ? filename : "";
@ -225,7 +225,7 @@ public:
void void
print(const spot::twa_graph_ptr& aut, print(const spot::twa_graph_ptr& aut,
spot::ltl::formula f = nullptr, spot::formula f = nullptr,
// Input location for errors and statistics. // Input location for errors and statistics.
const char* filename = nullptr, const char* filename = nullptr,
int loc = -1, int loc = -1,

View file

@ -77,14 +77,14 @@ parse_opt_finput(int key, char* arg, struct argp_state*)
return 0; return 0;
} }
spot::ltl::formula spot::formula
parse_formula(const std::string& s, spot::ltl::parse_error_list& pel) parse_formula(const std::string& s, spot::parse_error_list& pel)
{ {
if (lbt_input) if (lbt_input)
return spot::ltl::parse_prefix_ltl(s, pel); return spot::parse_prefix_ltl(s, pel);
else else
return spot::ltl::parse_infix_psl return spot::parse_infix_psl
(s, pel, spot::ltl::default_environment::instance(), false, lenient); (s, pel, spot::default_environment::instance(), false, lenient);
} }
job_processor::job_processor() job_processor::job_processor()
@ -109,14 +109,14 @@ job_processor::process_string(const std::string& input,
const char* filename, const char* filename,
int linenum) int linenum)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
auto f = parse_formula(input, pel); auto f = parse_formula(input, pel);
if (!f || !pel.empty()) if (!f || !pel.empty())
{ {
if (filename) if (filename)
error_at_line(0, 0, filename, linenum, "parse error:"); error_at_line(0, 0, filename, linenum, "parse error:");
spot::ltl::format_parse_errors(std::cerr, input, pel); spot::format_parse_errors(std::cerr, input, pel);
return 1; return 1;
} }
return process_formula(f, filename, linenum); return process_formula(f, filename, linenum);

View file

@ -44,8 +44,8 @@ extern const struct argp finput_argp;
int parse_opt_finput(int key, char* arg, struct argp_state* state); int parse_opt_finput(int key, char* arg, struct argp_state* state);
spot::ltl::formula spot::formula
parse_formula(const std::string& s, spot::ltl::parse_error_list& error_list); parse_formula(const std::string& s, spot::parse_error_list& error_list);
class job_processor class job_processor
@ -58,7 +58,7 @@ public:
virtual ~job_processor(); virtual ~job_processor();
virtual int virtual int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) = 0; const char* filename = nullptr, int linenum = 0) = 0;
virtual int virtual int

View file

@ -70,10 +70,10 @@ const struct argp output_argp = { options, parse_opt_output,
static static
void void
report_not_ltl(spot::ltl::formula f, report_not_ltl(spot::formula f,
const char* filename, int linenum, const char* syn) const char* filename, int linenum, const char* syn)
{ {
std::string s = spot::ltl::str_psl(f); std::string s = spot::str_psl(f);
static const char msg[] = static const char msg[] =
"formula '%s' cannot be written %s's syntax because it is not LTL"; "formula '%s' cannot be written %s's syntax because it is not LTL";
if (filename) if (filename)
@ -84,36 +84,36 @@ report_not_ltl(spot::ltl::formula f,
std::ostream& std::ostream&
stream_formula(std::ostream& out, stream_formula(std::ostream& out,
spot::ltl::formula f, const char* filename, int linenum) spot::formula f, const char* filename, int linenum)
{ {
switch (output_format) switch (output_format)
{ {
case lbt_output: case lbt_output:
if (f.is_ltl_formula()) if (f.is_ltl_formula())
spot::ltl::print_lbt_ltl(out, f); spot::print_lbt_ltl(out, f);
else else
report_not_ltl(f, filename, linenum, "LBT"); report_not_ltl(f, filename, linenum, "LBT");
break; break;
case spot_output: case spot_output:
spot::ltl::print_psl(out, f, full_parenth); spot::print_psl(out, f, full_parenth);
break; break;
case spin_output: case spin_output:
if (f.is_ltl_formula()) if (f.is_ltl_formula())
spot::ltl::print_spin_ltl(out, f, full_parenth); spot::print_spin_ltl(out, f, full_parenth);
else else
report_not_ltl(f, filename, linenum, "Spin"); report_not_ltl(f, filename, linenum, "Spin");
break; break;
case wring_output: case wring_output:
if (f.is_ltl_formula()) if (f.is_ltl_formula())
spot::ltl::print_wring_ltl(out, f); spot::print_wring_ltl(out, f);
else else
report_not_ltl(f, filename, linenum, "Wring"); report_not_ltl(f, filename, linenum, "Wring");
break; break;
case utf8_output: case utf8_output:
spot::ltl::print_utf8_psl(out, f, full_parenth); spot::print_utf8_psl(out, f, full_parenth);
break; break;
case latex_output: case latex_output:
spot::ltl::print_latex_psl(out, f, full_parenth); spot::print_latex_psl(out, f, full_parenth);
break; break;
case count_output: case count_output:
case quiet_output: case quiet_output:
@ -124,7 +124,7 @@ stream_formula(std::ostream& out,
static void static void
stream_escapable_formula(std::ostream& os, stream_escapable_formula(std::ostream& os,
spot::ltl::formula f, spot::formula f,
const char* filename, int linenum) const char* filename, int linenum)
{ {
if (escape_csv) if (escape_csv)
@ -146,7 +146,7 @@ namespace
{ {
struct formula_with_location struct formula_with_location
{ {
spot::ltl::formula f; spot::formula f;
const char* filename; const char* filename;
int line; int line;
const char* prefix; const char* prefix;
@ -260,7 +260,7 @@ parse_opt_output(int key, char* arg, struct argp_state*)
static void static void
output_formula(std::ostream& out, output_formula(std::ostream& out,
spot::ltl::formula f, spot::formula f,
const char* filename = nullptr, int linenum = 0, const char* filename = nullptr, int linenum = 0,
const char* prefix = nullptr, const char* suffix = nullptr) const char* prefix = nullptr, const char* suffix = nullptr)
{ {
@ -286,7 +286,7 @@ void
} }
void void
output_formula_checked(spot::ltl::formula f, output_formula_checked(spot::formula f,
const char* filename, int linenum, const char* filename, int linenum,
const char* prefix, const char* suffix) const char* prefix, const char* suffix)
{ {

View file

@ -43,20 +43,20 @@ int parse_opt_output(int key, char* arg, struct argp_state* state);
// Low-level output // Low-level output
std::ostream& std::ostream&
stream_formula(std::ostream& out, stream_formula(std::ostream& out,
spot::ltl::formula f, const char* filename, int linenum); spot::formula f, const char* filename, int linenum);
void output_formula_checked(spot::ltl::formula f, void output_formula_checked(spot::formula f,
const char* filename = nullptr, int linenum = 0, const char* filename = nullptr, int linenum = 0,
const char* prefix = nullptr, const char* prefix = nullptr,
const char* suffix = nullptr); const char* suffix = nullptr);
class printable_formula: class printable_formula:
public spot::printable_value<spot::ltl::formula> public spot::printable_value<spot::formula>
{ {
public: public:
printable_formula& printable_formula&
operator=(spot::ltl::formula new_val) operator=(spot::formula new_val)
{ {
val_ = new_val; val_ = new_val;
return *this; return *this;
@ -79,7 +79,7 @@ public:
std::ostream& std::ostream&
print(const spot::const_twa_graph_ptr& aut, print(const spot::const_twa_graph_ptr& aut,
spot::ltl::formula f = nullptr, spot::formula f = nullptr,
double run_time = -1.) double run_time = -1.)
{ {
formula_ = f; formula_ = f;

View file

@ -44,4 +44,4 @@
extern int simplification_level; extern int simplification_level;
void parse_r(const char* arg); void parse_r(const char* arg);
spot::ltl::ltl_simplifier_options simplifier_options(); spot::ltl_simplifier_options simplifier_options();

View file

@ -290,16 +290,16 @@ translator_runner::formula() const
} }
void void
translator_runner::round_formula(spot::ltl::formula f, unsigned serial) translator_runner::round_formula(spot::formula f, unsigned serial)
{ {
if (has('f') || has('F')) if (has('f') || has('F'))
string_ltl_spot = spot::ltl::str_psl(f, true); string_ltl_spot = spot::str_psl(f, true);
if (has('s') || has('S')) if (has('s') || has('S'))
string_ltl_spin = spot::ltl::str_spin_ltl(f, true); string_ltl_spin = spot::str_spin_ltl(f, true);
if (has('l') || has('L')) if (has('l') || has('L'))
string_ltl_lbt = spot::ltl::str_lbt_ltl(f); string_ltl_lbt = spot::str_lbt_ltl(f);
if (has('w') || has('W')) if (has('w') || has('W'))
string_ltl_wring = spot::ltl::str_wring_ltl(f); string_ltl_wring = spot::str_wring_ltl(f);
if (has('F')) if (has('F'))
string_to_tmp(string_ltl_spot, serial, filename_ltl_spot); string_to_tmp(string_ltl_spot, serial, filename_ltl_spot);
if (has('S')) if (has('S'))

View file

@ -94,7 +94,7 @@ public:
bool no_output_allowed = false); bool no_output_allowed = false);
void string_to_tmp(std::string& str, unsigned n, std::string& tmpname); void string_to_tmp(std::string& str, unsigned n, std::string& tmpname);
const std::string& formula() const; const std::string& formula() const;
void round_formula(spot::ltl::formula f, unsigned serial); void round_formula(spot::formula f, unsigned serial);
}; };

View file

@ -139,7 +139,7 @@ namespace
} }
int int
process_formula(spot::ltl::formula, const char*, int) process_formula(spot::formula, const char*, int)
{ {
SPOT_UNREACHABLE(); SPOT_UNREACHABLE();
} }

View file

@ -90,7 +90,6 @@
#include "tl/relabel.hh" #include "tl/relabel.hh"
using namespace spot; using namespace spot;
using namespace spot::ltl;
const char argp_program_doc[] ="\ const char argp_program_doc[] ="\
Generate temporal logic formulas from predefined scalable patterns."; Generate temporal logic formulas from predefined scalable patterns.";

View file

@ -139,16 +139,16 @@ namespace
} }
int int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
// This should not happen, because the parser we use can only // This should not happen, because the parser we use can only
// read PSL/LTL formula, but since our ltl::formula type can // read PSL/LTL formula, but since our formula type can
// represent more than PSL formula, let's make this // represent more than PSL formula, let's make this
// future-proof. // future-proof.
if (!f.is_psl_formula()) if (!f.is_psl_formula())
{ {
std::string s = spot::ltl::str_psl(f); std::string s = spot::str_psl(f);
error_at_line(2, 0, filename, linenum, error_at_line(2, 0, filename, linenum,
"formula '%s' is not an LTL or PSL formula", "formula '%s' is not an LTL or PSL formula",
s.c_str()); s.c_str());

View file

@ -170,18 +170,18 @@ namespace
} }
int int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
auto aut = trans.run(&f); auto aut = trans.run(&f);
// This should not happen, because the parser we use can only // This should not happen, because the parser we use can only
// read PSL/LTL formula, but since our ltl::formula type can // read PSL/LTL formula, but since our formula type can
// represent more than PSL formula, let's make this // represent more than PSL formula, let's make this
// future-proof. // future-proof.
if (!f.is_psl_formula()) if (!f.is_psl_formula())
{ {
std::string s = spot::ltl::str_psl(f); std::string s = spot::str_psl(f);
error_at_line(2, 0, filename, linenum, error_at_line(2, 0, filename, linenum,
"formula '%s' is not an LTL or PSL formula", "formula '%s' is not an LTL or PSL formula",
s.c_str()); s.c_str());

View file

@ -819,7 +819,7 @@ namespace
} }
typedef typedef
std::unordered_set<spot::ltl::formula> fset_t; std::unordered_set<spot::formula> fset_t;
class processor: public job_processor class processor: public job_processor
@ -838,14 +838,14 @@ namespace
const char* filename, const char* filename,
int linenum) int linenum)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = parse_formula(input, pel); spot::formula f = parse_formula(input, pel);
if (!f || !pel.empty()) if (!f || !pel.empty())
{ {
if (filename) if (filename)
error_at_line(0, 0, filename, linenum, "parse error:"); error_at_line(0, 0, filename, linenum, "parse error:");
spot::ltl::format_parse_errors(std::cerr, input, pel); spot::format_parse_errors(std::cerr, input, pel);
return 1; return 1;
} }
@ -856,7 +856,7 @@ namespace
if (res && grind_output) if (res && grind_output)
{ {
std::string bogus = input; std::string bogus = input;
std::vector<spot::ltl::formula> mutations; std::vector<spot::formula> mutations;
unsigned mutation_count; unsigned mutation_count;
unsigned mutation_max; unsigned mutation_max;
while (res) while (res)
@ -886,9 +886,9 @@ namespace
if (res) if (res)
{ {
if (lbt_input) if (lbt_input)
bogus = spot::ltl::str_lbt_ltl(f); bogus = spot::str_lbt_ltl(f);
else else
bogus = spot::ltl::str_psl(f); bogus = spot::str_psl(f);
if (bogus_output) if (bogus_output)
bogus_output->ostream() << bogus << std::endl; bogus_output->ostream() << bogus << std::endl;
} }
@ -938,7 +938,7 @@ namespace
} }
int int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
static unsigned round = 0; static unsigned round = 0;
@ -947,7 +947,7 @@ namespace
// output, relabel the formula. // output, relabel the formula.
if (!f.has_lbt_atomic_props() && if (!f.has_lbt_atomic_props() &&
(runner.has('l') || runner.has('L') || runner.has('T'))) (runner.has('l') || runner.has('L') || runner.has('T')))
f = spot::ltl::relabel(f, spot::ltl::Pnn); f = spot::relabel(f, spot::Pnn);
// ---------- Positive Formula ---------- // ---------- Positive Formula ----------
@ -1028,7 +1028,7 @@ namespace
nstats = &vstats[n + 1]; nstats = &vstats[n + 1];
nstats->resize(m); nstats->resize(m);
spot::ltl::formula nf = spot::ltl::formula::Not(f); spot::formula nf = spot::formula::Not(f);
if (!allow_dups) if (!allow_dups)
{ {
@ -1143,7 +1143,7 @@ namespace
std::cerr << "Gathering statistics..." << std::endl; std::cerr << "Gathering statistics..." << std::endl;
} }
spot::ltl::atomic_prop_set* ap = spot::ltl::atomic_prop_collect(f); spot::atomic_prop_set* ap = spot::atomic_prop_collect(f);
if (want_stats) if (want_stats)
for (size_t i = 0; i < m; ++i) for (size_t i = 0; i < m; ++i)

View file

@ -237,14 +237,14 @@ namespace
const char* filename, const char* filename,
int linenum) int linenum)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = parse_formula(input, pel); spot::formula f = parse_formula(input, pel);
if (!f || !pel.empty()) if (!f || !pel.empty())
{ {
if (filename) if (filename)
error_at_line(0, 0, filename, linenum, "parse error:"); error_at_line(0, 0, filename, linenum, "parse error:");
spot::ltl::format_parse_errors(std::cerr, input, pel); spot::format_parse_errors(std::cerr, input, pel);
return 1; return 1;
} }
@ -255,10 +255,10 @@ namespace
int int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
std::unique_ptr<spot::ltl::relabeling_map> relmap; std::unique_ptr<spot::relabeling_map> relmap;
// If atomic propositions are incompatible with one of the // If atomic propositions are incompatible with one of the
// output, relabel the formula. // output, relabel the formula.
@ -267,8 +267,8 @@ namespace
|| (!f.has_spin_atomic_props() && || (!f.has_spin_atomic_props() &&
(runner.has('s') || runner.has('S')))) (runner.has('s') || runner.has('S'))))
{ {
relmap.reset(new spot::ltl::relabeling_map); relmap.reset(new spot::relabeling_map);
f = spot::ltl::relabel(f, spot::ltl::Pnn, relmap.get()); f = spot::relabel(f, spot::Pnn, relmap.get());
} }
static unsigned round = 1; static unsigned round = 1;

View file

@ -251,7 +251,7 @@ static int bsize_min = -1;
static int bsize_max = -1; static int bsize_max = -1;
enum relabeling_mode { NoRelabeling = 0, ApRelabeling, BseRelabeling }; enum relabeling_mode { NoRelabeling = 0, ApRelabeling, BseRelabeling };
static relabeling_mode relabeling = NoRelabeling; static relabeling_mode relabeling = NoRelabeling;
static spot::ltl::relabeling_style style = spot::ltl::Abc; static spot::relabeling_style style = spot::Abc;
static bool remove_x = false; static bool remove_x = false;
static bool stutter_insensitive = false; static bool stutter_insensitive = false;
static bool ap = false; static bool ap = false;
@ -262,16 +262,16 @@ static spot::exclusive_ap excl_ap;
static std::unique_ptr<output_file> output_define = nullptr; static std::unique_ptr<output_file> output_define = nullptr;
static std::string unabbreviate; static std::string unabbreviate;
static spot::ltl::formula implied_by = nullptr; static spot::formula implied_by = nullptr;
static spot::ltl::formula imply = nullptr; static spot::formula imply = nullptr;
static spot::ltl::formula equivalent_to = nullptr; static spot::formula equivalent_to = nullptr;
static spot::ltl::formula static spot::formula
parse_formula_arg(const std::string& input) parse_formula_arg(const std::string& input)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = parse_formula(input, pel); spot::formula f = parse_formula(input, pel);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
error(2, 0, "parse error when parsing an argument"); error(2, 0, "parse error when parsing an argument");
return f; return f;
} }
@ -343,16 +343,16 @@ parse_opt(int key, char* arg, struct argp_state*)
break; break;
case OPT_IMPLIED_BY: case OPT_IMPLIED_BY:
{ {
spot::ltl::formula i = parse_formula_arg(arg); spot::formula i = parse_formula_arg(arg);
// a→c∧b→c ≡ (ab)→c // a→c∧b→c ≡ (ab)→c
implied_by = spot::ltl::formula::Or({implied_by, i}); implied_by = spot::formula::Or({implied_by, i});
break; break;
} }
case OPT_IMPLY: case OPT_IMPLY:
{ {
// a→b∧a→c ≡ a→(b∧c) // a→b∧a→c ≡ a→(b∧c)
spot::ltl::formula i = parse_formula_arg(arg); spot::formula i = parse_formula_arg(arg);
imply = spot::ltl::formula::And({imply, i}); imply = spot::formula::And({imply, i});
break; break;
} }
case OPT_LTL: case OPT_LTL:
@ -371,9 +371,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_RELABEL_BOOL: case OPT_RELABEL_BOOL:
relabeling = (key == OPT_RELABEL_BOOL ? BseRelabeling : ApRelabeling); relabeling = (key == OPT_RELABEL_BOOL ? BseRelabeling : ApRelabeling);
if (!arg || !strncasecmp(arg, "abc", 6)) if (!arg || !strncasecmp(arg, "abc", 6))
style = spot::ltl::Abc; style = spot::Abc;
else if (!strncasecmp(arg, "pnn", 4)) else if (!strncasecmp(arg, "pnn", 4))
style = spot::ltl::Pnn; style = spot::Pnn;
else else
error(2, 0, "invalid argument for --relabel%s: '%s'", error(2, 0, "invalid argument for --relabel%s: '%s'",
(key == OPT_RELABEL_BOOL ? "-bool" : ""), (key == OPT_RELABEL_BOOL ? "-bool" : ""),
@ -404,7 +404,7 @@ parse_opt(int key, char* arg, struct argp_state*)
if (arg) if (arg)
unabbreviate += arg; unabbreviate += arg;
else else
unabbreviate += spot::ltl::default_unabbrev_string; unabbreviate += spot::default_unabbrev_string;
break; break;
case OPT_AP_N: case OPT_AP_N:
ap = true; ap = true;
@ -438,18 +438,18 @@ parse_opt(int key, char* arg, struct argp_state*)
} }
typedef typedef
std::unordered_set<spot::ltl::formula> fset_t; std::unordered_set<spot::formula> fset_t;
namespace namespace
{ {
class ltl_processor: public job_processor class ltl_processor: public job_processor
{ {
public: public:
spot::ltl::ltl_simplifier& simpl; spot::ltl_simplifier& simpl;
fset_t unique_set; fset_t unique_set;
spot::ltl::relabeling_map relmap; spot::relabeling_map relmap;
ltl_processor(spot::ltl::ltl_simplifier& simpl) ltl_processor(spot::ltl_simplifier& simpl)
: simpl(simpl) : simpl(simpl)
{ {
} }
@ -458,8 +458,8 @@ namespace
process_string(const std::string& input, process_string(const std::string& input,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
spot::ltl::formula f = parse_formula(input, pel); spot::formula f = parse_formula(input, pel);
if (!f || pel.size() > 0) if (!f || pel.size() > 0)
{ {
@ -467,7 +467,7 @@ namespace
{ {
if (filename) if (filename)
error_at_line(0, 0, filename, linenum, "parse error:"); error_at_line(0, 0, filename, linenum, "parse error:");
spot::ltl::format_parse_errors(std::cerr, input, pel); spot::format_parse_errors(std::cerr, input, pel);
} }
if (error_style == skip_errors) if (error_style == skip_errors)
@ -489,7 +489,7 @@ namespace
} }
int int
process_formula(spot::ltl::formula f, process_formula(spot::formula f,
const char* filename = nullptr, int linenum = 0) const char* filename = nullptr, int linenum = 0)
{ {
if (opt_max_count >= 0 && match_count >= opt_max_count) if (opt_max_count >= 0 && match_count >= opt_max_count)
@ -499,14 +499,14 @@ namespace
} }
if (negate) if (negate)
f = spot::ltl::formula::Not(f); f = spot::formula::Not(f);
if (remove_x) if (remove_x)
{ {
// If simplification are enabled, we do them before and after. // If simplification are enabled, we do them before and after.
if (simplification_level) if (simplification_level)
f = simpl.simplify(f); f = simpl.simplify(f);
f = spot::ltl::remove_x(f); f = spot::remove_x(f);
} }
if (simplification_level || boolean_to_isop) if (simplification_level || boolean_to_isop)
@ -520,13 +520,13 @@ namespace
case ApRelabeling: case ApRelabeling:
{ {
relmap.clear(); relmap.clear();
f = spot::ltl::relabel(f, style, &relmap); f = spot::relabel(f, style, &relmap);
break; break;
} }
case BseRelabeling: case BseRelabeling:
{ {
relmap.clear(); relmap.clear();
f = spot::ltl::relabel_bse(f, style, &relmap); f = spot::relabel_bse(f, style, &relmap);
break; break;
} }
case NoRelabeling: case NoRelabeling:
@ -534,7 +534,7 @@ namespace
} }
if (!unabbreviate.empty()) if (!unabbreviate.empty())
f = spot::ltl::unabbreviate(f, unabbreviate.c_str()); f = spot::unabbreviate(f, unabbreviate.c_str());
if (!excl_ap.empty()) if (!excl_ap.empty())
f = excl_ap.constrain(f); f = excl_ap.constrain(f);
@ -556,14 +556,14 @@ namespace
if (matched && (size_min > 0 || size_max >= 0)) if (matched && (size_min > 0 || size_max >= 0))
{ {
int l = spot::ltl::length(f); int l = spot::length(f);
matched &= (size_min <= 0) || (l >= size_min); matched &= (size_min <= 0) || (l >= size_min);
matched &= (size_max < 0) || (l <= size_max); matched &= (size_max < 0) || (l <= size_max);
} }
if (matched && (bsize_min > 0 || bsize_max >= 0)) if (matched && (bsize_min > 0 || bsize_max >= 0))
{ {
int l = spot::ltl::length_boolone(f); int l = spot::length_boolone(f);
matched &= (bsize_min <= 0) || (l >= bsize_min); matched &= (bsize_min <= 0) || (l >= bsize_min);
matched &= (bsize_max < 0) || (l <= bsize_max); matched &= (bsize_max < 0) || (l <= bsize_max);
} }
@ -606,7 +606,7 @@ namespace
&& output_format != quiet_output) && output_format != quiet_output)
{ {
// Sort the formulas alphabetically. // Sort the formulas alphabetically.
std::map<std::string, spot::ltl::formula> m; std::map<std::string, spot::formula> m;
for (auto& p: relmap) for (auto& p: relmap)
m.emplace(str_psl(p.first), p.second); m.emplace(str_psl(p.first), p.second);
for (auto& p: m) for (auto& p: m)
@ -641,9 +641,9 @@ main(int argc, char** argv)
if (boolean_to_isop && simplification_level == 0) if (boolean_to_isop && simplification_level == 0)
simplification_level = 1; simplification_level = 1;
spot::ltl::ltl_simplifier_options opt(simplification_level); spot::ltl_simplifier_options opt(simplification_level);
opt.boolean_to_isop = boolean_to_isop; opt.boolean_to_isop = boolean_to_isop;
spot::ltl::ltl_simplifier simpl(opt); spot::ltl_simplifier simpl(opt);
ltl_processor processor(simpl); ltl_processor processor(simpl);
if (processor.run()) if (processor.run())

View file

@ -43,7 +43,7 @@ enum {
static unsigned mutation_nb = 1; static unsigned mutation_nb = 1;
static unsigned max_output = -1U; static unsigned max_output = -1U;
static unsigned opt_all = spot::ltl::Mut_All; static unsigned opt_all = spot::Mut_All;
static unsigned mut_opts = 0; static unsigned mut_opts = 0;
static bool opt_sort = false; static bool opt_sort = false;
@ -96,11 +96,11 @@ namespace
{ {
public: public:
int int
process_formula(spot::ltl::formula f, const char* filename = nullptr, process_formula(spot::formula f, const char* filename = nullptr,
int linenum = 0) int linenum = 0)
{ {
auto mutations = auto mutations =
spot::ltl::mutate(f, mut_opts, max_output, mutation_nb, opt_sort); spot::mutate(f, mut_opts, max_output, mutation_nb, opt_sort);
for (auto g: mutations) for (auto g: mutations)
output_formula_checked(g, filename, linenum); output_formula_checked(g, filename, linenum);
return 0; return 0;
@ -121,31 +121,31 @@ parse_opt(int key, char* arg, struct argp_state*)
break; break;
case OPT_AP2CONST: case OPT_AP2CONST:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Ap2Const; mut_opts |= spot::Mut_Ap2Const;
break; break;
case OPT_REMOVE_ONE_AP: case OPT_REMOVE_ONE_AP:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Remove_One_Ap; mut_opts |= spot::Mut_Remove_One_Ap;
break; break;
case OPT_REMOVE_MULTOP_OPERANDS: case OPT_REMOVE_MULTOP_OPERANDS:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Remove_Multop_Operands; mut_opts |= spot::Mut_Remove_Multop_Operands;
break; break;
case OPT_REMOVE_OPS: case OPT_REMOVE_OPS:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Remove_Ops; mut_opts |= spot::Mut_Remove_Ops;
break; break;
case OPT_SPLIT_OPS: case OPT_SPLIT_OPS:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Split_Ops; mut_opts |= spot::Mut_Split_Ops;
break; break;
case OPT_REWRITE_OPS: case OPT_REWRITE_OPS:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Rewrite_Ops; mut_opts |= spot::Mut_Rewrite_Ops;
break; break;
case OPT_SIMPLIFY_BOUNDS: case OPT_SIMPLIFY_BOUNDS:
opt_all = 0; opt_all = 0;
mut_opts |= spot::ltl::Mut_Simplify_Bounds; mut_opts |= spot::Mut_Simplify_Bounds;
break; break;
case OPT_SORT: case OPT_SORT:
opt_sort = true; opt_sort = true;

View file

@ -135,7 +135,7 @@ static const struct argp_child children[] =
static const char* opt_acceptance = nullptr; static const char* opt_acceptance = nullptr;
typedef spot::twa_graph::graph_t::edge_storage_t tr_t; typedef spot::twa_graph::graph_t::edge_storage_t tr_t;
typedef std::set<std::vector<tr_t>> unique_aut_t; typedef std::set<std::vector<tr_t>> unique_aut_t;
static spot::ltl::atomic_prop_set aprops; static spot::atomic_prop_set aprops;
static range ap_count_given = {-1, -2}; // Must be two different negative val static range ap_count_given = {-1, -2}; // Must be two different negative val
static int opt_seed = 0; static int opt_seed = 0;
static const char* opt_seed_str = "0"; static const char* opt_seed_str = "0";
@ -249,10 +249,10 @@ parse_opt(int key, char* arg, struct argp_state* as)
ap_count_given = parse_range(arg); ap_count_given = parse_range(arg);
// Create the set once if the count is fixed. // Create the set once if the count is fixed.
if (ap_count_given.min == ap_count_given.max) if (ap_count_given.min == ap_count_given.max)
aprops = spot::ltl::create_atomic_prop_set(ap_count_given.min); aprops = spot::create_atomic_prop_set(ap_count_given.min);
break; break;
} }
aprops.insert(spot::ltl::formula::ap(arg)); aprops.insert(spot::formula::ap(arg));
break; break;
default: default:
@ -329,7 +329,7 @@ main(int argc, char** argv)
&& ap_count_given.min != ap_count_given.max) && ap_count_given.min != ap_count_given.max)
{ {
int c = spot::rrand(ap_count_given.min, ap_count_given.max); int c = spot::rrand(ap_count_given.min, ap_count_given.max);
aprops = spot::ltl::create_atomic_prop_set(c); aprops = spot::create_atomic_prop_set(c);
} }
int size = opt_states.min; int size = opt_states.min;

View file

@ -130,7 +130,7 @@ const struct argp_child children[] =
{ nullptr, 0, nullptr, 0 } { nullptr, 0, nullptr, 0 }
}; };
spot::ltl::atomic_prop_set aprops; spot::atomic_prop_set aprops;
static int output = OUTPUTLTL; static int output = OUTPUTLTL;
static char* opt_pL = nullptr; static char* opt_pL = nullptr;
static char* opt_pS = nullptr; static char* opt_pS = nullptr;
@ -209,11 +209,11 @@ parse_opt(int key, char* arg, struct argp_state* as)
if (!*endptr && res >= 0) // arg is a number if (!*endptr && res >= 0) // arg is a number
{ {
ap_count_given = true; ap_count_given = true;
aprops = spot::ltl::create_atomic_prop_set(res); aprops = spot::create_atomic_prop_set(res);
break; break;
} }
} }
aprops.insert(spot::ltl::default_environment::instance().require(arg)); aprops.insert(spot::default_environment::instance().require(arg));
break; break;
default: default:
return ARGP_ERR_UNKNOWN; return ARGP_ERR_UNKNOWN;
@ -241,7 +241,7 @@ main(int argc, char** argv)
spot::srand(opt_seed); spot::srand(opt_seed);
try try
{ {
spot::ltl::randltlgenerator rg spot::randltlgenerator rg
(aprops, (aprops,
[&] (){ [&] (){
spot::option_map opts; spot::option_map opts;
@ -292,7 +292,7 @@ main(int argc, char** argv)
while (opt_formulas < 0 || opt_formulas--) while (opt_formulas < 0 || opt_formulas--)
{ {
static int count = 0; static int count = 0;
spot::ltl::formula f = rg.next(); spot::formula f = rg.next();
if (!f) if (!f)
{ {
error(2, 0, "failed to generate a new unique formula after %d " \ error(2, 0, "failed to generate a new unique formula after %d " \

View file

@ -260,7 +260,7 @@ namespace spot
} }
void kripke_explicit::add_condition(ltl::formula f, std::string on_me) void kripke_explicit::add_condition(formula f, std::string on_me)
{ {
add_conditions(formula_to_bdd(f, get_dict(), this), on_me); add_conditions(formula_to_bdd(f, get_dict(), this), on_me);
} }

View file

@ -151,7 +151,7 @@ namespace spot
/// ///
/// \param f the formula to add. /// \param f the formula to add.
/// \param on_me the state where to add. /// \param on_me the state where to add.
void add_condition(ltl::formula f, std::string on_me); void add_condition(formula f, std::string on_me);
/// \brief Return map between states and their names. /// \brief Return map between states and their names.
const std::map<const state_kripke*, std::string>& const std::map<const state_kripke*, std::string>&

View file

@ -40,7 +40,7 @@ typedef std::map<std::string, bdd> formula_cache;
} }
%parse-param {spot::kripke_parse_error_list& error_list} %parse-param {spot::kripke_parse_error_list& error_list}
%parse-param {spot::ltl::environment& parse_environment} %parse-param {spot::environment& parse_environment}
%parse-param {spot::kripke_explicit_ptr& result} %parse-param {spot::kripke_explicit_ptr& result}
%parse-param {formula_cache& fcache} %parse-param {formula_cache& fcache}
@ -62,9 +62,9 @@ typedef std::map<std::string, bdd> formula_cache;
before parsedecl.hh uses it. */ before parsedecl.hh uses it. */
#include "parsedecl.hh" #include "parsedecl.hh"
using namespace spot::ltl; using namespace spot;
#include <iostream> #include <iostream>
//typedef std::pair<bool, spot::ltl::formula*> pair; //typedef std::pair<bool, spot::formula*> pair;
} }
%token <str> STRING UNTERMINATED_STRING IDENT %token <str> STRING UNTERMINATED_STRING IDENT
@ -109,7 +109,7 @@ strident "," condition "," follow_list ";"
if (i == fcache.end()) if (i == fcache.end())
{ {
parse_error_list pel; parse_error_list pel;
formula f = spot::ltl::parse_infix_boolean(*$3, pel, formula f = spot::parse_infix_boolean(*$3, pel,
parse_environment); parse_environment);
for (parse_error_list::iterator i = pel.begin(); for (parse_error_list::iterator i = pel.begin();
i != pel.end(); ++i) i != pel.end(); ++i)
@ -207,7 +207,7 @@ namespace spot
error_list.push_back error_list.push_back
(kripke_parse_error(spot::location(), (kripke_parse_error(spot::location(),
std::string("Cannot open file ") + name)); std::string("Cannot open file ") + name));
return 0; return nullptr;
} }
formula_cache fcache; formula_cache fcache;
auto result = make_kripke_explicit(dict); auto result = make_kripke_explicit(dict);

View file

@ -41,15 +41,15 @@ namespace spot
kripke_parse(const std::string& name, kripke_parse(const std::string& name,
kripke_parse_error_list& error_list, kripke_parse_error_list& error_list,
const bdd_dict_ptr& dict, const bdd_dict_ptr& dict,
ltl::environment& env environment& env
= ltl::default_environment::instance(), = default_environment::instance(),
bool debug = false); bool debug = false);
/// \brief Format diagnostics produced by spot::kripke_parse. /// \brief Format diagnostics produced by spot::kripke_parse.
/// \param os Where diagnostics should be output. /// \param os Where diagnostics should be output.
/// \param filename The filename that should appear in the diagnostics. /// \param filename The filename that should appear in the diagnostics.
/// \param error_list The error list filled by spot::ltl::parse while /// \param error_list The error list filled by spot::parse while
/// parsing \a ltl_string. /// parsing \a ltl_string.
/// \return \c true if any diagnostic was output. /// \return \c true if any diagnostic was output.
SPOT_API SPOT_API

View file

@ -28,9 +28,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
void void
fix_utf8_locations(const std::string& ltl_string, fix_utf8_locations(const std::string& ltl_string,
parse_error_list& error_list) parse_error_list& error_list)
@ -112,6 +109,4 @@ namespace spot
return format_parse_errors_aux(os, ltl_string, error_list); return format_parse_errors_aux(os, ltl_string, error_list);
} }
} }
}
} }

View file

@ -27,7 +27,7 @@
%debug %debug
%error-verbose %error-verbose
%expect 0 %expect 0
%lex-param { spot::ltl::parse_error_list& error_list } %lex-param { spot::parse_error_list& error_list }
%define api.location.type "spot::location" %define api.location.type "spot::location"
%code requires %code requires
@ -41,13 +41,13 @@
struct minmax_t { unsigned min, max; }; struct minmax_t { unsigned min, max; };
} }
%parse-param {spot::ltl::parse_error_list &error_list} %parse-param {spot::parse_error_list &error_list}
%parse-param {spot::ltl::environment &parse_environment} %parse-param {spot::environment &parse_environment}
%parse-param {spot::ltl::formula &result} %parse-param {spot::formula &result}
%union %union
{ {
std::string* str; std::string* str;
const spot::ltl::fnode* ltl; const spot::fnode* ltl;
unsigned num; unsigned num;
minmax_t minmax; minmax_t minmax;
} }
@ -57,7 +57,7 @@
We mut ensure that YYSTYPE is declared (by the above %union) We mut ensure that YYSTYPE is declared (by the above %union)
before parsedecl.hh uses it. */ before parsedecl.hh uses it. */
#include "parsedecl.hh" #include "parsedecl.hh"
using namespace spot::ltl; using namespace spot;
#define missing_right_op_msg(op, str) \ #define missing_right_op_msg(op, str) \
error_list.emplace_back(op, \ error_list.emplace_back(op, \
@ -94,10 +94,10 @@ using namespace spot::ltl;
static formula static formula
try_recursive_parse(const std::string& str, try_recursive_parse(const std::string& str,
const spot::location& location, const spot::location& location,
spot::ltl::environment& env, spot::environment& env,
bool debug, bool debug,
parser_type type, parser_type type,
spot::ltl::parse_error_list& error_list) spot::parse_error_list& error_list)
{ {
// We want to parse a U (b U c) as two until operators applied // We want to parse a U (b U c) as two until operators applied
// to the atomic propositions a, b, and c. We also want to // to the atomic propositions a, b, and c. We also want to
@ -120,18 +120,18 @@ using namespace spot::ltl;
return nullptr; return nullptr;
} }
spot::ltl::parse_error_list suberror; spot::parse_error_list suberror;
formula f; formula f;
switch (type) switch (type)
{ {
case parser_sere: case parser_sere:
f = spot::ltl::parse_infix_sere(str, suberror, env, debug, true); f = spot::parse_infix_sere(str, suberror, env, debug, true);
break; break;
case parser_bool: case parser_bool:
f = spot::ltl::parse_infix_boolean(str, suberror, env, debug, true); f = spot::parse_infix_boolean(str, suberror, env, debug, true);
break; break;
case parser_ltl: case parser_ltl:
f = spot::ltl::parse_infix_psl(str, suberror, env, debug, true); f = spot::parse_infix_psl(str, suberror, env, debug, true);
break; break;
} }
@ -237,8 +237,8 @@ using namespace spot::ltl;
%destructor { $$->destroy(); } <ltl> %destructor { $$->destroy(); } <ltl>
%printer { debug_stream() << *$$; } <str> %printer { debug_stream() << *$$; } <str>
%printer { spot::ltl::print_psl(debug_stream(), formula($$)); } <ltl> %printer { print_psl(debug_stream(), formula($$)); } <ltl>
%printer { spot::ltl::print_sere(debug_stream(), formula($$)); } sere bracedsere %printer { print_sere(debug_stream(), formula($$)); } sere bracedsere
%printer { debug_stream() << $$; } <num> %printer { debug_stream() << $$; } <num>
%printer { debug_stream() << $$.min << ".." << $$.max; } <minmax> %printer { debug_stream() << $$.min << ".." << $$.max; } <minmax>
@ -992,8 +992,6 @@ ltlyy::parser::error(const location_type& location, const std::string& message)
} }
namespace spot namespace spot
{
namespace ltl
{ {
formula formula
parse_infix_psl(const std::string& ltl_string, parse_infix_psl(const std::string& ltl_string,
@ -1081,8 +1079,6 @@ namespace spot
} }
return f; return f;
} }
}
} }
// Local Variables: // Local Variables:

View file

@ -99,7 +99,7 @@ eol2 (\n\r)+|(\r\n)+
<<EOF>> { <<EOF>> {
BEGIN(orig_cond); BEGIN(orig_cond);
error_list.push_back( error_list.push_back(
spot::ltl::one_parse_error(*yylloc, spot::one_parse_error(*yylloc,
"unclosed comment")); "unclosed comment"));
return 0; return 0;
} }
@ -141,7 +141,7 @@ eol2 (\n\r)+|(\r\n)+
unput(')'); unput(')');
if (!missing_parent) if (!missing_parent)
error_list.push_back( error_list.push_back(
spot::ltl::one_parse_error(*yylloc, spot::one_parse_error(*yylloc,
"missing closing parenthese")); "missing closing parenthese"));
missing_parent = true; missing_parent = true;
} }
@ -195,7 +195,7 @@ eol2 (\n\r)+|(\r\n)+
unput(')'); unput(')');
if (!missing_parent) if (!missing_parent)
error_list.push_back( error_list.push_back(
spot::ltl::one_parse_error(*yylloc, spot::one_parse_error(*yylloc,
"missing closing brace")); "missing closing brace"));
missing_parent = true; missing_parent = true;
} }
@ -238,7 +238,7 @@ eol2 (\n\r)+|(\r\n)+
if (errno || yylval->num != n) if (errno || yylval->num != n)
{ {
error_list.push_back( error_list.push_back(
spot::ltl::one_parse_error(*yylloc, spot::one_parse_error(*yylloc,
"value too large ignored")); "value too large ignored"));
// Skip this number and read next token // Skip this number and read next token
yylloc->step(); yylloc->step();
@ -347,7 +347,7 @@ eol2 (\n\r)+|(\r\n)+
[^\\\"\n\r]+ s.append(yytext, yyleng); [^\\\"\n\r]+ s.append(yytext, yyleng);
<<EOF>> { <<EOF>> {
error_list.push_back( error_list.push_back(
spot::ltl::one_parse_error(*yylloc, spot::one_parse_error(*yylloc,
"unclosed string")); "unclosed string"));
BEGIN(orig_cond); BEGIN(orig_cond);
yylval->str = new std::string(s); yylval->str = new std::string(s);

View file

@ -28,7 +28,7 @@
# define YY_DECL \ # define YY_DECL \
int ltlyylex (ltlyy::parser::semantic_type *yylval, \ int ltlyylex (ltlyy::parser::semantic_type *yylval, \
spot::location *yylloc, \ spot::location *yylloc, \
spot::ltl::parse_error_list& error_list) spot::parse_error_list& error_list)
YY_DECL; YY_DECL;
void flex_set_buffer(const std::string& buf, int start_tok, bool lenient); void flex_set_buffer(const std::string& buf, int start_tok, bool lenient);

View file

@ -31,8 +31,6 @@
#include <iosfwd> #include <iosfwd>
namespace spot namespace spot
{
namespace ltl
{ {
/// \addtogroup ltl_io /// \addtogroup ltl_io
/// @{ /// @{
@ -161,18 +159,18 @@ namespace spot
bool debug = false, bool debug = false,
bool lenient = false); bool lenient = false);
/// \brief Format diagnostics produced by spot::ltl::parse /// \brief Format diagnostics produced by spot::parse
/// or spot::ltl::ratexp /// or spot::ratexp
/// ///
/// If the string is utf8 encoded, spot::ltl::fix_utf8_locations() /// If the string is utf8 encoded, spot::fix_utf8_locations()
/// will be used to report correct utf8 locations (assuming the /// will be used to report correct utf8 locations (assuming the
/// output is utf8 aware). Nonetheless, the supplied \a /// output is utf8 aware). Nonetheless, the supplied \a
/// error_list will not be modified. /// error_list will not be modified.
/// ///
/// \param os Where diagnostics should be output. /// \param os Where diagnostics should be output.
/// \param input_string The string that were parsed. /// \param input_string The string that were parsed.
/// \param error_list The error list filled by spot::ltl::parse /// \param error_list The error list filled by spot::parse
/// or spot::ltl::parse_sere while parsing \a input_string. /// or spot::parse_sere while parsing \a input_string.
/// \return \c true iff any diagnostic was output. /// \return \c true iff any diagnostic was output.
SPOT_API SPOT_API
bool format_parse_errors(std::ostream& os, bool format_parse_errors(std::ostream& os,
@ -194,13 +192,13 @@ namespace spot
/// valid utf8. /// valid utf8.
/// ///
/// You should NOT call this function before calling /// You should NOT call this function before calling
/// spot::ltl::format_parse_errors() because it is already called /// spot::format_parse_errors() because it is already called
/// inside if needed. You may need this function only if you want /// inside if needed. You may need this function only if you want
/// to write your own error reporting code. /// to write your own error reporting code.
/// ///
/// \param input_string The string that were parsed. /// \param input_string The string that were parsed.
/// \param error_list The error list filled by spot::ltl::parse /// \param error_list The error list filled by spot::parse
/// or spot::ltl::parse_sere while parsing \a input_string. /// or spot::parse_sere while parsing \a input_string.
SPOT_API SPOT_API
void void
fix_utf8_locations(const std::string& input_string, fix_utf8_locations(const std::string& input_string,
@ -208,4 +206,3 @@ namespace spot
/// @} /// @}
} }
}

View file

@ -44,7 +44,7 @@
typedef std::map<int, bdd> map_t; typedef std::map<int, bdd> map_t;
/* Cache parsed formulae. Labels on arcs are frequently identical /* Cache parsed formulae. Labels on arcs are frequently identical
and it would be a waste of time to parse them to ltl::formula and it would be a waste of time to parse them to formula
over and over, and to register all their atomic_propositions in over and over, and to register all their atomic_propositions in
the bdd_dict. Keep the bdd result around so we can reuse the bdd_dict. Keep the bdd result around so we can reuse
it. */ it. */
@ -71,7 +71,7 @@
spot::location used_loc; spot::location used_loc;
}; };
spot::parsed_aut_ptr h; spot::parsed_aut_ptr h;
spot::ltl::environment* env; spot::environment* env;
formula_cache fcache; formula_cache fcache;
named_tgba_t* namer = nullptr; named_tgba_t* namer = nullptr;
spot::acc_mapper_int* acc_mapper = nullptr; spot::acc_mapper_int* acc_mapper = nullptr;
@ -1403,8 +1403,8 @@ nc-formula: nc-formula-or-ident
auto i = res.fcache.find(*$1); auto i = res.fcache.find(*$1);
if (i == res.fcache.end()) if (i == res.fcache.end())
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
auto f = spot::ltl::parse_infix_boolean(*$1, pel, *res.env, auto f = spot::parse_infix_boolean(*$1, pel, *res.env,
debug_level(), true); debug_level(), true);
for (auto& j: pel) for (auto& j: pel)
{ {
@ -1578,8 +1578,8 @@ lbtt-acc: { $$ = 0U; }
} }
lbtt-guard: STRING lbtt-guard: STRING
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
auto f = spot::ltl::parse_prefix_ltl(*$1, pel, *res.env); auto f = spot::parse_prefix_ltl(*$1, pel, *res.env);
if (!f || !pel.empty()) if (!f || !pel.empty())
{ {
std::string s = "failed to parse guard: "; std::string s = "failed to parse guard: ";
@ -1884,7 +1884,7 @@ namespace spot
parsed_aut_ptr parsed_aut_ptr
automaton_stream_parser::parse(parse_aut_error_list& error_list, automaton_stream_parser::parse(parse_aut_error_list& error_list,
const bdd_dict_ptr& dict, const bdd_dict_ptr& dict,
ltl::environment& env, environment& env,
bool debug) bool debug)
{ {
restart: restart:
@ -1927,7 +1927,7 @@ namespace spot
twa_graph_ptr twa_graph_ptr
automaton_stream_parser::parse_strict(const bdd_dict_ptr& dict, automaton_stream_parser::parse_strict(const bdd_dict_ptr& dict,
ltl::environment& env, environment& env,
bool debug) bool debug)
{ {
parse_aut_error_list pel; parse_aut_error_list pel;

View file

@ -79,13 +79,13 @@ namespace spot
~automaton_stream_parser(); ~automaton_stream_parser();
parsed_aut_ptr parse(parse_aut_error_list& error_list, parsed_aut_ptr parse(parse_aut_error_list& error_list,
const bdd_dict_ptr& dict, const bdd_dict_ptr& dict,
ltl::environment& env = environment& env =
ltl::default_environment::instance(), default_environment::instance(),
bool debug = false); bool debug = false);
// Raises a parse_error on any syntax error // Raises a parse_error on any syntax error
twa_graph_ptr parse_strict(const bdd_dict_ptr& dict, twa_graph_ptr parse_strict(const bdd_dict_ptr& dict,
ltl::environment& env = environment& env =
ltl::default_environment::instance(), default_environment::instance(),
bool debug = false); bool debug = false);
}; };
@ -120,7 +120,7 @@ namespace spot
parse_aut(const std::string& filename, parse_aut(const std::string& filename,
parse_aut_error_list& error_list, parse_aut_error_list& error_list,
const bdd_dict_ptr& dict, const bdd_dict_ptr& dict,
ltl::environment& env = ltl::default_environment::instance(), environment& env = default_environment::instance(),
bool debug = false) bool debug = false)
{ {
try try
@ -138,7 +138,7 @@ namespace spot
/// \brief Format diagnostics produced by spot::parse_aut. /// \brief Format diagnostics produced by spot::parse_aut.
/// \param os Where diagnostics should be output. /// \param os Where diagnostics should be output.
/// \param filename The filename that should appear in the diagnostics. /// \param filename The filename that should appear in the diagnostics.
/// \param error_list The error list filled by spot::ltl::parse while /// \param error_list The error list filled by spot::parse while
/// parsing \a ltl_string. /// parsing \a ltl_string.
/// \return \c true iff any diagnostic was output. /// \return \c true iff any diagnostic was output.
SPOT_API bool SPOT_API bool

View file

@ -60,13 +60,13 @@ main(int argc, char** argv)
if (s.empty() || s[0] == '#') // Skip comments if (s.empty() || s[0] == '#') // Skip comments
continue; continue;
spot::ltl::parse_error_list pe; spot::parse_error_list pe;
auto fpos = spot::ltl::parse_infix_psl(s, pe); auto fpos = spot::parse_infix_psl(s, pe);
if (spot::ltl::format_parse_errors(std::cerr, s, pe)) if (spot::format_parse_errors(std::cerr, s, pe))
return 2; return 2;
auto fneg = spot::ltl::formula::Not(fpos); auto fneg = spot::formula::Not(fpos);
{ {
auto apos = scc_filter(ltl_to_tgba_fm(fpos, d)); auto apos = scc_filter(ltl_to_tgba_fm(fpos, d));
@ -104,6 +104,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -83,10 +83,10 @@ main(int argc, char** argv)
if (s.empty() || s[0] == '#') // Skip comments if (s.empty() || s[0] == '#') // Skip comments
continue; continue;
spot::ltl::parse_error_list pe; spot::parse_error_list pe;
auto f = spot::ltl::parse_infix_psl(s, pe); auto f = spot::parse_infix_psl(s, pe);
if (spot::ltl::format_parse_errors(std::cerr, s, pe)) if (spot::format_parse_errors(std::cerr, s, pe))
return 2; return 2;
@ -220,6 +220,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -119,7 +119,7 @@ int main(int argc, char* argv[])
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
if (print_automaton || print_safra) if (print_automaton || print_safra)
{ {
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::environment& env(spot::default_environment::instance());
spot::parse_aut_error_list pel; spot::parse_aut_error_list pel;
auto h = spot::parse_aut(file, pel, dict, env); auto h = spot::parse_aut(file, pel, dict, env);
if (spot::format_parse_aut_errors(std::cerr, file, pel)) if (spot::format_parse_aut_errors(std::cerr, file, pel))
@ -147,10 +147,10 @@ int main(int argc, char* argv[])
} }
else if (print_formula) else if (print_formula)
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(file, p1); auto f1 = spot::parse_infix_psl(file, p1);
if (spot::ltl::format_parse_errors(std::cerr, file, p1)) if (spot::format_parse_errors(std::cerr, file, p1))
return 2; return 2;
auto a = spot::ltl_to_tgba_fm(f1, dict); auto a = spot::ltl_to_tgba_fm(f1, dict);
@ -162,14 +162,14 @@ int main(int argc, char* argv[])
else if (stats) else if (stats)
{ {
spot::twa_graph_ptr a; spot::twa_graph_ptr a;
spot::ltl::formula f1 = nullptr; spot::formula f1 = nullptr;
if (formula) if (formula)
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
f1 = spot::ltl::parse_infix_psl(file, p1); f1 = spot::parse_infix_psl(file, p1);
if (spot::ltl::format_parse_errors(std::cerr, file, p1)) if (spot::format_parse_errors(std::cerr, file, p1))
return 2; return 2;
a = spot::ltl_to_tgba_fm(f1, dict); a = spot::ltl_to_tgba_fm(f1, dict);
@ -177,7 +177,7 @@ int main(int argc, char* argv[])
else else
{ {
spot::parse_aut_error_list pel; spot::parse_aut_error_list pel;
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::environment& env(spot::default_environment::instance());
auto h = spot::parse_aut(file, pel, dict, env); auto h = spot::parse_aut(file, pel, dict, env);
if (spot::format_parse_aut_errors(std::cerr, file, pel)) if (spot::format_parse_aut_errors(std::cerr, file, pel))
return 2; return 2;
@ -209,7 +209,7 @@ int main(int argc, char* argv[])
if (formula) if (formula)
{ {
auto a2 = spot::ltl_to_tgba_fm(spot::ltl::formula::Not(f1), dict); auto a2 = spot::ltl_to_tgba_fm(spot::formula::Not(f1), dict);
spot::tgba_statistics a_size = spot::stats_reachable(a2); spot::tgba_statistics a_size = spot::stats_reachable(a2);
std::cout << "Not Formula: " std::cout << "Not Formula: "
<< a_size.states << ", " << a_size.states << ", "
@ -220,14 +220,14 @@ int main(int argc, char* argv[])
} }
else else
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(file, p1); auto f1 = spot::parse_infix_psl(file, p1);
if (spot::ltl::format_parse_errors(std::cerr, file, p1)) if (spot::format_parse_errors(std::cerr, file, p1))
return 2; return 2;
auto Af = spot::ltl_to_tgba_fm(f1, dict); auto Af = spot::ltl_to_tgba_fm(f1, dict);
auto nf1 = spot::ltl::formula::Not(f1); auto nf1 = spot::formula::Not(f1);
auto Anf = spot::ltl_to_tgba_fm(nf1, dict); auto Anf = spot::ltl_to_tgba_fm(nf1, dict);
auto nAf = spot::make_safra_complement(Af); auto nAf = spot::make_safra_complement(Af);
auto nAnf = spot::make_safra_complement(Anf); auto nAnf = spot::make_safra_complement(Anf);

View file

@ -58,9 +58,9 @@ main(int argc, char **argv)
std::getline(ss, form, ','); std::getline(ss, form, ',');
ss >> expected; ss >> expected;
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_sere(form, p1); auto f1 = spot::parse_infix_sere(form, p1);
if (spot::ltl::format_parse_errors(std::cerr, form, p1)) if (spot::format_parse_errors(std::cerr, form, p1))
return 2; return 2;
bool b = f1.accepts_eword(); bool b = f1.accepts_eword();
@ -73,6 +73,6 @@ main(int argc, char **argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -89,9 +89,9 @@ main(int argc, char** argv)
int runs = atoi(tokens[0].c_str()); int runs = atoi(tokens[0].c_str());
spot::ltl::parse_error_list pe; spot::parse_error_list pe;
auto f = spot::ltl::parse_infix_psl(tokens[1], pe); auto f = spot::parse_infix_psl(tokens[1], pe);
if (spot::ltl::format_parse_errors(std::cerr, tokens[1], pe)) if (spot::format_parse_errors(std::cerr, tokens[1], pe))
return 2; return 2;
auto d = spot::make_bdd_dict(); auto d = spot::make_bdd_dict();
@ -199,6 +199,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -95,47 +95,47 @@ main(int argc, char** argv)
return 2; return 2;
} }
spot::ltl::parse_error_list p2; spot::parse_error_list p2;
auto f2 = spot::ltl::parse_infix_psl(formulas[size - 1], p2); auto f2 = spot::parse_infix_psl(formulas[size - 1], p2);
if (spot::ltl::format_parse_errors(std::cerr, formulas[size - 1], p2)) if (spot::format_parse_errors(std::cerr, formulas[size - 1], p2))
return 2; return 2;
for (unsigned n = 0; n < size - 1; ++n) for (unsigned n = 0; n < size - 1; ++n)
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(formulas[n], p1); auto f1 = spot::parse_infix_psl(formulas[n], p1);
if (check_first && if (check_first &&
spot::ltl::format_parse_errors(std::cerr, formulas[n], p1)) spot::format_parse_errors(std::cerr, formulas[n], p1))
return 2; return 2;
int exit_code = 0; int exit_code = 0;
{ {
#if defined UNABBREV || defined NENOFORM #if defined UNABBREV || defined NENOFORM
spot::ltl::formula tmp; spot::formula tmp;
#endif #endif
#ifdef UNABBREV #ifdef UNABBREV
tmp = f1; tmp = f1;
f1 = spot::ltl::unabbreviate(f1, UNABBREV); f1 = spot::unabbreviate(f1, UNABBREV);
f1.dump(std::cout) << std::endl; f1.dump(std::cout) << std::endl;
#endif #endif
#ifdef NENOFORM #ifdef NENOFORM
tmp = f1; tmp = f1;
f1 = spot::ltl::negative_normal_form(f1); f1 = spot::negative_normal_form(f1);
f1.dump(std::cout) << std::endl; f1.dump(std::cout) << std::endl;
#endif #endif
#ifdef REDUC #ifdef REDUC
spot::ltl::ltl_simplifier_options opt(true, true, true, spot::ltl_simplifier_options opt(true, true, true,
false, false); false, false);
# ifdef EVENT_UNIV # ifdef EVENT_UNIV
opt.favor_event_univ = true; opt.favor_event_univ = true;
# endif # endif
spot::ltl::ltl_simplifier simp(opt); spot::ltl_simplifier simp(opt);
{ {
spot::ltl::formula tmp; spot::formula tmp;
tmp = f1; tmp = f1;
f1 = simp.simplify(f1); f1 = simp.simplify(f1);
@ -143,18 +143,18 @@ main(int argc, char** argv)
{ {
std::cerr std::cerr
<< "Source and simplified formulae are not equivalent!\n"; << "Source and simplified formulae are not equivalent!\n";
spot::ltl::print_psl(std::cerr << "Simplified: ", f1) << '\n'; spot::print_psl(std::cerr << "Simplified: ", f1) << '\n';
exit_code = 1; exit_code = 1;
} }
} }
f1.dump(std::cout) << std::endl; f1.dump(std::cout) << std::endl;
#endif #endif
#ifdef REDUC_TAU #ifdef REDUC_TAU
spot::ltl::ltl_simplifier_options opt(false, false, false, spot::ltl_simplifier_options opt(false, false, false,
true, false); true, false);
spot::ltl::ltl_simplifier simp(opt); spot::ltl_simplifier simp(opt);
{ {
spot::ltl::formula tmp; spot::formula tmp;
tmp = f1; tmp = f1;
f1 = simp.simplify(f1); f1 = simp.simplify(f1);
@ -162,18 +162,18 @@ main(int argc, char** argv)
{ {
std::cerr std::cerr
<< "Source and simplified formulae are not equivalent!\n"; << "Source and simplified formulae are not equivalent!\n";
spot::ltl::print_psl(std::cerr << "Simplified: ", f1) << '\n'; spot::print_psl(std::cerr << "Simplified: ", f1) << '\n';
exit_code = 1; exit_code = 1;
} }
} }
f1.dump(std::cout) << std::endl; f1.dump(std::cout) << std::endl;
#endif #endif
#ifdef REDUC_TAUSTR #ifdef REDUC_TAUSTR
spot::ltl::ltl_simplifier_options opt(false, false, false, spot::ltl_simplifier_options opt(false, false, false,
true, true); true, true);
spot::ltl::ltl_simplifier simp(opt); spot::ltl_simplifier simp(opt);
{ {
spot::ltl::formula tmp; spot::formula tmp;
tmp = f1; tmp = f1;
f1 = simp.simplify(f1); f1 = simp.simplify(f1);
@ -181,7 +181,7 @@ main(int argc, char** argv)
{ {
std::cerr std::cerr
<< "Source and simplified formulae are not equivalent!\n"; << "Source and simplified formulae are not equivalent!\n";
spot::ltl::print_psl(std::cerr << "Simplified: ", f1) << '\n'; spot::print_psl(std::cerr << "Simplified: ", f1) << '\n';
exit_code = 1; exit_code = 1;
} }
} }
@ -191,7 +191,7 @@ main(int argc, char** argv)
exit_code |= f1 != f2; exit_code |= f1 != f2;
#if (!defined(REDUC) && !defined(REDUC_TAU) && !defined(REDUC_TAUSTR)) #if (!defined(REDUC) && !defined(REDUC_TAU) && !defined(REDUC_TAUSTR))
spot::ltl::ltl_simplifier simp; spot::ltl_simplifier simp;
#endif #endif
if (!simp.are_equivalent(f1, f2)) if (!simp.are_equivalent(f1, f2))
@ -215,6 +215,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -342,7 +342,7 @@ checked_main(int argc, char** argv)
bool nra2nba = false; bool nra2nba = false;
bool scc_filter = false; bool scc_filter = false;
bool simpltl = false; bool simpltl = false;
spot::ltl::ltl_simplifier_options redopt(false, false, false, false, spot::ltl_simplifier_options redopt(false, false, false, false,
false, false, false); false, false, false);
bool simpcache_stats = false; bool simpcache_stats = false;
bool scc_filter_all = false; bool scc_filter_all = false;
@ -363,8 +363,8 @@ checked_main(int argc, char** argv)
bool opt_stutterize = false; bool opt_stutterize = false;
const char* opt_never = nullptr; const char* opt_never = nullptr;
const char* hoa_opt = nullptr; const char* hoa_opt = nullptr;
auto& env = spot::ltl::default_environment::instance(); auto& env = spot::default_environment::instance();
spot::ltl::atomic_prop_set* unobservables = nullptr; spot::atomic_prop_set* unobservables = nullptr;
spot::twa_ptr system_aut = nullptr; spot::twa_ptr system_aut = nullptr;
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
spot::timer_map tm; spot::timer_map tm;
@ -790,7 +790,7 @@ checked_main(int argc, char** argv)
} }
else if (!strncmp(argv[formula_index], "-U", 2)) else if (!strncmp(argv[formula_index], "-U", 2))
{ {
unobservables = new spot::ltl::atomic_prop_set; unobservables = new spot::atomic_prop_set;
translation = TransFM; translation = TransFM;
// Parse -U's argument. // Parse -U's argument.
const char* tok = strtok(argv[formula_index] + 2, ", \t;"); const char* tok = strtok(argv[formula_index] + 2, ", \t;");
@ -923,7 +923,7 @@ checked_main(int argc, char** argv)
input = argv[formula_index]; input = argv[formula_index];
} }
spot::ltl::formula f = nullptr; spot::formula f = nullptr;
if (!from_file) // Reading a formula, not reading an automaton from a file. if (!from_file) // Reading a formula, not reading an automaton from a file.
{ {
switch (translation) switch (translation)
@ -932,11 +932,11 @@ checked_main(int argc, char** argv)
case TransTAA: case TransTAA:
case TransCompo: case TransCompo:
{ {
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
tm.start("parsing formula"); tm.start("parsing formula");
f = spot::ltl::parse_infix_psl(input, pel, env, debug_opt); f = spot::parse_infix_psl(input, pel, env, debug_opt);
tm.stop("parsing formula"); tm.stop("parsing formula");
exit_code = spot::ltl::format_parse_errors(std::cerr, input, pel); exit_code = spot::format_parse_errors(std::cerr, input, pel);
} }
break; break;
} }
@ -964,14 +964,14 @@ checked_main(int argc, char** argv)
} }
else else
{ {
spot::ltl::ltl_simplifier* simp = nullptr; spot::ltl_simplifier* simp = nullptr;
if (simpltl) if (simpltl)
simp = new spot::ltl::ltl_simplifier(redopt, dict); simp = new spot::ltl_simplifier(redopt, dict);
if (simp) if (simp)
{ {
tm.start("reducing formula"); tm.start("reducing formula");
spot::ltl::formula t = simp->simplify(f); spot::formula t = simp->simplify(f);
tm.stop("reducing formula"); tm.stop("reducing formula");
f = t; f = t;
if (display_reduced_form) if (display_reduced_form)
@ -1659,6 +1659,6 @@ int
main(int argc, char** argv) main(int argc, char** argv)
{ {
int exit_code = checked_main(argc, argv); int exit_code = checked_main(argc, argv);
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return exit_code; return exit_code;
} }

View file

@ -58,13 +58,13 @@ main(int argc, char **argv)
std::getline(ss, form, ','); std::getline(ss, form, ',');
std::getline(ss, expected); std::getline(ss, expected);
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(form, p1); auto f1 = spot::parse_infix_psl(form, p1);
if (spot::ltl::format_parse_errors(std::cerr, form, p1)) if (spot::format_parse_errors(std::cerr, form, p1))
return 2; return 2;
std::ostringstream so; std::ostringstream so;
spot::ltl::print_formula_props(so, f1, true); spot::print_formula_props(so, f1, true);
auto sost = so.str(); auto sost = so.str();
std::cout << form << ',' << sost << '\n'; std::cout << form << ',' << sost << '\n';
if (sost != expected) if (sost != expected)
@ -74,6 +74,6 @@ main(int argc, char **argv)
return 2; return 2;
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -45,18 +45,18 @@ main(int argc, char **argv)
} }
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(argv[1], p1); auto f1 = spot::parse_infix_psl(argv[1], p1);
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1)) if (spot::format_parse_errors(std::cerr, argv[1], p1))
return 2; return 2;
if (boolone) if (boolone)
std::cout << spot::ltl::length_boolone(f1) << std::endl; std::cout << spot::length_boolone(f1) << std::endl;
else else
std::cout << spot::ltl::length(f1) << std::endl; std::cout << spot::length(f1) << std::endl;
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -44,18 +44,18 @@ main(int argc, char** argv)
syntax(argv[0]); syntax(argv[0]);
{ {
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::environment& env(spot::default_environment::instance());
spot::ltl::parse_error_list pel1; spot::parse_error_list pel1;
auto f1 = spot::ltl::parse_infix_psl(argv[1], pel1, env); auto f1 = spot::parse_infix_psl(argv[1], pel1, env);
if (spot::ltl::format_parse_errors(std::cerr, argv[1], pel1)) if (spot::format_parse_errors(std::cerr, argv[1], pel1))
return 2; return 2;
spot::ltl::parse_error_list pel2; spot::parse_error_list pel2;
auto f2 = spot::ltl::parse_infix_psl(argv[2], pel2, env); auto f2 = spot::parse_infix_psl(argv[2], pel2, env);
if (spot::ltl::format_parse_errors(std::cerr, argv[2], pel2)) if (spot::format_parse_errors(std::cerr, argv[2], pel2))
return 2; return 2;
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
@ -65,6 +65,6 @@ main(int argc, char** argv)
spot::print_dot(std::cout, product(a1, a2)); spot::print_dot(std::cout, product(a1, a2));
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return exit_code; return exit_code;
} }

View file

@ -38,29 +38,29 @@ main(int argc, char **argv)
syntax(argv[0]); syntax(argv[0]);
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(argv[1], p1); auto f1 = spot::parse_infix_psl(argv[1], p1);
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1)) if (spot::format_parse_errors(std::cerr, argv[1], p1))
return 2; return 2;
spot::ltl::relabeling_map* m = new spot::ltl::relabeling_map; spot::relabeling_map* m = new spot::relabeling_map;
auto f2 = spot::ltl::relabel_bse(f1, spot::ltl::Pnn, m); auto f2 = spot::relabel_bse(f1, spot::Pnn, m);
spot::ltl::print_psl(std::cout, f2) << '\n'; spot::print_psl(std::cout, f2) << '\n';
typedef std::map<std::string, std::string> map_t; typedef std::map<std::string, std::string> map_t;
map_t sorted_map; map_t sorted_map;
for (spot::ltl::relabeling_map::const_iterator i = m->begin(); for (spot::relabeling_map::const_iterator i = m->begin();
i != m->end(); ++i) i != m->end(); ++i)
sorted_map[spot::ltl::str_psl(i->first)] = sorted_map[spot::str_psl(i->first)] =
spot::ltl::str_psl(i->second); spot::str_psl(i->second);
for (map_t::const_iterator i = sorted_map.begin(); for (map_t::const_iterator i = sorted_map.begin();
i != sorted_map.end(); ++i) i != sorted_map.end(); ++i)
std::cout << " " << i->first << " -> " std::cout << " " << i->first << " -> "
<< i->second << '\n'; << i->second << '\n';
delete m; delete m;
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that spot::ltl::parse succeed on valid input, and that # Check that spot::parse succeed on valid input, and that
# dump and dotty will work with the resulting trees. Note that # dump and dotty will work with the resulting trees. Note that
# this doesn't check that the tree is correct w.r.t. the formula. # this doesn't check that the tree is correct w.r.t. the formula.

View file

@ -42,6 +42,6 @@ int main(int argc, char** argv)
kripke_save_reachable(std::cout, k); kripke_save_reachable(std::cout, k);
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return return_value; return return_value;
} }

View file

@ -486,9 +486,9 @@ print_ar_stats(ar_stats_type& ar_stats, const std::string& s)
std::cout << std::setiosflags(old); std::cout << std::setiosflags(old);
} }
spot::ltl::formula spot::formula
generate_formula(const spot::ltl::random_ltl& rl, generate_formula(const spot::random_ltl& rl,
spot::ltl::ltl_simplifier& simp, spot::ltl_simplifier& simp,
int opt_f, int opt_s, int opt_f, int opt_s,
int opt_l = 0, bool opt_u = false) int opt_l = 0, bool opt_u = false)
{ {
@ -498,7 +498,7 @@ generate_formula(const spot::ltl::random_ltl& rl,
while (max_tries_u--) while (max_tries_u--)
{ {
spot::srand(opt_s++); spot::srand(opt_s++);
spot::ltl::formula f; spot::formula f;
int max_tries_l = 1000; int max_tries_l = 1000;
while (max_tries_l--) while (max_tries_l--)
{ {
@ -506,12 +506,12 @@ generate_formula(const spot::ltl::random_ltl& rl,
if (opt_l) if (opt_l)
{ {
f = simp.simplify(f); f = simp.simplify(f);
if (spot::ltl::length(f) < opt_l) if (spot::length(f) < opt_l)
continue; continue;
} }
else else
{ {
assert(spot::ltl::length(f) <= opt_f); assert(spot::length(f) <= opt_f);
} }
break; break;
} }
@ -522,7 +522,7 @@ generate_formula(const spot::ltl::random_ltl& rl,
<< "of size " << opt_l << " or more." << std::endl; << "of size " << opt_l << " or more." << std::endl;
return nullptr; return nullptr;
} }
std::string txt = spot::ltl::str_psl(f); std::string txt = spot::str_psl(f);
if (!opt_u || unique.insert(txt).second) if (!opt_u || unique.insert(txt).second)
return f; return f;
} }
@ -576,12 +576,12 @@ main(int argc, char** argv)
spot::option_map options; spot::option_map options;
auto& env = spot::ltl::default_environment::instance(); auto& env = spot::default_environment::instance();
spot::ltl::atomic_prop_set* ap = new spot::ltl::atomic_prop_set; spot::atomic_prop_set* ap = new spot::atomic_prop_set;
auto dict = spot::make_bdd_dict(); auto dict = spot::make_bdd_dict();
spot::ltl::ltl_simplifier_options simpopt(true, true, true, true, true); spot::ltl_simplifier_options simpopt(true, true, true, true, true);
spot::ltl::ltl_simplifier simp(simpopt); spot::ltl_simplifier simp(simpopt);
if (argc <= 1) if (argc <= 1)
syntax(argv[0]); syntax(argv[0]);
@ -788,7 +788,7 @@ main(int argc, char** argv)
} }
} }
spot::ltl::random_ltl rl(ap); spot::random_ltl rl(ap);
const char* tok = rl.parse_options(opt_p); const char* tok = rl.parse_options(opt_p);
if (tok) if (tok)
{ {
@ -824,7 +824,7 @@ main(int argc, char** argv)
spot::timer_map tm_ar; spot::timer_map tm_ar;
std::set<int> failed_seeds; std::set<int> failed_seeds;
int init_opt_ec = opt_ec; int init_opt_ec = opt_ec;
spot::ltl::atomic_prop_set* apf = new spot::ltl::atomic_prop_set; spot::atomic_prop_set* apf = new spot::atomic_prop_set;
if (opt_ec) if (opt_ec)
{ {
@ -847,7 +847,7 @@ main(int argc, char** argv)
{ {
if (opt_F) if (opt_F)
{ {
spot::ltl::formula f = spot::formula f =
generate_formula(rl, simp, opt_f, opt_ec_seed, opt_l, opt_u); generate_formula(rl, simp, opt_f, opt_ec_seed, opt_l, opt_u);
if (!f) if (!f)
exit(1); exit(1);
@ -862,15 +862,15 @@ main(int argc, char** argv)
break; break;
else if (input == "") else if (input == "")
break; break;
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
auto f = spot::ltl::parse_infix_psl(input, pel, env); auto f = spot::parse_infix_psl(input, pel, env);
if (spot::ltl::format_parse_errors(std::cerr, input, pel)) if (spot::format_parse_errors(std::cerr, input, pel))
{ {
exit_code = 1; exit_code = 1;
break; break;
} }
formula = spot::ltl_to_tgba_fm(f, dict, true); formula = spot::ltl_to_tgba_fm(f, dict, true);
auto* tmp = spot::ltl::atomic_prop_collect(f); auto* tmp = spot::atomic_prop_collect(f);
for (auto i: *tmp) for (auto i: *tmp)
apf->insert(i); apf->insert(i);
delete tmp; delete tmp;

View file

@ -54,18 +54,18 @@ main(int argc, char** argv)
} }
{ {
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::environment& env(spot::default_environment::instance());
spot::ltl::parse_error_list pel; spot::parse_error_list pel;
auto f = spot::ltl::parse_infix_psl(argv[formula_index], pel, env, debug); auto f = spot::parse_infix_psl(argv[formula_index], pel, env, debug);
exit_code = exit_code =
spot::ltl::format_parse_errors(std::cerr, argv[formula_index], pel); spot::format_parse_errors(std::cerr, argv[formula_index], pel);
if (f) if (f)
{ {
#ifdef DOTTY #ifdef DOTTY
spot::ltl::print_dot_psl(std::cout, f); spot::print_dot_psl(std::cout, f);
#else #else
f.dump(std::cout) << std::endl; f.dump(std::cout) << std::endl;
#endif #endif
@ -76,6 +76,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return exit_code; return exit_code;
} }

View file

@ -45,7 +45,7 @@ main(int argc, char** argv)
bool hidereduc = false; bool hidereduc = false;
unsigned long sum_before = 0; unsigned long sum_before = 0;
unsigned long sum_after = 0; unsigned long sum_after = 0;
spot::ltl::ltl_simplifier_options o(false, false, false, false, false); spot::ltl_simplifier_options o(false, false, false, false, false);
if (argc < 3) if (argc < 3)
syntax(argv[0]); syntax(argv[0]);
@ -147,12 +147,12 @@ main(int argc, char** argv)
int exit_code = 0; int exit_code = 0;
{ {
spot::ltl::ltl_simplifier* simp = new spot::ltl::ltl_simplifier(o); spot::ltl_simplifier* simp = new spot::ltl_simplifier(o);
o.reduce_size_strictly = true; o.reduce_size_strictly = true;
spot::ltl::ltl_simplifier* simp_size = new spot::ltl::ltl_simplifier(o); spot::ltl_simplifier* simp_size = new spot::ltl_simplifier(o);
spot::ltl::formula f1 = nullptr; spot::formula f1 = nullptr;
spot::ltl::formula f2 = nullptr; spot::formula f2 = nullptr;
std::ifstream* fin = nullptr; std::ifstream* fin = nullptr;
@ -178,16 +178,16 @@ main(int argc, char** argv)
} }
while (input == ""); while (input == "");
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
f1 = spot::ltl::parse_infix_psl(input, p1); f1 = spot::parse_infix_psl(input, p1);
if (spot::ltl::format_parse_errors(std::cerr, input, p1)) if (spot::format_parse_errors(std::cerr, input, p1))
return 2; return 2;
} }
else else
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
f1 = spot::ltl::parse_infix_psl(argv[2], p1); f1 = spot::parse_infix_psl(argv[2], p1);
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p1)) if (spot::format_parse_errors(std::cerr, argv[2], p1))
return 2; return 2;
} }
@ -199,23 +199,23 @@ main(int argc, char** argv)
exit(2); exit(2);
} }
spot::ltl::parse_error_list p2; spot::parse_error_list p2;
f2 = spot::ltl::parse_infix_psl(argv[3], p2); f2 = spot::parse_infix_psl(argv[3], p2);
if (spot::ltl::format_parse_errors(std::cerr, argv[3], p2)) if (spot::format_parse_errors(std::cerr, argv[3], p2))
return 2; return 2;
} }
{ {
spot::ltl::formula ftmp1; spot::formula ftmp1;
ftmp1 = f1; ftmp1 = f1;
f1 = simp_size->negative_normal_form(f1, false); f1 = simp_size->negative_normal_form(f1, false);
int length_f1_before = spot::ltl::length(f1); int length_f1_before = spot::length(f1);
std::string f1s_before = spot::ltl::str_psl(f1); std::string f1s_before = spot::str_psl(f1);
std::string f1l; std::string f1l;
spot::ltl::formula input_f = f1; spot::formula input_f = f1;
f1 = simp_size->simplify(input_f); f1 = simp_size->simplify(input_f);
if (!simp_size->are_equivalent(input_f, f1)) if (!simp_size->are_equivalent(input_f, f1))
{ {
@ -226,8 +226,8 @@ main(int argc, char** argv)
} }
else else
{ {
spot::ltl::formula maybe_larger = simp->simplify(input_f); spot::formula maybe_larger = simp->simplify(input_f);
f1l = spot::ltl::str_psl(maybe_larger); f1l = spot::str_psl(maybe_larger);
if (!simp->are_equivalent(input_f, maybe_larger)) if (!simp->are_equivalent(input_f, maybe_larger))
{ {
std::cerr << "Incorrect reduction (reduce_size_strictly=0) from `" std::cerr << "Incorrect reduction (reduce_size_strictly=0) from `"
@ -236,15 +236,15 @@ main(int argc, char** argv)
} }
} }
int length_f1_after = spot::ltl::length(f1); int length_f1_after = spot::length(f1);
std::string f1s_after = spot::ltl::str_psl(f1); std::string f1s_after = spot::str_psl(f1);
std::string f2s = ""; std::string f2s = "";
if (f2) if (f2)
{ {
ftmp1 = f2; ftmp1 = f2;
f2 = simp_size->negative_normal_form(f2, false); f2 = simp_size->negative_normal_form(f2, false);
f2s = spot::ltl::str_psl(f2); f2s = spot::str_psl(f2);
} }
sum_before += length_f1_before; sum_before += length_f1_before;
@ -308,6 +308,6 @@ main(int argc, char** argv)
} }
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return exit_code; return exit_code;
} }

View file

@ -45,25 +45,25 @@ main(int argc, char** argv)
int exit_return = 0; int exit_return = 0;
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto ftmp1 = spot::ltl::parse_infix_psl(argv[2], p1); auto ftmp1 = spot::parse_infix_psl(argv[2], p1);
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p1)) if (spot::format_parse_errors(std::cerr, argv[2], p1))
return 2; return 2;
spot::ltl::parse_error_list p2; spot::parse_error_list p2;
auto ftmp2 = spot::ltl::parse_infix_psl(argv[3], p2); auto ftmp2 = spot::parse_infix_psl(argv[3], p2);
if (spot::ltl::format_parse_errors(std::cerr, argv[3], p2)) if (spot::format_parse_errors(std::cerr, argv[3], p2))
return 2; return 2;
spot::ltl::formula f1 = spot::ltl::negative_normal_form(ftmp1); spot::formula f1 = spot::negative_normal_form(ftmp1);
spot::ltl::formula f2 = spot::ltl::negative_normal_form(ftmp2); spot::formula f2 = spot::negative_normal_form(ftmp2);
std::string f1s = spot::ltl::str_psl(f1); std::string f1s = spot::str_psl(f1);
std::string f2s = spot::ltl::str_psl(f2); std::string f2s = spot::str_psl(f2);
spot::ltl::ltl_simplifier* c = new spot::ltl::ltl_simplifier; spot::ltl_simplifier* c = new spot::ltl_simplifier;
switch (opt) switch (opt)
{ {
@ -102,6 +102,6 @@ main(int argc, char** argv)
delete c; delete c;
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return exit_return; return exit_return;
} }

View file

@ -28,8 +28,8 @@ int
main() main()
{ {
{ {
spot::ltl::default_environment& e = spot::default_environment& e =
spot::ltl::default_environment::instance(); spot::default_environment::instance();
auto a = spot::make_taa_tgba_string(spot::make_bdd_dict()); auto a = spot::make_taa_tgba_string(spot::make_bdd_dict());
typedef spot::taa_tgba::transition trans; typedef spot::taa_tgba::transition trans;
@ -48,6 +48,6 @@ main()
spot::print_dot(std::cout, a); spot::print_dot(std::cout, a);
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -40,21 +40,21 @@ main(int argc, char **argv)
syntax(argv[0]); syntax(argv[0]);
{ {
spot::ltl::parse_error_list p1; spot::parse_error_list p1;
auto f1 = spot::ltl::parse_infix_psl(argv[1], p1); auto f1 = spot::parse_infix_psl(argv[1], p1);
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1)) if (spot::format_parse_errors(std::cerr, argv[1], p1))
return 2; return 2;
// The string generated from an abstract tree should be parsable // The string generated from an abstract tree should be parsable
// again. // again.
std::string f1s = spot::ltl::str_psl(f1); std::string f1s = spot::str_psl(f1);
std::cout << f1s << '\n'; std::cout << f1s << '\n';
auto f2 = spot::ltl::parse_infix_psl(f1s, p1); auto f2 = spot::parse_infix_psl(f1s, p1);
if (spot::ltl::format_parse_errors(std::cerr, f1s, p1)) if (spot::format_parse_errors(std::cerr, f1s, p1))
return 2; return 2;
// This second abstract tree should be equal to the first. // This second abstract tree should be equal to the first.
@ -64,13 +64,13 @@ main(int argc, char **argv)
// It should also map to the same string. // It should also map to the same string.
std::string f2s = spot::ltl::str_psl(f2); std::string f2s = spot::str_psl(f2);
std::cout << f2s << '\n'; std::cout << f2s << '\n';
if (f2s != f1s) if (f2s != f1s)
return 1; return 1;
} }
assert(spot::ltl::fnode::instances_check()); assert(spot::fnode::instances_check());
return 0; return 0;
} }

View file

@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check for spot::ltl::tostring. # Check for spot::tostring.
. ./defs || exit 1 . ./defs || exit 1

View file

@ -25,8 +25,6 @@
#include "twa/bdddict.hh" #include "twa/bdddict.hh"
namespace spot namespace spot
{
namespace ltl
{ {
atomic_prop_set create_atomic_prop_set(unsigned n) atomic_prop_set create_atomic_prop_set(unsigned n)
{ {
@ -57,7 +55,7 @@ namespace spot
bdd bdd
atomic_prop_collect_as_bdd(formula f, const twa_ptr& a) atomic_prop_collect_as_bdd(formula f, const twa_ptr& a)
{ {
spot::ltl::atomic_prop_set aps; spot::atomic_prop_set aps;
atomic_prop_collect(f, &aps); atomic_prop_collect(f, &aps);
bdd res = bddtrue; bdd res = bddtrue;
for (auto f: aps) for (auto f: aps)
@ -65,4 +63,3 @@ namespace spot
return res; return res;
} }
} }
}

View file

@ -28,8 +28,6 @@
#include "twa/fwd.hh" #include "twa/fwd.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \addtogroup ltl_misc /// \addtogroup ltl_misc
/// @{ /// @{
@ -63,4 +61,3 @@ namespace spot
/// @} /// @}
} }
}

View file

@ -27,9 +27,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
language_containment_checker::language_containment_checker language_containment_checker::language_containment_checker
(const bdd_dict_ptr& dict, bool exprop, bool symb_merge, (const bdd_dict_ptr& dict, bool exprop, bool symb_merge,
bool branching_postponement, bool fair_loop_approx) bool branching_postponement, bool fair_loop_approx)
@ -137,4 +134,3 @@ namespace spot
return simpl.simplify(f); return simpl.simplify(f);
} }
} }
}

View file

@ -28,8 +28,6 @@
#include <map> #include <map>
namespace spot namespace spot
{
namespace ltl
{ {
/// Check containment between LTL formulae. /// Check containment between LTL formulae.
class SPOT_API language_containment_checker class SPOT_API language_containment_checker
@ -79,4 +77,3 @@ namespace spot
trans_map translated_; trans_map translated_;
}; };
} }
}

View file

@ -24,9 +24,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
declarative_environment::declarative_environment() declarative_environment::declarative_environment()
{ {
} }
@ -62,4 +59,3 @@ namespace spot
return props_; return props_;
} }
} }
}

View file

@ -29,9 +29,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
/// \ingroup ltl_environment /// \ingroup ltl_environment
/// \brief A declarative environment. /// \brief A declarative environment.
/// ///
@ -61,4 +58,3 @@ namespace spot
prop_map props_; prop_map props_;
}; };
} }
}

View file

@ -24,9 +24,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
default_environment::~default_environment() default_environment::~default_environment()
{ {
} }
@ -54,6 +51,4 @@ namespace spot
static default_environment* singleton = new default_environment(); static default_environment* singleton = new default_environment();
return *singleton; return *singleton;
} }
}
} }

View file

@ -27,9 +27,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
/// \ingroup ltl_environment /// \ingroup ltl_environment
/// \brief A laxist environment. /// \brief A laxist environment.
/// ///
@ -44,10 +41,9 @@ namespace spot
virtual formula require(const std::string& prop_str); virtual formula require(const std::string& prop_str);
virtual const std::string& name() const; virtual const std::string& name() const;
/// Get the sole instance of spot::ltl::default_environment. /// Get the sole instance of spot::default_environment.
static default_environment& instance(); static default_environment& instance();
protected: protected:
default_environment(); default_environment();
}; };
} }
}

View file

@ -27,8 +27,6 @@
#include <sstream> #include <sstream>
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -134,4 +132,3 @@ namespace spot
return os; return os;
} }
} }
}

View file

@ -25,8 +25,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \ingroup ltl_io /// \ingroup ltl_io
/// \brief Write a formula tree using dot's syntax. /// \brief Write a formula tree using dot's syntax.
@ -38,4 +36,3 @@ namespace spot
SPOT_API SPOT_API
std::ostream& print_dot_psl(std::ostream& os, formula f); std::ostream& print_dot_psl(std::ostream& os, formula f);
} }
}

View file

@ -26,8 +26,6 @@
#include <string> #include <string>
namespace spot namespace spot
{
namespace ltl
{ {
/// \ingroup ltl_essential /// \ingroup ltl_essential
/// \brief An environment that describes atomic propositions. /// \brief An environment that describes atomic propositions.
@ -37,14 +35,14 @@ namespace spot
/// \brief Obtain the formula associated to \a prop_str /// \brief Obtain the formula associated to \a prop_str
/// ///
/// Usually \a prop_str, is the name of an atomic proposition, /// Usually \a prop_str, is the name of an atomic proposition,
/// and spot::ltl::require simply returns the associated /// and spot::require simply returns the associated
/// spot::ltl::formula. /// spot::formula.
/// ///
/// Note this is not a \c const method. Some environments will /// Note this is not a \c const method. Some environments will
/// "create" the atomic proposition when requested. /// "create" the atomic proposition when requested.
/// ///
/// \return 0 iff \a prop_str is not part of the environment, /// \return 0 iff \a prop_str is not part of the environment,
/// or the associated spot::ltl::formula otherwise. /// or the associated spot::formula otherwise.
virtual formula require(const std::string& prop_str) = 0; virtual formula require(const std::string& prop_str) = 0;
/// Get the name of the environment. /// Get the name of the environment.
@ -55,6 +53,4 @@ namespace spot
{ {
} }
}; };
}
} }

View file

@ -27,10 +27,10 @@ namespace spot
{ {
namespace namespace
{ {
static const std::vector<ltl::formula> static const std::vector<formula>
split_aps(const char* arg) split_aps(const char* arg)
{ {
std::vector<ltl::formula> group; std::vector<formula> group;
auto start = arg; auto start = arg;
while (*start) while (*start)
{ {
@ -61,7 +61,7 @@ namespace spot
throw std::invalid_argument(s); throw std::invalid_argument(s);
} }
std::string ap(start, end - start); std::string ap(start, end - start);
group.emplace_back(ltl::formula::ap(ap)); group.emplace_back(formula::ap(ap));
do do
++end; ++end;
while (*end == ' ' || *end == '\t'); while (*end == ' ' || *end == '\t');
@ -86,7 +86,7 @@ namespace spot
while (rend > start && (rend[-1] == ' ' || rend[-1] == '\t')) while (rend > start && (rend[-1] == ' ' || rend[-1] == '\t'))
--rend; --rend;
std::string ap(start, rend - start); std::string ap(start, rend - start);
group.emplace_back(ltl::formula::ap(ap)); group.emplace_back(formula::ap(ap));
if (*end == ',') if (*end == ',')
start = end + 1; start = end + 1;
else else
@ -102,27 +102,27 @@ namespace spot
add_group(split_aps(ap_csv)); add_group(split_aps(ap_csv));
} }
void exclusive_ap::add_group(std::vector<ltl::formula> ap) void exclusive_ap::add_group(std::vector<formula> ap)
{ {
groups.push_back(ap); groups.push_back(ap);
} }
namespace namespace
{ {
ltl::formula formula
nand(ltl::formula lhs, ltl::formula rhs) nand(formula lhs, formula rhs)
{ {
return ltl::formula::Not(ltl::formula::And({lhs, rhs})); return formula::Not(formula::And({lhs, rhs}));
} }
} }
ltl::formula formula
exclusive_ap::constrain(ltl::formula f) const exclusive_ap::constrain(formula f) const
{ {
auto* s = atomic_prop_collect(f); auto* s = atomic_prop_collect(f);
std::vector<ltl::formula> group; std::vector<formula> group;
std::vector<ltl::formula> v; std::vector<formula> v;
for (auto& g: groups) for (auto& g: groups)
{ {
@ -139,7 +139,7 @@ namespace spot
}; };
delete s; delete s;
return ltl::formula::And({f, ltl::formula::G(ltl::formula::And(v))}); return formula::And({f, formula::G(formula::And(v))});
} }
twa_graph_ptr exclusive_ap::constrain(const_twa_graph_ptr aut, twa_graph_ptr exclusive_ap::constrain(const_twa_graph_ptr aut,

View file

@ -27,10 +27,10 @@ namespace spot
{ {
class SPOT_API exclusive_ap final class SPOT_API exclusive_ap final
{ {
std::vector<std::vector<ltl::formula>> groups; std::vector<std::vector<formula>> groups;
public: public:
#ifndef SWIG #ifndef SWIG
void add_group(std::vector<ltl::formula> ap); void add_group(std::vector<formula> ap);
#endif #endif
void add_group(const char* ap_csv); void add_group(const char* ap_csv);
@ -39,7 +39,7 @@ namespace spot
return groups.empty(); return groups.empty();
} }
ltl::formula constrain(ltl::formula f) const; formula constrain(formula f) const;
twa_graph_ptr constrain(const_twa_graph_ptr aut, twa_graph_ptr constrain(const_twa_graph_ptr aut,
bool simplify_guards = false) const; bool simplify_guards = false) const;
}; };

View file

@ -37,7 +37,7 @@ namespace spot
{ {
namespace namespace
{ {
typedef std::vector<const ltl::fnode*> vec; typedef std::vector<const fnode*> vec;
// Compare two formulas, by looking at their operators and // Compare two formulas, by looking at their operators and
// children. This does not use id for the top-level operator, // children. This does not use id for the top-level operator,
@ -45,14 +45,14 @@ namespace spot
// formula. // formula.
struct formula_cmp struct formula_cmp
{ {
bool operator()(const ltl::fnode* l, const ltl::fnode* r) const bool operator()(const fnode* l, const fnode* r) const
{ {
ltl::op opl = l->kind(); op opl = l->kind();
ltl::op opr = r->kind(); op opr = r->kind();
if (opl != opr) if (opl != opr)
return opl < opr; return opl < opr;
if (SPOT_UNLIKELY(opl == ltl::op::Star || opl == ltl::op::FStar)) if (SPOT_UNLIKELY(opl == op::Star || opl == op::FStar))
{ {
{ {
auto minl = l->min(); auto minl = l->min();
@ -87,15 +87,15 @@ namespace spot
struct maps_t final struct maps_t final
{ {
std::map<std::string, const ltl::fnode*> name2ap; std::map<std::string, const fnode*> name2ap;
std::map<size_t, std::string> ap2name; std::map<size_t, std::string> ap2name;
std::set<const ltl::fnode*, formula_cmp> uniq; std::set<const fnode*, formula_cmp> uniq;
}; };
static maps_t m; static maps_t m;
static void static void
gather_bool(vec& v, ltl::op o) gather_bool(vec& v, op o)
{ {
// Gather all boolean terms. // Gather all boolean terms.
vec b; vec b;
@ -119,12 +119,10 @@ namespace spot
// - OrRat(Exps1...,Bool1,Exps2...,Bool2,Exps3...) = // - OrRat(Exps1...,Bool1,Exps2...,Bool2,Exps3...) =
// AndRat(Or(Bool1,Bool2),Exps1...,Exps2...,Exps3...) // AndRat(Or(Bool1,Bool2),Exps1...,Exps2...,Exps3...)
if (!b.empty()) if (!b.empty())
v.insert(v.begin(), ltl::fnode::multop(o, std::move(b))); v.insert(v.begin(), fnode::multop(o, std::move(b)));
} }
} }
namespace ltl
{
const fnode* fnode::unique(const fnode* f) const fnode* fnode::unique(const fnode* f)
{ {
auto ires = m.uniq.emplace(f); auto ires = m.uniq.emplace(f);
@ -993,7 +991,6 @@ namespace spot
return unique(new(mem) fnode(o, {first, second})); return unique(new(mem) fnode(o, {first, second}));
} }
const fnode* const fnode*
fnode::ap(const std::string& name) fnode::ap(const std::string& name)
{ {
@ -1747,4 +1744,3 @@ namespace spot
return out; return out;
} }
} }
}

View file

@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
/// \file tlformula.hh /// \file tl/formula.hh
/// \brief LTL/PSL formula interface /// \brief LTL/PSL formula interface
#pragma once #pragma once
@ -36,8 +36,6 @@
#include <initializer_list> #include <initializer_list>
namespace spot namespace spot
{
namespace ltl
{ {
enum class op: uint8_t enum class op: uint8_t
{ {
@ -1261,15 +1259,14 @@ namespace spot
SPOT_API SPOT_API
std::list<std::string> list_formula_props(const formula& f); std::list<std::string> list_formula_props(const formula& f);
} }
}
#ifndef SWIG #ifndef SWIG
namespace std namespace std
{ {
template <> template <>
struct hash<spot::ltl::formula> struct hash<spot::formula>
{ {
size_t operator()(const spot::ltl::formula& x) const noexcept size_t operator()(const spot::formula& x) const noexcept
{ {
return x.id(); return x.id();
} }

View file

@ -24,8 +24,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
int int
length(formula f) length(formula f)
@ -77,4 +75,3 @@ namespace spot
} }
} }
}

View file

@ -25,8 +25,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \ingroup ltl_misc /// \ingroup ltl_misc
/// \brief Compute the length of a formula. /// \brief Compute the length of a formula.
@ -45,9 +43,8 @@ namespace spot
/// \ingroup ltl_misc /// \ingroup ltl_misc
/// \brief Compute the length of a formula, squashing Boolean formulae /// \brief Compute the length of a formula, squashing Boolean formulae
/// ///
/// This is similar to spot::ltl::length(), except all Boolean /// This is similar to spot::length(), except all Boolean
/// formulae are assumed to have length one. /// formulae are assumed to have length one.
SPOT_API SPOT_API
int length_boolone(formula f); int length_boolone(formula f);
} }
}

View file

@ -24,8 +24,6 @@
#include <vector> #include <vector>
namespace spot namespace spot
{
namespace ltl
{ {
formula formula
mark_tools::mark_concat_ops(formula f) mark_tools::mark_concat_ops(formula f)
@ -34,7 +32,7 @@ namespace spot
if (i != markops_.end()) if (i != markops_.end())
return i->second; return i->second;
ltl::formula res; formula res;
switch (f.kind()) switch (f.kind())
{ {
case op::ff: case op::ff:
@ -63,10 +61,10 @@ namespace spot
res = f; res = f;
break; break;
case op::NegClosure: case op::NegClosure:
res = ltl::formula::NegClosureMarked(f[0]); res = formula::NegClosureMarked(f[0]);
break; break;
case op::EConcat: case op::EConcat:
res = ltl::formula::EConcatMarked(f[0], f[1]); res = formula::EConcatMarked(f[0], f[1]);
break; break;
case op::Or: case op::Or:
case op::And: case op::And:
@ -100,7 +98,7 @@ namespace spot
return this->simplify_mark(f); return this->simplify_mark(f);
}; };
ltl::formula res; formula res;
switch (f.kind()) switch (f.kind())
{ {
case op::ff: case op::ff:
@ -170,7 +168,7 @@ namespace spot
for (auto n: nlist) for (auto n: nlist)
if (nmset.find(n[0]) == nmset.end()) if (nmset.find(n[0]) == nmset.end())
v.push_back(n); v.push_back(n);
res = ltl::formula::And(v); res = formula::And(v);
} }
break; break;
case op::Xor: case op::Xor:
@ -189,6 +187,4 @@ namespace spot
simpmark_[f] = res; simpmark_[f] = res;
return res; return res;
} }
}
} }

View file

@ -23,8 +23,6 @@
#include "misc/hash.hh" #include "misc/hash.hh"
namespace spot namespace spot
{
namespace ltl
{ {
class mark_tools final class mark_tools final
{ {
@ -42,6 +40,4 @@ namespace spot
f2f_map simpmark_; f2f_map simpmark_;
f2f_map markops_; f2f_map markops_;
}; };
}
} }

View file

@ -31,8 +31,6 @@
#define Not_(x) formula::Not(x) #define Not_(x) formula::Not(x)
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -368,4 +366,3 @@ namespace spot
return res; return res;
} }
} }
}

View file

@ -23,8 +23,6 @@
#include <vector> #include <vector>
namespace spot namespace spot
{
namespace ltl
{ {
enum mut_opts enum mut_opts
{ {
@ -45,4 +43,3 @@ namespace spot
unsigned mutation_count = 1, unsigned mutation_count = 1,
bool sort = true); bool sort = true);
} }
}

View file

@ -24,8 +24,6 @@
#include "simplify.hh" #include "simplify.hh"
namespace spot namespace spot
{
namespace ltl
{ {
formula formula
negative_normal_form(formula f, bool negated) negative_normal_form(formula f, bool negated)
@ -36,6 +34,4 @@ namespace spot
ltl_simplifier s; ltl_simplifier s;
return s.negative_normal_form(f, negated); return s.negative_normal_form(f, negated);
} }
}
} }

View file

@ -25,8 +25,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \ingroup ltl_rewriting /// \ingroup ltl_rewriting
/// \brief Build the negative normal form of \a f. /// \brief Build the negative normal form of \a f.
@ -39,11 +37,10 @@ namespace spot
/// \c !f /// \c !f
/// ///
/// Note that this will not remove abbreviated operators. If you /// Note that this will not remove abbreviated operators. If you
/// want to remove abbreviations, call spot::ltl::unabbreviate /// want to remove abbreviations, call spot::unabbreviate
/// first. (Calling this function after /// first. (Calling this function after
/// spot::ltl::negative_normal_form would likely produce a formula /// spot::negative_normal_form would likely produce a formula
/// which is not in negative normal form.) /// which is not in negative normal form.)
SPOT_API formula SPOT_API formula
negative_normal_form(formula f, bool negated = false); negative_normal_form(formula f, bool negated = false);
} }
}

View file

@ -30,8 +30,6 @@
#include "misc/escape.hh" #include "misc/escape.hh"
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -1139,6 +1137,4 @@ namespace spot
print_lbt_ltl(os, f); print_lbt_ltl(os, f);
return os.str(); return os.str();
} }
}
} }

View file

@ -26,8 +26,6 @@
#include <iosfwd> #include <iosfwd>
namespace spot namespace spot
{
namespace ltl
{ {
/// \addtogroup ltl_io /// \addtogroup ltl_io
/// @{ /// @{
@ -221,4 +219,3 @@ namespace spot
str_lbt_ltl(formula f); str_lbt_ltl(formula f);
/// @} /// @}
} }
}

View file

@ -31,8 +31,6 @@
#include <sstream> #include <sstream>
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -583,4 +581,3 @@ namespace spot
rs_->rb.dump_priorities(os); rs_->rb.dump_priorities(os);
} }
} }
}

View file

@ -38,9 +38,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
/// \ingroup ltl_io /// \ingroup ltl_io
/// \brief Base class for random formula generators /// \brief Base class for random formula generators
class SPOT_API random_formula class SPOT_API random_formula
@ -69,7 +66,7 @@ namespace spot
/// It is possible to obtain formulae that are smaller than \a /// It is possible to obtain formulae that are smaller than \a
/// n, because some simple simplifications are performed by the /// n, because some simple simplifications are performed by the
/// AST. (For instance the formula <code>a | a</code> is /// AST. (For instance the formula <code>a | a</code> is
/// automatically reduced to <code>a</code> by spot::ltl::multop.) /// automatically reduced to <code>a</code> by spot::multop.)
formula generate(int n) const; formula generate(int n) const;
/// \brief Print the priorities of each operator, constants, /// \brief Print the priorities of each operator, constants,
@ -350,4 +347,3 @@ namespace spot
random_sere* rs_ = nullptr; random_sere* rs_ = nullptr;
}; };
} }
}

View file

@ -27,9 +27,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Basic relabeler // Basic relabeler
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@ -484,4 +481,3 @@ namespace spot
return rel.visit(f); return rel.visit(f);
} }
} }
}

View file

@ -24,8 +24,6 @@
#include <map> #include <map>
namespace spot namespace spot
{
namespace ltl
{ {
enum relabeling_style { Abc, Pnn }; enum relabeling_style { Abc, Pnn };
@ -51,4 +49,3 @@ namespace spot
formula relabel_bse(formula f, relabeling_style style, formula relabel_bse(formula f, relabeling_style style,
relabeling_map* m = nullptr); relabeling_map* m = nullptr);
} }
}

View file

@ -22,8 +22,6 @@
#include "remove_x.hh" #include "remove_x.hh"
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -99,4 +97,3 @@ namespace spot
return remove_x_rec(f, aps); return remove_x_rec(f, aps);
} }
} }
}

View file

@ -22,8 +22,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \brief Rewrite a stutter-insensitive formula \a f without /// \brief Rewrite a stutter-insensitive formula \a f without
/// using the X operator. /// using the X operator.
@ -46,4 +44,3 @@ namespace spot
SPOT_API SPOT_API
formula remove_x(formula f); formula remove_x(formula f);
} }
}

View file

@ -23,8 +23,6 @@
#include "simpfg.hh" #include "simpfg.hh"
namespace spot namespace spot
{
namespace ltl
{ {
formula simplify_f_g(formula p) formula simplify_f_g(formula p)
{ {
@ -42,6 +40,4 @@ namespace spot
return formula::F(p[0]); return formula::F(p[0]);
return p.map(simplify_f_g); return p.map(simplify_f_g);
} }
}
} }

View file

@ -25,8 +25,6 @@
#include "formula.hh" #include "formula.hh"
namespace spot namespace spot
{
namespace ltl
{ {
/// \ingroup ltl_rewriting /// \ingroup ltl_rewriting
/// \brief Replace <code>true U f</code> and <code>false R g</code> by /// \brief Replace <code>true U f</code> and <code>false R g</code> by
@ -41,4 +39,3 @@ namespace spot
/// ///
SPOT_API formula simplify_f_g(formula f); SPOT_API formula simplify_f_g(formula f);
} }
}

View file

@ -35,8 +35,6 @@
#include <memory> #include <memory>
namespace spot namespace spot
{
namespace ltl
{ {
typedef std::vector<formula> vec; typedef std::vector<formula> vec;
@ -278,13 +276,13 @@ namespace spot
formula formula
star_normal_form(formula f) star_normal_form(formula f)
{ {
return ltl::star_normal_form(f, &snf_cache_); return spot::star_normal_form(f, &snf_cache_);
} }
formula formula
star_normal_form_bounded(formula f) star_normal_form_bounded(formula f)
{ {
return ltl::star_normal_form_bounded(f, &snfb_cache_); return spot::star_normal_form_bounded(f, &snfb_cache_);
} }
@ -3446,4 +3444,3 @@ namespace spot
cache_->lcc.clear(); cache_->lcc.clear();
} }
} }
}

View file

@ -25,8 +25,6 @@
#include <iosfwd> #include <iosfwd>
namespace spot namespace spot
{
namespace ltl
{ {
class ltl_simplifier_options class ltl_simplifier_options
{ {
@ -111,7 +109,7 @@ namespace spot
/// Build the negative normal form of formula \a f. /// Build the negative normal form of formula \a f.
/// All negations of the formula are pushed in front of the /// All negations of the formula are pushed in front of the
/// atomic propositions. Operators <=>, =>, xor are all removed /// atomic propositions. Operators <=>, =>, xor are all removed
/// (calling spot::ltl::unabbreviate_ltl is not needed). /// (calling spot::unabbreviate_ltl is not needed).
/// ///
/// \param f The formula to normalize. /// \param f The formula to normalize.
/// \param negated If \c true, return the negative normal form of /// \param negated If \c true, return the negative normal form of
@ -181,7 +179,7 @@ namespace spot
/// Return the bdd_dict used. /// Return the bdd_dict used.
bdd_dict_ptr get_dict() const; bdd_dict_ptr get_dict() const;
/// Cached version of spot::ltl::star_normal_form(). /// Cached version of spot::star_normal_form().
formula star_normal_form(formula f); formula star_normal_form(formula f);
/// \brief Rewrite a Boolean formula \a f into as an irredundant /// \brief Rewrite a Boolean formula \a f into as an irredundant
@ -201,4 +199,3 @@ namespace spot
void operator=(const ltl_simplifier&) SPOT_DELETED; void operator=(const ltl_simplifier&) SPOT_DELETED;
}; };
} }
}

View file

@ -20,8 +20,6 @@
#include "snf.hh" #include "snf.hh"
namespace spot namespace spot
{
namespace ltl
{ {
namespace namespace
{ {
@ -144,6 +142,4 @@ namespace spot
snf_visitor<true> v(cache); snf_visitor<true> v(cache);
return v.visit(sere); return v.visit(sere);
} }
}
} }

View file

@ -24,9 +24,6 @@
namespace spot namespace spot
{ {
namespace ltl
{
typedef std::unordered_map<formula, formula> snf_cache; typedef std::unordered_map<formula, formula> snf_cache;
/// Helper to rewrite a sere in Star Normal Form. /// Helper to rewrite a sere in Star Normal Form.
@ -55,4 +52,3 @@ namespace spot
SPOT_API formula SPOT_API formula
star_normal_form_bounded(formula sere, snf_cache* cache = nullptr); star_normal_form_bounded(formula sere, snf_cache* cache = nullptr);
} }
}

View file

@ -21,8 +21,6 @@
#include "unabbrev.hh" #include "unabbrev.hh"
namespace spot namespace spot
{
namespace ltl
{ {
unabbreviator::unabbreviator(const char* opt) unabbreviator::unabbreviator(const char* opt)
{ {
@ -250,4 +248,3 @@ namespace spot
return un.run(in); return un.run(in);
} }
} }
}

Some files were not shown because too many files have changed in this diff Show more