Commit graph

6536 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
5826a40063 add test case for issue #546
This, and the previous two patches, fixes issue #546.

* tests/core/ltlcross.test: Add a test case.
2023-11-10 23:38:25 +01:00
Alexandre Duret-Lutz
67b5d2aa9a fix several algorithms that incorrectly preserved !weak
This massive set of changes was triggered by issue #546.
In addition to the better handling of !weak, this also adds some
weak properties in a few places.

* spot/twaalgos/product.cc (product_aux): Throw some exception
if an automaton with t or f acceptance has the !weak property.  This
is a cheap sanity check to help detect algorithms that incorrectly
assumed !weak input would necessarily become !weak output.
* spot/twaalgos/hoa.cc (print_hoa): Likewise, also do not assume
that terminal implies very-weak.
* spot/parseaut/parseaut.yy: Add several diagnostics for similar
cases.  E.g., a one-state automaton cannot be declared as !very-weak.
* tests/core/parseaut.test: Check those new diagnostics.
* spot/twa/twa.cc (twa::intersecting_run): Temporary remove the weak
property by setting it to maybe, not to false.
* spot/twaalgos/minimize.cc, spot/twaalgos/parity.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/simulation.cc: Account for
the fact that these algorithm may in fact improve the weakness.
* spot/twaalgos/strength.cc: Only look at colors used by the
acceptance condition when deciding weakness.
* spot/twaalgos/synthesis.cc: Declare the strategy as weak.
* bin/randaut.cc: Add weak to automata with t/f acceptance.
* spot/kripke/kripke.hh: Make kripke structures as weak.
* tests/core/acc_word.test, tests/core/alternating.test,
tests/core/complement.test, tests/core/complete.test,
tests/core/ltlsynt.test, tests/core/randomize.test,
tests/core/readsave.test, tests/core/remfin.test,
tests/core/sccsimpl.test, tests/core/strength.test,
tests/core/wdba2.test, tests/ltsmin/kripke.test,
tests/python/automata-io.ipynb, tests/python/automata.ipynb,
tests/python/dbranch.py, tests/python/highlighting.ipynb,
tests/python/kripke.py, tests/python/ltsmin-dve.ipynb,
tests/python/mealy.py, tests/python/simstate.py: Adjust all these test
cases.
* NEWS: Mention the fixes.
2023-11-10 23:38:25 +01:00
Alexandre Duret-Lutz
ac05035267 product_susp: fix handling of unsatisfiable/universal acceptances
Part of issue #546 reported by Rüdiger Ehlers

* spot/twaalgos/product.cc (product_susp): Fix detection and handling
of unsatisfiable/universal acceptances.
* tests/python/_product_susp.ipynb: Add test cases.
2023-11-10 23:38:25 +01:00
Florian Renkin
127cb89cad Remove binary integer literals
Remove this notation because Swig only supports it since version 4.0.0,
whereas Spot requires a version greater than or equal to 3.0.2.

* spot/tl/apcollect.hh: Here.
2023-11-08 10:05:54 +01:00
Alexandre Duret-Lutz
9bdc500013 powerset: speedup computation for singleton with single edge
* spot/twaalgos/powerset.cc: Here.
2023-11-03 10:15:24 +01:00
Alexandre Duret-Lutz
75f3a5f2c5 Fix warnings with GCC 7 on Centos 7
* spot/twa/twagraph.cc: Mark two variables as unused.
* spot/twaalgos/aiger.cc: Avoid spurious nullptr dereference warning,
and mark more variable as unused.
* spot/twaalgos/forq_contains.cc (word::operator==): Mark as
maybe_unused.
* bin/ltlsynt.cc, spot/twaalgos/relabel.cc,
spot/twaalgos/mealy_machine.cc, spot/twaalgos/synthesis.cc,
spot/twaalgos/zlktree.cc: Avoid unused variables warnings.
* spot/twaalgos/toparity.cc: Remove uses of std::optional, they were
not necessary, and they trigger spurious warnings in GCC 7.  Also
work around a spurious "potential nullptr deref".
* tests/core/twacube.cc: Fix another potential nullptr warning.
* spot/twaalgos/simulation.cc: Work a around GCC 6/7 bug.
2023-11-03 10:14:34 +01:00
Alexandre Duret-Lutz
1a2746e182 sbacc: ignore false edges and unreachable states
* spot/twaalgos/sbacc.cc: Here.
2023-10-12 16:06:00 +02:00
Alexandre Duret-Lutz
f2d034130a introduce realizability_simplifier to share more of ltlsynt's code
* spot/tl/apcollect.hh,
spot/tl/apcollect.cc (realizability_simplifier): New class, built from
code existing in ltlsynt, so that other tools may use this too.
* bin/ltlsynt.cc: Use realizability_simplifier.
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Adjust to use
realizability_simplifier instead of relabeling_map.
* NEWS: Mention the new class.
2023-10-09 17:53:12 +02:00
Alexandre Duret-Lutz
9e40a32fd1 * .gitlab-ci.yml: Add a centos7 build. 2023-10-05 13:56:45 +02:00
Alexandre Duret-Lutz
02f9f0a1c9 * .gitlab-ci.yml: Activate Raspbian again. 2023-10-03 16:25:19 +02:00
Alexandre Duret-Lutz
9bf1edd80d ltlsynt: add option --global-equivalence
Fixes issue #529.

