if (o->type_ < type_)
return o->depends(this);
- if (auto* other = dynamic_cast<const BarrierTransition*>(o)) {
+ // Actions executed by the same actor are always dependent
+ if (o->aid_ == aid_)
+ return true;
+
+ if (const auto* other = dynamic_cast<const BarrierTransition*>(o)) {
if (bar_ != other->bar_)
return false;
// type_ <= other->type_ in MUTEX_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT,
- if (auto* other = dynamic_cast<const MutexTransition*>(o)) {
+ if (const auto* other = dynamic_cast<const MutexTransition*>(o)) {
// Theorem 4.4.7: Any pair of synchronization actions of distinct actors concerning distinct mutexes are independent
if (mutex_ != other->mutex_)
return false;
std::string SemaphoreTransition::to_string(bool verbose) const
{
if (type_ == Type::SEM_ASYNC_LOCK || type_ == Type::SEM_UNLOCK)
- return xbt::string_printf("%s(semaphore: %" PRIxPTR ")", Transition::to_c_str(type_), sem_);
+ return xbt::string_printf("%s(semaphore: %u)", Transition::to_c_str(type_), sem_);
if (type_ == Type::SEM_WAIT)
- return xbt::string_printf("%s(semaphore: %" PRIxPTR ", granted: %s)", Transition::to_c_str(type_), sem_,
+ return xbt::string_printf("%s(semaphore: %u, granted: %s)", Transition::to_c_str(type_), sem_,
granted_ ? "yes" : "no");
THROW_IMPOSSIBLE;
}
if (o->type_ < type_)
return o->depends(this);
- if (auto* other = dynamic_cast<const SemaphoreTransition*>(o)) {
+ // Actions executed by the same actor are always dependent
+ if (o->aid_ == aid_)
+ return true;
+
+ if (const auto* other = dynamic_cast<const SemaphoreTransition*>(o)) {
if (sem_ != other->sem_)
return false;