Legal stress-testing of planning applications