:- set_prolog_flag(flowlog_engine, wam).

ok :-
    op(500, xfx, foo),
    current_op(500, xfx, foo),
    findall(P, current_op(P, xfx, foo), Ps),
    Ps == [500],

    catch(op(500, xfx, ','), E0, true),
    E0 == error(permission_error(modify, operator, ','), op/3),

    catch(op(500, xfx, []), E1, true),
    E1 == error(permission_error(create, operator, []), op/3),

    catch(op(500, xfx, '|'), E2, true),
    E2 == error(permission_error(create, operator, '|'), op/3),

    catch(op(1201, xfx, bar), E3, true),
    E3 == error(domain_error(operator_priority, 1201), op/3),

    catch(op(500, zzz, bar), E4, true),
    E4 == error(domain_error(operator_specifier, zzz), op/3).