* spot/tl/apcollect.hh,
spot/tl/apcollect.cc (collect_equivalent_literals): New function.
* python/spot/impl.i: Adjust.
* spot/tl/formula.hh,
spot/tl/formula.cc (formula_ptr_less_than_bool_first): New comparison
function.
* spot/twaalgos/aiger.hh, spot/twaalgos/aiger.cc: Adjust to deal
with equivalent assignments.
* bin/ltlsynt.cc: Implement the new option.
* tests/core/ltlsynt.test: Adjust test cases.
2023-10-03 09:21:55 +02:00
Alexandre Duret-Lutz
c016f561fa sccinfo: implement PROCESS_UNREACHABLE_STATES
This is actually used by next patch.

* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Here.
* tests/python/sccinfo.py: Add a small test case.
* NEWS: Mention it.
2023-10-02 14:19:53 +02:00
Alexandre Duret-Lutz
70812046d2 ltlsynt: do a fixpoint around the polarity simplifications
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Adjust.
2023-10-02 14:19:53 +02:00
Florian Renkin
6dc11b4715 notebooks: correction of typos
* tests/python/_partitioned_relabel.ipynb,
  tests/python/_product_weak.ipynb,
  tests/python/acc_cond.ipynb,
  tests/python/aliases.ipynb,
  tests/python/automata.ipynb,
  tests/python/cav22-figs.ipynb,
  tests/python/contains.ipynb,
  tests/python/decompose.ipynb,
  tests/python/formulas.ipynb,
  tests/python/games.ipynb,
  tests/python/highlighting.ipynb,
  tests/python/ltsmin-dve.ipynb,
  tests/python/parity.ipynb,
  tests/python/product.ipynb,
  tests/python/satmin.ipynb,
  tests/python/stutter-inv.ipynb,
  tests/python/synthesis.ipynb,
  tests/python/twagraph-internals.ipynb,
  tests/python/word.ipynb,
  tests/python/zlktree.ipynb: here
2023-09-26 11:56:26 +02:00
Alexandre Duret-Lutz
858629dd3a twagraph: fix merge_states() on automata without edges
This corner case was simply causing segfaults.

* tests/python/mergedge.py: Add a test case.
* spot/twa/twagraph.cc (merge_states): Add special handling for
the case where the automaton has no edges.
2023-09-20 00:02:29 +02:00
Alexandre Duret-Lutz
202ab92d1d ltlsynt: detect APs with constant polarity
This implements the first point of issue #529.

* spot/tl/apcollect.cc, spot/tl/apcollect.hh (collect_litterals): New
function.
* bin/ltlsynt.cc: Implement the --polarity option, use
collect_litterals() to simplify the specification, finally patch the
game, Mealy, or Aiger output.
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Take a
relabeling_map has argument to specify extra APs.
* tests/core/ltlsynt.test, tests/core/ltlsynt2.test: Adjust test
cases.
2023-09-19 11:35:21 +02:00
Alexandre Duret-Lutz
abca0f7fd9 * spot/tl/formula.hh: Typo in comment. 2023-09-15 11:25:48 +02:00
Alexandre Duret-Lutz
6ac2416e5d forq: remove the "same AP set" restriction
* spot/twaalgos/forq_contains.cc: Remove the check.
* tests/python/forq_contains.py: Add two test cases for this.
2023-09-15 10:51:00 +02:00
Alexandre Duret-Lutz
6eff384fca forq: remove the relevance test
Looks like the comparison operator between std::set<std::pair<state,
bool>> and std::set<state> had a few issue.  This is part of an
optimization that Pierre Ganty prefers to see removed, so I'm just
removing that code.

