Commit graph

28 commits

Author SHA1 Message Date
Etienne Renault
57cd9f2d2c Replace guards by pragma once.
* iface/ltsmin/ltsmin.hh, src/bin/common_aoutput.hh,
src/bin/common_conv.hh, src/bin/common_cout.hh,
src/bin/common_file.hh, src/bin/common_finput.hh,
src/bin/common_output.hh, src/bin/common_post.hh,
src/bin/common_r.hh, src/bin/common_range.hh,
src/bin/common_setup.hh, src/bin/common_sys.hh,
src/bin/common_trans.hh, src/dstarparse/parsedecl.hh,
src/dstarparse/public.hh, src/graph/graph.hh,
src/graph/ngraph.hh, src/hoaparse/parsedecl.hh,
src/hoaparse/public.hh, src/kripke/fairkripke.hh,
src/kripke/fwd.hh, src/kripke/kripke.hh,
src/kripke/kripkeexplicit.hh, src/kripke/kripkeprint.hh,
src/kripkeparse/parsedecl.hh, src/kripkeparse/public.hh,
src/ltlast/allnodes.hh, src/ltlast/atomic_prop.hh,
src/ltlast/binop.hh, src/ltlast/bunop.hh,
src/ltlast/constant.hh, src/ltlast/formula.hh,
src/ltlast/multop.hh, src/ltlast/predecl.hh,
src/ltlast/unop.hh, src/ltlast/visitor.hh,
src/ltlenv/declenv.hh, src/ltlenv/defaultenv.hh,
src/ltlenv/environment.hh, src/ltlparse/parsedecl.hh,
src/ltlparse/public.hh, src/ltlvisit/apcollect.hh,
src/ltlvisit/clone.hh, src/ltlvisit/contain.hh,
src/ltlvisit/dotty.hh, src/ltlvisit/dump.hh,
src/ltlvisit/lbt.hh, src/ltlvisit/length.hh,
src/ltlvisit/lunabbrev.hh, src/ltlvisit/mark.hh,
src/ltlvisit/mutation.hh, src/ltlvisit/nenoform.hh,
src/ltlvisit/postfix.hh, src/ltlvisit/randomltl.hh,
src/ltlvisit/relabel.hh, src/ltlvisit/remove_x.hh,
src/ltlvisit/simpfg.hh, src/ltlvisit/simplify.hh,
src/ltlvisit/snf.hh, src/ltlvisit/tostring.hh,
src/ltlvisit/tunabbrev.hh, src/ltlvisit/wmunabbrev.hh,
src/misc/bareword.hh, src/misc/bddlt.hh, src/misc/bitvect.hh,
src/misc/casts.hh, src/misc/common.hh, src/misc/escape.hh,
src/misc/fixpool.hh, src/misc/formater.hh, src/misc/hash.hh,
src/misc/hashfunc.hh, src/misc/intvcmp2.hh,
src/misc/intvcomp.hh, src/misc/location.hh, src/misc/ltstr.hh,
src/misc/memusage.hh, src/misc/minato.hh, src/misc/mspool.hh,
src/misc/optionmap.hh, src/misc/position.hh, src/misc/random.hh,
src/misc/satsolver.hh, src/misc/timer.hh, src/misc/tmpfile.hh,
src/misc/version.hh, src/priv/accmap.hh, src/priv/bddalloc.hh,
src/priv/freelist.hh, src/ta/ta.hh, src/ta/taexplicit.hh,
src/ta/taproduct.hh, src/ta/tgta.hh, src/ta/tgtaexplicit.hh,
src/ta/tgtaproduct.hh, src/taalgos/dotty.hh,
src/taalgos/emptinessta.hh, src/taalgos/minimize.hh,
src/taalgos/reachiter.hh, src/taalgos/statessetbuilder.hh,
src/taalgos/stats.hh, src/taalgos/tgba2ta.hh,
src/tgba/acc.hh, src/tgba/bdddict.hh,
src/tgba/bddprint.hh, src/tgba/formula2bdd.hh, src/tgba/fwd.hh,
src/tgba/taatgba.hh, src/tgba/tgba.hh, src/tgba/tgbagraph.hh,
src/tgba/tgbamask.hh, src/tgba/tgbaproduct.hh, src/tgba/tgbaproxy.hh,
src/tgba/tgbasafracomplement.hh, src/tgbaalgos/are_isomorphic.hh,
src/tgbaalgos/bfssteps.hh, src/tgbaalgos/canonicalize.hh,
src/tgbaalgos/cleanacc.hh, src/tgbaalgos/complete.hh,
src/tgbaalgos/compsusp.hh, src/tgbaalgos/cycles.hh,
src/tgbaalgos/degen.hh, src/tgbaalgos/dotty.hh,
src/tgbaalgos/dtbasat.hh, src/tgbaalgos/dtgbacomp.hh,
src/tgbaalgos/dtgbasat.hh, src/tgbaalgos/dupexp.hh,
src/tgbaalgos/emptiness.hh, src/tgbaalgos/emptiness_stats.hh,
src/tgbaalgos/gtec/ce.hh, src/tgbaalgos/gtec/gtec.hh,
src/tgbaalgos/gtec/sccstack.hh, src/tgbaalgos/gtec/status.hh,
src/tgbaalgos/gv04.hh, src/tgbaalgos/hoa.hh, src/tgbaalgos/isdet.hh,
src/tgbaalgos/isweakscc.hh, src/tgbaalgos/lbtt.hh,
src/tgbaalgos/ltl2taa.hh, src/tgbaalgos/ltl2tgba_fm.hh,
src/tgbaalgos/magic.hh, src/tgbaalgos/mask.hh,
src/tgbaalgos/minimize.hh, src/tgbaalgos/neverclaim.hh,
src/tgbaalgos/postproc.hh, src/tgbaalgos/powerset.hh,
src/tgbaalgos/product.hh, src/tgbaalgos/projrun.hh,
src/tgbaalgos/randomgraph.hh, src/tgbaalgos/randomize.hh,
src/tgbaalgos/reachiter.hh, src/tgbaalgos/reducerun.hh,
src/tgbaalgos/relabel.hh, src/tgbaalgos/remfin.hh,
src/tgbaalgos/replayrun.hh, src/tgbaalgos/safety.hh,
src/tgbaalgos/sbacc.hh, src/tgbaalgos/scc.hh,
src/tgbaalgos/sccfilter.hh, src/tgbaalgos/sccinfo.hh,
src/tgbaalgos/se05.hh, src/tgbaalgos/simulation.hh,
src/tgbaalgos/stats.hh, src/tgbaalgos/stripacc.hh,
src/tgbaalgos/stutter.hh, src/tgbaalgos/tau03.hh,
src/tgbaalgos/tau03opt.hh, src/tgbaalgos/translate.hh,
src/tgbaalgos/weight.hh, src/tgbaalgos/word.hh,
src/sanity/includes.test, src/tgbaalgos/ndfs_result.hxx: here.
2015-03-23 10:19:55 +01:00
Etienne Renault
734bceff8e random: Get rid of uniform_distribution (non-portable).
* src/misc/random.cc, src/misc/random.hh,
src/tgbaalgos/randomgraph.cc, src/tgbatest/randaut.test,
src/tgbatest/randomize.test, src/tgbatest/readsave.test,
src/ltlvisit/simplify.cc, src/tgbaalgos/randomize.cc,
src/graph/graph.hh, src/tgbatest/randpsl.test: here.
2015-02-27 14:17:07 +01:00
Alexandre Duret-Lutz
db34207084 graph: Make perfect forwarding imperfect.
Make sure the constructors with perfect forwarding for states and
transitions do not take the place of copy constructors.  Thanks to Akim
Demaille for its help.  This should fix a bug observed by Joachim Klein
and David Muller.

