예제 #1
0
    def __getitem__(self,x):
        """ Return max(t(x) t in S), where each t is a min-term.

        :param x: the input
        """
        Operation.check_input(self,x)
        return max([min([x[i] for i in s]) for s in self.S])
예제 #2
0
 def __getitem__(self,x):
     Operation.check_input(self,x)
     if x[0] == x[1]:
         return x[self.pos[0]]
     elif x[0] == x[2]:
         return x[self.pos[1]]
     elif x[1] == x[2]:
         return x[self.pos[2]]
     else:
         return self.vals[x]