Commit graph

1727 commits

Author SHA1 Message Date
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
Alexandre Duret-Lutz
98f67973eb Speedup minimize_obligation() when f->is_syntactic_obligation().
* src/tgbaalgos/minimize.cc (minimize_obligation): Do not check
the output of minimize_wdba if the input formula is a syntactic
obligation.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
c483053a85 Add documentation for temporal logic operators.
* doc/tl/Makefile.am, doc/tl/tl.tex, doc/tl/tl.bib: New files.
* doc/Makefile.am (SUBDIRS): Recurse into tl/.
* configure.ac: Output doc/tl/Makefile
* README: Describe doc/tl/.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
b3cc033e92 Trim DFAs used when translating PSL's closure operators.
This fixes a bug where {(a&!a)[=2]} was translated either into an
universal automaton (with simplification turned off) or in an
empty automaton (with simplification turned on).

* src/tgbaalgos/ltl2tgba_fm.cc (ratexp_to_dfa::translate): Trim
the automaton.
(ratexp_to_dfa::succ, ratexp_to_dfa::get_label): Deal with trimed
states.
(ltl_trad_visitor::visit(unop::Closure)): Likewise.
* src/tgbatest/ltl2tgba.test, src/ltltest/reduccmp.test: New test
cases.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
d1530de125 Setup machinery to build DFA when translating some PSL operators.
This is especially important when translating the Closure
operators, because normally we should only keep the satisfiable
formulae (i.e. co-accessible states), which seems hard to check on
the fly.  After this patch we need to teach
ratexp_to_dfa::translate() how to trim (and then minimize) the DFA
to prune those useless (non co-accessible) states.

* src/tgbaalgos/ltl2tgba_fm.cc (ratexp_to_dfa): New class.
(translate_dict::transdfa): New member.
(ltl_trad_visitor::visit(unop::Closure)): Use transdfa.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
2f03649324 Generalize syntactic implication for event. and univ. formulae.
* src/ltlvisit/simplify.cc (syntactic_implication_aux): Refine
rules to deal with pure eventualities and purely universal
properties.
* src/ltltest/reduccmp.test: Add tests.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
07e40e706a Translate Boolean formulae as BDD using the ltl_simplifier cache.
* src/ltlvisit/simplify.hh, src/ltlvisit/simplify.cc
(ltl_simplifier::ltl_simplifier, ltl_simplifier::get_dict): Make
it possible to supply and retrieve the dictionary used.
(ltl_simplifier::as_bdd): New function, exported from the cache.
* src/tgbaalgos/ltl2tgba_fm.cc (translate_dict): Store the
ltl_simplifier object.
(translate_dict::boolean_to_bdd): Call ltl_simplifier::as_bdd.
(translate_ratexp): New wrapper around the ratexp_trad_visitor,
calling boolean_to_bdd whenever possible.
(ratexp_trad_visitor): Do not deal with negated formulae, there
are necessarily Boolean and handled by translate_ratexp().
(ltl_visitor): Adjust to call translate_ratexp.
(ltl_to_tgba_fm): Adjust passing of the ltl_simplifier to the
translate_dict, and make sure everybody is using the same
dictionary.
* src/tgbatest/ltl2tgba.cc: Pass the dictionary to the
ltl_simplifier.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
369ad87e50 Rewrite syntactic implication using a single function.
* src/ltlvisit/simplify.cc (inf_left_recurse_visitor,
inf_right_recurse_visitor): Remove.
(syntactic_implication, syntactic_implication_aux): Rewrite all
rules for syntactic implication.
(syntactic_implication_neg): Simplify.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
7514cc15ee Decrease the maximum bound used in random BUnOps.
* src/ltlvisit/randomltl.cc (bunop_bounded_builder,
bunop_bool_bounded_builder): Set the maximum value
to 3 instead of 4, to speed up the test suite.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
c54627bebd Avoid containment checks on equal formulae.
* src/ltlvisit/contain.cc
(language_containment_checker::contained,
language_containment_checker::neg_contained,
language_containment_checker::contained_neg): Detect
cases where both formulae are equal.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
58bbaa0859 Fix translation of '{(c&!c)[->0..1]}!'.
* src/tgbaalgos/ltl2tgba_fm.cc (ratexp_trad_visitor::visit): Fix
the translation of the Goto operator.
(ratexp_trad_visitor::next_to_concat): More comments.
* src/ltltest/reduccmp.test: Add a test case.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
1507dbc63a Fix a Clang-2.9 warning.
* src/tgbaalgos/ltl2tgba_fm.cc (trace_ltl_bdd):
Declare as unused.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
7f7627bf22 Check that reductions are legitimates with containment.
* src/ltlvisit/simplify.cc, src/ltlvisit/simplify.hh
(are_equivalent): Export this function from the cache.
* src/ltltest/reduc.cc, src/ltltest/equals.cc: Use
are_equivalent() to check that the reductions are legitimate.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
cd9369c186 Fix universal and eventual rules for M and W.
* src/ltlast/binop.cc: a M b is eventual if both a and b are
eventual, or if b == 1.  a W b is universal if both a and b
are universal or if b == 0.
* src/ltltest/kind.test: New test case.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
c9a659c8d4 Compare Boolean LTL formulae using BDDs.
* src/ltlvisit/simplify.cc (syntactic_implication): Here.
2012-04-28 09:34:43 +02:00
Alexandre Duret-Lutz
fea49630f6 Merge the syntactic implication code with ltl_simplifier.
So that we can latter use some combined optimizations.