* src/graph/graph.hh: Disable forwarding constructors for states and
transitions if the first argument is a subclass of the current class.
2015-02-06 14:40:08 +01:00
Thibaud Michaud
1995602df5 Adding function to canonicalize an automaton.
* src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/are_isomorphic.hh,
src/bin/autfilt.cc: are_isomorphic now uses canonicalize. It returns a
bool, because the mapping cannot be deduced easily from the
canonicalized automaton.
* src/graph/graph.hh: Add equality operator to trans_storage_t
for easy comparison of transition vectors.
* src/tgba/tgbagraph.hh: Add equality operator to tgba_graph_trans_data
and to tgba_digraph.
* src/tgbaalgos/canonicalize.cc, src/tgbaalgos/canonicalize.hh:
New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbatest/isomorph.test: Test them.
2014-12-17 14:12:59 +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
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
c0e9891246 randomize: new function
* src/tgbaalgos/randomize.cc, src/tgbaalgos/randomize.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/graph/graph.hh (rename_states_): New method.
* src/bin/autfilt.cc: Add options --randomize and --seed.
* src/tgbatest/randomize.test: Test them.
* src/tgbatest/Makefile.am: Add randomize.test.
* NEWS: Mention randomize().
2014-12-03 14:23:59 +01:00
Alexandre Duret-Lutz
0db0eca14e graph: store the source indices in the transition vector
... and use it to sort transitions.

