Commit graph

42 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
76c676dba0 rename set_acceptance_conditions as set_generalized_buchi
* src/hoaparse/hoaparse.yy, src/tgba/tgbagraph.hh,
src/tgbaalgos/compsusp.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/mask.cc, src/tgbaalgos/randomgraph.cc,
src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/stripacc.cc, src/tgba/tgba.hh: Here.
2015-02-23 17:12:11 +01:00
Alexandre Duret-Lutz
fd1f6c4d61 Preliminirary support for generic acceptance.
* src/tgba/acc.hh: Add creation and printing of generic acceptance
code.
* src/tgba/acc.cc: New file.
* src/tgba/Makefile.am: Add it.
* src/tgbatest/acc.cc: More tests.
* src/tgbatest/acc.test: Update.
* src/tgba/tgba.hh (set_acceptance, get_acceptance): New methods.
* src/tgba/tgbagraph.hh: Store acceptance code.
* src/hoaparse/hoaparse.yy: Read any acceptance.
* src/dstarparse/nsa2tgba.cc, src/ta/taexplicit.cc,
src/tgba/tgbaproduct.cc, src/tgba/tgbasafracomplement.cc,
src/tgbaalgos/degen.cc, src/tgbaalgos/hoa.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/product.cc, src/tgbaalgos/stutter.cc,
src/tgbatest/hoaparse.test: Adjust.
2015-02-23 17:12:11 +01:00
Etienne Renault
2786d0c652 hoaparse: Fix non-posix warnings.
*  src/hoaparse/Makefile.am: here.
2015-02-09 10:10:06 +01:00
Alexandre Duret-Lutz
cbee5c1a3f hoaparse: detect duplicate atomic propositions
Reported by Joachim Klein.

* src/hoaparse/hoaparse.yy: Add a std::set to keep track of duplicate
propositions.
* src/tgbatest/hoaparse.test: Test it.
2015-02-03 09:57:53 +01:00
Alexandre Duret-Lutz
d7dc584992 hoaparse: fix parsing of LBTT with non 0-based states
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/lbttparse.test: Add test cases.
* src/tgbatest/hoaparse.test: Adjust.
2015-02-02 20:09:33 +01:00
Alexandre Duret-Lutz
847270b480 ltlcross: replace %H,%T,%N by %O
Also get rid of the lbt_parser, and fix the LBT support of the HOA
parser.

* doc/org/ltlcross.org, doc/org/ltldo.org: Update.
* src/bin/common_trans.cc, src/bin/common_trans.hh: Add support for
%O, and keep %T,%N,%H as hidden aliases without disabling them.
* src/bin/ltlcross.cc, src/bin/ltldo.cc, src/tgbatest/ltl2tgba.cc:
Call hoa_parse instead of lbt_parse.
* src/hoaparse/hoaparse.yy: Improve error reporting from LBT.
* src/hoaparse/hoascan.ll: Fix typos preventing parsing of
LBT files with more than 10 states.
* src/tgbaalgos/lbtt.cc, src/tgbaalgos/lbtt.hh: Delete the lbt
parser.
* src/tgbatest/lbttparse.test: Adjust the expected error message.
* NEWS: Update.
2015-02-01 02:09:48 +01:00
Alexandre Duret-Lutz
5852292c9f hoa: correctly deal with "Acceptance: 1 t"
Report from Tomáš Babiak and František Blahoudek

See also https://github.com/adl/hoaf/issues/36

Also fix a typo in the handling of Fin(1)&Fin(!1) while we are at it.

* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add tests.
2015-01-28 22:35:11 +01:00
Alexandre Duret-Lutz
44f98219d3 python: use hoa_parse instead of tgba_parse
* src/hoaparse/public.hh: Cope with SWIG.
* wrap/python/spot.i: Bind hoa_parse instead of tgba_parse.
Remove the binding for tgba_parse because it will be removed
soon from Spot (cf. #1).
* wrap/python/ajax/spot.in: Use the HOA output of ltl3ba.
* wrap/python/tests/parsetgba.py: Adjust test case.
2015-01-27 22:44:01 +01:00
Alexandre Duret-Lutz
e5294aac21 never: use state-names as comments
* src/tgbaalgos/neverclaim.cc: Here.
* src/hoaparse/hoaparse.yy: Use set_acceptance_conditions() to set
the number of acceptance sets.  Otherwise, the single_acc_set property
is not set.
* src/tgbaalgos/postproc.cc: When expecting a BA or a monitor, do not do
anything if the input is already a BA or a monitor.
* src/tgbatest/hoaparse.test: Add a test case.
* src/tgbatest/readsave.test: Adjust.
2015-01-25 13:07:04 +01:00
Alexandre Duret-Lutz
9add895ba7 hoa,dot: propagate state names
* src/hoaparse/hoaparse.yy: Store state names.
* src/tgbaalgos/dotty.cc, src/tgbaalgos/hoa.cc: Output them.
* src/tgbatest/readsave.test: Test this.
* src/tgbatest/hoaparse.test: Update.
2015-01-23 18:50:03 +01:00
Alexandre Duret-Lutz
2fc816c8a7 hoa: make the scanner interactive when reading from a pipe
Otherwise autfilt will not start processing input automata before its
input buffer is full.

* src/hoaparse/hoascan.ll: Here.
2015-01-22 17:40:00 +01:00
Alexandre Duret-Lutz
a89b9d3678 hoa: do not add a fake initial state when possible
* src/hoaparse/hoaparse.yy: If we have multiple initial states, but
one of them has no incoming edge, use this state instead of the fake
initial state we normally add.
* src/tgbatest/hoaparse.test: Add test case.
2015-01-21 23:28:35 +01:00
Alexandre Duret-Lutz
dd948bc1a7 hoa: validate trans-acc and state-acc
and also set prop_state_based_acc() on input

* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add tests.
2015-01-20 10:55:30 +01:00
Alexandre Duret-Lutz
c6110a884c hoa: fix parsing of label-expr with parentheses
Report from Tomáš Babiak.

* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add example from a development version
of ltl3ba.
2015-01-20 08:31:48 +01:00
Alexandre Duret-Lutz
5536bac4a1 dstarparse, hoaparse: rename inline namespace to please clang
The namespace dstaryy was declared inline and then reopened as
non-inline.  Likewise for hoayy.  Let's use different names.

* src/dstarparse/dstarparse.yy, src/hoaparse/hoaparse.yy: Here.
2015-01-09 14:57:58 +01:00
Alexandre Duret-Lutz
d3fdf55fa3 fix symbol collision, seen with clang-3.5
autfilt would segfault after reading any file, because the local result_
structure used in hoaparse has the same name as the local result_
structure used in dstarparse.  For some reason I can only see this
problem using clang-3.5, not with gcc.

* src/dstarparse/dstarparse.yy, src/hoaparse/hoaparse.yy: Declare both
structures in a different namespace.
2015-01-08 20:59:57 +01:00
Alexandre Duret-Lutz
0b8b65f96f hoaparse: validate use of deterministic and complete
* src/hoaparse/hoaparse.yy: validate deterministic and
complete when parsing HOA.  Also set the deterministic
property on the TGBA.
* src/tgbatest/hoaparse.test: Test errors.
2015-01-05 21:46:21 +01:00
Alexandre Duret-Lutz
578e390d8d hoaparse: validate use of explicit-labels and implicit-labels
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Test it.
2015-01-05 21:45:55 +01:00
Alexandre Duret-Lutz
34b798e115 hoaparse: validate use of state-labels and trans-labels
* src/hoaparse/hoaparse.yy: Fix a map with properties, and use it to
report error when state-label or trans-label are misused.
* src/tgbatest/hoaparse.test: Test that.
2015-01-05 13:33:59 +01:00
Alexandre Duret-Lutz
1a022c8093 hoaparse: improve reporting of errors in LBTT guards
* src/hoaparse/hoaparse.yy: forward the error messages
from lbt_parse().
* src/hoaparse/hoascan.ll: Minor cleanups.
* src/tgbatest/lbttparse.test: Test it.
2014-12-11 22:36:47 +01:00
Alexandre Duret-Lutz
6eb2b06fa7 hoaparse: also accept LBTT input
This is probably the worse grammar I wrote: the LBTT format is designed
to be scanned with scanf, and very inconvenient to parse with
bison/flex.  Here the scanner basically has to emulate a parser to
classify the different INTs as tokens with different types.

* src/hoaparse/hoaparse.yy, src/hoaparse/hoascan.ll: Add rules for LBTT.
* src/hoaparse/parsedecl.hh: Add a way to reset the parser between each
automata.
* src/tgbatest/hoaparse.test, src/tgbatest/lbttparse.test: Add more
tests.
2014-12-10 20:56:07 +01:00
Alexandre Duret-Lutz
61edf7f41d tgba: simplify usage of named properties
* src/tgba/tgba.hh, src/tgba/tgba.cc (set_named_prop): Add a template
version.
(get_named_prop): Hide the old version, and supply a template version
that casts.
* src/bin/ltlcross.cc, src/hoaparse/hoaparse.yy, src/tgbaalgos/hoa.cc,
src/tgbaalgos/product.cc: Adjust usage.
2014-12-09 16:21:45 +01:00
Alexandre Duret-Lutz
5a1e38d90f hoa: store the automaton name as a property
* src/hoaparse/hoaparse.yy: Store the automaton name.
* src/tgbaalgos/hoa.cc: Output it if it exists.
* src/tgbatest/hoaparse.test: Adjust tests.
2014-12-09 16:00:10 +01:00
Alexandre Duret-Lutz
fbbf584bbb graph: let transitions() iterate only on valid transitions
This fixes #6.

* src/graph/graph.hh: Rename the old transitions() as
transition_vector(), and implement a new transitions() that iterates
only on non-dead transitions.
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc, src/graph/ngraph.hh:
Adjust wrappers.
* src/hoaparse/hoaparse.yy, src/tgbaalgos/complete.cc,
src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/randomize.cc, src/tgbaalgos/safety.cc: Adjust calls.
2014-12-08 18:29:45 +01:00
Alexandre Duret-Lutz
ad77145496 how: fix multi-line incomplete strings
Location tracking was incorrect for multi-line
strings/comments/parentheses.  This also fixes and tests recovery on
inclosed strings/comments/parentheses.

* src/hoaparse/hoaparse.yy: Abort on expected EOF.
* src/hoaparse/hoascan.ll: Track newlines inside strings and comments.
Do not use unput() to close incomplete parentheses.
* src/tgbatest/neverclaimread.test, src/tgbatest/hoaparse.test: Add
more tests.
2014-12-04 12:19:18 +01:00
Alexandre Duret-Lutz
ebc3d64927 neverclaim: fix reporting of parse_boolean() errors
* src/hoaparse/hoaparse.yy: Correctly adjust the
location of error messagges.
* src/tgbatest/neverclaimread.test: Add test case.
2014-12-04 12:19:18 +01:00
Alexandre Duret-Lutz
d0525871ed neverclaim: fix parsing of aliased states
* src/graph/ngraph.hh (alias_states): Deal with the case
of aliasing two existing states.
* src/hoaparse/hoaparse.yy: Fix handling of aliased states.
* src/tgbatest/neverclaimread.test: Augment test case.
2014-12-04 12:19:18 +01:00
Alexandre Duret-Lutz
e1bba50047 hoa: swallow the neverclaim parser
This way we can easily parse a stream of HOAs intermixed with
neverclaims.

* src/hoaparse/hoaparse.yy, src/hoaparse/hoascan.ll: Add rules
for neverclaims, adjusted from src/neverparse/neverclaimparse.yy
and src/neverparse/neverclaimparse.ll.
* src/hoaparse/public.hh, NEWS: Update documentation.
* src/neverparse/: Remove this directory.
* README, configure.ac, src/Makefile.am: Adjust accordingly.
* src/tgbatest/ltl2tgba.cc, src/bin/ltlcross.cc: Use HOA
parser to read neverclaims.
* src/tgbatest/hoaparse.test, src/tgbatest/neverclaimread.test: Adjust.
2014-12-04 12:19:17 +01:00
Alexandre Duret-Lutz
0d59e55f4d hoa: fix handling of escaped characters in atomic propositions
* src/hoaparse/hoascan.ll: Remove superfluous line.
* src/tgbaalgos/hoaf.cc: Do not call to_string() to display names, as
this would add another level of escaping.
* src/tgbatest/hoaparse.test: Test it.
2014-11-25 11:37:29 +01:00
Alexandre Duret-Lutz
e7e21ae58f hoa: improve parser and scanner
* src/hoaparse/hoaparse.yy: Improve error reporting
in case labeled edges are mixed with unlabeled edges.
* src/hoaparse/hoascan.ll: Fix handling of nested comments.
* src/tgbatest/hoaparse.test: More coverage.
2014-11-25 08:51:55 +01:00
Alexandre Duret-Lutz
1c8b58d69f hoa: add some error recovery
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: More tests.
2014-11-21 17:44:10 +01:00
Alexandre Duret-Lutz
4043ad2ccf hoa: diagnose unsupported Headers
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Test it.
2014-11-21 17:44:10 +01:00
Alexandre Duret-Lutz
8004dca157 hoa: add support for multiple initial states
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add tests.
2014-11-21 16:07:27 +01:00
Alexandre Duret-Lutz
c12b2d63b3 hoa: add support for --ABORT--
* src/hoaparse/parsedecl.hh (hoa_abort): New structure.
* src/hoaparse/hoascan.ll: Throw hoa_abort on --ABORT--.
* src/hoaparse/hoaparse.yy: Deal with this exception.
* src/hoaparse/public.hh: Add a boolean flag to mark aborted automata.
* src/bin/autfilt.cc: Report aborted automata.
* src/tgbatest/hoaparse.test: Add test case.
2014-11-21 16:07:27 +01:00
Alexandre Duret-Lutz
8c8c2f0b7c hoa: allocate the states once, after parsing the header
* src/hoaparse/hoaparse.yy: Allocate state after parsing the entire
header, not right after passing "States:".
* src/tgbatest/hoaparse.test: Reflect improved error message
about initial state.
2014-11-21 16:07:27 +01:00
Alexandre Duret-Lutz
71d21b378b hoa: support Inf(!x)
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: More tests.
* src/tgba/acc.hh (operator^=): New method.
2014-11-21 16:07:11 +01:00
Alexandre Duret-Lutz
7a03228880 hoa: add alias support
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Test it.
2014-11-21 11:05:24 +01:00
Alexandre Duret-Lutz
691ab05926 hoa: catch redefinition of states
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: More test.
2014-11-21 10:49:58 +01:00
Alexandre Duret-Lutz
69678152b6 hoa: add support for unlabeled transitions
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add tests.
2014-11-20 19:44:56 +01:00
Alexandre Duret-Lutz
1d962f79ac hoa: make the parser more resilient to errors
* src/hoaparse/hoaparse.yy: Improve error recovery,
and fix location tracking in streams.
* src/hoaparse/public.hh: Store the last location so
that the next parse start at the correct position.
* src/bin/autfilt.cc: Stop parsing a stream on irrecoverable errors.
* src/tgbatest/hoaparse.test: Adjust tests.
2014-11-20 12:29:18 +01:00
Alexandre Duret-Lutz
131299d03e hoa: make it possible to read a stream of automata
* src/bin/autfilt.cc: Loop over all automata in a file.
* src/hoaparse/public.hh: Turn the parser into an object.
* src/hoaparse/hoaparse.yy: Adjust.
2014-11-19 23:24:09 +01:00
Alexandre Duret-Lutz
e55bcd95aa hoa: preliminary implementation of a parser
* src/hoaparse/Makefile.am, src/hoaparse/fmterror.cc,
src/hoaparse/hoaparse.yy, src/hoaparse/hoascan.ll,
src/hoaparse/parsedecl.hh, src/hoaparse/public.hh: New files.
* src/Makefile.am, configure.ac, README: Adjust.
* src/tgbatest/ltl2tgba.cc: Add a -XH option.
* src/tgbatest/hoaparse.test: New file.
* src/tgbatest/Makefile.am: Adjust.
* buddy/src/bddx.h: Add a bdd_from_int() function.
2014-11-19 19:29:29 +01:00