tl: rename ltl_simplifier to tl_simplifier
* doc/org/tut01.org, doc/tl/tl.tex, src/bin/common_r.hh, src/bin/ltlfilt.cc, src/tests/equalsf.cc, src/tests/ikwiad.cc, src/tests/randtgba.cc, src/tests/reduc.cc, src/tests/syntimpl.cc, src/tl/nenoform.cc, src/tl/randomltl.cc, src/tl/randomltl.hh, src/tl/simplify.cc, src/tl/simplify.hh, src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/stutter.cc, src/twaalgos/translate.cc, src/twaalgos/translate.hh, wrap/python/ajax/spotcgi.in, wrap/python/spot.py, wrap/python/tests/interdep.py: Rename ltl_simplifier to tl_simplifier. * NEWS: Mention it.
This commit is contained in:
parent
21be883cf6
commit
176c9e2e17
23 changed files with 119 additions and 117 deletions
6
NEWS
6
NEWS
|
|
@ -3,7 +3,7 @@ New in spot 1.99.4a (not yet released)
|
||||||
Command-line tools:
|
Command-line tools:
|
||||||
|
|
||||||
* autfilt has gained a --complement option.
|
* autfilt has gained a --complement option.
|
||||||
It currently work only for deterministic automata.
|
It currently works only for deterministic automata.
|
||||||
|
|
||||||
* By default, autfilt does not simplify automata (this has not
|
* By default, autfilt does not simplify automata (this has not
|
||||||
changed), as if the --low --any options where used. But now, if
|
changed), as if the --low --any options where used. But now, if
|
||||||
|
|
@ -18,7 +18,7 @@ New in spot 1.99.4a (not yet released)
|
||||||
|
|
||||||
Library:
|
Library:
|
||||||
|
|
||||||
* Rename dtgba_complement() as dtwa_complement(), rename the header
|
* Rename dtgba_complement() to dtwa_complement(), rename the header
|
||||||
as complement.hh, and restrict the purpose of this function to
|
as complement.hh, and restrict the purpose of this function to
|
||||||
just complete the automaton and complement its acceptance
|
just complete the automaton and complement its acceptance
|
||||||
condition. Any further acceptance condition transformation
|
condition. Any further acceptance condition transformation
|
||||||
|
|
@ -39,6 +39,8 @@ New in spot 1.99.4a (not yet released)
|
||||||
* The HOA parser will diagnose any version that is not v1, unless it
|
* The HOA parser will diagnose any version that is not v1, unless it
|
||||||
looks like a subversion of v1 and no parse error was detected.
|
looks like a subversion of v1 and no parse error was detected.
|
||||||
|
|
||||||
|
* ltl_simplifier renamed to tl_simplifier.
|
||||||
|
|
||||||
Python:
|
Python:
|
||||||
|
|
||||||
* Add bindings for complete() and dtwa_complement()
|
* Add bindings for complete() and dtwa_complement()
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ prepared to reject the formula any way. In our example, we are lucky
|
||||||
return 1;
|
return 1;
|
||||||
if (!f.is_ltl_formula())
|
if (!f.is_ltl_formula())
|
||||||
{
|
{
|
||||||
spot::ltl_simplifier simp;
|
spot::tl_simplifier simp;
|
||||||
f = simp.simplify(f);
|
f = simp.simplify(f);
|
||||||
}
|
}
|
||||||
if (!f.is_ltl_formula())
|
if (!f.is_ltl_formula())
|
||||||
|
|
|
||||||
|
|
@ -1286,24 +1286,24 @@ you plan to abbreviate many formulas sharing identical subformulas.
|
||||||
\section{LTL simplifier}
|
\section{LTL simplifier}
|
||||||
|
|
||||||
The LTL rewritings described in the next three sections are all
|
The LTL rewritings described in the next three sections are all
|
||||||
implemented in the `\verb|ltl_simplifier|' class defined in
|
implemented in the `\verb|tl_simplifier|' class defined in
|
||||||
\texttt{spot/tl/simplify.hh}. This class implements several
|
\texttt{spot/tl/simplify.hh}. This class implements several
|
||||||
caches in order to quickly rewrite formulas that have already been
|
caches in order to quickly rewrite formulas that have already been
|
||||||
rewritten previously. For this reason, it is suggested that you reuse
|
rewritten previously. For this reason, it is suggested that you reuse
|
||||||
your instance of `\verb|ltl_simplifier|' as much as possible. If you
|
your instance of `\verb|tl_simplifier|' as much as possible. If you
|
||||||
write an algorithm that will simplify LTL formulas, we suggest you
|
write an algorithm that will simplify LTL formulas, we suggest you
|
||||||
accept an optional `\verb|ltl_simplifier|' argument, so that you can
|
accept an optional `\verb|tl_simplifier|' argument, so that you can
|
||||||
benefit from an existing instance.
|
benefit from an existing instance.
|
||||||
|
|
||||||
The `\verb|ltl_simplifier|' takes an optional
|
The `\verb|tl_simplifier|' takes an optional
|
||||||
`\verb|ltl_simplifier_options|' argument, making it possible to tune
|
`\verb|tl_simplifier_options|' argument, making it possible to tune
|
||||||
the various rewritings that can be performed by this class. These
|
the various rewritings that can be performed by this class. These
|
||||||
options cannot be changed afterwards (because changing these options
|
options cannot be changed afterwards (because changing these options
|
||||||
would invalidate the results stored in the caches).
|
would invalidate the results stored in the caches).
|
||||||
|
|
||||||
\section{Negative normal form}\label{sec:nnf}
|
\section{Negative normal form}\label{sec:nnf}
|
||||||
|
|
||||||
This is implemented by the `\verb|ltl_simplifier::negative_normal_form|`
|
This is implemented by the `\verb|tl_simplifier::negative_normal_form|`
|
||||||
method.
|
method.
|
||||||
|
|
||||||
A formula in negative normal form can only have negation
|
A formula in negative normal form can only have negation
|
||||||
|
|
@ -1347,11 +1347,11 @@ Note that the above rules include the ``unabbreviation'' of operators
|
||||||
rules \texttt{"ei\^"} of function `\verb=unabbreviate()= as described
|
rules \texttt{"ei\^"} of function `\verb=unabbreviate()= as described
|
||||||
in Section~\ref{sec:unabbrev}. Therefore it is never necessary to
|
in Section~\ref{sec:unabbrev}. Therefore it is never necessary to
|
||||||
apply these abbreviations before or after
|
apply these abbreviations before or after
|
||||||
`\verb|ltl_simplifier::negative_normal_form|`.
|
`\verb|tl_simplifier::negative_normal_form|`.
|
||||||
|
|
||||||
If the option `\verb|nenoform_stop_on_boolean|' is set, the above
|
If the option `\verb|nenoform_stop_on_boolean|' is set, the above
|
||||||
recursive rewritings are not applied to Boolean subformulas. For
|
recursive rewritings are not applied to Boolean subformulas. For
|
||||||
instance calling `\verb|ltl_simplifier::negative_normal_form|` on
|
instance calling `\verb|tl_simplifier::negative_normal_form|` on
|
||||||
$\NOT\F\G(a \XOR b)$ will produce $\G\F(((\NOT a)\AND(\NOT
|
$\NOT\F\G(a \XOR b)$ will produce $\G\F(((\NOT a)\AND(\NOT
|
||||||
b))\OR(a\AND b))$ if `\verb|nenoform_stop_on_boolean|' is unset, while
|
b))\OR(a\AND b))$ if `\verb|nenoform_stop_on_boolean|' is unset, while
|
||||||
it will produce $\G\F(\NOT(a \XOR b))$ if
|
it will produce $\G\F(\NOT(a \XOR b))$ if
|
||||||
|
|
@ -1359,8 +1359,8 @@ it will produce $\G\F(\NOT(a \XOR b))$ if
|
||||||
|
|
||||||
\section{Simplifications}
|
\section{Simplifications}
|
||||||
|
|
||||||
The `\verb|ltl_simplifier::simplify|' method performs several kinds of
|
The `\verb|tl_simplifier::simplify|' method performs several kinds of
|
||||||
simplifications, depending on which `\verb|ltl_simplifier_options|'
|
simplifications, depending on which `\verb|tl_simplifier_options|'
|
||||||
was set.
|
was set.
|
||||||
|
|
||||||
The goals in most of these simplification are to:
|
The goals in most of these simplification are to:
|
||||||
|
|
@ -1381,7 +1381,7 @@ The goals in most of these simplification are to:
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Rewritings defined with $\equivEU$ are applied only when
|
Rewritings defined with $\equivEU$ are applied only when
|
||||||
\verb|ltl_simplifier_options::favor_event_univ|' is \texttt{true}:
|
\verb|tl_simplifier_options::favor_event_univ|' is \texttt{true}:
|
||||||
they try to lift subformulas that are both eventual and universal
|
they try to lift subformulas that are both eventual and universal
|
||||||
\emph{higher} in the syntax tree. Conversely, rules defined with $\equivNeu$
|
\emph{higher} in the syntax tree. Conversely, rules defined with $\equivNeu$
|
||||||
are applied only when \verb|favor_event_univ|' is \texttt{false}: they
|
are applied only when \verb|favor_event_univ|' is \texttt{false}: they
|
||||||
|
|
@ -1390,10 +1390,10 @@ try to \textit{lower} subformulas that are both eventual and universal.
|
||||||
\subsection{Basic Simplifications}\label{sec:basic-simp}
|
\subsection{Basic Simplifications}\label{sec:basic-simp}
|
||||||
|
|
||||||
These simplifications are enabled with
|
These simplifications are enabled with
|
||||||
\verb|ltl_simplifier_options::reduce_basics|'. A couple of them may
|
\verb|tl_simplifier_options::reduce_basics|'. A couple of them may
|
||||||
enlarge the size of the formula: they are denoted using $\equiV$
|
enlarge the size of the formula: they are denoted using $\equiV$
|
||||||
instead of $\equiv$, and they can be disabled by setting the
|
instead of $\equiv$, and they can be disabled by setting the
|
||||||
\verb|ltl_simplifier_options::reduce_size_strictly|' option to
|
\verb|tl_simplifier_options::reduce_size_strictly|' option to
|
||||||
\texttt{true}.
|
\texttt{true}.
|
||||||
|
|
||||||
\subsubsection{Basic Simplifications for Temporal Operators}
|
\subsubsection{Basic Simplifications for Temporal Operators}
|
||||||
|
|
@ -1596,7 +1596,7 @@ $\Esuffix$. They assume that $b$, denote a Boolean formula.
|
||||||
|
|
||||||
As noted at the beginning for section~\ref{sec:basic-simp}, rewritings
|
As noted at the beginning for section~\ref{sec:basic-simp}, rewritings
|
||||||
denoted with $\equiV$ can be disabled by setting the
|
denoted with $\equiV$ can be disabled by setting the
|
||||||
\verb|ltl_simplifier_options::reduce_size_strictly|' option to
|
\verb|tl_simplifier_options::reduce_size_strictly|' option to
|
||||||
\texttt{true}.
|
\texttt{true}.
|
||||||
|
|
||||||
\begin{align*}
|
\begin{align*}
|
||||||
|
|
@ -1707,19 +1707,19 @@ implication can be done in two ways:
|
||||||
\begin{description}
|
\begin{description}
|
||||||
\item[Syntactic Implication Checks] were initially proposed
|
\item[Syntactic Implication Checks] were initially proposed
|
||||||
by~\citet{somenzi.00.cav}. This detection is enabled by the
|
by~\citet{somenzi.00.cav}. This detection is enabled by the
|
||||||
``\verb|ltl_simplifier_options::synt_impl|'' option. This is a
|
``\verb|tl_simplifier_options::synt_impl|'' option. This is a
|
||||||
cheap way to detect implications, but it may miss some. The rules
|
cheap way to detect implications, but it may miss some. The rules
|
||||||
we implement are described in Appendix~\ref{ann:syntimpl}.
|
we implement are described in Appendix~\ref{ann:syntimpl}.
|
||||||
|
|
||||||
\item[Language Containment Checks] were initially proposed
|
\item[Language Containment Checks] were initially proposed
|
||||||
by~\citet{tauriainen.03.a83}. This detection is enabled by the
|
by~\citet{tauriainen.03.a83}. This detection is enabled by the
|
||||||
``\verb|ltl_simplifier_options::containment_checks|'' option.
|
``\verb|tl_simplifier_options::containment_checks|'' option.
|
||||||
\end{description}
|
\end{description}
|
||||||
|
|
||||||
In the following rewritings rules, $f\simp g$ means that $g$ was
|
In the following rewritings rules, $f\simp g$ means that $g$ was
|
||||||
proved to be implied by $f$ using either of the above two methods.
|
proved to be implied by $f$ using either of the above two methods.
|
||||||
Additionally, implications denoted by $f\Simp g$ are only checked if
|
Additionally, implications denoted by $f\Simp g$ are only checked if
|
||||||
the ``\verb|ltl_simplifier_options::containment_checks_stronger|''
|
the ``\verb|tl_simplifier_options::containment_checks_stronger|''
|
||||||
option is set (otherwise the rewriting rule is not applied).
|
option is set (otherwise the rewriting rule is not applied).
|
||||||
|
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
|
|
|
||||||
|
|
@ -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_simplifier_options simplifier_options();
|
spot::tl_simplifier_options simplifier_options();
|
||||||
|
|
|
||||||
|
|
@ -445,11 +445,11 @@ namespace
|
||||||
class ltl_processor: public job_processor
|
class ltl_processor: public job_processor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spot::ltl_simplifier& simpl;
|
spot::tl_simplifier& simpl;
|
||||||
fset_t unique_set;
|
fset_t unique_set;
|
||||||
spot::relabeling_map relmap;
|
spot::relabeling_map relmap;
|
||||||
|
|
||||||
ltl_processor(spot::ltl_simplifier& simpl)
|
ltl_processor(spot::tl_simplifier& simpl)
|
||||||
: simpl(simpl)
|
: simpl(simpl)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -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_simplifier_options opt(simplification_level);
|
spot::tl_simplifier_options opt(simplification_level);
|
||||||
opt.boolean_to_isop = boolean_to_isop;
|
opt.boolean_to_isop = boolean_to_isop;
|
||||||
spot::ltl_simplifier simpl(opt);
|
spot::tl_simplifier simpl(opt);
|
||||||
|
|
||||||
ltl_processor processor(simpl);
|
ltl_processor processor(simpl);
|
||||||
if (processor.run())
|
if (processor.run())
|
||||||
|
|
|
||||||
|
|
@ -128,12 +128,12 @@ main(int argc, char** argv)
|
||||||
f1.dump(std::cout) << std::endl;
|
f1.dump(std::cout) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef REDUC
|
#ifdef REDUC
|
||||||
spot::ltl_simplifier_options opt(true, true, true,
|
spot::tl_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_simplifier simp(opt);
|
spot::tl_simplifier simp(opt);
|
||||||
{
|
{
|
||||||
spot::formula tmp;
|
spot::formula tmp;
|
||||||
tmp = f1;
|
tmp = f1;
|
||||||
|
|
@ -150,9 +150,9 @@ main(int argc, char** argv)
|
||||||
f1.dump(std::cout) << std::endl;
|
f1.dump(std::cout) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef REDUC_TAU
|
#ifdef REDUC_TAU
|
||||||
spot::ltl_simplifier_options opt(false, false, false,
|
spot::tl_simplifier_options opt(false, false, false,
|
||||||
true, false);
|
true, false);
|
||||||
spot::ltl_simplifier simp(opt);
|
spot::tl_simplifier simp(opt);
|
||||||
{
|
{
|
||||||
spot::formula tmp;
|
spot::formula tmp;
|
||||||
tmp = f1;
|
tmp = f1;
|
||||||
|
|
@ -169,9 +169,9 @@ main(int argc, char** argv)
|
||||||
f1.dump(std::cout) << std::endl;
|
f1.dump(std::cout) << std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef REDUC_TAUSTR
|
#ifdef REDUC_TAUSTR
|
||||||
spot::ltl_simplifier_options opt(false, false, false,
|
spot::tl_simplifier_options opt(false, false, false,
|
||||||
true, true);
|
true, true);
|
||||||
spot::ltl_simplifier simp(opt);
|
spot::tl_simplifier simp(opt);
|
||||||
{
|
{
|
||||||
spot::formula tmp;
|
spot::formula tmp;
|
||||||
tmp = f1;
|
tmp = f1;
|
||||||
|
|
@ -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_simplifier simp;
|
spot::tl_simplifier simp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!simp.are_equivalent(f1, f2))
|
if (!simp.are_equivalent(f1, f2))
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,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_simplifier_options redopt(false, false, false, false,
|
spot::tl_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;
|
||||||
|
|
@ -944,9 +944,9 @@ checked_main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spot::ltl_simplifier* simp = nullptr;
|
spot::tl_simplifier* simp = nullptr;
|
||||||
if (simpltl)
|
if (simpltl)
|
||||||
simp = new spot::ltl_simplifier(redopt, dict);
|
simp = new spot::tl_simplifier(redopt, dict);
|
||||||
|
|
||||||
if (simp)
|
if (simp)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ print_ar_stats(ar_stats_type& ar_stats, const std::string& s)
|
||||||
|
|
||||||
static spot::formula
|
static spot::formula
|
||||||
generate_formula(const spot::random_ltl& rl,
|
generate_formula(const spot::random_ltl& rl,
|
||||||
spot::ltl_simplifier& simp,
|
spot::tl_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)
|
||||||
{
|
{
|
||||||
|
|
@ -580,8 +580,8 @@ main(int argc, char** argv)
|
||||||
spot::atomic_prop_set* ap = new spot::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_simplifier_options simpopt(true, true, true, true, true);
|
spot::tl_simplifier_options simpopt(true, true, true, true, true);
|
||||||
spot::ltl_simplifier simp(simpopt);
|
spot::tl_simplifier simp(simpopt);
|
||||||
|
|
||||||
if (argc <= 1)
|
if (argc <= 1)
|
||||||
syntax(argv[0]);
|
syntax(argv[0]);
|
||||||
|
|
|
||||||
|
|
@ -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_simplifier_options o(false, false, false, false, false);
|
spot::tl_simplifier_options o(false, false, false, false, false);
|
||||||
|
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
syntax(argv[0]);
|
syntax(argv[0]);
|
||||||
|
|
@ -147,9 +147,9 @@ main(int argc, char** argv)
|
||||||
int exit_code = 0;
|
int exit_code = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
spot::ltl_simplifier* simp = new spot::ltl_simplifier(o);
|
spot::tl_simplifier* simp = new spot::tl_simplifier(o);
|
||||||
o.reduce_size_strictly = true;
|
o.reduce_size_strictly = true;
|
||||||
spot::ltl_simplifier* simp_size = new spot::ltl_simplifier(o);
|
spot::tl_simplifier* simp_size = new spot::tl_simplifier(o);
|
||||||
|
|
||||||
spot::formula f1 = nullptr;
|
spot::formula f1 = nullptr;
|
||||||
spot::formula f2 = nullptr;
|
spot::formula f2 = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ main(int argc, char** argv)
|
||||||
std::string f1s = spot::str_psl(f1);
|
std::string f1s = spot::str_psl(f1);
|
||||||
std::string f2s = spot::str_psl(f2);
|
std::string f2s = spot::str_psl(f2);
|
||||||
|
|
||||||
spot::ltl_simplifier* c = new spot::ltl_simplifier;
|
spot::tl_simplifier* c = new spot::tl_simplifier;
|
||||||
|
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace spot
|
||||||
if (!negated && f.is_in_nenoform())
|
if (!negated && f.is_in_nenoform())
|
||||||
return f;
|
return f;
|
||||||
|
|
||||||
ltl_simplifier s;
|
tl_simplifier s;
|
||||||
return s.negative_normal_form(f, negated);
|
return s.negative_normal_form(f, negated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -470,8 +470,8 @@ namespace spot
|
||||||
+ std::string(tok_pB));
|
+ std::string(tok_pB));
|
||||||
|
|
||||||
spot::srand(opt_seed_);
|
spot::srand(opt_seed_);
|
||||||
ltl_simplifier_options simpl_opts(opt_simpl_level_);
|
tl_simplifier_options simpl_opts(opt_simpl_level_);
|
||||||
ltl_simplifier simpl_(simpl_opts);
|
tl_simplifier simpl_(simpl_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
randltlgenerator::randltlgenerator(int aprops_n,
|
randltlgenerator::randltlgenerator(int aprops_n,
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ namespace spot
|
||||||
bool opt_unique_;
|
bool opt_unique_;
|
||||||
bool opt_wf_;
|
bool opt_wf_;
|
||||||
int opt_simpl_level_;
|
int opt_simpl_level_;
|
||||||
ltl_simplifier simpl_;
|
tl_simplifier simpl_;
|
||||||
|
|
||||||
int output_;
|
int output_;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace spot
|
||||||
typedef std::vector<formula> vec;
|
typedef std::vector<formula> vec;
|
||||||
|
|
||||||
// The name of this class is public, but not its contents.
|
// The name of this class is public, but not its contents.
|
||||||
class ltl_simplifier_cache
|
class tl_simplifier_cache
|
||||||
{
|
{
|
||||||
typedef std::unordered_map<formula, formula> f2f_map;
|
typedef std::unordered_map<formula, formula> f2f_map;
|
||||||
typedef std::unordered_map<formula, bdd> f2b_map;
|
typedef std::unordered_map<formula, bdd> f2b_map;
|
||||||
|
|
@ -47,21 +47,21 @@ namespace spot
|
||||||
typedef std::map<pairf, bool> syntimpl_cache_t;
|
typedef std::map<pairf, bool> syntimpl_cache_t;
|
||||||
public:
|
public:
|
||||||
bdd_dict_ptr dict;
|
bdd_dict_ptr dict;
|
||||||
ltl_simplifier_options options;
|
tl_simplifier_options options;
|
||||||
language_containment_checker lcc;
|
language_containment_checker lcc;
|
||||||
|
|
||||||
~ltl_simplifier_cache()
|
~tl_simplifier_cache()
|
||||||
{
|
{
|
||||||
dict->unregister_all_my_variables(this);
|
dict->unregister_all_my_variables(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ltl_simplifier_cache(const bdd_dict_ptr& d)
|
tl_simplifier_cache(const bdd_dict_ptr& d)
|
||||||
: dict(d), lcc(d, true, true, false, false)
|
: dict(d), lcc(d, true, true, false, false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ltl_simplifier_cache(const bdd_dict_ptr& d,
|
tl_simplifier_cache(const bdd_dict_ptr& d,
|
||||||
const ltl_simplifier_options& opt)
|
const tl_simplifier_options& opt)
|
||||||
: dict(d), options(opt), lcc(d, true, true, false, false)
|
: dict(d), options(opt), lcc(d, true, true, false, false)
|
||||||
{
|
{
|
||||||
options.containment_checks |= options.containment_checks_stronger;
|
options.containment_checks |= options.containment_checks_stronger;
|
||||||
|
|
@ -319,10 +319,10 @@ namespace spot
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
formula
|
formula
|
||||||
nenoform_rec(formula f, bool negated, ltl_simplifier_cache* c);
|
nenoform_rec(formula f, bool negated, tl_simplifier_cache* c);
|
||||||
|
|
||||||
formula equiv_or_xor(bool equiv, formula f1, formula f2,
|
formula equiv_or_xor(bool equiv, formula f1, formula f2,
|
||||||
ltl_simplifier_cache* c)
|
tl_simplifier_cache* c)
|
||||||
{
|
{
|
||||||
auto rec = [c](formula f, bool negated)
|
auto rec = [c](formula f, bool negated)
|
||||||
{
|
{
|
||||||
|
|
@ -354,7 +354,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
formula
|
formula
|
||||||
nenoform_rec(formula f, bool negated, ltl_simplifier_cache* c)
|
nenoform_rec(formula f, bool negated, tl_simplifier_cache* c)
|
||||||
{
|
{
|
||||||
if (f.is(op::Not))
|
if (f.is(op::Not))
|
||||||
{
|
{
|
||||||
|
|
@ -542,7 +542,7 @@ namespace spot
|
||||||
|
|
||||||
// Forward declaration.
|
// Forward declaration.
|
||||||
formula
|
formula
|
||||||
simplify_recursively(formula f, ltl_simplifier_cache* c);
|
simplify_recursively(formula f, tl_simplifier_cache* c);
|
||||||
|
|
||||||
// X(a) R b or X(a) M b
|
// X(a) R b or X(a) M b
|
||||||
// This returns a.
|
// This returns a.
|
||||||
|
|
@ -654,7 +654,7 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mospliter(unsigned split, ltl_simplifier_cache* cache)
|
mospliter(unsigned split, tl_simplifier_cache* cache)
|
||||||
: split_(split), c_(cache),
|
: split_(split), c_(cache),
|
||||||
res_GF{(split_ & Split_GF) ? new vec : nullptr},
|
res_GF{(split_ & Split_GF) ? new vec : nullptr},
|
||||||
res_FG{(split_ & Split_FG) ? new vec : nullptr},
|
res_FG{(split_ & Split_FG) ? new vec : nullptr},
|
||||||
|
|
@ -672,7 +672,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mospliter(unsigned split, vec v, ltl_simplifier_cache* cache)
|
mospliter(unsigned split, vec v, tl_simplifier_cache* cache)
|
||||||
: mospliter(split, cache)
|
: mospliter(split, cache)
|
||||||
{
|
{
|
||||||
for (auto f: v)
|
for (auto f: v)
|
||||||
|
|
@ -683,7 +683,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
mospliter(unsigned split, formula mo,
|
mospliter(unsigned split, formula mo,
|
||||||
ltl_simplifier_cache* cache)
|
tl_simplifier_cache* cache)
|
||||||
: mospliter(split, cache)
|
: mospliter(split, cache)
|
||||||
{
|
{
|
||||||
unsigned mos = mo.size();
|
unsigned mos = mo.size();
|
||||||
|
|
@ -788,7 +788,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned split_;
|
unsigned split_;
|
||||||
ltl_simplifier_cache* c_;
|
tl_simplifier_cache* c_;
|
||||||
std::unique_ptr<vec> res_GF;
|
std::unique_ptr<vec> res_GF;
|
||||||
std::unique_ptr<vec> res_FG;
|
std::unique_ptr<vec> res_FG;
|
||||||
std::unique_ptr<vec> res_F;
|
std::unique_ptr<vec> res_F;
|
||||||
|
|
@ -807,7 +807,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
simplify_visitor(ltl_simplifier_cache* cache)
|
simplify_visitor(tl_simplifier_cache* cache)
|
||||||
: c_(cache), opt_(cache->options)
|
: c_(cache), opt_(cache->options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -2973,14 +2973,14 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ltl_simplifier_cache* c_;
|
tl_simplifier_cache* c_;
|
||||||
const ltl_simplifier_options& opt_;
|
const tl_simplifier_options& opt_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
formula
|
formula
|
||||||
simplify_recursively(formula f,
|
simplify_recursively(formula f,
|
||||||
ltl_simplifier_cache* c)
|
tl_simplifier_cache* c)
|
||||||
{
|
{
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
static int srec = 0;
|
static int srec = 0;
|
||||||
|
|
@ -3029,7 +3029,7 @@ namespace spot
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// ltl_simplifier_cache
|
// tl_simplifier_cache
|
||||||
|
|
||||||
|
|
||||||
// This implements the recursive rules for syntactic implication.
|
// This implements the recursive rules for syntactic implication.
|
||||||
|
|
@ -3037,7 +3037,7 @@ namespace spot
|
||||||
// appendix in the documentation for temporal logic operators.)
|
// appendix in the documentation for temporal logic operators.)
|
||||||
inline
|
inline
|
||||||
bool
|
bool
|
||||||
ltl_simplifier_cache::syntactic_implication_aux(formula f, formula g)
|
tl_simplifier_cache::syntactic_implication_aux(formula f, formula g)
|
||||||
{
|
{
|
||||||
// We first process all lines from the table except the
|
// We first process all lines from the table except the
|
||||||
// first two, and then we process the first two as a fallback.
|
// first two, and then we process the first two as a fallback.
|
||||||
|
|
@ -3278,7 +3278,7 @@ namespace spot
|
||||||
|
|
||||||
// Return true if f => g syntactically
|
// Return true if f => g syntactically
|
||||||
bool
|
bool
|
||||||
ltl_simplifier_cache::syntactic_implication(formula f,
|
tl_simplifier_cache::syntactic_implication(formula f,
|
||||||
formula g)
|
formula g)
|
||||||
{
|
{
|
||||||
// We cannot run syntactic_implication on SERE formulae,
|
// We cannot run syntactic_implication on SERE formulae,
|
||||||
|
|
@ -3331,7 +3331,7 @@ namespace spot
|
||||||
// If right==false, true if !f1 => f2, false otherwise.
|
// If right==false, true if !f1 => f2, false otherwise.
|
||||||
// If right==true, true if f1 => !f2, false otherwise.
|
// If right==true, true if f1 => !f2, false otherwise.
|
||||||
bool
|
bool
|
||||||
ltl_simplifier_cache::syntactic_implication_neg(formula f1,
|
tl_simplifier_cache::syntactic_implication_neg(formula f1,
|
||||||
formula f2,
|
formula f2,
|
||||||
bool right)
|
bool right)
|
||||||
{
|
{
|
||||||
|
|
@ -3350,26 +3350,26 @@ namespace spot
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
// ltl_simplifier
|
// tl_simplifier
|
||||||
|
|
||||||
ltl_simplifier::ltl_simplifier(const bdd_dict_ptr& d)
|
tl_simplifier::tl_simplifier(const bdd_dict_ptr& d)
|
||||||
{
|
{
|
||||||
cache_ = new ltl_simplifier_cache(d);
|
cache_ = new tl_simplifier_cache(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
ltl_simplifier::ltl_simplifier(const ltl_simplifier_options& opt,
|
tl_simplifier::tl_simplifier(const tl_simplifier_options& opt,
|
||||||
bdd_dict_ptr d)
|
bdd_dict_ptr d)
|
||||||
{
|
{
|
||||||
cache_ = new ltl_simplifier_cache(d, opt);
|
cache_ = new tl_simplifier_cache(d, opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
ltl_simplifier::~ltl_simplifier()
|
tl_simplifier::~tl_simplifier()
|
||||||
{
|
{
|
||||||
delete cache_;
|
delete cache_;
|
||||||
}
|
}
|
||||||
|
|
||||||
formula
|
formula
|
||||||
ltl_simplifier::simplify(formula f)
|
tl_simplifier::simplify(formula f)
|
||||||
{
|
{
|
||||||
if (!f.is_in_nenoform())
|
if (!f.is_in_nenoform())
|
||||||
f = negative_normal_form(f, false);
|
f = negative_normal_form(f, false);
|
||||||
|
|
@ -3377,68 +3377,68 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
formula
|
formula
|
||||||
ltl_simplifier::negative_normal_form(formula f, bool negated)
|
tl_simplifier::negative_normal_form(formula f, bool negated)
|
||||||
{
|
{
|
||||||
return nenoform_rec(f, negated, cache_);
|
return nenoform_rec(f, negated, cache_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ltl_simplifier::syntactic_implication(formula f1, formula f2)
|
tl_simplifier::syntactic_implication(formula f1, formula f2)
|
||||||
{
|
{
|
||||||
return cache_->syntactic_implication(f1, f2);
|
return cache_->syntactic_implication(f1, f2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ltl_simplifier::syntactic_implication_neg(formula f1,
|
tl_simplifier::syntactic_implication_neg(formula f1,
|
||||||
formula f2, bool right)
|
formula f2, bool right)
|
||||||
{
|
{
|
||||||
return cache_->syntactic_implication_neg(f1, f2, right);
|
return cache_->syntactic_implication_neg(f1, f2, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ltl_simplifier::are_equivalent(formula f, formula g)
|
tl_simplifier::are_equivalent(formula f, formula g)
|
||||||
{
|
{
|
||||||
return cache_->lcc.equal(f, g);
|
return cache_->lcc.equal(f, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ltl_simplifier::implication(formula f, formula g)
|
tl_simplifier::implication(formula f, formula g)
|
||||||
{
|
{
|
||||||
return cache_->lcc.contained(f, g);
|
return cache_->lcc.contained(f, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
ltl_simplifier::as_bdd(formula f)
|
tl_simplifier::as_bdd(formula f)
|
||||||
{
|
{
|
||||||
return cache_->as_bdd(f);
|
return cache_->as_bdd(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
formula
|
formula
|
||||||
ltl_simplifier::star_normal_form(formula f)
|
tl_simplifier::star_normal_form(formula f)
|
||||||
{
|
{
|
||||||
return cache_->star_normal_form(f);
|
return cache_->star_normal_form(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
formula
|
formula
|
||||||
ltl_simplifier::boolean_to_isop(formula f)
|
tl_simplifier::boolean_to_isop(formula f)
|
||||||
{
|
{
|
||||||
return cache_->boolean_to_isop(f);
|
return cache_->boolean_to_isop(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd_dict_ptr
|
bdd_dict_ptr
|
||||||
ltl_simplifier::get_dict() const
|
tl_simplifier::get_dict() const
|
||||||
{
|
{
|
||||||
return cache_->dict;
|
return cache_->dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ltl_simplifier::print_stats(std::ostream& os) const
|
tl_simplifier::print_stats(std::ostream& os) const
|
||||||
{
|
{
|
||||||
cache_->print_stats(os);
|
cache_->print_stats(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ltl_simplifier::clear_as_bdd_cache()
|
tl_simplifier::clear_as_bdd_cache()
|
||||||
{
|
{
|
||||||
cache_->clear_as_bdd_cache();
|
cache_->clear_as_bdd_cache();
|
||||||
cache_->lcc.clear();
|
cache_->lcc.clear();
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
class ltl_simplifier_options
|
class tl_simplifier_options
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ltl_simplifier_options(bool basics = true,
|
tl_simplifier_options(bool basics = true,
|
||||||
bool synt_impl = true,
|
bool synt_impl = true,
|
||||||
bool event_univ = true,
|
bool event_univ = true,
|
||||||
bool containment_checks = false,
|
bool containment_checks = false,
|
||||||
|
|
@ -50,8 +50,8 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ltl_simplifier_options(int level) :
|
tl_simplifier_options(int level) :
|
||||||
ltl_simplifier_options(false, false, false)
|
tl_simplifier_options(false, false, false)
|
||||||
{
|
{
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
|
@ -90,17 +90,17 @@ namespace spot
|
||||||
};
|
};
|
||||||
|
|
||||||
// fwd declaration to hide technical details.
|
// fwd declaration to hide technical details.
|
||||||
class ltl_simplifier_cache;
|
class tl_simplifier_cache;
|
||||||
|
|
||||||
/// \ingroup tl_rewriting
|
/// \ingroup tl_rewriting
|
||||||
/// \brief Rewrite or simplify \a f in various ways.
|
/// \brief Rewrite or simplify \a f in various ways.
|
||||||
class SPOT_API ltl_simplifier
|
class SPOT_API tl_simplifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ltl_simplifier(const bdd_dict_ptr& dict = make_bdd_dict());
|
tl_simplifier(const bdd_dict_ptr& dict = make_bdd_dict());
|
||||||
ltl_simplifier(const ltl_simplifier_options& opt,
|
tl_simplifier(const tl_simplifier_options& opt,
|
||||||
bdd_dict_ptr dict = make_bdd_dict());
|
bdd_dict_ptr dict = make_bdd_dict());
|
||||||
~ltl_simplifier();
|
~tl_simplifier();
|
||||||
|
|
||||||
/// Simplify the formula \a f (using options supplied to the
|
/// Simplify the formula \a f (using options supplied to the
|
||||||
/// constructor).
|
/// constructor).
|
||||||
|
|
@ -193,9 +193,9 @@ namespace spot
|
||||||
void print_stats(std::ostream& os) const;
|
void print_stats(std::ostream& os) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ltl_simplifier_cache* cache_;
|
tl_simplifier_cache* cache_;
|
||||||
// Copy disallowed.
|
// Copy disallowed.
|
||||||
ltl_simplifier(const ltl_simplifier&) = delete;
|
tl_simplifier(const tl_simplifier&) = delete;
|
||||||
void operator=(const ltl_simplifier&) = delete;
|
void operator=(const tl_simplifier&) = delete;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
translate_dict(twa_graph_ptr& a, ltl_simplifier* ls, bool exprop,
|
translate_dict(twa_graph_ptr& a, tl_simplifier* ls, bool exprop,
|
||||||
bool single_acc, bool unambiguous)
|
bool single_acc, bool unambiguous)
|
||||||
: a_(a),
|
: a_(a),
|
||||||
dict(a->get_dict()),
|
dict(a->get_dict()),
|
||||||
|
|
@ -156,7 +156,7 @@ namespace spot
|
||||||
|
|
||||||
twa_graph_ptr& a_;
|
twa_graph_ptr& a_;
|
||||||
bdd_dict_ptr dict;
|
bdd_dict_ptr dict;
|
||||||
ltl_simplifier* ls;
|
tl_simplifier* ls;
|
||||||
mark_tools mt;
|
mark_tools mt;
|
||||||
|
|
||||||
typedef bdd_dict::fv_map fv_map;
|
typedef bdd_dict::fv_map fv_map;
|
||||||
|
|
@ -1886,9 +1886,9 @@ namespace spot
|
||||||
ltl_to_tgba_fm(formula f2, const bdd_dict_ptr& dict,
|
ltl_to_tgba_fm(formula f2, const bdd_dict_ptr& dict,
|
||||||
bool exprop, bool symb_merge, bool branching_postponement,
|
bool exprop, bool symb_merge, bool branching_postponement,
|
||||||
bool fair_loop_approx, const atomic_prop_set* unobs,
|
bool fair_loop_approx, const atomic_prop_set* unobs,
|
||||||
ltl_simplifier* simplifier, bool unambiguous)
|
tl_simplifier* simplifier, bool unambiguous)
|
||||||
{
|
{
|
||||||
ltl_simplifier* s = simplifier;
|
tl_simplifier* s = simplifier;
|
||||||
|
|
||||||
// Simplify the formula, if requested.
|
// Simplify the formula, if requested.
|
||||||
if (s)
|
if (s)
|
||||||
|
|
@ -1903,7 +1903,7 @@ namespace spot
|
||||||
// negations on the atomic propositions. We also suppress
|
// negations on the atomic propositions. We also suppress
|
||||||
// logic abbreviations such as <=>, =>, or XOR, since they
|
// logic abbreviations such as <=>, =>, or XOR, since they
|
||||||
// would involve negations at the BDD level.
|
// would involve negations at the BDD level.
|
||||||
s = new ltl_simplifier(dict);
|
s = new tl_simplifier(dict);
|
||||||
f2 = s->negative_normal_form(f2, false);
|
f2 = s->negative_normal_form(f2, false);
|
||||||
}
|
}
|
||||||
assert(f2.is_in_nenoform());
|
assert(f2.is_in_nenoform());
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ namespace spot
|
||||||
/// representing each state of the automaton will be simplified
|
/// representing each state of the automaton will be simplified
|
||||||
/// before computing the successor. \a simpl should be configured
|
/// before computing the successor. \a simpl should be configured
|
||||||
/// for the type of reduction you want, see
|
/// for the type of reduction you want, see
|
||||||
/// spot::ltl_simplifier. This idea is taken from the
|
/// spot::tl_simplifier. This idea is taken from the
|
||||||
/// following paper.
|
/// following paper.
|
||||||
/** \verbatim
|
/** \verbatim
|
||||||
@InProceedings{ thirioux.02.fmics,
|
@InProceedings{ thirioux.02.fmics,
|
||||||
|
|
@ -145,6 +145,6 @@ namespace spot
|
||||||
bool branching_postponement = false,
|
bool branching_postponement = false,
|
||||||
bool fair_loop_approx = false,
|
bool fair_loop_approx = false,
|
||||||
const atomic_prop_set* unobs = nullptr,
|
const atomic_prop_set* unobs = nullptr,
|
||||||
ltl_simplifier* simplifier = nullptr,
|
tl_simplifier* simplifier = nullptr,
|
||||||
bool unambiguous = false);
|
bool unambiguous = false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -558,7 +558,7 @@ namespace spot
|
||||||
bool res;
|
bool res;
|
||||||
if (algo == 0) // Equivalence check
|
if (algo == 0) // Equivalence check
|
||||||
{
|
{
|
||||||
ltl_simplifier ls;
|
tl_simplifier ls;
|
||||||
res = ls.are_equivalent(f, g);
|
res = ls.are_equivalent(f, g);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace spot
|
||||||
|
|
||||||
void translator::build_simplifier(const bdd_dict_ptr& dict)
|
void translator::build_simplifier(const bdd_dict_ptr& dict)
|
||||||
{
|
{
|
||||||
ltl_simplifier_options options(false, false, false);
|
tl_simplifier_options options(false, false, false);
|
||||||
switch (level_)
|
switch (level_)
|
||||||
{
|
{
|
||||||
case High:
|
case High:
|
||||||
|
|
@ -58,7 +58,7 @@ namespace spot
|
||||||
options.event_univ = true;
|
options.event_univ = true;
|
||||||
// fall through
|
// fall through
|
||||||
}
|
}
|
||||||
simpl_owned_ = simpl_ = new ltl_simplifier(options, dict);
|
simpl_owned_ = simpl_ = new tl_simplifier(options, dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
twa_graph_ptr translator::run(formula* f)
|
twa_graph_ptr translator::run(formula* f)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace spot
|
||||||
class SPOT_API translator: protected postprocessor
|
class SPOT_API translator: protected postprocessor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
translator(ltl_simplifier* simpl, const option_map* opt = nullptr)
|
translator(tl_simplifier* simpl, const option_map* opt = nullptr)
|
||||||
: postprocessor(opt), simpl_(simpl), simpl_owned_(nullptr)
|
: postprocessor(opt), simpl_(simpl), simpl_owned_(nullptr)
|
||||||
{
|
{
|
||||||
assert(simpl);
|
assert(simpl);
|
||||||
|
|
@ -114,8 +114,8 @@ namespace spot
|
||||||
void build_simplifier(const bdd_dict_ptr& dict);
|
void build_simplifier(const bdd_dict_ptr& dict);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ltl_simplifier* simpl_;
|
tl_simplifier* simpl_;
|
||||||
ltl_simplifier* simpl_owned_;
|
tl_simplifier* simpl_owned_;
|
||||||
int comp_susp_;
|
int comp_susp_;
|
||||||
int early_susp_;
|
int early_susp_;
|
||||||
int skel_wdba_;
|
int skel_wdba_;
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ if not f:
|
||||||
finish()
|
finish()
|
||||||
|
|
||||||
# Formula simplifications
|
# Formula simplifications
|
||||||
simpopt = spot.ltl_simplifier_options(False, False, False,
|
simpopt = spot.tl_simplifier_options(False, False, False,
|
||||||
False, False, False, True)
|
False, False, False, True)
|
||||||
dored = False
|
dored = False
|
||||||
for r in form.getlist('r'):
|
for r in form.getlist('r'):
|
||||||
|
|
@ -480,7 +480,7 @@ for r in form.getlist('r'):
|
||||||
if dored:
|
if dored:
|
||||||
# Not keeping the ltl simplifier aive will also clear the as_bdd()
|
# Not keeping the ltl simplifier aive will also clear the as_bdd()
|
||||||
# cache.
|
# cache.
|
||||||
f = spot.ltl_simplifier(simpopt).simplify(f)
|
f = spot.tl_simplifier(simpopt).simplify(f)
|
||||||
|
|
||||||
# Formula manipulation only.
|
# Formula manipulation only.
|
||||||
if output_type == 'f':
|
if output_type == 'f':
|
||||||
|
|
|
||||||
|
|
@ -677,7 +677,7 @@ def randltl(ap, n=-1, **kwargs):
|
||||||
def simplify(f, **kwargs):
|
def simplify(f, **kwargs):
|
||||||
level = kwargs.get('level', None)
|
level = kwargs.get('level', None)
|
||||||
if level is not None:
|
if level is not None:
|
||||||
return ltl_simplifier(ltl_simplifier_options(level)).simplify(f)
|
return tl_simplifier(tl_simplifier_options(level)).simplify(f)
|
||||||
|
|
||||||
basics = kwargs.get('basics', True)
|
basics = kwargs.get('basics', True)
|
||||||
synt_impl = kwargs.get('synt_impl', True)
|
synt_impl = kwargs.get('synt_impl', True)
|
||||||
|
|
@ -689,7 +689,7 @@ def simplify(f, **kwargs):
|
||||||
boolean_to_isop = kwargs.get('boolean_to_isop', False)
|
boolean_to_isop = kwargs.get('boolean_to_isop', False)
|
||||||
favor_event_univ = kwargs.get('favor_event_univ', False)
|
favor_event_univ = kwargs.get('favor_event_univ', False)
|
||||||
|
|
||||||
simp_opts = ltl_simplifier_options(basics,
|
simp_opts = tl_simplifier_options(basics,
|
||||||
synt_impl,
|
synt_impl,
|
||||||
event_univ,
|
event_univ,
|
||||||
cont_checks,
|
cont_checks,
|
||||||
|
|
@ -698,7 +698,7 @@ def simplify(f, **kwargs):
|
||||||
reduce_size_strictly,
|
reduce_size_strictly,
|
||||||
boolean_to_isop,
|
boolean_to_isop,
|
||||||
favor_event_univ)
|
favor_event_univ)
|
||||||
return ltl_simplifier(simp_opts).simplify(f)
|
return tl_simplifier(simp_opts).simplify(f)
|
||||||
|
|
||||||
|
|
||||||
for fun in dir(formula):
|
for fun in dir(formula):
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import buddy
|
||||||
import spot
|
import spot
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
simp = spot.ltl_simplifier()
|
simp = spot.tl_simplifier()
|
||||||
|
|
||||||
e = spot.default_environment.instance()
|
e = spot.default_environment.instance()
|
||||||
p = spot.empty_parse_error_list()
|
p = spot.empty_parse_error_list()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue