Commit graph

1751 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
5ce59c011c ltl2tgba.html: Provide a link to an SVG output. Suggested by Denis.
Because this means we are running dot twice, I have added a flag that
will allow us to easily turn this off, should it prove too slow.

* wrap/python/ajax/spot.in (output_both): New variable.
(run_dot): New function, extracted from ...
(render_dot): ... here.  Adjust to call run_dot for all needed format.
And ajust the output accordingly.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
277ae7ddfb ltl::dotty: Number children for Concat and Fusion.
* src/ltlvisit/dotty.cc (dotty_visitor): Replace the "dir" attribute
by a childnum attribute used to number children.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
266bd25ba5 ltl2tgba.html: lists PSL operators in the help text.
* wrap/python/ajax/ltl2tgba.html: Revamp the syntax table to include
PSL operators.
* wrap/python/ajax/css/ltl2tgba.css: Adjust CSS as needed.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
412f946ac0 Use []=> and <>=> as sugar in the output when possible.
* src/ltlast/multop.hh (is_multop): Take a constant formula as input.
* src/ltlvisit/tostring.cc (to_string_visitor::visit(multop*)):
Output []=> or <>=> when the left argument of a []-> or <>-> is
a concatenation that ends in 1.
* doc/tl/tl.tex: Document this desugaring.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
5e7c0add49 Move helper functions from simplify.cc to the AST files.
* src/ltlvisit/simplify.cc (spot::ltl::is_And, spot::ltl::is_F,
spot::ltl::is_FG, spot::ltl::is_G, spot::ltl::is_GF, spot::ltl::is_M,
spot::ltl::is_Or, spot::ltl::is_R, spot::ltl::is_U, spot::ltl::is_W,
spot::ltl::is_X, spot::ltl::is_binop, spot::ltl::is_constant,
spot::ltl::is_multop, spot::ltl::is_unop): Move ...
* src/ltlast/binop.hh, src/ltlast/constant.hh, src/ltlast/multop.hh
src/ltlast/unop.hh: ... here, as appropriate.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
aa4b68fcfc Simplify some simplification code using but_all().
* src/ltlvisit/simplify.cc: Use but_all() to simplify code.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
955fc041ca Reduce 'a|(b&X(b U a))' to 'b U a', plus three simular rules.
* src/ltlast/multop.hh, src/ltlast/multop.cc (all_but): New method
used to simplify the removal of one element of a multop.
* src/ltlvisit/simplify.cc: Implement the new rewriting rules.
* doc/tl/tl.tex: Document them.
* src/ltltest/reduccmp.test: Test them.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
bb56c26d1c Rewrite "(Xc) M b" as "b & X(b U c)", plus three similar rules.
* src/ltlvisit/simplify.hh (ltl_simplifier_options): New option
reduce_size_stricly.
* src/ltlvisit/simplify.cc (simplify_visitor): Implement these
rules.
* src/ltltest/reduc.cc: Check with reduce_size_strictly unset or
set, but only use the latter result to check sizes.
* src/ltltest/reduccmp.test: Test them.
* doc/tl/tl.tex: Document them.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
c9b34d684a * src/ltlvisit/tostring.cc: Output <-> and -> instead of <=> and =>. 2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
1ddafc1cb4 Move the U,W,R,M equivalences to an appendix.
* doc/tl/tl.tex (Other Equivalences): Move...
(Defining LTL with only one of $\U$, $\W$, $\R$, or $\M$): ... here.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
e6e85999de Add new simplification rules like: "a | (Xa R b)" gives "b U a".
* src/ltlvisit/simplify.cc: Add new rules.
* doc/tl/tl.tex: Document them.
* src/ltltest/reduccmp.test: Add test cases.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
005988530e Augment the Syntactic Hierarchy Classes grammar with ->, <-> and xor.
* doc/tl/tl.tex (Syntactic Hierarchy Classes): Document the ->,
<->, and xor operators.  Also add a \phi_F class.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
54fd973a90 Fix computation of syntactic classes for Implies.
* src/ltlast/binop.cc (binop::binop): Fix computation
of syntactic guarantee and syntactic obligation for the Implies
operator.  Reported by Étienne Renault.
* src/ltltest/kind.test: Add more tests.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
395793d986 Rewrite a&XGa as Ga, and a|XFa as Fa.
The actual rules are a bit more complex:
a & X(G(a&b...)&c...) = Ga & X(G(b...)&c...)
a | X(Fa | c) = F(a) | c
with the second rule being applied only if all XF can
be removed.  See the documentation for an example.

