from abc import ABC, abstractmethod
class _Intersection(AbstractHomogeneousBinaryRelationOnPerformances):
def __init__(
self,
rel1: AbstractHomogeneousBinaryRelationOnPerformances,
rel2: AbstractHomogeneousBinaryRelationOnPerformances,
):
super().__init__(name=f"Conjonction({rel1.name}, {rel2.name})")
self._rel1 = rel1
self._rel2 = rel2
def isReflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isIrreflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTransitive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isSymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAsymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAntisymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isEquivalence(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPreorder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPartialOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTotalOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def __call__(self, p1, p2):
return self._rel1(p1, p2) and self._rel2(p1, p2)
class _Union(AbstractHomogeneousBinaryRelationOnPerformances):
def __init__(
self,
rel1: AbstractHomogeneousBinaryRelationOnPerformances,
rel2: AbstractHomogeneousBinaryRelationOnPerformances,
):
super().__init__(name=f"Disjonction({rel1.name}, {rel2.name})")
self._rel1 = rel1
self._rel2 = rel2
def isReflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isIrreflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTransitive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isSymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAsymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAntisymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isEquivalence(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPreorder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPartialOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTotalOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def __call__(self, p1, p2):
return self._rel1(p1, p2) or self._rel2(p1, p2)
class _Complement(AbstractHomogeneousBinaryRelationOnPerformances):
def __init__(self, rel1: AbstractHomogeneousBinaryRelationOnPerformances):
super().__init__(name=f"Negation({rel1.name})")
self._rel1 = rel1
def isReflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isIrreflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTransitive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isSymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAsymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAntisymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isEquivalence(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPreorder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPartialOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTotalOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def __call__(self, p1, p2):
return not (self._rel1(p1, p2))
class _Dual(AbstractHomogeneousBinaryRelationOnPerformances):
def __init__(self, rel1: AbstractHomogeneousBinaryRelationOnPerformances):
super().__init__(name=f"Dual({rel1.name})")
self._rel1 = rel1
def isReflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isIrreflexive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTransitive(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isSymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAsymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isAntisymmetric(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isEquivalence(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPreorder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isPartialOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def isTotalOrder(self) -> bool:
raise NotImplementedError() # TODO: implement this!
def __call__(self, p1, p2):
return self._rel1(p2, p1)