include src/mc/explo/udpor/Configuration.cpp
include src/mc/explo/udpor/EventSet.cpp
include src/mc/explo/udpor/EventSet.hpp
-include src/mc/explo/udpor/StateManager.cpp
-include src/mc/explo/udpor/StateManager.hpp
include src/mc/explo/udpor/UnfoldingEvent.cpp
include src/mc/explo/udpor/UnfoldingEvent.hpp
include src/mc/explo/udpor/Unfolding.cpp
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/mc/explo/UdporChecker.hpp"
+#include "src/mc/api/State.hpp"
#include <xbt/asserts.h>
#include <xbt/log.h>
#include "src/mc/explo/Exploration.hpp"
#include "src/mc/explo/udpor/Configuration.hpp"
#include "src/mc/explo/udpor/EventSet.hpp"
-#include "src/mc/explo/udpor/StateManager.hpp"
#include "src/mc/explo/udpor/Unfolding.hpp"
#include "src/mc/explo/udpor/UnfoldingEvent.hpp"
#include "src/mc/mc_record.hpp"
*/
EventSet G;
- /**
- * Maintains the mapping between handles referenced by events in
- * the current state of the unfolding
- */
- StateManager state_manager_;
-
/**
* @brief UDPOR's current "view" of the program it is exploring
*/
+++ /dev/null
-/* Copyright (c) 2008-2023. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "src/mc/explo/udpor/StateManager.hpp"
-#include "xbt/asserts.h"
-
-namespace simgrid::mc::udpor {
-
-StateManager::Handle StateManager::record_state(std::unique_ptr<State> state)
-{
- if (state.get() == nullptr) {
- throw std::invalid_argument("Expected a newly-allocated State but got NULL instead");
- }
-
- const auto integer_handle = this->current_handle_;
- this->state_map_.insert({integer_handle, std::move(state)});
-
- this->current_handle_++;
- xbt_assert(integer_handle <= this->current_handle_, "Too many states were vended out during exploration via UDPOR.\n"
- "It's suprising you didn't run out of memory elsewhere first...\n"
- "Please report this as a bug along with the very large program");
-
- return integer_handle;
-}
-
-std::optional<std::reference_wrapper<State>> StateManager::get_state(StateManager::Handle handle)
-{
- auto state = this->state_map_.find(handle);
- if (state == this->state_map_.end()) {
- return std::nullopt;
- }
- auto& state_ref = *state->second.get();
- return std::optional<std::reference_wrapper<State>>{state_ref};
-}
-
-} // namespace simgrid::mc::udpor
+++ /dev/null
-/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_MC_UDPOR_GLOBAL_HPP
-#define SIMGRID_MC_UDPOR_GLOBAL_HPP
-
-#include "src/mc/api/State.hpp"
-#include "src/mc/explo/udpor/udpor_forward.hpp"
-
-#include <optional>
-
-namespace simgrid::mc::udpor {
-
-class StateManager {
-private:
- using Handle = StateHandle;
-
- Handle current_handle_ = 1ul;
- std::unordered_map<Handle, std::unique_ptr<State>> state_map_;
-
-public:
- Handle record_state(std::unique_ptr<State>);
- std::optional<std::reference_wrapper<State>> get_state(Handle);
-};
-
-} // namespace simgrid::mc::udpor
-#endif
class EventSet;
class UnfoldingEvent;
class Configuration;
-class StateManager;
class Unfolding;
using StateHandle = unsigned long long;
src/mc/explo/udpor/Configuration.cpp
src/mc/explo/udpor/EventSet.cpp
src/mc/explo/udpor/EventSet.hpp
- src/mc/explo/udpor/StateManager.cpp
- src/mc/explo/udpor/StateManager.hpp
src/mc/explo/udpor/UnfoldingEvent.cpp
src/mc/explo/udpor/UnfoldingEvent.hpp
src/mc/explo/udpor/Unfolding.cpp