Commit graph

87 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
88141b2711 randaut: better generation of acceptance conditions
* src/bin/randaut.cc: Replace the --acc-type and --acc-sets
options by a more general --acceptance option, that take either
an acceptance formula, or an acceptance name parametred by ranges.
Also accept a range for the number of atomic propositions.
* src/twaalgos/randomgraph.cc (random_acceptance): Move...
* src/twa/acc.cc, src/twa/acc.hh (random): ... here.
(parse_acc_code): Generalize to accept ranges instead of
numbers whenever sensible, and accept a 'random' acceptance.
* src/tests/randaut.test: Adjust tests and add more.
* wrap/python/tests/randaut.ipynb: Adjust call to randaut.
2015-05-26 09:09:31 +02:00
Alexandre Duret-Lutz
ae0f0d5fc2 ltlcross: add --automata option
* src/bin/ltlcross.cc: Implement it.
* src/tests/ltlcross3.test: Use it.
* NEWS: Mention it.
2015-05-25 17:35:43 +02:00
Alexandre Duret-Lutz
5d7f4464ea acc: Adjust generalition of parity acceptance
According to https://github.com/adl/hoaf/issues/46

* src/twa/acc.cc (parity): Adjust generation.
* src/tests/hoaparse.test, wrap/python/tests/accparse.ipynb:
Adjust existing test cases.
* wrap/python/tests/accparse2.py: New test cases.
2015-05-24 00:00:36 +02:00
Alexandre Duret-Lutz
96e2da8666 sat-minimize: some documentation and associated fixes
* doc/org/satmin.org: Document the new DTωA-minimization procedure.
* doc/org/tools.org: Fix link.
* src/bin/autfilt.cc: Pass -S to sat_minimize().
* src/twa/twagraph.hh: (state_acc_sets) New method.
* src/twaalgos/dotty.cc: Use it to correctly display co-Büchi automata.
* src/twaalgos/dtbasat.cc: Set the deterministic property on the result.
* src/twaalgos/dtgbasat.cc: Likewise, and preprocess the input automaton
in sat_minimize().
* src/twaalgos/dtgbasat.hh: Fix documentation, and take the state-based
information as an argument.
* src/twaalgos/postproc.cc: Do not call simulation-based reduction
on non-separated acceptances.
* src/tests/satmin2.test: Use -S rather than 'state-based'.
* NEWS: Update.
2015-05-22 00:02:09 +02:00
Alexandre Duret-Lutz
e04b4eb9fb acc: better Rabin/Streett detection
* src/twa/acc.cc: Allow duplicate and reordered pairs.  Also recognize
the single-pair cases.
* src/twaalgos/hoa.cc: When Rabin or Streett is detected, canonicalize
the Acceptance: line.
* src/tests/hoaparse.test, wrap/python/tests/accparse2.py: More tests.
* src/tests/sbacc.test: Adjust.
2015-05-21 08:57:49 +02:00
Alexandre Duret-Lutz
04171207e6 acc: recognize parity acceptance
It has two modes: strict or not.  In strict mode (tested in
hoaparse.test), the acceptance formula has to match exactly the one
given in the HOA spec.  In non-strict mode (tested in accparse2.py)
any equivalent formula is accepted.

* src/twa/acc.cc, src/twa/acc.hh (acc_cond::is_parity): New method.
* src/twaalgos/hoa.cc: Use it.
* src/tests/hoaparse.test: Test it.
* wrap/python/spot_impl.i: Bind it.
* wrap/python/tests/accparse2.py: New file.
* wrap/python/tests/Makefile.am: Add it.
2015-05-20 20:00:25 +02:00
Alexandre Duret-Lutz
d276f73eed hoa: output acc-name for several acceptance types
So far the HOA output would emit an acc-name only
for generalized-Buchi or inferior types (Buchi, all).
It now knows about none, co-Buchi, generalized-co-Buchi,
Rabin, Streett, and generalized-Rabin as well.

