def main():
    pol = gardenwall()

    # For NuSMV
    smv_str = fsm_def_to_smv_model(pol.fsm_def)
    mc = ModelChecker(smv_str,'gardenwall')  

    ## Add specs
    mc.add_spec("FAIRNESS\n  infected;")
    mc.add_spec("FAIRNESS\n  exempt;")

    # Now, traffic is dropped only when exempt is false and infected is true
    mc.add_spec("SPEC AG (infected & !exempt -> AX policy=policy_2)")

    # If exempt is true, next policy state to redirect to gardenwall, even if infected
    mc.add_spec("SPEC AG (infected & exempt -> AX policy=policy_1)")

    # If infected is false, next policy state is always 'allow'
    mc.add_spec("SPEC AG (!infected -> AX policy=policy_3)")

    ### Policy state is 'allow' until infected is true.
    mc.add_spec("SPEC A [ policy=policy_3 U infected ]")

    # Save NuSMV file
    mc.save_as_smv_file()

    # Verify
    mc.verify()

    return pol >> mac_learner()
def main():
    pol = gardenwall()

    # For NuSMV
    smv_str = fsm_def_to_smv_model(pol.fsm_def)
    mc = ModelChecker(smv_str,'gardenwall')  

    ## Add specs
    mc.add_spec("FAIRNESS\n  infected;")
    mc.add_spec("FAIRNESS\n  exempt;")

    # Now, traffic is dropped only when exempt is false and infected is true
    mc.add_spec("SPEC AG (infected & !exempt -> AX policy=policy_2)")

    # If exempt is true, next policy state to redirect to gardenwall, even if infected
    mc.add_spec("SPEC AG (infected & exempt -> AX policy=policy_1)")

    # If infected is false, next policy state is always 'allow'
    mc.add_spec("SPEC AG (!infected -> AX policy=policy_3)")

    ### Policy state is 'allow' until infected is true.
    mc.add_spec("SPEC A [ policy=policy_3 U infected ]")

    # Save NuSMV file
    mc.save_as_smv_file()

    # Verify
    mc.verify()

    return pol >> mac_learner()
def main():
    pol = serverlb()

    # For NuSMV
    smv_str = fsm_def_to_smv_model(pol.fsm_def)
    mc = ModelChecker(smv_str, "server_lb")

    ## Add specs
    mc.save_as_smv_file()
    mc.verify()

    return pol >> mac_learner()
def main():
    pol = serverlb()

    # For NuSMV
    smv_str = fsm_def_to_smv_model(pol.fsm_def)
    mc = ModelChecker(smv_str, 'server_lb')

    ## Add specs
    mc.save_as_smv_file()
    mc.verify()

    return pol >> mac_learner()