Earlier quoted context omitted.
The kind of assertion he needed though, could only be ensured by the database, not application code (my impression).
Agreed, infinite loops are a little hard to protect using asserts. When I hit the first infinite loop bug on a code path, I frequently add code to assert that the number of calls is less than $A_LARGE_NUMBER to catch future occurrences of the same root cause.
http://www.cs.cmu.edu/~pane/research.html
http://www.cs.cmu.edu/~pane/thesis/
Pretty cool work regardless, I really like the way it deals with aggregates, for example.