Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Commit

Permalink
Add generic BinaryRelation class
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolfoams committed Nov 7, 2019
1 parent 1f4cb87 commit 15761dc
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions equivalence-relation/projeto-logica-unifacisa/BinaryRelation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#coding: utf-8


class BinaryRelation(object):
"""Template class for classes representing a Binary Relation."""

def contains_ordered_pair(self, x, y):
"""
This method returns a boolean value indicating if a given ordered pair belongs to the binary relation.
Arguments:
x - The first element of the ordered pair.
y - The second element of the ordered pair.
Return True if the ordered pair belongs to the binary relation, otherwise, return False.
"""
pass

def relation(self, S):
"""
This method returns a set of pairs in SxS (a.k.a. S²) that belong to the binary relation.
Arguments:
S - The input set.
Return a set of pairs in SxS (a.k.a. S²) that belong to the binary relation.
"""
pass

0 comments on commit 15761dc

Please sign in to comment.