diff options
-rw-r--r-- | src/act4e_solutions/sets_properties.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/act4e_solutions/sets_properties.py b/src/act4e_solutions/sets_properties.py index 5390d23..2044abd 100644 --- a/src/act4e_solutions/sets_properties.py +++ b/src/act4e_solutions/sets_properties.py @@ -7,7 +7,13 @@ X = TypeVar("X") class SolFiniteSetProperties(I.FiniteSetProperties): def is_subset(self, a: I.FiniteSet[X], b: I.FiniteSet[X]) -> bool: - raise NotImplementedError() + return all([b.contains(e) for e in a.elements()]) + + def equal(self, a: I.FiniteSet[X], b: I.FiniteSet[X]) -> bool: + return self.is_Subset(a, b) and self.is_subset(b, a) + + def is_strict_subset(self, a: I.FiniteSet[X], b: I.FiniteSet[X]) -> bool: + return self.is_subset(a, b) and not self.is_subset(b, a) class SolFiniteMakeSetUnion(I.FiniteMakeSetUnion): |