* src/twa/acc.cc, src/twa/acc.hh: Add detection code.
* src/twaalgos/hoa.cc: Use it.
* src/tests/remfin.test, src/tests/maskacc.test,
src/tests/complete.test, src/tests/sim3.test,
src/tests/ltl2dstar.test: Adjust tests.
* src/tests/hoaparse.test: Adjust and add more tests.
2015-05-20 20:00:25 +02:00
Alexandre Duret-Lutz
8e1c846984 acc: parse standard acceptance names
* src/twa/acc.cc, src/twa/acc.hh: Add method to create
standard acceptance conditions, and adjust the parse_acc_code
to recognize them
* wrap/python/spot_impl.i (acc_cond::acc_code): Add a printer.
* wrap/python/tests/accparse.ipynb: New test file.
* wrap/python/tests/Makefile.am: Add it.
* src/tests/satmin2.test: Use the new syntax.
2015-05-18 21:49:51 +02:00
Alexandre Duret-Lutz
7880b25aae sat-minimize: add a max-states option
* src/twaalgos/dtbasat.cc, src/twaalgos/dtbasat.hh,
src/twaalgos/dtgbasat.cc, src/twaalgos/dtgbasat.hh: Add it.
* src/tests/satmin2.test: Add couple of tests.
2015-05-18 21:46:11 +02:00
Alexandre Duret-Lutz
91f68ab1d8 sat-minimize: ignore silly histories
If the target acceptance is Fin(0)&Inf(1), there is no need to
distinguish between an history of {0,1} and an history of {0}, as a
cycle with either history will be rejected.  This implements this
simplification.  If both the canditate and reference automata
are Rabin automata with n pairs, then we now use at most
  Q * Q' * Q * Q' * 3^n * 3^n
variables to encode the partial cycles histories, versus
  Q * Q' * Q * Q' * 4^n * 4^n
before.

* src/twaalgos/dtgbasat.cc: Implement this.
* src/tests/satmin2.test: More tests.
2015-05-18 21:46:11 +02:00
Alexandre Duret-Lutz
0ede968760 sat-minimize: allow different acceptances as input and output
* src/twaalgos/dtgbasat.cc (sat_minimize): Use any arbitrary
acceptance condition passed via the "acc" option.
* src/twa/acc.hh (mark_t::max_set): New method.
* src/tests/satmin2.test: Add two test cases with DRA as input
and DSA as output.
2015-05-18 21:46:11 +02:00
Alexandre Duret-Lutz
3efeacb61b acc: preserve input order in parse_acc_code()
* src/twa/acc.cc: Here.
* src/tests/acc.test: Adjust.
2015-05-18 21:46:11 +02:00
Alexandre Duret-Lutz
0874980574 sat-minimize: generalize to any acceptance
This is still missing tests.

* src/bin/autfilt.cc: Add a --sat-minimize option.
* src/misc/optionmap.cc, src/misc/optionmap.hh: Allow passing strings.
* src/twa/acc.cc, src/twa/acc.hh: Add helper functions needed
by the SAT-encoder.
* src/twaalgos/complete.hh: Typos.
* src/twaalgos/dtbasat.hh: Adjust comment.
* src/twaalgos/dtgbasat.cc, src/twaalgos/dtgbasat.hh: Generalize
to take the target acceptance as input.
* src/twaalgos/postproc.cc, src/tests/ltl2tgba.cc: Adjust calls.
* src/twaalgos/sbacc.cc, src/twaalgos/sbacc.hh: Don't pass
the pointer by reference.
* src/tests/acc.cc, src/tests/acc.test: More tests
for the acceptance helper function.
2015-05-18 21:45:33 +02:00
Alexandre Duret-Lutz
0786e068ae postproc: add a SBAcc option
Producing state-based acceptance is now part of the postprocessing
routines.  That means we can more easily simplify automata with
state-based acceptance (using autfilt -S --small --high, for instance)
and as as side-effect, ltl2tgba can produce GBA.  However the result of
ltl2tgba -S is often larger than that of ltl2tgba -B.

