Commit graph

2285 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
fa4e6effa6 tgbaexplicit: fix state_is_accepting()
* src/tgba/tgbaexplicit.hh (state_is_accepting): Use
all_acceptance_conditions(), not all_acceptance_conditions_, so that
it works even when all_acceptance_conditions_ is not ready.
* src/tgbatest/explicit2.cc, src/tgbatest/explicit2.test: Adjust
test case.
2012-10-21 00:02:07 +02:00
Alexandre Duret-Lutz
76787b23c0 postproc: add the possibility to output a monitor
* src/tgbaalgos/stripacc.cc, src/tgbaalgos/stripacc.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbaalgos/postproc.cc, src/tgbaalgos/postproc.hh: Add a Monitor
output option.
* src/bin/ltl2tgba.cc: Add a --monitor/-M option.
* NEWS: Mention monitors.
* src/tgba/tgbaexplicit.hh (is_accepting_state): Fix for the
case where the automaton has no acceptance set.
2012-10-21 00:02:06 +02:00
Alexandre Duret-Lutz
5f6c262ae5 * NEWS: Document to_wring_string(). 2012-10-20 19:20:28 +02:00
Alexandre Duret-Lutz
877082bfb0 Add a parse_boolean() function to use in parsers for Automata.
* src/ltlparse/public.hh, src/ltlparse/ltlparse.yy (parse_boolean):
New function.
* src/neverparse/neverclaimparse.yy, src/tgbaparse/tgbaparse.yy:
Use it.
2012-10-20 19:18:54 +02:00
Alexandre Duret-Lutz
da5f7ac3aa to_string: remove extra parentheses
* src/ltlvisit/tostring.cc: Fix duplicate parentheses around
argument of unary operators when full_parent=true.
2012-10-20 13:52:44 +02:00
Alexandre Duret-Lutz
0fc3c6bcff Add support for printing LTL formulas using Wring's syntax.
* src/ltlvisit/tostring.hh, src/ltlvisit/tostring.cc
(to_wring_string): New option.
* src/bin/common_output.hh, src/bin/common_output.cc:
Add support for a --wring option.
* src/bin/ltlcheck.cc: Add %w and %W format specifiers.
2012-10-20 13:40:33 +02:00
Alexandre Duret-Lutz
bf765480b1 * src/tgba/tgbaexplicit.hh: Fix hash_map definition to please old g++. 2012-10-20 12:18:06 +02:00
Alexandre Duret-Lutz
b8ed85a30d bin: Adjust version display and help options.
In particular, this get rid of the ugly -? option that argp adds by
default, and we also remove -V so that we can use it for something
else later.

* src/bin/common_setup.cc, src/bin/common_setup.hh (misc_argp):
Provide support for --help/--version/--usage output, replacing argp's
default builting version.
* src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlcheck.cc, src/bin/ltlfilt.cc, src/bin/randltl.cc:
Call argp_parse() with ARGP_NO_HELP, and use misc_argp instead.
2012-10-19 22:58:38 +02:00
Alexandre Duret-Lutz
c6030df936 accconv: speed up acceptance_convertor::as_positive_product()
* src/misc/accconv.cc (as_positive_product): Use a small loop instead
of calling bdd_satone().
2012-10-19 20:50:35 +02:00
Alexandre Duret-Lutz
31fb3d9d15 tgbaexplicit: speed up merge_transitions()
* src/tgba/tgbaexplicit.hh (merge_transitions): Use a hash table
to merge compatible transitions.
* src/tgbatest/readsave.test: Add a test case.
2012-10-19 17:53:08 +02:00
Alexandre Duret-Lutz
0bdfd9c72c * src/bin/ltlcheck.cc: Cleanup temporary files on ^C. 2012-10-19 16:17:53 +02:00
Alexandre Duret-Lutz
e426c63550 lbttparse: allow acceptance sets that are not consecutive integers.
* src/tgbaalgos/lbtt.cc: Renumber acceptance sets as they are read.
* src/tgbatest/lbttparse.test: Add a test cases.
2012-10-19 15:56:42 +02:00
Alexandre Duret-Lutz
89b9cc5fd5 lbttparse: make sure we parse wring2lbtt's output
* src/tgbaalgos/lbtt.cc: Do not expect a new line after the number of
acceptance conditions.
* src/tgbatest/lbttparse.test: Add a test case.
2012-10-18 14:48:10 +02:00
Alexandre Duret-Lutz
676ab41f6f ltlparse: diagnose empty (...) block in lenient mode.
* src/ltlparse/ltlparse.yy (try_recursive_parse): Diagnose
empty strings.
* src/ltltest/lenient.test: Add tests.
2012-10-18 00:23:34 +02:00
Alexandre Duret-Lutz
ff0eada81d * NEWS: Mention lenient parsing. 2012-10-17 18:46:04 +02:00
Alexandre Duret-Lutz
86dac4aadf ltlparse: add a lenient parsing mode
Spin 6 supports formulas such as []<>(a < b) so that atomic properties
need not be specified using #define.  Of course we don't want to
implement all the syntax of Spin in our LTL parser because other tools
may have different syntaxes for their atomic propositions.  The
lenient mode tells the scanner to return any (...), {...}, or {...}!
block as a single token.  The parser will try to recursively parse
this block as a LTL/SERE formula, and if this fails, it will consider
the block to be an atomic proposition.  The drawback is that most
syntax errors will no be considered to be atomic propositions.  For
instance (a U b U) is a single atomic proposition in lenient mode, and
a syntax error in default mode.