For reference, changing the removed operator<= to the following
also seem to fix all tests.

  static bool operator<=(std::set<std::pair<state, bool>> const& f,
                         state_set const& set)
  {
    auto first1 = set.begin(), last1 = set.end();
    auto first2 = f.begin(), last2 = f.end();
    for (; first2 != last2; ++first1)
      if (first1 == last1 || first2->first < *first1)
        {
          return false;
        }
      else if (first2->first == *first1)
        {
          ++first2;
          // Some states of f may appear twice because of the attached
          // Boolean.
          if (first2 != last2 && first2->first == *first1)
            ++first2;
        }
    return true;
  }

* spot/twaalgos/forq_contains.cc: Remove relevance-based optimization.
2023-09-15 10:51:00 +02:00
Alexandre Duret-Lutz
05d7622f8f forq: make it easier to select contains's version
* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc
(containment_select_version): New function.
(contains): Use it.
* spot/twa/twa.cc (exclusive_word): Likewise.
* bin/autfilt.cc (--included-in): Adjust to use forq depending
on containement_select_version.
* bin/man/spot-x.x: Adjust documentation of
CONTAINMENT_SELECT_VERSION.
* tests/core/included.test, tests/python/forq_contains.py: Add more
tests.
* NEWS: Mention the new feature.
2023-09-15 10:51:00 +02:00
Alexandre Duret-Lutz
ca4e6c4b48 forq: swap arguments of contains_forq
* spot/twaalgos/forq_contains.hh,
spot/twaalgos/forq_contains.cc (contains_forq): Swap arguments so
they follow the same order as contains().
* tests/python/forq_contains.py: Adjust.
2023-09-15 10:50:52 +02:00
Alexandre Duret-Lutz
3861c04581 forq: fix Buchi acceptance test
* spot/twa/twa.cc: Here.
* spot/twaalgos/forq_contains.cc: And there.  Also simplify the
handling code by simply throwing the exception when the error is
detected.
2023-09-13 15:48:17 +02:00
Alexandre Duret-Lutz
28a6471efb forq: fix bib entry and bind the doxygen doc to a group
* doc/spot.bib: Reformat the FORQ reference in the style of the
rest of the bibliographic file.
* spot/twaalgos/forq_contains.hh: Adjust, and add missing \ingroup.
2023-09-13 15:48:17 +02:00
Jonah Romero
ad22eb3e65 add enviroment variables for FORQ algorithm
* AUTHORS: added Jonah Romero
* bin/man/spot-x.x: Added the enviroment variables,
                    SPOT_EXCLUSIVE_WORD and SPOT_CONTAINMENT_CHECK
* doc/spot.bib: Added paper citation for FORQ inclusion algorithm
* spot/twa/twa.cc: Modified exclusive_word to also use FORQ
* spot/twaalgos/contains.cc: Modified contains to also use FORQ
2023-09-13 15:48:17 +02:00
Jonah Romero
d1c5b2efdf implement a FORQ-based inclusion check for SBAs
* spot/twaalgos/forq_contains.cc, spot/twaalgos/forq_contains.hh: New
files.
* spot/twaalgos/Makefile.am, python/spot/impl.i: Add them.
* tests/python/forq_contains.py: New file.
* tests/Makefile.am: Add it.
2023-09-13 15:48:17 +02:00
Jonah Romero
c2832cabfc split: add a new split_edge variant
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: Here.
* tests/python/splitedge.py: New file.
* tests/Makefile.am: Add it.
2023-09-13 15:48:17 +02:00
Alexandre Duret-Lutz
d96796121a replace sprintf by snprintf
This was reported by Pierre Ganty, who said that sprintf is reported
as deprecated on MacOS 13.5.2 (22G91).

* spot/twa/acc.cc, spot/twaalgos/aiger.cc: Here.
2023-09-13 15:39:36 +02:00
Alexandre Duret-Lutz
7149521f48 relabel_bse: rework to simplify more patterns
Rework the way we compute and use cut-points to catch more patterns we
can rewrite.  Also Use BDDs to check if a Boolean sub-expression is
false or true.   Fixes issue #540.

* spot/tl/relabel.hh: Update documentation
* spot/tl/relabel.cc (relabel_bse): Rework.
* tests/core/ltlfilt.test: Add more test cases.
* tests/python/_mealy.ipynb: Update.
* NEWS: Mention the change.
2023-09-13 11:31:49 +02:00
Alexandre Duret-Lutz
cbb981ffd5 python: add bindings for set of unsigned int
Requested by Marek Jankola.

* python/spot/impl.i: Add bindings for std::set<unsigned>.
* tests/python/powerset.py: New file.
* tests/Makefile.am: Add it.
* THANKS: Add Marek.
2023-09-08 12:05:06 +02:00
Alexandre Duret-Lutz
538afeb73b * spot/twaalgos/aiger.hh: Add missing include. 2023-09-08 11:37:47 +02:00
Alexandre Duret-Lutz
e2149fabf4 determinize: work around overflow in reachability matrix indices
Fixes #541, reported by David Dokoupil.