* src/ltlvisit/simplify.hh, src/ltlvisit/simplify.cc: Integrate
the code from syntimpl.cc
* src/ltlvisit/syntimpl.hh, src/ltlvisit/syntimpl.cc: Delete.  All
code has been moved above.
* src/ltlvisit/Makefile.am: Adjust.
* src/ltltest/syntimpl.cc: Adjust code.
2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
3db13a6f97 * src/ltlvisit/simplify.cc: More comments. 2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
03fd46a13b Rewrite xor, =>, and <=> in negative_normal_form().
* src/ltlvisit/simplify.hh, src/ltlvisit/simplify.cc
(ltl_simplify::negative_normal_form): Remove the third
parameter and always rewrite XOR, =>, and <=>.  This avoid
problems with the cache, that could have been populated with
a different value for this third parameter.
* src/ltltest/reduc.cc, src/tgbaalgos/ltl2tgba_fm.cc: Adjust
calls to negative_normal_form().
* src/ltltest/nenoform.test: Adjust tests.
2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
b89f86edcf Mark reduce_tau03() as deprecated.
* src/ltlvisit/contain.hh (reduce_tau03): Mark as deprecated.
* src/tgbaalgos/ltl2tgba_fm.cc, src/tgbatest/ltl2tgba.cc,
src/ltltest/equals.cc: Do not include ltlvisit/contain.hh, since
it's not used.
2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
5c1729d6e4 Remove basicreduce files. ltl_simplifier does all the work.
* src/ltlvisit/basicreduce.cc, src/ltlvisit/basicreduce.hh: Delete.
* src/ltlvisit/Makefile.am: Remove them.
2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
67f4e8b5ce Deprecate reduce() in favor of ltl_simplifier.
* src/ltlvisit/reduce.hh: Mark the file as obsolete.
(reduce): Declare this function as obsolete.
* src/ltlvisit/reduce.cc: Define SKIP_DEPRECATED_WARNING
so we can include reduce.hh.
* src/sanity/includes.test: Also use SKIP_DEPRECATED_WARNING
when compiling headers.
* iface/dve2/dve2check.cc,
src/ltltest/equals.cc, src/ltltest/randltl.cc,
src/ltltest/reduc.cc, src/tgbaalgos/ltl2tgba_fm.hh,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbatest/randtgba.cc,
wrap/python/ajax/spot.in, wrap/python/spot.i: Adjust
to use ltl_simplifier.
* src/tgbatest/ltl2tgba.cc: Adjust to use ltl_simplifier,
and replace -fr1...-fr7 options by a single -fr option.
* src/tgbatest/spotlbtt.test: Adjust -fr flags accordingly.
* src/tgbatest/reductgba.cc: Do not include reduce.hh.
2012-04-28 09:34:42 +02:00
Alexandre Duret-Lutz
c0085a8f30 Move the remaining reduce() logic into ltl_simplifier.
* src/ltlvisit/simplify.hh
(ltl_simplifier::negative_normal_form): Allow logical
unabbreviations during the NNF pass.
* src/ltlvisit/simplify.cc
(ltl_simplifier::negative_normal_form)
(negative_normal_form_visitor): Adjust.
(ltl_simplifier::simplify): Request unabbreviations.
* src/ltlvisit/reduce.cc (reduce): Remove most
of the code, leaving only a call ltl_simplifier
and some wrapper code to convert options.
* src/ltltest/reduccmp.test: Add more test cases.
2012-04-28 09:30:37 +02:00
Alexandre Duret-Lutz
d4d4c0e7d3 Typo in the code rewriting "a M 1 = Fa".
* src/ltlvisit/simplify.cc (simplify_visitor): Fix it,
and leave the trace code.
2012-04-28 09:30:37 +02:00
Alexandre Duret-Lutz
c2335edb57 Remove the negative_normal_form call from reduce().
* src/ltlvisit/simplify.cc (ltl_simplifier::simplify):
Convert in negative normal form if needed.
* src/ltlvisit/reduce.cc (reduce): Do not call
negative_normal_form().
2012-04-28 09:30:37 +02:00
Alexandre Duret-Lutz
1087c62356 Move language containment into ltl_simplifier.
* src/ltlvisit/simplify.cc: Integrate the tau03
containment rules.
* src/ltlvisit/simplify.hh: Add options to select simplifications.
* src/ltlvisit/reduce.cc (reduce): Do not call reduce_tau03().
* src/ltlvisit/contain.cc (reduce_tau03_visitor): Remove.
(reduce_tau03): Implement it using ltl_simplifier.
2012-04-28 09:30:37 +02:00