From ee0e9491408f6eef33bdd6b729e45d483ba2e859 Mon Sep 17 00:00:00 2001 From: Maxwell Pirtle Date: Mon, 27 Feb 2023 08:57:23 +0100 Subject: [PATCH] Add default method for constructing full graph A convenience method was added which allows the full compatibility graph to be constructed without needing to specify that each node should be included. --- src/mc/explo/udpor/Configuration.cpp | 5 +++++ src/mc/explo/udpor/Configuration.hpp | 12 ++++++++++-- src/mc/explo/udpor/Configuration_test.cpp | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/mc/explo/udpor/Configuration.cpp b/src/mc/explo/udpor/Configuration.cpp index ac99056500..c4bdd79ee2 100644 --- a/src/mc/explo/udpor/Configuration.cpp +++ b/src/mc/explo/udpor/Configuration.cpp @@ -233,4 +233,9 @@ Configuration::make_compatibility_graph_filtered_on(std::function Configuration::make_compatibility_graph() const +{ + return make_compatibility_graph_filtered_on([=](const UnfoldingEvent*) { return true; }); +} + } // namespace simgrid::mc::udpor diff --git a/src/mc/explo/udpor/Configuration.hpp b/src/mc/explo/udpor/Configuration.hpp index b2c469e4a5..d6c95616f0 100644 --- a/src/mc/explo/udpor/Configuration.hpp +++ b/src/mc/explo/udpor/Configuration.hpp @@ -105,8 +105,7 @@ public: /** * @brief Construct a new compatibility graph from the events of the - * configuration whose associated transitions are dependent with the - * given action + * configuration that satisfy the given predicate * * @param pred whether or not to even consider the unfolding event in any * compatibility nodes of the resulting graph @@ -116,6 +115,15 @@ public: std::unique_ptr make_compatibility_graph_filtered_on(std::function pred) const; + /** + * @brief Construct a new compatibility graph from the events of the + * configuration + * + * @returns a new compatibility graph that defines possible maximal subsets + * of events of C + */ + std::unique_ptr make_compatibility_graph() const; + private: /** * @brief The most recent event added to the configuration diff --git a/src/mc/explo/udpor/Configuration_test.cpp b/src/mc/explo/udpor/Configuration_test.cpp index bf12e98765..5232a0542d 100644 --- a/src/mc/explo/udpor/Configuration_test.cpp +++ b/src/mc/explo/udpor/Configuration_test.cpp @@ -300,13 +300,13 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli UnfoldingEvent e7{&e2, &e8}, e11{&e8}; UnfoldingEvent e10{&e7}, e9{&e6, &e7}; UnfoldingEvent e12{&e5, &e9, &e10}; + Configuration C{&e1, &e2, &e3, &e4, &e5, &e6, &e7, &e8, &e9, &e10, &e11, &e12}; SECTION("Test every combination of the maximal configuration (forward graph)") { // To test this, we ensure that for the `i`th event // in `ordered_events`, each event in `ordered_events[0...