* spot/twaalgos/determinize.cc: Disable use_simulation when the input
has more than 2^16 SCCs..  Also rework the reachability
matrix to store only its lower half triangle.
* spot/twaalgos/determinize.hh, NEWS: Mention the limitation of
use_simulation.
* THANKS: Add David.
2023-09-05 09:12:15 +02:00
Alexandre Duret-Lutz
110b052b7d translate: add a new relabel-overlap option
Fixes issue #536.  Also a part of issue #500.

* spot/twaalgos/translate.hh, spot/twaalgos/translate.cc: Implement
this new option.
* bin/spot-x.cc, NEWS: Mention it.
* tests/core/ltl2tgba2.test: Add the test case from issue #536.
2023-08-30 16:49:28 +02:00
Alexandre Duret-Lutz
18478e663f relabel: introduce an overlapping relabeling version
Related to issue #500 and issue #536.

* spot/tl/relabel.hh (relabel_overlapping_bse): New function.
* spot/tl/relabel.cc: Implement it.
* bin/ltlfilt.cc: Add a --relabel-overlapping-bool option.
* tests/core/ltlfilt.test: Test it.
* NEWS: Mention it.
2023-08-30 16:49:19 +02:00
Alexandre Duret-Lutz
14347cdc52 * tests/sanity/style.test: Don't use egrep. 2023-08-03 11:49:08 +02:00
Alexandre Duret-Lutz
93ded57e52 Merge branch 'master' into next 2023-08-01 14:26:35 +02:00
Alexandre Duret-Lutz
41751b80a1 * NEWS, configure.ac: Bump version to 2.11.6.dev. 2023-08-01 14:22:32 +02:00
Alexandre Duret-Lutz
f4b397a2bf Release Spot 2.11.6
* NEWS, configure.ac, doc/org/setup.org: Update version.
2023-08-01 12:19:47 +02:00
Alexandre Duret-Lutz
bb95705d52 mention the bug fixed in BuDDy
* NEWS: Explain the bug fixed in previous patch and reported in
issue #535.
* THANKS: Add Guillermo.
2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
e37bc9e1ae [buddy] fix cache index of bdd_forall
Fix a 20 year old typo that caused a bug reported by Guillermo Perez.

* src/bddop.c (bdd_forall, bdd_forallcomp): Fix the cache index.
2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
de7d5a956f * .gitlab-ci.yml: temporary disable raspbian. 2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
44d9e34e32 improve coverage of LaTeX/utf8 printers for SERE
* bin/common_output.cc, bin/common_output.hh,
bin/randltl.cc: Adjust so that running "randltl -S" use
the SERE flavor of the spot/latex/utf8 formula printers.
* tests/core/latex.test, tests/core/utf8.test,
tests/python/ltlparse.py: Add more test cases.
2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
15857385a5 bin: cover more tmpfile failure when running as root
* tests/core/ltlcross5.test: reorganize to test missing directory
before permission issues, as the latter cannot be run as root.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
3d412fbb78 tests: add some test to cover autcross' univ-edges removal
* tests/core/ltl3ba.test: Here.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
531252119c aiger: order the inputs of binary AND gates
* spot/twaalgos/aiger.cc: Here.
* tests/core/ltlsynt.test: Adjust, and add test case for aiger=optim.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
e548bf0a8e acc: remove some dead functions
* spot/twa/acc.hh, spot/twa/acc.cc (has_parity_prefix,
is_parity_max_equiv): Remove.
* spot/twa/acc.hh, spot/twa/twagraph.cc,
spot/twa/twagraph.hh (apply_permutation): Remove.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
69b9ffef9a bin: fix handling for --output & --format with LTL outputs
* bin/common_output.cc: Set the output stream for LTL formats.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
8065759fbd * HACKING: Mention the svgo version we use. 2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
090dcf17eb work around spurious GCC 13 warnings
* spot/graph/graph.hh (new_univ_dests): Add an overload taking
a temporary vector.
* spot/twa/twagraph.cc (defrag_states): Use it.
* tests/core/parity.cc: Remove some temporary variables.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
bd1809f758 bin: handle thousands of output files
Fixes #534.  Test case is only on next branch.

* bin/common_file.hh, bin/common_file.cc: Make it possible
to reopen a closed file.
* bin/common_output.cc, bin/common_aoutput.cc: Add a heuristic
to decide when to close files.
* NEWS: Mention the issue.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
adca03a30a * tests/core/ltlcross4.test: Work around recent Pandas change. 2023-08-01 10:51:33 +02:00