def ParseAndSimplify(query):
 node = Parse(query).tree
 node = _ColonToEquals(node)
 node = SequenceToConjunction(node)
 node = SimplifyNode(node)
 return node

def ParseAndSimplify ( query ) : node = Parse ( query ) . tree node = _ColonToEquals ( node ) node = SequenceToConjunction ( node ) node = SimplifyNode ( node ) return node
parses a query and performs all necessary transformations on the tree .