diff --git a/NEWS b/NEWS index a524e91ec..db16d6baa 100644 --- a/NEWS +++ b/NEWS @@ -135,11 +135,21 @@ New in spot 2.9.5.dev (not yet released) automaton, but we should not waste too much space and time trying that. - spot::translator additionally honor the following new variable: + spot::translator additionally honor the following new variables: - tls-max-states Maximum number of states of automata involved in - automata-based implication checks for formula - simplifications. Defaults to 64. + tls-max-states Maximum number of states of automata involved in + automata-based implication checks for formula + simplifications. Defaults to 64. + exprop When set, this causes the core LTL translation to + explicitly iterate over all possible valuations of + atomic propositions when considering the successors + of a BDD-encoded state, instead of discovering + possible successors by rewriting the BDD as a sum of + product. This is enabled by default for --high, + and disabled by default otherwise. When unambiguous + automata are required, this option forced and + cannot be disabled. (This feature is not new, but + was not tunable before.) - tgba_powerset() now takes an extra optional argument to specify a list of accepting sinks states if some are known. Doing so can diff --git a/bin/spot-x.cc b/bin/spot-x.cc index 2f74bf167..63170ad4b 100644 --- a/bin/spot-x.cc +++ b/bin/spot-x.cc @@ -58,6 +58,12 @@ default) to disable.") }, the transitions that enter accepting SCCs, and not only on the transitions \ inside accepting SCCs. This option defaults to 0, and is only used when \ comp-susp=1.") }, + { DOC("exprop", "When set, this causes the core LTL translation to \ +explicitly iterate over all possible valuations of atomic propositions when \ +considering the successors of a BDD-encoded state, instead of discovering \ +possible successors by rewriting the BDD as a sum of product. This is enabled \ +by default for --high, and disabled by default otherwise. When unambiguous \ +automata are required, this option forced and cannot be disabled.") }, { DOC("skel-simul", "Default to 1. Set to 0 to disable simulation \ on the skeleton automaton during compositional suspension. Only used when \ comp-susp=1.") }, diff --git a/spot/twaalgos/translate.cc b/spot/twaalgos/translate.cc index 6a39b37f6..8ed672270 100644 --- a/spot/twaalgos/translate.cc +++ b/spot/twaalgos/translate.cc @@ -39,6 +39,7 @@ namespace spot relabel_bool_ = 4; tls_impl_ = -1; ltl_split_ = true; + exprop_ = -1; opt_ = opt; if (!opt) @@ -62,6 +63,7 @@ namespace spot ltl_split_ = opt->get("ltl-split", 1); int tls_max_states = opt->get("tls-max-states", 64); tls_max_states_ = std::max(0, tls_max_states); + exprop_ = opt->get("exprop", -1); } void translator::build_simplifier(const bdd_dict_ptr& dict) @@ -396,7 +398,9 @@ namespace spot } } } - bool exprop = unambiguous || level_ == postprocessor::High; + bool exprop = unambiguous + || (level_ == postprocessor::High && exprop_ != 0) + || exprop_ > 0; aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop, true, false, false, nullptr, nullptr, unambiguous); diff --git a/spot/twaalgos/translate.hh b/spot/twaalgos/translate.hh index 344cae3ba..9dc6b12d2 100644 --- a/spot/twaalgos/translate.hh +++ b/spot/twaalgos/translate.hh @@ -155,6 +155,7 @@ namespace spot bool gf_guarantee_set_ = false; bool ltl_split_; unsigned tls_max_states_ = 0; + int exprop_; const option_map* opt_; }; /// @} diff --git a/tests/core/ltl2tgba2.test b/tests/core/ltl2tgba2.test index f090c2aa2..ffaaa6f8c 100755 --- a/tests/core/ltl2tgba2.test +++ b/tests/core/ltl2tgba2.test @@ -485,3 +485,21 @@ f='(!(G({(a)} |=> {(b)[*12]})))' test 14,1 = `ltl2tgba -B --stats=%s,%d "$f"` f='(!(G({(a)} |=> {(b)[*13]})))' test 15,0 = `ltl2tgba -B --stats=%s,%d "$f"` + +# Related to Issue #298. The difference between the translation of +# this formula with --med and --high is just a different ordering of +# the states caused by the use of exprop. +opts="-x scc-filter=0,tls-impl=0,gf-guarantee=0,wdba-minimize=0" +f='G(p0 -> F(p1 & !p2 & X(!p2 U p3)))' +ltl2tgba $opts --med "$f" >med.hoa +ltl2tgba $opts,exprop=0 "$f" > high.hoa +diff med.hoa high.hoa +ltl2tgba $opts "$f" > high.hoa +test $(wc -l < med.hoa) = $(wc -l < high.hoa) +cmp med.hoa high.hoa && exit 1 +autfilt --stats=%F:%s,%e med.hoa high.hoa >out +cat >exp <