* src/ltlvisit/simplify.cc: Implement these new rules.
* doc/tl/tl.tex: Document them.
* src/ltltest/reduccmp.test: Add test cases.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
58f99203ad * doc/tl/Makefile.am: Fix timestamp issue causing distcheck failure. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
54d4a0a093 Rewrite F(a M b) as F(a & b), and G(a W b) as G(a | b).
* src/ltlvisit/simplify.cc: Implement these rules.
* src/ltltest/reduccmp.test: Add tests.
* doc/tl/tl.tex: Document them.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
212c7ebdd7 Add implication-based rewritings from Babiak et al. (TACAS'12)
* src/ltlvisit/simplify.cc: Implement them here, and augment them
to support M, and W operators.
* src/ltltest/reduccmp.test: Add some tests.
* doc/tl/tl.tex (Simplifications Based on Implications): Document
these rules.
* doc/tl/tl.bib (babiak.12.tacas): New entry.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
ed0dd0b48d Add a new length_boolone() function to fix an assert in randpsl.
* src/ltlvisit/length.hh (length_boolone): New function.
* src/ltlvisit/length.cc (length_boolone): Implement it using...
(length_boolone_visitor): ... this new visitor.
* src/ltltest/randltl.cc: Use length_boolone() to check the result
of the random generator, and ignore any formula larger (in
length()) than opt_f.  This fix a bug where the random formula
generator would sometime produce formula larger than requested,
because of the trivial rewriting of {f}[]->e as e|!f.
* src/ltltest/length.cc: Add option -b to call length_boolone().
* src/ltltest/length.test: Test length_boolone().
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
c2ab4e781b Rewrite "a U (a&b)" as "b M a", and "a W (a&b)" as "b R a".
* src/ltlvisit/simplify.cc (simplify_visitor): Implement these
rules.
* doc/tl/tl.tex: Document these rules.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
55a1c6c12f Fix compilation of tl.tex in VPATH builds.
* doc/tl/Makefile.am (LATEXMK): Set BIBINPUTS for VPATH builds.
(EXTRA_DIST): Distribute tl.tex and tl.bib.
($(srcdir)/tl.pdf): Fix update in srcdir.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
0536cdfb9b Fix a g++ warning about possibly uninitialized variable.
* src/ltlvisit/simplify.cc (simplify_visitor::visit(multop)):
Initialize `ri' to kill a warning.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
dd52768932 Support the PSL syntax [*1:inf], as a synonym for [*1:].
* src/ltlparse/ltlscan.ll: Parse "inf" as OP_UNBOUNDED.
* src/ltltest/equals.test: Add some tests.
* doc/tl/tl.tex: Document it.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
d0a8e6d6f5 * doc/tl/Makefile.am (LATEXMK): Support an older version of latexmk. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
8c077b662d * doc/tl/tl.tex: Various minor improvements. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
2c37367075 * doc/tl/tl.tex: More text for the temporal hierarchy. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
dc5a0620b7 * doc/tl/tl.tex: Fix trivial identities for AndNLM. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
72609185b8 Fix drawing a bonup operators in the AST.
* src/ltlvisit/dotty.cc (dotty_visitor::visit): Do not
declare bunop as sinks.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
fa44383efb Replace reference to RATEXP in the parser, by reference to SERE.
* src/ltlparse/ltlparse.yy: Cleanup the names used in the grammar.
* src/ltlparse/public.hh (parse_ratexp): Rename as...
(parse_sere): ... this.
* src/ltltest/consterm.cc: Adjust call to parse_ratexp().
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
3d183d68c8 Make sure PSL formulae are translated with the FM translation online.
* wrap/python/ajax/spot.in: Diagnose attempt to use LaCIM or Tau
on PSL formulae.
* wrap/python/ajax/css/ltl2tgba.css (.ltl2tgba .error): New entry.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
3dfde9e85f Make sure PSL formulae are translated with the FM translation.
* src/tgbatest/ltl2tgba.cc: Diagnose attempt to use -l and -taa
on PSL formulae.  Switch back to -f for these formulae.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
9e92267c70 more files to ignore 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
fef1547bc3 Use `SERE' consistently. Add more references.
* doc/tl/tl.tex: Replace all occurrences of ``rational
[expression]'' by SERE.  Add a couple of more notes and
bibliographic references.
* doc/tl/tl.bib: More entries.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
b03935a4cf Simplify {r1;b1}&&{r2;b2} or {b1:r1}&&{b2:r2}, or similar.
* src/ltlvisit/simplify.cc: Add four rules.
* doc/tl/tl.tex: Document these rules.
* src/ltltest/reduccmp.test: Add tests.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
2f9f274a5f Diagnose reversed ranges like [=2..1], [->..0] or [*8..4].
* src/ltlparse/ltlparse.yy: Diagnose them.
* src/ltltest/parseerr.test: Add tests.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
ec9a3f96cb * src/ltlvisit/postfix.cc: Fix recursion on bunop formulae. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
2a4f181737 * doc/tl/tl.tex: Fix footnote the the property table. 2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
775438422d Remove a dynamic_cast.
* src/tgbaalgos/ltl2tgba_fm.cc (translate_ratexp): Replace
a dynamic cast by a call to kind().
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
614810c0db Simplify {b && {r1;...;rn}}.
* doc/tl/tl.tex: Document the rules.
* src/ltlvisit/simplify.cc (simplify_visitor): Implement them.
* src/ltltest/reduccmp.test: Test them.
2012-04-28 09:34:44 +02:00
Alexandre Duret-Lutz
d0cfd44ba6 Simplify {b && {r1:...:rn}} as {b && r1 && ... && rn}.
* src/ltlvisit/simplify.cc (simplify_visitor): Do it.
* src/ltltest/reduccmp.test: Add a test.
* doc/tl/tl.tex: Document it.
* src/ltlast/multop.cc: Fix the computation of is.accepting_eword
for Fusion.  The Fusion operator never accepts [*0].
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
77084747b9 Simplify {b && r[*]} as {b && r}; likewise for [->] and [=].
* src/ltlvisit/simplify.cc (simplify_visitor): Do it.
* src/ltltest/reduccmp.test: Add more tests.
* doc/tl/tl.tex: Document it.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
e61c01b826 * doc/tl/tl.tex: Document operator precedence. 2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
2f46267117 Use latexmk to build tl.tex.
* doc/tl/Makefile.am: Rewrite using latexmk instead of texi2dvi.
Also define the SpotVersion when calling latexmk, not in tl.tex.
* doc/tl/tl.tex: Assume SpotVersion is defined outside the file.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
0f11e5fe0e Speedup mark_concat_ops() and simplify_mark() with a cache.
* src/ltlvisit/mark.hh, src/ltlvisit/mark.cc (mark_concat_ops,
simplify_mark): Rewrite these two functions as methods of
(mark_tools): this new class.
* src/ltlast/binop.cc, src/ltlast/unop.cc: Adjust computation
of not_marked to ignore marked operators that are not at
the top-level.  I.e., something like X(!{a}) is not marked.
* src/tgbaalgos/ltl2tgba_fm.cc (translate_dict::mt): New
instance of mark_tools.
(formula_canonizer::translate) Adjust calls to
mark_concat_ops() and simplify_mark().
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
f68f639e68 Rewrite {b}<>->f as (!b)|f instead of b->f.
* src/ltlast/binop.cc, src/ltlast/binop.hh: Here.
* doc/tl/tl.tex, src/ltltest/equals.test: Adjust.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
098e121a36 Ignore sub-"SERE" that have been proved useless already.
* src/tgbaalgos/ltl2tgba_fm.cc (ratexp_to_dfa::translate): Do not
translate a subformula if we have already proved it useless in
a previous rational expression.
* src/tgbatest/ltl2tgba.test: Add an example, although that
test does not ensure the subformula is ignored early in the
translation.  I.e., it would still work without the patch.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
b6702fc23a [buddy] Speedup hash functions.
* src/kernel.h (PAIR, TRIPLE): Redefine these hash functions
using something that is simpler to compute.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
4ba60dad28 Speedup construction of transitions in ltl_to_tgba_fm.
* src/tgbaalgos/ltl2tgba_fm.cc (ratexp_to_dfa::translate,
ltl_to_tgba_fm): Do not convert labels as Boolean formulas before
creating transitions.  Use the bdd directly, and register the used
transitions later.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
b67852a5ff Reuse Boolean->BDD translations performed during simplification.
* src/tgbaalgos/ltl2tgba_fm.cc (translate_dict::ltl_to_bdd):
Use boolean_to_bdd()
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
f590ca4e96 Cache the LTL->BDD translation for every subformulae.
We used to cache it only for formulas used as states.

* src/tgbaalgos/ltl2tgba_fm.cc (translate_dict::ltl_to_bdd): New method.
(ltl_trad_visitor::recurse): Use ltl_to_bdd().
(formula_canonizer): Likewise.
(ltl_to_tgba_fm): Adjust.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
77d704ea9e Add trivial identity {b}=b and !{b}=!b for any Boolean formula b.
* src/ltlast/unop.cc: Perform the simplification.
* src/ltlast/unop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Adjust test cases.
2012-04-28 09:34:43 +02:00