A Brutal Look at Balanced Parentheses, Computing Machines, and Pushdown Automata
As discussed in Pattern Matching and Recursion , a well-known programming puzzle is to write a function that determines whether a string of parentheses is “balanced,” i.e. each opening parenthesis has a corresponding closing parenthesis, and the parentheses are properly nested.