* src/twaalgos/postproc.cc, src/twaalgos/postproc.hh: Implement
the SBAcc option.
* src/bin/common_post.cc, src/bin/common_post.hh: Implement -S.
* src/bin/autfilt.cc, src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc,
src/bin/ltl2tgta.cc, src/bin/ltldo.cc: Adjust.
* src/tests/sim3.test: Augment test case.
* NEWS, doc/org/ltl2tgba.org, doc/org/autfilt.org: Document it -S.
2015-05-14 21:05:12 +02:00
Alexandre Duret-Lutz
dd87bdf868 wdba: adjust to work on any TωA
* src/twaalgos/minimize.cc, src/twaalgos/safety.cc,
src/twaalgos/safety.hh: Adjust.
* src/tests/wdba2.test: More tests.
2015-05-14 18:34:14 +02:00
Alexandre Duret-Lutz
8080813303 simulation: work on TωA
* src/twaalgos/simulation.cc, src/twaalgos/simulation.hh: Adjust
to work on TωA.  This only require separate acceptance sets.
* src/tests/sim3.test: New test.
* src/tests/Makefile.am: Add it.
2015-05-14 18:34:14 +02:00
Alexandre Duret-Lutz
0e04b25342 ltldo: preserve generic acceptance
* src/bin/ltldo.cc: Default to generic acceptance.
* src/tests/ltl2dstar.test: Add a test.
2015-05-14 18:34:14 +02:00
Alexandre Duret-Lutz
3d1ccdc45e autfilt: new --separate-sets option
* src/twaalgos/sepsets.cc, src/twaalgos/sepsets.hh: New files.
* src/twaalgos/Makefile.am: Add them.
* src/twa/acc.hh (get_acceptance): Add a non-const version.
* src/bin/autfilt.cc: Add the --separate-sets option.
* src/tests/sepsets.test: New file.
* src/tests/Makefile.am: Add it.
2015-05-14 18:34:14 +02:00
Alexandre Duret-Lutz
8c32fba8b9 scc_info: determine accepting/rejecting-SCCs for any acceptance
* src/twaalgos/sccinfo.cc, src/twaalgos/sccinfo.hh
(determine_unknown_acceptance): New function to call explicitly
in case one want to know whether the accepting/rejecting status
of all SCCs regardless of the acceptance.
* src/twaalgos/dotty.cc src/twaalgos/sccfilter.cc,
src/twaalgos/sccfilter.hh: Use it.
* src/tests/unambig.test, src/tests/sccdot.test: Add more tests.
* doc/org/oaut.org: Adjust doc for --dot=s, orange is not output
anymore.
2015-05-13 23:16:26 +02:00
Alexandre Duret-Lutz
07ee3d2dd0 allow scc_filter() and scc_filter_states() on any TωA
Note however that scc_info does not provide a precise accept/reject
characterization for SCCs when using Fin acceptance.  However whenever
it tells that an SCC is rejecting, scc_filter_states() may safely remove
it.

* src/twaalgos/sccfilter.cc (scc_filter_states): Allow on any TωA.
(scc_filter): Only use acceptance simplifications on TGBA.
* src/tests/unambig.test: Add a co-Büchi test.
2015-05-13 18:54:11 +02:00
Alexandre Duret-Lutz
5d76b9127b ltl2tgba_fm: produce unambiguous automata for PSL as well
* src/twaalgos/ltl2tgba_fm.cc: Fix the PSL operators.
* src/tests/unambig.test: Add more tests.
2015-05-12 20:21:16 +02:00
Alexandre Duret-Lutz
487a86d06a bin: add --check=unambiguous
* src/bin/common_aoutput.cc: Add --check=unambiguous.
* src/twa/twa.hh: New unambiguous property.
* src/twaalgos/hoa.cc: Print it.
* src/twaalgos/ltl2tgba_fm.cc: Set it.
* src/twaalgos/isunamb.cc, src/twaalgos/isunamb.hh
(check_unambiguous): New function.
* src/tests/unambig.test: More tests.
2015-05-12 20:21:15 +02:00
Alexandre Duret-Lutz
98de84f3de Add an is_unambiguous() function, use it in ltlcross and autfilt
* src/twaalgos/isunamb.hh, src/twaalgos/isunamb.cc: New files.
* src/twaalgos/Makefile.am: Add them.
* src/tests/unambig.test: New file.
* src/tests/Makefile.am: Add it.
* src/bin/ltlcross.cc: Record whether each produced automaton is
ambiguous.
* src/bin/autfilt.cc: Add a --is-unambiguous option.
* NEWS: Mention it.
2015-05-12 20:21:15 +02:00
Alexandre Duret-Lutz
9f3a7a49de Add support for unambiguous automata
* src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/ltl2tgba_fm.cc: Implement
generation of unambiguous automata.
* src/tests/ltl2tgba.cc: Add option -fu to test it.
* src/bin/common_post.cc: Adjust the group of options so we can easily
add more from ltl2tgba.cc.
* src/bin/ltl2tgba.cc: Add support for -U and --unambigous.
* src/twaalgos/translate.cc, src/twaalgos/translate.hh: Add support
for Unambiguous.
* src/tests/ltlcross.test, src/tests/ltlcross2.test: Test both
bin/ltl2tgba and tgbatest/ltl2tgba.
* NEWS: Mention the change.
2015-05-12 20:21:15 +02:00
Alexandre Duret-Lutz
f55211336e ltlgrind: fix two bugs related to PSL formulas
* src/ltlvisit/mutation.cc: Do not bindly rewrite e[]->f and
e<>->f as e, since e is not a valid PSL formula.  Use !{e}
and {e} instead.  Also fix a memory leak in the handling of
bunops, discovered while testing the previous change.
* src/tests/ltlgrind.test: Add a test case.
2015-05-11 23:58:32 +02:00
Alexandre Duret-Lutz
e026766219 bin: add -0 option for LTL output
* src/bin/common_output.cc: Add option -0.
* src/tests/ltlfilt.test: Test it.
* NEWS: Document it.
2015-05-11 17:17:15 +02:00
Alexandre Duret-Lutz
6bc2fa2431 hoa: add a stutter-sensitive property
* src/twa/twa.hh: Support this new property.
* src/twaalgos/stutter.cc: Set it if needed.
* src/twaalgos/hoa.cc: Output it.
* src/tests/stutter-tgba.test: More tests.
2015-05-10 21:13:11 +02:00
Alexandre Duret-Lutz
fe2fc88fc6 bin: add a --check option for automata outputs
This currently only allows extra check for stutter invariance.

