Commit 34e91b76 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

c++11: replace Sgi::hash_* by Sgi::unordered_*.

* bench/scc-stats/stats.cc, bench/split-product/cutscc.cc,
iface/gspn/ssp.cc, src/bin/ltlcross.cc, src/bin/ltlfilt.cc,
src/bin/randltl.cc, src/dstarparse/nsa2tgba.cc, src/ltlast/formula.hh,
src/ltlast/nfa.hh, src/ltlvisit/contain.hh, src/ltlvisit/dotty.cc,
src/ltlvisit/mark.hh, src/ltlvisit/relabel.cc, src/ltlvisit/relabel.hh,
src/ltlvisit/simplify.cc, src/ltlvisit/snf.hh, src/misc/hash.hh,
src/misc/mspool.hh, src/priv/acccompl.hh, src/priv/accconv.hh,
src/saba/explicitstateconjunction.hh, src/saba/sabastate.hh,
src/sabaalgos/sabareachiter.hh, src/sanity/style.test,
src/ta/taexplicit.cc, src/ta/taexplicit.hh, src/taalgos/emptinessta.cc,
src/taalgos/minimize.cc, src/taalgos/reachiter.hh, src/tgba/state.hh,
src/tgba/taatgba.hh, src/tgba/tgbabddconcretefactory.hh,
src/tgba/tgbaexplicit.hh, src/tgba/tgbakvcomplement.cc,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbatba.cc,
src/tgba/tgbatba.hh, src/tgbaalgos/cutscc.cc, src/tgbaalgos/cycles.hh,
src/tgbaalgos/degen.cc, src/tgbaalgos/dtbasat.cc,
src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/eltl2tgba_lacim.cc,
src/tgbaalgos/emptiness.cc, src/tgbaalgos/gtec/explscc.hh,
src/tgbaalgos/gtec/nsheap.hh, src/tgbaalgos/gv04.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/minimize.cc, src/tgbaalgos/ndfs_result.hxx,
src/tgbaalgos/powerset.hh, src/tgbaalgos/randomgraph.cc,
src/tgbaalgos/reachiter.hh, src/tgbaalgos/replayrun.cc,
src/tgbaalgos/safety.cc, src/tgbaalgos/scc.hh, src/tgbaalgos/se05.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc: Adjust code.
* src/sanity/style.test: Remove check.
parent c568b4d3
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
// Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -28,7 +28,7 @@ namespace spot
{
unsigned tgba_size(const tgba* a)
{
typedef Sgi::hash_set<const state*,
typedef std::unordered_set<const state*,
state_ptr_hash, state_ptr_equal> hash_type;
hash_type seen;
std::queue<state*> tovisit;
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
// Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -38,7 +38,7 @@ namespace spot
{
unsigned tgba_size(const tgba* a)
{
typedef Sgi::hash_set<const state*,
typedef std::unordered_set<const state*,
state_ptr_hash, state_ptr_equal> hash_type;
hash_type seen;
std::queue<state*> tovisit;
......
// Copyright (C) 2008, 2011 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2008, 2011, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2005, 2006, 2007 Laboratoire
// d'Informatique de Paris 6 (LIP6), dpartement Systmes Rpartis
// Coopratifs (SRC), Universit Pierre et Marie Curie.
// d'Informatique de Paris 6 (LIP6), département Systèmes Répartis
// Coopératifs (SRC), Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
......@@ -610,8 +611,8 @@ namespace spot
}
protected:
typedef Sgi::hash_set<const state*,
state_ptr_hash, state_ptr_equal> set_type;
typedef std::unordered_set<const state*,
state_ptr_hash, state_ptr_equal> set_type;
set_type states;
};
......@@ -895,15 +896,15 @@ namespace spot
virtual numbered_state_heap_const_iterator* iterator() const;
protected:
typedef Sgi::hash_map<const state*, int,
state_ptr_hash, state_ptr_equal> hash_type;
typedef std::unordered_map<const state*, int,
state_ptr_hash, state_ptr_equal> hash_type;
hash_type h; ///< Map of visited states.
typedef std::list<const state*> state_list;
typedef Sgi::hash_map<const state*, state_list,
state_ptr_hash, state_ptr_equal> f_map;
typedef Sgi::hash_map<const void*, f_map,
ptr_hash<void> > contained_map;
typedef std::unordered_map<const state*, state_list,
state_ptr_hash, state_ptr_equal> f_map;
typedef std::unordered_map<const void*, f_map,
ptr_hash<void> > contained_map;
contained_map contained;
friend class numbered_state_heap_ssp_const_iterator;
......
......@@ -1190,8 +1190,8 @@ namespace
}
typedef
Sgi::hash_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula> > fset_t;
std::unordered_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula> > fset_t;
class processor: public job_processor
......
......@@ -385,8 +385,9 @@ parse_opt(int key, char* arg, struct argp_state*)
return 0;
}
typedef Sgi::hash_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula> > fset_t;
typedef
std::unordered_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula>> fset_t;
namespace
{
......
......@@ -344,8 +344,9 @@ main(int argc, char** argv)
error(2, 0, "No atomic proposition supplied? Run '%s --help' for usage.",
program_name);
typedef Sgi::hash_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula> > fset_t;
typedef
std::unordered_set<const spot::ltl::formula*,
const spot::ptr_hash<const spot::ltl::formula>> fset_t;
fset_t unique_set;
......
......@@ -90,8 +90,8 @@ namespace spot
};
// Associate the build state to its number.
typedef Sgi::hash_map<build_state, int,
build_state_hash, build_state_equal> bs2num_map;
typedef std::unordered_map<build_state, int,
build_state_hash, build_state_equal> bs2num_map;
// Queue of state to be processed.
typedef std::deque<build_state> queue_t;
......
......@@ -497,14 +497,14 @@ namespace spot
/// \brief Hash Function for <code>const formula*</code>.
///
/// This is meant to be used as a hash functor for
/// Sgi's \c hash_map whose key are of type <code>const formula*</code>.
/// \c unordered_map whose key are of type <code>const formula*</code>.
///
/// For instance here is how one could declare
/// a map of \c const::formula*.
/// \code
/// // Remember how many times each formula has been seen.
/// Sgi::hash_map<const spot::ltl::formula*, int,
/// const spot::ltl::formula_ptr_hash> seen;
/// std::unordered_map<const spot::ltl::formula*, int,
/// const spot::ltl::formula_ptr_hash> seen;
/// \endcode
struct formula_ptr_hash:
public std::unary_function<const formula*, size_t>
......
......@@ -102,8 +102,8 @@ namespace spot
private:
state* add_state(int name);
typedef Sgi::hash_map<int, state*, Sgi::hash<int> > is_map;
typedef Sgi::hash_map<const state*, int, ptr_hash<state> > si_map;
typedef std::unordered_map<int, state*, std::hash<int>> is_map;
typedef std::unordered_map<const state*, int, ptr_hash<state>> si_map;
is_map is_;
si_map si_;
......
......@@ -41,8 +41,8 @@ namespace spot
typedef std::map<const record_*, bool> incomp_map;
incomp_map incompatible;
};
typedef Sgi::hash_map<const formula*,
record_, formula_ptr_hash> trans_map;
typedef std::unordered_map<const formula*,
record_, formula_ptr_hash> trans_map;
public:
/// This class uses spot::ltl_to_tgba_fm to translate LTL
/// formulae. See that function for the meaning of these options.
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
......@@ -36,7 +36,7 @@ namespace spot
class dotty_visitor: public visitor
{
public:
typedef Sgi::hash_map<const formula*, int, ptr_hash<formula> > map;
typedef std::unordered_map<const formula*, int, ptr_hash<formula>> map;
dotty_visitor(std::ostream& os, map& m)
: os_(os), father_(-1), node_(m), sinks_(new std::ostringstream)
{
......
// Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
// Dveloppement de l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -42,8 +43,8 @@ namespace spot
~mark_tools();
private:
typedef Sgi::hash_map<const formula*, const formula*,
ptr_hash<formula> > f2f_map;
typedef std::unordered_map<const formula*, const formula*,
ptr_hash<formula>> f2f_map;
f2f_map simpmark_;
f2f_map markops_;
visitor* simpvisitor_;
......
......@@ -91,8 +91,8 @@ namespace spot
class relabeler: public clone_visitor
{
public:
typedef Sgi::hash_map<const formula*, const formula*,
ptr_hash<formula> > map;
typedef std::unordered_map<const formula*, const formula*,
ptr_hash<formula> > map;
map newname;
ap_generator* gen;
relabeling_map* oldnames;
......@@ -363,8 +363,8 @@ namespace spot
unsigned num; // serial number, in pre-order
unsigned low; // lowest number accessible via unstacked descendants
};
typedef Sgi::hash_map<const formula*, data_entry,
const formula_ptr_hash> fmap_t;
typedef std::unordered_map<const formula*, data_entry,
const formula_ptr_hash> fmap_t;
struct stack_entry
{
const formula* grand_parent;
......
......@@ -30,9 +30,9 @@ namespace spot
enum relabeling_style { Abc, Pnn };
struct relabeling_map: public Sgi::hash_map<const formula*,
const formula*,
ptr_hash<formula> >
struct relabeling_map: public std::unordered_map<const formula*,
const formula*,
ptr_hash<formula>>
{
~relabeling_map()
{
......
......@@ -44,10 +44,10 @@ namespace spot
// The name of this class is public, but not its contents.
class ltl_simplifier_cache
{
typedef Sgi::hash_map<const formula*, const formula*,
ptr_hash<formula> > f2f_map;
typedef Sgi::hash_map<const formula*, bdd,
ptr_hash<formula> > f2b_map;
typedef std::unordered_map<const formula*, const formula*,
ptr_hash<formula>> f2f_map;
typedef std::unordered_map<const formula*, bdd,
ptr_hash<formula>> f2b_map;
typedef std::pair<const formula*, const formula*> pairf;
typedef std::map<pairf, bool> syntimpl_cache_t;
public:
......@@ -2857,11 +2857,11 @@ namespace spot
// a & (b | X(b M a)) = b M a
if (!mo->is_X_free())
{
typedef Sgi::hash_set<const formula*,
ptr_hash<formula> > fset_t;
typedef Sgi::hash_map<const formula*,
std::set<unsigned>,
ptr_hash<formula> > fmap_t;
typedef std::unordered_set<const formula*,
ptr_hash<formula>> fset_t;
typedef std::unordered_map<const formula*,
std::set<unsigned>,
ptr_hash<formula>> fmap_t;
fset_t xgset; // XG(...)
fset_t xset; // X(...)
fmap_t wuset; // (X...)W(...) or (X...)U(...)
......@@ -3131,9 +3131,9 @@ namespace spot
// F(a) & (a M b) = a M b
// F(b) & (a W b) = a U b
// F(b) & (a U b) = a U b
typedef Sgi::hash_map<const formula*,
multop::vec::iterator,
ptr_hash<formula> > fmap_t;
typedef std::unordered_map<const formula*,
multop::vec::iterator,
ptr_hash<formula>> fmap_t;
fmap_t uwmap; // associates "b" to "a U b" or "a W b"
fmap_t rmmap; // associates "a" to "a R b" or "a M b"
// (a U b) & (c U b) = (a & c) U b
......@@ -3606,11 +3606,11 @@ namespace spot
// a | (b & X(b U a)) = b U a
if (!mo->is_X_free())
{
typedef Sgi::hash_set<const formula*,
ptr_hash<formula> > fset_t;
typedef Sgi::hash_map<const formula*,
std::set<unsigned>,
ptr_hash<formula> > fmap_t;
typedef std::unordered_set<const formula*,
ptr_hash<formula>> fset_t;
typedef std::unordered_map<const formula*,
std::set<unsigned>,
ptr_hash<formula>> fmap_t;
fset_t xfset; // XF(...)
fset_t xset; // X(...)
fmap_t rmset; // (X...)R(...) or (X...)M(...) or
......@@ -3922,9 +3922,9 @@ namespace spot
// G(a) | (a W b) = a W b
// G(b) | (a R b) = a R b.
// G(b) | (a M b) = a R b.
typedef Sgi::hash_map<const formula*,
multop::vec::iterator,
ptr_hash<formula> > fmap_t;
typedef std::unordered_map<const formula*,
multop::vec::iterator,
ptr_hash<formula>> fmap_t;
fmap_t uwmap; // associates "a" to "a U b" or "a W b"
fmap_t rmmap; // associates "b" to "a R b" or "a M b"
// (a U b) | (a U c) = a U (b | c)
......
......@@ -28,8 +28,8 @@ namespace spot
namespace ltl
{
typedef Sgi::hash_map<const formula*, const formula*,
ptr_hash<formula> > snf_cache;
typedef std::unordered_map<const formula*, const formula*,
ptr_hash<formula>> snf_cache;
/// Helper to rewrite a sere in Star Normal Form.
///
......
......@@ -30,10 +30,6 @@
# include <unordered_map>
# include <unordered_set>
namespace Sgi = std;
# define hash_map unordered_map
# define hash_multimap unordered_multimap
# define hash_set unordered_set
namespace spot
{
......@@ -60,7 +56,7 @@ namespace spot
/// \ingroup hash_funcs
/// \brief A hash function for strings.
typedef Sgi::hash<std::string> string_hash;
typedef std::hash<std::string> string_hash;
/// \ingroup hash_funcs
/// \brief A hash function that returns identity
......
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE)
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
//
......@@ -117,7 +118,7 @@ namespace spot
private:
struct block_ { block_* next; };
Sgi::hash_map<size_t, block_*> freelist_;
std::unordered_map<size_t, block_*> freelist_;
char* free_start_;
char* free_end_;
// chunk = several agglomerated blocks
......
......@@ -48,7 +48,7 @@ namespace spot
protected:
const bdd all_;
const bdd neg_;
typedef Sgi::hash_map<bdd, bdd, bdd_hash> bdd_cache_t;
typedef std::unordered_map<bdd, bdd, bdd_hash> bdd_cache_t;
bdd_cache_t cache_;
};
} // End namespace Spot
......
......@@ -41,7 +41,7 @@ namespace spot
protected:
bdd allneg_;
typedef Sgi::hash_map<bdd, bdd, bdd_hash> bdd_cache_t;
typedef std::unordered_map<bdd, bdd, bdd_hash> bdd_cache_t;
bdd_cache_t pos_prod_cache_;
bdd_cache_t full_prod_cache_;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment