From 9b282c4acb634f1ebd4878fb621371c692b07e1d Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Wed, 24 Sep 2025 13:51:49 -0400 Subject: [PATCH] Added similarity relation. --- src/main.rs | 6 +++++- src/tree.rs | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fcf4126..74da9cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,5 +5,9 @@ mod tree; mod test; fn main() { - unimplemented!(); + // safely: trust me!! + // having fun or funly having? + unsafe { + std::hint::unreachable_unchecked() + } } diff --git a/src/tree.rs b/src/tree.rs index 82559db..3cb29f7 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -93,3 +93,19 @@ impl Tree { } } +pub struct SimilarityRelation { + left: T, + right: T, + with_respect_to: T +} + +// implement symmetry +impl PartialEq for SimilarityRelation { + fn eq(&self, other: &Self) -> bool { + ( + (self.left == other.left && self.right == other.right) + || (self.left == other.right && self.right == other.left) + ) + && self.with_respect_to == other.with_respect_to + } +}