Commit graph

1796 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
861969b53a Prefer -R3 to -R3f when applying direct simulation in the web interface.
* wrap/python/ajax/spot.in: Adjust.
2012-04-30 18:11:13 +02:00
Alexandre Duret-Lutz
fb6a2a50b5 One more test for U,W,R,M rewritins.
* src/ltltest/uwrm.test: New file.
* src/ltltest/Makefile.am: Add it.
2012-04-30 18:03:33 +02:00
Alexandre Duret-Lutz
84cefea203 * src/tgbaalgos/minimize.hh: Reencode in utf-8 and wrap long lines. 2012-04-30 16:13:13 +02:00
Alexandre Duret-Lutz
6a250eb9c3 * doc/tl/tl.tex: Disable draft mode. 2012-04-30 11:57:59 +02:00
Alexandre Duret-Lutz
a9cccd11e6 Change tgba_dupexp_bfs() and tgba_dupexp_dfs() to build numbered tgba.
* src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh: Change the return
type.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
0821599db8 Implement rewritings for {f|g} and !{f|g}.
* src/ltlvisit/simplify.cc: Here.
* src/ltltest/reduccmp.test: Test them.
* doc/tl/tl.tex: Document them.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
496c449fa4 Update the intro of tl.tex, and add a reference to VECOS'11.
* doc/tl/tl.tex, doc/tl/tl.bib: Here.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
776564cbf2 Rertite a M (b | a) = b U a and a R (b | a) == b W a.
* src/ltlvisit/simplify.cc: Here.
* src/ltltest/reduccmp.test: Test it.
* doc/tl/tl.tex: Document it.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
a09ad6b4c6 Implement W,M removal for Spin output.
* src/ltlvisit/wmunabbrev.hh, src/ltlvisit/wmunabbrev.cc: New files.
* src/ltlvisit/Makefile.am: Add them.
* src/ltlvisit/tostring.cc (to_spin_string): Use the new rewriting.
* wrap/python/ajax/spot.in: Warn when a "Spin" still contain PSL
operators.
* wrap/python/ajax/ltl2tgba.html: Adjust help text.
* doc/tl/tl.tex, NEWS: Document the new rewriting.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
e64a1bf565 * NEWS: Mention utf-8 output. 2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
6ea88efddc Allow atomic propositions negated with a combining overline.
* src/ltlparse/ltlscan.ll: Understand the combining overline, and
combining overbar as synonym for =0.
* src/ltlvisit/tostring.cc: Emit a combining overline for
single-letter atomic propositions.
* src/ltlast/atomic_prop.hh (is_atomic_prop): New function.
* doc/tl/tl.tex: Document these two characters.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
1319e18e1d Make sure PYTHON is absolute.
* m4/pypath.m4: Here.  This is needed because PYTHON is used as
she-bang line in scripts.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
43d1be09d5 Add an UTF-8 option to the web interface.
* wrap/python/ajax/ltl2tgba.html: Add the checkbox.
* wrap/python/ajax/css/ltl2tgba.css: Add the necessary class.
* wrap/python/ajax/protocol.txt: Add the new option.
* wrap/python/ajax/spot.in: Handle it.
* wrap/python/ajax/README: Add a few lines to explain
how to run the CGI script from the command line for debugging.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
e93ceebafe Make it possible to output UTF-8 for dotty().
* src/tgba/tgbaexplicit.hh: Rerganize a bit to
allow different functions to be used to format
states.  Add an enabled_utf8() method to
tgba_explicit_formula.
* src/tgbaalgos/dotty.hh, src/tgbaalgos/dotty.cc:
Simplify the interface by not depending on
dotty_decorator explicitely.
* src/tgba/bddprint.hh (enable_utf8): New function.
* src/tgba/bddprint.cc (enable_utf8): Implement it
and use the global utf8 flag in other functions.
* src/tgbatest/ltl2tgba.cc: Add an -8 option for
UTF-8 outpout.
* wrap/python/spot.i: Adjust for tgbexplicit.hh
changes.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
f082700fb2 Fix constness of minimize_wdba() return.
* src/tgbaalgos/minimize.hh, src/tgbaalgos/minimize.cc:
Return a tgba*, not a const tgba*.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
df1785f526 Fix doxygen comments.
* src/tgba/formula2bdd.hh: Fix the comments so Doxygen can
see them.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
53f38c2ccd Implement to_utf8_string().
* src/ltlvisit/tostring.cc, src/ltlvisit/tostring.hh: Here.
* src/ltltest/randltl.cc: Add option -8 to display utf-8 formulae.
* src/ltltest/utf8.test: Test it.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
6f29141174 Remove useless include.
* src/misc/acccompl.cc: Do not include tgbaexplicit.hh.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
5eae815a1c Document recognized utf8 characters.
* doc/tl/tl.tex: Here.
2012-04-30 11:57:55 +02:00
Alexandre Duret-Lutz
7e4787da22 Fix error reporting in utf8-encoded LTL formulae.
* src/ltlparse/public.hh (fix_utf8_locations): New function.
* src/ltlparse/fmterror.cc (fix_utf8_locations): Implement it.
(format_parse_errors): Rename as ...
(format_parse_errors_aux): ... this.
(format_parse_errors): New implementation that call fix_utf8_locations()
before format_parse_errors_aux() on valid utf8 strings.
* src/ltlparse/Makefile.am: Include $(top_srcdir).
* src/ltltest/utf8.test: New file.
* src/ltltest/Makefile.am: Add it.
* src/ltltest/parse.test: Fix header.
2012-04-30 11:57:15 +02:00
Alexandre Duret-Lutz
403170f5c8 Distribute UTF8-for-cpp.
* utf8/doc/ReleaseNotes, utf8/doc/utf8cpp.html, utf8/utf8.h,
utf8/utf8/checked.h, utf8/utf8/core.h, utf8/utf8/unchecked.h:
New files.
* Makefile.am (EXTRA_DIST): Distribute them.
2012-04-30 11:57:14 +02:00
Alexandre Duret-Lutz
80a9c3e219 ltlparse: Preliminary support for utf8 operators.
* src/ltlparse/ltlscan.ll: Recognize several utf8 operators
such as □, ◇, ◯, ↔, ⤇, etc.
2012-04-30 11:57:14 +02:00
Alexandre Duret-Lutz
ce437cd499 Fix the associativity of ->, <->, U, R, W, and M wrt the PSL standard.
* src/ltlparse/ltlparse.yy: Make all the above operators
right-associative.  Also let `:' have precedence over `;'.
* src/ltltest/reduccmp.test: Adjust for the `:' precedence.
* doc/tl/tl.tex, NEWS: Document this.
2012-04-30 11:57:03 +02:00
Alexandre Duret-Lutz
807dcefba4 Document the changes from the PSL branch.
* NEWS: Here.
2012-04-28 10:55:02 +02:00
Alexandre Duret-Lutz
bdeb87a6b0 web ltl2tgba: add an option to disable larger rewritings
* wrap/python/ajax/ltl2tgba.html: Add a checkbox and some
code to keep it consistent with the basic rewriting checkbox.
* wrap/python/ajax/spot.in: Deal with the new option.
* wrap/python/ajax/protocol.txt: Document it.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
8f40fd41f4 Replace the "encoding: utf-8" by "coding: utf-8" comments.
* Makefile.am, src/ltlast/formula.cc, src/ltlast/formula.hh,
src/tgba/tgbaexplicit.hh, wrap/python/ajax/Makefile.am,
wrap/python/spot.i: Here.
* HACKING: Document -*- coding: utf-8 -*-.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
aec556f7a2 Implement basic rewriting rules for {r} and !{r}.
* src/ltlvisit/simplify.cc: Here.
* src/ltltest/reduccmp.test: Test them.
* doc/tl/tl.tex: Document them.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
d6587cf531 Implement dual rewritings rules for <>->.
* src/ltlvisit/simplify.cc (reduce_sere_ltl): New function,
to factor the code of the []-> and <>-> rewrittings.
* src/ltltest/reduccmp.test: Add more tests.
* doc/tl/tl.tex: Document these rewritings.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
6f46345c3a Implement 11 rewritings for []->.
* src/ltlvisit/simplify.cc: Here.
* doc/tl/tl.tex: Document then.
* src/ltlast/bunop.hh (as_KleenStar): New helper function.
* src/ltltest/reduccmp.test: Add more tests.
* src/ltltest/reduc.cc: Also display the resulting formula
without reduce_size_stricly.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
6eb830c8ae Implement star-normal-form rewriting.
* src/ltlvisit/snf.cc, src/ltlvisit/snf.hh: New files.
* src/ltlvisit/Makefile.am: Distribute them.
* src/ltlvisit/simplify.cc, src/ltlvisit/simplify.hh: Call snf(f) for
all f[*].
* src/ltltest/reduccmp.test: Test it.
* doc/tl/tl.tex, doc/tl/tl.bib: Document it.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
e7cf7b422d Trivially reduce f;f to f[*2], f[*1..3];f to f[*2..4], etc.
* src/ltlast/multop.cc (instance): Implement the reduction.
* src/ltlast/multop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Add a test.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
4a775a17a3 Trivially reduce [*];f to [*] if f accepts the empty word.
* src/ltlast/multop.cc (instance): Implement the reduction.
* src/ltlast/multop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Test it.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
e06b3b7974 Trivially reduce 1[*]&&f = f and 1[*]|f = 1[*].
* src/ltlast/bunop.hh (one_star): New static method building 1[*].
* src/ltlast/bunop.cc (bunop::~bunop, bunop::instance_count): Adjust.
* src/ltlast/multop.cc: Implement the trivial rewriting.
* src/ltlast/multop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Test it.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
5bea6e4950 Fix handling of 1 in trivial identities for rational operators.
Especially, 1&f and 1:f were mistakenly always reduced to f, which is
incorrect when f accept the empty word.

* src/ltlast/multop.cc: Here.
* src/ltlast/multop.hh, doc/tl/tl.tex: Adjust documentation.
* src/ltltest/equals.test: Add more tests.
2012-04-28 09:34:46 +02:00
Alexandre Duret-Lutz
691119c188 Introduce AndRat and OrRat operator.
It was a mistake to try to overload And/Or LTL operator for these when
trivial simplification are performed.  The reason is so simple it is
embarassing: And(f,1)=f is a trivial identity that should not be
applied with AndRat.  E.g. AndRat(a;b, 1) is equal to 0, not a;b.

* src/ltlast/multop.hh, src/ltlast/multop.cc: Add the AndRat and OrRat
operators.
* src/ltlparse/ltlparse.yy: Build them.
* src/ltlvisit/mark.cc, src/ltlvisit/simplify.cc,
src/ltlvisit/tostring.cc, src/tgba/formula2bdd.cc,
src/tgbaalgos/eltl2tgba_lacim.cc, src/tgbaalgos/ltl2taa.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_lacim.cc:
Adjust all switches.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
35b41331f7 Add more simplification rules for AndNLM.
* src/ltlvisit/simplify.cc: Here.
* src/ltltest/reduccmp.test: More tests.
* doc/tl/tl.tex: Document them.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
f7c64060c8 Fix translation of AndNLM and Fusion operators.
* src/tgbaalgos/ltl2tgba_fm.cc: Here.
The check is done by next patch.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
866384b423 Fix trivial rules for b₁:b₂ and b&f.
* src/ltlast/multop.cc (instance): Here.
* src/ltlast/multop.hh, doc/tl/tl.tex: Adjust documentation.
* src/ltltest/equals.test: Adjust test cases.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
a4353d3985 Trivially reduce 'a[*1]' to 'a'.
* src/ltlast/bunop.cc (bunop::instance): Here.
* src/ltlast/bunop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Test it.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
abaf102746 Get rid of bunop::Equal and bunop::Goto.
* src/ltlast/bunop.hh, src/ltlast/bunop.cc, src/ltlvisit/randomltl.cc,
src/ltlvisit/simplify.cc, src/ltlvisit/tostring.cc,
src/tgbaalgos/ltl2tgba_fm.cc: Remove all traces of these two
operators since they are not handled like sugar.
* doc/tl/tl.tex: Adjust documentation to reflect the fact that these
two operators are sugar.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
210723e30c Implement [->i..j] and [=i..j] as sugar with [*i..j].
* src/ltlast/bunop.hh, src/ltlast/bunop.cc (sugar_goto, sugar_equal):
New functions..
* src/ltlparse/ltlparse.yy: Use them.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
39417037d7 to_string: abbreviate [->i..j] and [=i..j] expressed using [*i..j]
* src/ltlast/bunop.hh (is_bunop, is_Star): New functions.
* src/ltlast/multop.hh (is_And, is_Or): Fix constness.
(is_Concat, is_Fusion): New functions.
* src/ltlast/unop.hh (is_unop, is_X, is_F, is_G, is_GF, is_FG):
Fix constness.
(is_Not): New function.
* src/ltlvisit/tostring.cc (strip_star_not, match_goto,
emit_bunop_child, resugar_concat): New methods.
(visit(bunop)): Rewrite without calling format().  Detect the
[->i..j] pattern.
(visit(multop)): Call resugar_concat to detect [=i..j] patterns.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
e109f21ce4 Factor the code of ltl::to_string and ltl::to_spin_string.
* src/ltlvisit/tostring.cc (to_string_visitor): Take a list of
keywords as fourth argument.
(to_spin_string_visitor): Remove.
(to_string, to_spin_string): Adjust usage of to_string_visitor.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
3d41bf9ff1 ltl2tgba.html: Display properties of formulas.
* src/ltlast/formula.hh, src/ltlast/formula.cc (list_formula_props):
New function.
* wrap/python/spot.i: Adjust to wrap list_formula_props.
* wrap/python/ajax/ltl2tgba.html: Add option to display properties.
* wrap/python/ajax/spot.in: Handle ff=p and display properties.
* wrap/python/ajax/protocol.txt: Adjust.
2012-04-28 09:34:45 +02:00
Alexandre Duret-Lutz
62bf41cdb4 Prefer "xor" over "^" when outputing formulae.
* src/ltlvisit/tostring.cc (to_string_visitor): Here.
2012-04-28 09:34:45 +02:00
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