* src/bin/common_aoutput.cc: Add check option,
and test stutter invariance.
* src/twaalgos/stutter.cc, src/twaalgos/stutter.hh
(check_stutter_invariance): New function.
* src/tests/stutter-tgba.test: Test it.
2015-05-10 21:13:11 +02:00
Alexandre Duret-Lutz
fa37bc5f72 postproc: do not simplify BA via transitions-based simulation
This addresses the easy part of #79.

* src/twaalgos/postproc.cc: If the input is already BA and we want a BA
as output, do not try the transition-based simulation only to
degeneralize the result.
* src/tests/optba.test: New file.
* src/tests/Makefile.am: Add it.
2015-05-05 00:02:28 +02:00
Alexandre Duret-Lutz
e83bfd37a4 hoa: fix segfault when input has initial alternation
* src/hoaparse/hoaparse.yy: Do not check initial alternating state
number until we support alternation.
* src/tests/hoaparse.test: Add a test case.
2015-05-04 22:04:51 +02:00
Alexandre Duret-Lutz
a4b63e8e7f dot: heuristic to switch between circles and ellipses
* src/twaalgos/dotty.cc: Add an option (e) to force elliptic shape, and
a heuristic to choose between circle and ellipse by default.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc: Document 'e'.
* src/taalgos/dotty.cc: Ignore 'e'.
* wrap/python/spot.py (setup): Do not force circular states.  The
default should be fine.
* src/tests/det.test, src/tests/dstar.test, src/tests/monitor.test,
src/tests/neverclaimread.test, src/tests/readsave.test,
src/tests/sccdot.test, src/tests/tgbagraph.test: Adjust expected
results.
* NEWS: Adjust.
2015-04-28 18:25:37 +02:00
Alexandre Duret-Lutz
51309cf742 dot: --dot=1 to ignore names and force numbered states
Fixes #78.

