now working bisimilarity

This commit is contained in:
elvis
2025-07-16 01:35:57 +02:00
parent e5f81301c6
commit 0ef51200e5
3 changed files with 55 additions and 29 deletions

View File

@ -11,8 +11,7 @@ use serde::{Deserialize, Serialize};
// -----------------------------------------------------------------------------
/// Basic set of entities.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize,
Deserialize)]
#[derive(Clone, Debug, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
pub struct RSset {
pub identifiers: BTreeSet<IdType>,
}
@ -118,6 +117,12 @@ impl Default for RSset {
}
}
impl PartialEq for RSset {
fn eq(&self, other: &Self) -> bool {
self.identifiers.eq(&other.identifiers)
}
}
impl IntoIterator for RSset {
type Item = IdType;
type IntoIter = std::collections::btree_set::IntoIter<Self::Item>;
@ -491,7 +496,7 @@ impl Default for RSsystem {
// -----------------------------------------------------------------------------
// RSlabel
// -----------------------------------------------------------------------------
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd)]
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialOrd)]
pub struct RSlabel {
pub available_entities: RSset,
pub context: RSset,
@ -555,6 +560,19 @@ impl Default for RSlabel {
}
}
impl PartialEq for RSlabel {
fn eq(&self, other: &Self) -> bool {
self.available_entities == other.available_entities &&
self.context == other.context &&
self.t == other.t &&
self.reactants == other.reactants &&
self.reactants_absent == other.reactants_absent &&
self.inhibitors == other.inhibitors &&
self.inhibitors_present == other.inhibitors_present &&
self.products == other.products
}
}
// -----------------------------------------------------------------------------
// RSassertOp
// -----------------------------------------------------------------------------