def handle_atomicity(protocol, args): reset_stats() a, formula = protocol.check_atomicity(args) print(" Atomic: ", not a) if args.verbose or args.stats: print(" stats: ", stats) if a and not args.quiet: print("\nViolation:") pp.pprint(a) print("\nFormula:") print(json.dumps(formula, default=str, sort_keys=True, indent=2)) print()
def handle_enactability(protocol, args): reset_stats() e = protocol.is_enactable() print(" Enactable: ", bool(e)) if args.verbose or args.stats: print(" stats: ", stats) if not e and not args.quiet or args.verbose: print_formula(logic.And(protocol.correct, protocol.enactability)) if e and args.verbose: pp.pprint(e) return e
def handle_safety(protocol, args): reset_stats() expr = protocol.unsafe violation = consistent(expr) print(" Safe: ", not violation) if args.verbose or args.stats: print(" stats: ", stats) if violation and not args.quiet or args.verbose: print_formula(expr) if violation and not args.quiet: print("\nViolation:") pp.pprint(violation) print()
def handle_liveness(protocol, args): reset_stats() e = protocol.is_enactable() violation = consistent(protocol.dead_end) print(" Live: ", e and not violation) if args.verbose or args.stats: print(" stats: ", stats) if violation and not args.quiet or args.verbose: print_formula(protocol.dead_end) if violation and not args.quiet: print("\n Violation:") pp.pprint(violation) print()