Document reasoning