* src/ltlparse/ltlparse.yy, src/ltlparse/ltlscan.ll,
src/ltlparse/parsedecl.hh, src/ltlparse/public.hh: Add a
lenient parsing mode.  Simplify the lexer using yy_scan_string.
* src/bin/common_finput.cc: Add a --lenient option.
* src/ltltest/lenient.test: New file.
* src/ltltest/Makefile.am: Add it.
* src/neverparse/neverclaimparse.yy: Parse the guards in lenient mode.
* src/tgbatest/neverclaimread.test: Adjust.
* src/ltlvisit/tostring.cc: When outputing a formula in Spin's syntax,
output (a < b) instead of "a < b".
* src/misc/escape.cc, src/misc/escape.hh (trim): New helper function.
2012-10-17 18:26:42 +02:00
Alexandre Duret-Lutz
d9ceb4adc4 bin: plug several memory leaks
* src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc: Destroy the translated
formulas.
* src/bin/ltlcheck.cc, src/bin/ltlfilt.cc: Free the unicity table on
exit.
2012-10-15 20:54:28 +02:00
Alexandre Duret-Lutz
9f1d369563 * src/bin/ltlcheck.cc: Add a --no-checks option. 2012-10-15 20:41:44 +02:00
Alexandre Duret-Lutz
2977635ae5 ltlcheck: do not check duplicate formulas
* src/bin/ltlcheck.cc: filter duplicate formulas, unless the
new --allow-dups option is used.
2012-10-15 18:21:38 +02:00
Alexandre Duret-Lutz
35fc975d1e * NEWS: mention ltlcheck 2012-10-15 17:48:01 +02:00
Alexandre Duret-Lutz
f03ba4b56f man page cosmetics
* src/bin/man/genltl.x, src/bin/man/ltlcheck.x, src/bin/man/ltlfilt.x,
src/bin/man/randltl.x: Use .BR in the SEE ALSO section.
2012-10-15 17:37:47 +02:00
Alexandre Duret-Lutz
b2a5d5aa62 ltlcheck: add options --json and --csv
* src/bin/ltlcheck.cc: Add option --json and --csv.
* src/bin/man/ltlcheck.x: Adjust examples.
* src/tgbatest/ltlcheck.test: Do not output any statistic.
* src/tgbatest/ltlcheck2.test: Output both JSON and CSV stats.
2012-10-15 17:31:43 +02:00
Alexandre Duret-Lutz
fc374c0790 * src/tgbatest/spotlbtt.test: Remove superfluous options. 2012-10-15 15:14:51 +02:00
Alexandre Duret-Lutz
2fe8f025e3 ltlcheck: add a "Sanity check..." message
* src/bin/ltlcheck.cc: Here.
2012-10-14 19:08:03 +02:00
Alexandre Duret-Lutz
7d6fc328ab Add new tests for LTL and PSL translation, based on ltlcheck.
* src/tgbatest/ltlcheck.test, src/tgbatest/ltlcheck2.test: New files.
* src/tgbatest/Makefile.am: Add them.
2012-10-14 19:06:59 +02:00
Alexandre Duret-Lutz
d1871d87dc * src/bin/ltlcheck.cc: Diagnose missing output format. 2012-10-14 18:29:34 +02:00
Alexandre Duret-Lutz
8e9002947e ltlcheck: do not ignore ^C during sanity checks
* src/bin/ltlcheck.cc (sig_handler): Exit when receiving the signal.
2012-10-14 18:27:50 +02:00
Alexandre Duret-Lutz
7022853dad * src/ltlvisit/simplify.cc (simplify_visitor): Return automatop as-is. 2012-10-14 18:25:36 +02:00
Alexandre Duret-Lutz
7b6337f456 ltlcheck: Add a man page.
* src/bin/man/ltlcheck.x: New file.
* src/bin/man/Makefile.am: Add it.
* src/bin/ltlcheck.cc: Arrange help text.
2012-10-14 17:42:25 +02:00
Alexandre Duret-Lutz
b2de0136b2 Add a has_lbt_atomic_props() method to LTL formulas.
* src/ltlast/formula.hh (has_lbt_atomic_props): New method.
* src/ltlast/formula.cc (printprops): Display it.
* src/ltlast/atomic_prop.cc: Update it.
* src/bin/ltlcheck.cc, src/bin/genltl.cc: Use it.
* doc/tl/tl.tex: Menton has_lbt_atomic_props().
2012-10-14 17:42:25 +02:00
Alexandre Duret-Lutz
f40925f67b ltlcheck: disable timeout handling when kill() or alarm() are missing
* configure.ac: Check for kill and alarm.
* src/bin/ltlcheck.cc: Disable timeout code when kill or alarm are
missing.  Recognize the --timeout option, but display a warning.
2012-10-14 17:42:25 +02:00
Alexandre Duret-Lutz
e46ae2799f ltlcheck: use kill instead of killpg
kill(-x,y) is more portable than killpg(x,y)

