https://chat.openai.com/share/e1d04428-d57e-4e50-ac38-4d11b55f4f3e
Be sure to click the blue "view analysis" icon, it looks like this: [>_] at the end of its reply to view the code it wrote.
After analyzing and working on the problem for about two minutes, ChatGPT 4 was was able to write a correct Recursive Descent Parser for arithmetic expressions and parentheses that obeys order of operations and includes unary minus (for expressions like 3*-1). It worked for most of the inputs I tried, including:
evaluate_expression("5+5")
evaluate_expression("5+-5")
evaluate_expression("(10+5)/3")
evaluate_expression("(10+5)/-4")
Though it accepted some invalid expressions such as "4.5+++2" as well.I think this would be a challenge for most computer science students to write in a few hours even if they were studying exactly this, and not all students would be able to complete the assignment successfully. ChatGPT's parser even handles decimal points.
Amazingly, it wrote its own test suite which it passed.
While this demonstration doesn't obviously qualify as superintelligence, I think it is an amazing demonstration of how much ChatGPT 4 can do all on its own now.