import os

def validate_plan(domain, instance, plan_file):
    val_path = "VAL"
    cmd = f"{val_path}/validate {domain} {instance} {plan_file}"
    response = os.popen(cmd).read()
    if "Problem in domain" in response:
        raise Exception("Problem in domain: Check PDDL Writer")
    return True if "Plan valid" in response else False
