diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2018-10-09 10:36:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 10:36:40 -0700 |
commit | 90ffa8b4eb26af9060e57be7fe5d6008717d3ce6 (patch) | |
tree | 0442e608d7cf01131cd98293a3a20b0906348c71 /src/theory/quantifiers/sygus | |
parent | 12246d53ac1dd4bbd464dee9dea61b8ac05b4b49 (diff) |
Random: support URNG interface (#2595)
Use std::shuffle (with Random as the unified random generator) instead
of std::random_shuffle for deterministic, reproducable random shuffling.
Diffstat (limited to 'src/theory/quantifiers/sygus')
-rw-r--r-- | src/theory/quantifiers/sygus/sygus_unif.cpp | 2 | ||||
-rw-r--r-- | src/theory/quantifiers/sygus/sygus_unif_io.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/theory/quantifiers/sygus/sygus_unif.cpp b/src/theory/quantifiers/sygus/sygus_unif.cpp index d1217d01d..c262c77e5 100644 --- a/src/theory/quantifiers/sygus/sygus_unif.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif.cpp @@ -79,7 +79,7 @@ Node SygusUnif::constructBestStringToConcat( { Assert(!strs.empty()); std::vector<Node> strs_tmp = strs; - std::random_shuffle(strs_tmp.begin(), strs_tmp.end()); + std::shuffle(strs_tmp.begin(), strs_tmp.end(), Random::getRandom()); // prefer one that has incremented by more than 0 for (const Node& ns : strs_tmp) { diff --git a/src/theory/quantifiers/sygus/sygus_unif_io.cpp b/src/theory/quantifiers/sygus/sygus_unif_io.cpp index 4fe3cfbed..bd9274f91 100644 --- a/src/theory/quantifiers/sygus/sygus_unif_io.cpp +++ b/src/theory/quantifiers/sygus/sygus_unif_io.cpp @@ -1143,7 +1143,8 @@ Node SygusUnifIo::constructSol( // try a random strategy if (snode.d_strats.size() > 1) { - std::random_shuffle(snode.d_strats.begin(), snode.d_strats.end()); + std::shuffle( + snode.d_strats.begin(), snode.d_strats.end(), Random::getRandom()); } // ITE always first if we have not yet solved // the reasoning is that splitting on conditions only subdivides the problem |