Commit graph

1771 commits

Author SHA1 Message Date
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
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