<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chk_module_statements(ctx, module_stmt, canonical=False):
 """Validate the statement hierarchy according to the grammar. Return True if module is valid, False otherwise. """

    return chk_statement(ctx, module_stmt, top_stmts, canonical)