src/parser.py
def evaluate(self, root):
        ''' Compute the parent node's truth value from its children '''
        truth_value = None
        # insert a truth value for an atomic sentence
        if root.name in self.lexer.terms:
            truth_value = self.insert_term_value(truth_value, root)
        # compute the negation of an expression
        elif root.name == '~':
            truth_value = self.insert_unary_value(truth_value, root)
        # compute the output of a binary function
        elif root.name in self.lexer.binary_op:
            truth_value = self.insert_binary_value(truth_value, root)
        # if token is the root of the tree, save truth value
        if root.root == True:
            self.addValue(truth_value)
 Compute the parent node's truth value from its children 
Compute the parent node's truth value from its children
Compute the parent node ' s truth value from its children
def evaluate(self, root):
        truth_value = None
        if root.name in self.lexer.terms:
            truth_value = self.insert_term_value(truth_value, root)
        elif root.name == '~':
            truth_value = self.insert_unary_value(truth_value, root)
        elif root.name in self.lexer.binary_op:
            truth_value = self.insert_binary_value(truth_value, root)
        if root.root == True:
            self.addValue(truth_value)
def evaluate ( self , root ) : truth_value = None if root . name in self . lexer . terms : truth_value = self . insert_term_value ( truth_value , root ) elif root . name == '~' : truth_value = self . insert_unary_value ( truth_value , root ) elif root . name in self . lexer . binary_op : truth_value = self . insert_binary_value ( truth_value , root ) if root . root == True : self . addValue ( truth_value )
Compute the parent node's truth value from its children
Compute the parent node ' s truth value from its children
''' Compute the parent node's truth value from its children ''' # insert a truth value for an atomic sentence # compute the negation of an expression # compute the output of a binary function # if token is the root of the tree, save truth value
self
root