* src/twaalgos/dotty.cc: Add option '1'.
* src/taalgos/dotty.cc: Ignore '1'.
* src/bin/dstar2tgba.cc, src/bin/common_aoutput.cc: Document it.
* src/tests/readsave.test: Test it.
2015-04-28 18:25:10 +02:00
Alexandre Duret-Lutz
c0bbabc400 autfilt: -uc should count the number of non-isomorphic automata
* src/bin/autfilt.cc: Fix it.
* src/tests/isomorph.test: Test it.
2015-04-28 18:25:10 +02:00
Etienne Renault
5f4b7e1f3f Remove all cvsignore files.
* .cvsignore, bench/.cvsignore,
bench/emptchk/.cvsignore, bench/emptchk/models/.cvsignore,
bench/ltl2tgba/.cvsignore, buddy/.cvsignore,
buddy/doc/.cvsignore, buddy/examples/.cvsignore,
buddy/examples/adder/.cvsignore,
buddy/examples/bddcalc/.cvsignore,
buddy/examples/bddtest/.cvsignore,
buddy/examples/calculator/.cvsignore,
buddy/examples/cmilner/.cvsignore,
buddy/examples/fdd/.cvsignore,
buddy/examples/internal/.cvsignore,
buddy/examples/milner/.cvsignore,
buddy/examples/money/.cvsignore,
buddy/examples/queen/.cvsignore,
buddy/examples/solitare/.cvsignore,
buddy/src/.cvsignore, buddy/tools/.cvsignore,
doc/.cvsignore, iface/.cvsignore,
src/.cvsignore, src/ltlast/.cvsignore,
src/ltlenv/.cvsignore, src/ltlparse/.cvsignore,
src/ltlvisit/.cvsignore, src/misc/.cvsignore,
src/sanity/.cvsignore, src/tests/.cvsignore,
src/twa/.cvsignore, tools/.cvsignore,
wrap/.cvsignore, wrap/python/.cvsignore,
wrap/python/tests/.cvsignore: here.
2015-04-24 13:57:56 +02:00
Etienne Renault
a14518e103 Fix unused parameter.
*  src/tests/parse_print_test.cc: here.
2015-04-24 13:57:56 +02:00
Etienne Renault
66bd8f34db Merge kripketest, graphtest and ltltest into tests
* README, configure.ac, iface/ltsmin/Makefile.am,
src/tests/defs.in, src/tests/.gitignore, src/tests/Makefile.am,
src/Makefile.am: update references.
* src/kripketest/.gitignore, src/kripketest/Makefile.am,
src/kripketest/defs.in, src/graphtest/.gitignore,
src/graphtest/Makefile.am,
src/graphtest/defs.in, src/ltltest/.cvsignore,
src/ltltest/.gitignore, src/ltltest/Makefile.am,
src/ltltest/defs.in:: remove files.
* src/kripketest/bad_parsing.test, src/kripketest/kripke.test,
src/kripketest/origin, src/kripketest/parse_print_test.cc,
src/ltltest/bare.test, src/ltltest/consterm.cc,
src/ltltest/consterm.test, src/tests/defs.in,
src/ltltest/equals.test, src/ltltest/equalsf.cc,
src/ltltest/eventuniv.test, src/ltltest/exclusive-ltl.test,
src/graphtest/graph.cc, src/graphtest/graph.test,
src/ltltest/isop.test, src/ltltest/kind.cc,
src/ltltest/kind.test, src/ltltest/latex.test,
src/ltltest/lbt.test, src/ltltest/length.cc,
src/ltltest/length.test, src/ltltest/lenient.test,
src/ltltest/ltlcrossgrind.test, src/ltltest/ltlfilt.test,
src/ltltest/ltlgrind.test, src/ltltest/ltlrel.cc,
src/ltltest/ltlrel.test, src/ltltest/lunabbrev.test,
src/ltltest/nenoform.test, src/graphtest/ngraph.cc,
src/graphtest/ngraph.test, src/ltltest/parse.test,
src/ltltest/parseerr.test, src/ltltest/rand.test,
src/ltltest/readltl.cc, src/ltltest/reduc.cc,
src/ltltest/reduc.test, src/ltltest/reduc0.test,
src/ltltest/reduccmp.test, src/ltltest/reducpsl.test,
src/ltltest/remove_x.test, src/ltltest/stutter-ltl.test,
src/ltltest/syntimpl.cc, src/ltltest/syntimpl.test,
src/graphtest/tgbagraph.test, src/ltltest/tostring.cc,
src/ltltest/tostring.test, src/ltltest/tunabbrev.test,
src/ltltest/tunenoform.test, src/graphtest/twagraph.cc,
src/ltltest/unabbrevwm.test,src/ltltest/utf8.test,
src/ltltest/uwrm.test: rename as...
* src/tests/bad_parsing.test, src/tests/kripke.test,
src/tests/origin, src/tests/parse_print_test.cc,
src/tests/bare.test, src/tests/consterm.cc,
src/tests/consterm.test, src/tests/equals.test,
src/tests/equalsf.cc, src/tests/eventuniv.test,
src/tests/exclusive-ltl.test, src/tests/graph.cc,
src/tests/graph.test, src/tests/isop.test,
src/tests/kind.cc, src/tests/kind.test,
src/tests/latex.test, src/tests/lbt.test,
src/tests/length.cc, src/tests/length.test,
src/tests/lenient.test, src/tests/ltlcrossgrind.test,
src/tests/ltlfilt.test, src/tests/ltlgrind.test,
src/tests/ltlrel.cc, src/tests/ltlrel.test,
src/tests/lunabbrev.test, src/tests/nenoform.test,
src/tests/ngraph.cc, src/tests/ngraph.test,
src/tests/parse.test, src/tests/parseerr.test,
src/tests/rand.test, src/tests/readltl.cc,
src/tests/reduc.cc, src/tests/reduc.test,
src/tests/reduc0.test, src/tests/reduccmp.test,
src/tests/reducpsl.test, src/tests/remove_x.test,
src/tests/stutter-ltl.test, src/tests/syntimpl.cc,
src/tests/syntimpl.test, src/tests/tgbagraph.test,
src/tests/tostring.cc, src/tests/tostring.test,
src/tests/tunabbrev.test, src/tests/tunenoform.test,
src/tests/twagraph.cc, src/tests/unabbrevwm.test,
src/tests/utf8.test, src/tests/uwrm.test: ...these!
2015-04-24 13:57:56 +02:00
Etienne Renault
bd57f7a991 Rename tgbatest into tests.
* src/Makefile.am, README, configure.ac: update references.
* src/tgbatest/: rename as...
* src/tests/: ...this!
2015-04-24 13:57:56 +02:00