Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Require conflict-freedom in is_valid_configuration
authorMaxwell Pirtle <maxwellpirtle@gmail.com>
Thu, 9 Mar 2023 14:19:07 +0000 (15:19 +0100)
committerMaxwell Pirtle <maxwellpirtle@gmail.com>
Thu, 9 Mar 2023 14:19:07 +0000 (15:19 +0100)
The method `EventSet::is_valid_configuration()`
was missing the condition that the set of events
need also be free of conflicts (in addition to
being causally closed)

src/mc/explo/udpor/EventSet.cpp
src/mc/explo/udpor/EventSet_test.cpp

index 3973022..f0dd8d1 100644 (file)
@@ -124,7 +124,7 @@ bool EventSet::is_valid_configuration() const
   /// which requires that all events have their history contained
   /// in the set
   const History history(*this);
-  return this->contains(history);
+  return contains(history) && is_conflict_free();
 }
 
 bool EventSet::contains(const History& history) const
index 776d3b3..4dc4762 100644 (file)
@@ -527,12 +527,12 @@ TEST_CASE("simgrid::mc::udpor::EventSet: Testing Configurations")
   // The tests enumerate all possible subsets of the events
   // in the structure and test whether those subsets are
   // maximal and/or valid configurations
-  UnfoldingEvent e1;
-  UnfoldingEvent e2{&e1};
-  UnfoldingEvent e3{&e2};
-  UnfoldingEvent e4{&e2};
-  UnfoldingEvent e5{&e1};
-  UnfoldingEvent e6{&e5};
+  UnfoldingEvent e1(EventSet(), std::make_shared<IndependentAction>());
+  UnfoldingEvent e2(EventSet({&e1}), std::make_shared<IndependentAction>());
+  UnfoldingEvent e3(EventSet({&e2}), std::make_shared<IndependentAction>());
+  UnfoldingEvent e4(EventSet({&e2}), std::make_shared<IndependentAction>());
+  UnfoldingEvent e5(EventSet({&e1}), std::make_shared<IndependentAction>());
+  UnfoldingEvent e6(EventSet({&e5}), std::make_shared<IndependentAction>());
 
   SECTION("Valid Configurations")
   {