src/parser.py
def generate_truth_assign(self, t, expression):
        ''' Generate the initial truth assignments for each term '''
        tmpExp = []
        # create an empty dictionary to store seen terms
        char_map = defaultdict(lambda: None)
        for character in expression:
            # if the term hasn't been seen
            if char_map[character] == None:
                # pop the head character off and
                next_char = t[0]
                t = t[1:]
                # update character map with seen char
                char_map[character] = next_char
                # add character to temporary exp
                tmpExp.append(next_char)
            # otherwise, if the term has been seen
            elif char_map[character] != None:
                # append the seen term to the temporary exp
                next_char = char_map[character]
                tmpExp.append(next_char)
        return tmpExp
 Generate the initial truth assignments for each term 
Generate the initial truth assignments for each term
Generate the initial truth assignments for each term
def generate_truth_assign(self, t, expression):
        tmpExp = []
        char_map = defaultdict(lambda: None)
        for character in expression:
            if char_map[character] == None:
                next_char = t[0]
                t = t[1:]
                char_map[character] = next_char
                tmpExp.append(next_char)
            elif char_map[character] != None:
                next_char = char_map[character]
                tmpExp.append(next_char)
        return tmpExp
def generate_truth_assign ( self , t , expression ) : tmpExp = [ ] char_map = defaultdict ( lambda : None ) for character in expression : if char_map [ character ] == None : next_char = t [ 0 ] t = t [ 1 : ] char_map [ character ] = next_char tmpExp . append ( next_char ) elif char_map [ character ] != None : next_char = char_map [ character ] tmpExp . append ( next_char ) return tmpExp
Generate the initial truth assignments for each term
Generate the initial truth assignments for each term
''' Generate the initial truth assignments for each term ''' # create an empty dictionary to store seen terms # if the term hasn't been seen # pop the head character off and # update character map with seen char # add character to temporary exp # otherwise, if the term has been seen # append the seen term to the temporary exp
self
t
expression