* src/graph/graph.hh: Adjust storage of source index.  Provide
remove_dead_transitions_(), sort_transitions_() and
chain_transitions_() methods.
* src/tgba/tgbagraph.cc (merge_transitions): Rewrite using
above methods.
* src/tgba/tgbagraph.hh: Add a comparison operator for
transitions.
* src/tgbatest/degenlskip.test, src/tgbatest/det.test,
src/tgbatest/ltl2ta.test, src/tgbatest/neverclaimread.test,
src/tgbatest/readsave.test: Adjust expected transition order in test
cases.
2014-12-02 22:58:18 +01:00
Alexandre Duret-Lutz
923785f76a tgba_digraph: add a copy constructor, and obsolete dupexp
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc: Add a copy constructor,
and some method to purge unreachable states.
* src/graph/graph.hh (defrag_states): Erase transition of removed
states.
* src/tgbaalgos/complete.cc, src/tgbaalgos/compsusp.cc,
src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/simulation.cc,
src/tgbatest/checkpsl.cc, src/tgbatest/emptchk.cc,
src/tgbatest/ltl2tgba.cc: Adjust to use make_tgba_digraph() instead
of tgba_dupexp_dfs() or tgba_dupexp_bfs().
* src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh: Use
make_tgba_digraph() when possible.
* src/tgbatest/det.test, src/tgbatest/sim.test: Adjust expected results.
2014-10-28 19:38:13 +01:00
Alexandre Duret-Lutz
2553c29ca7 tgba_digraph: add a purge_dead_states() method
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc (purge_dead_states): New.
* src/graph/graph.hh (defrag_states): New methods.
* src/tgbaalgos/dtgbacomp.cc: Use it.
* src/tgbatest/det.test: Fix state number.
2014-10-24 11:53:28 +02:00
Alexandre Duret-Lutz
1696fac80c tgbagraph: fix detection of dead transitions
* src/graph/graph.hh (digraph::digraph): Mark transition 0 as dead.
(digraph::is_dead_transition): Fix prototype.
* src/tgba/tgbagraph.hh (tgba_digraph::is_dead_transition): Fix
prototype.
2014-10-08 17:33:09 +02:00
Alexandre Duret-Lutz
d28e7f9c5c graph: Add a is_dead_transition method.
* src/graph/graph.hh, src/tgba/tgbagraph.hh (is_dead_transition): New
method.
2014-08-20 16:10:41 +02:00
Alexandre Duret-Lutz
6dc29547fe * src/graph/ngraph.hh (names): Fix constness. 2014-08-10 20:21:12 +02:00
Alexandre Duret-Lutz
6ecd71c485 * src/graph/graph.hh (transitions): New method. 2014-08-10 15:17:14 +02:00
Alexandre Duret-Lutz
7b23691629 ltl_to_tgba_fm: Build a tgba_digraph instead of a tgba_explicit_formula
The conversion is not complete, because the conversion from SERE to DRA
used for the closure operator is still building a tgba_explicit_formula.

