Added function to transform AST to tuple representation for testing purposes