* src/bin/ltlcheck.cc: Use kill.
2012-10-14 09:12:06 +02:00
Alexandre Duret-Lutz
a62a04670c more files to ignore 2012-10-14 09:11:49 +02:00
Alexandre Duret-Lutz
7e79fcb4e3 gnulib: add module sys_wait, for compilation on MinGW
Also, upgrade to gnulib 4af1990a0902f5914f582bade9d1aa843a291f5a.

* lib/sys_wait.in.h, m4/sys_wait_h.m4: New files.
* m4/sys_stat_h.m4, m4/stdlib_h.m4, m4/gnulib-comp.m4,
m4/gnulib-cache.m4, lib/stdlib.in.h, lib/Makefile.am: Update.
2012-10-13 18:13:52 +02:00
Alexandre Duret-Lutz
d22fb0b61f * src/ltlvisit/lbt.cc: Add missing case for Xor. 2012-10-13 17:56:15 +02:00
Alexandre Duret-Lutz
a7d7d8d0ef lbtt_parse: add support for state-based acceptance
* src/tgbaalgos/lbtt.cc (lbtt_read_gba): New function.
(lbtt_parse): Call lbtt_read_gba.
* src/tgbatest/lbttparse.test: Add a test.
2012-10-13 17:38:32 +02:00
Alexandre Duret-Lutz
37b0809c44 * src/misc/formater.hh: Add virtual destructors to please g++-4.0. 2012-10-13 16:42:39 +02:00
Alexandre Duret-Lutz
852603416f to_spin_string: fix output of false and true
We used to output 0 and 1, but "spin -f" does not under understand
that.

* src/ltlvisit/tostring.cc (kw_spin): Output true and false instead of
0 and 1.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
6167526548 * src/bin/ltlcheck.cc: Fix exit status and error reporting. 2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
d0a04f9410 ltlcheck: Add a timeout option.
* src/bin/ltlcheck.cc: Add option -T and machinery for signal handling.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
82babb9d38 ltlcheck: Record translation time.
* lib/gethrxtime.h, lib/xtime.h: Add extern "C".
* src/bin/Makefile.am (ltlcheck_LDADD): Use LIB_GETHRXTIME.
* src/bin/ltlcheck.cc: Use gethrxtime() to record translation time.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
756319739b Import the gethrxtime module from gnulib.
gnulib 9e117ae955a5c6a0406140e62b76c3ef50e3bc2b.

* lib/gethrxtime.c, lib/gethrxtime.h, lib/gettime.c, lib/timespec.c,
lib/timespec.h, lib/xtime.h, m4/clock_time.m4, m4/gethrxtime.m4,
m4/gettime.m4, m4/timespec.m4: New files.
* m4/gnulib-cache.m4, m4/gnulib-comp.m4, lib/Makefile.am: Adjust.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
d7e8684d38 * src/bin/ltlcheck.cc: Improve example in --help. 2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
122d34cce4 * src/bin/ltlcheck.cc: Compute statistics and print them in JSON. 2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
e99fdfb650 Pick the most readable format available for displaying formulas.
* src/bin/ltlcheck.cc (translator_runner::formula): New function.
(processor::process_formula): Use it.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
3f5e6102dc Clean up the misc/formater.hh file.
* src/misc/formater.hh (formater::format, formater::prime): Move ...
* src/misc/formater.cc: ... in this new file.
* src/misc/Makefile.am: Add it.
* src/sanity/style.test: Allow <iostream> in headers where << or >> are
used.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
f6dc6412d3 Use the spot::formater class in ltlcheck to format output commands.
* src/misc/formater.hh (printable_value): Add more accessors.
* src/bin/ltlcheck.cc: Use the formater class to factor the %-expansion
loop, and reuse filenames (such as %F, %S, and %L) between executions
on the same formula.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
a303c8603c Factor the %-formating machinery.
* src/misc/formater.hh: New file.
* src/misc/Makefile.am: Add it.
* src/tgbaalgos/stats.cc, src/tgbaalgos/stats.hh: Use it.
2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
62af20d39f * src/bin/ltlcheck.cc: Add support for LBTT's output as %T. 2012-10-13 13:36:40 +02:00
Alexandre Duret-Lutz
1017350110 * src/ltlparse/ltlscan.ll: Reset the starting condition to 0 initially. 2012-10-13 13:36:40 +02:00