* src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/ltl2tgba_fm.hh: Return
a tgba_digraph.
* src/priv/acccompl.cc: Simplify.
* src/graph/ngraph.hh: Add a way to iterate over all names.
* src/tgba/tgbagraph.hh (compute_support_conditions): Return something
useful.  It's actually used by the constructor of testing automata.
* src/tgbatest/wdba.test: Adjust to the fact that state are not
labeled by formulas anymore.
* src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc: Do not try to enable
UTF8 on automata anymore.
2014-08-06 18:31:18 +02:00
Alexandre Duret-Lutz
fd5fbda4dd Use emplace() for associative containers.
* HACKING: Adjust requirements.  g++4.8 is now OK
for all our targets.
* iface/dve2/dve2.cc, src/dstarparse/dstarparse.yy
src/dstarparse/nsa2tgba.cc, src/graph/ngraph.hh,
src/ltlast/atomic_prop.cc, src/ltlast/binop.cc, src/ltlast/bunop.cc,
src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlvisit/mark.cc,
src/ltlvisit/relabel.cc, src/taalgos/emptinessta.cc,
src/taalgos/tgba2ta.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbagraph.hh,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbatba.cc,
src/tgbaalgos/cycles.cc, src/tgbaalgos/degen.cc,
src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/emptiness.cc, src/tgbaalgos/gtec/gtec.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/reachiter.cc,
src/tgbaalgos/scc.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc, src/tgbaalgos/weight.cc: Use emplace()
instead of insert(make_pair(...)) or insert(...::value_type(...)).
2014-07-31 16:59:47 +02:00
Alexandre Duret-Lutz
c93b41a2c7 randomgraph: Use tgba_digraph.
* src/graph/graph.hh (new_states): Call reserve().
* src/tgbaalgos/randomgraph.cc: Use tgba_digraph
instead of tgba_string_explicit.
2014-06-27 11:40:57 +02:00
Alexandre Duret-Lutz
84f92541f3 * src/graph/graph.hh, src/tgba/tgbagraph.hh: Cosmetic fixes. 2014-06-20 13:46:39 +02:00
Alexandre Duret-Lutz
31bf8c2c1e ngraph: support aliasing states
* src/graph/ngraph.hh (alias_state): New method.
* src/graphtest/ngraph.cc: Use it.
2014-06-20 13:31:23 +02:00
Alexandre Duret-Lutz
424de90385 tgbagraph: add a merge_transitions() method.
* src/graph/graph.hh: Add some framework to erase transitions, and
defrag the resulting transitions_ vector on demand.  Also remove
the nb_states() and nb_transitions() because num_states() and
num_transitions() already exist.
* src/graphtest/graph.cc, src/graphtest/ngraph.cc: Adjust to
use num_states().
* src/tgba/tgbagraph.hh (merge_transitions): New method.
* src/misc/hash.hh: Add a pair_hash class, needed by
merge_transitions().
* src/graphtest/tgbagraph.cc, src/graphtest/tgbagraph.test: Add states
for transitions removal and merge_transitions().
2014-06-20 13:31:23 +02:00
Alexandre Duret-Lutz
9903ae2fa8 Implement an scc_info class that should eventually replace scc_map.
* src/graph/graph.hh (trans_iterator): Add operator->() and operator
bool().
* src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbatest/ltl2tgba.cc: Use the new dump_scc_info_dot() function.
2014-06-20 13:31:23 +02:00
Alexandre Duret-Lutz
1c0a93cc0f * src/graph/graph.hh (trans_iterator): Respect the forward_iterator API. 2014-05-23 18:36:43 +02:00
Alexandre Duret-Lutz
bb2ce45b8a simulation: simplify using tgba_digraph more
* src/graph/graph.hh (new_states): New.
* src/tgba/tgbagraph.hh (graph_t): Make it public.
* src/tgbaalgos/simulation.cc: Get read of the acc_compl_automaton
class and replace it by a loop over all states of a tgba_digraph.
Remove some useless data structures.
2014-05-23 18:36:43 +02:00
Alexandre Duret-Lutz
1f70e6742d tgba: Implement a tgbagraph subclass
* src/tgba/tgbagraph.hh: New file.
* src/tgba/Makefile.am: Add it.
* src/graph/graph.hh: Add methods needed by tgbagraph.hh.
* src/graphtest/tgbagraph.cc, src/graphtest/tgbagraph.test: New files.
* src/graphtest/Makefile.am: Add them.
2014-05-23 18:36:42 +02:00
Alexandre Duret-Lutz
f968c4ed67 graph: add SPOT_API on public classes.
* src/graph/graph.hh, src/graph/ngraph.hh: Here.
2014-05-20 15:40:17 +02:00
Alexandre Duret-Lutz
c793d3f13a graph: Add a test close to the tgba_explicit_string setup.
* src/graph/graph.hh (boxed_label): If State_Data==void, inherit from
std::tuple<> and implement a data() method.
(digraph::state_data): Return by reference.
* src/graphtest/ngraph.cc, src/graphtest/ngraph.test: Test the
case where State_Data implements the spot::state interface.
2014-05-20 15:40:17 +02:00
Alexandre Duret-Lutz
a8fd188d5e graph: Add a named_graph class.
* src/graph/ngraph.hh: New file.
* src/graph/Makefile.am: Add it.
* src/graphtest/ngraph.cc, src/graphtest/ngraph.test: New files.
* src/graphtest/Makefile.am: Add them
2014-05-20 15:40:17 +02:00
Alexandre Duret-Lutz
f7711e9a63 graph: Implement a directed graph.
* src/graph/graph.hh, src/graph/Makefile.am, src/graphtest/graph.cc,
src/graphtest/graph.test, src/graphtest/defs.in,
src/graphtest/Makefile.am: New files.
* src/Makefile.am, configure.ac: Add graph/ and graphtest/.
* README: Mention these directories.
2014-05-20 15:40:16 +02:00