import json rows=[] for restart,direct,position,involved in [('goal_kick',True,True,True),('throw_in',True,True,True),('corner_kick',True,True,True),('free_kick',True,True,True),('throw_in',False,True,True),('throw_in',False,False,True),('corner_kick',False,True,False)]: exception=direct and restart in ['goal_kick','throw_in','corner_kick'] result='direct_restart_exception' if exception else 'offside_offence_in_this_model' if position and involved else 'no_offside_offence_in_this_model' rows.append(dict(restart=restart,direct_from_restart=direct,offside_position_at_relevant_teammate_touch=position,plays_or_interferes_in_controlled_case=involved,result=result)) assert sum(r['result']=='direct_restart_exception' for r in rows)==3 print(json.dumps(dict(kind='constructed_rule_cases',date='2026-10-23',laws='IFAB 2026/27 Law 11, checked 2026-10-23',scope='All restarts otherwise valid. Direct means no intervening touch; non-direct cases use an intervening teammate pass. These are invented educational situations, not match observations or a general referee engine. No defender deflection, deliberate save, handball or other offence modeled.',rows=rows),ensure_ascii=False,indent=2))