:- module maybe.
:- use_module builtin, private_builtin, table_builtin.
maybe.map_maybe(V_4, maybe.no, maybe.no).
maybe.map_maybe(P_5, maybe.yes(T0_6), maybe.yes(T_7)) :-
    call(P_5, T0_6, T_7).
maybe.map_maybe(V_4, maybe.no) = maybe.no.
maybe.map_maybe(F_5, maybe.yes(T_6)) = maybe.yes(V_7) :-
    V_7 = apply(F_5, T_6).
maybe.fold_maybe(V_5, maybe.no, STATE_VARIABLE_Acc_0_7, STATE_VARIABLE_Acc_8) :-
    STATE_VARIABLE_Acc_8 = STATE_VARIABLE_Acc_0_7.
maybe.fold_maybe(P_9, maybe.yes(Value_10), STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13) :-
    call(P_9, Value_10, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13).
maybe.fold_maybe(V_5, maybe.no, Acc_6) = Acc_6.
maybe.fold_maybe(F_7, maybe.yes(Value_8), Acc0_9) = HeadVar__4_4 :-
    HeadVar__4_4 = apply(F_7, Value_8, Acc0_9).
maybe.map_fold_maybe(V_6, maybe.no, maybe.no, Acc_7, Acc_7).
maybe.map_fold_maybe(P_8, maybe.yes(T0_9), maybe.yes(T_10), Acc0_11, Acc_12) :-
    call(P_8, T0_9, T_10, Acc0_11, Acc_12).
maybe.map_fold2_maybe(V_8, maybe.no, maybe.no, STATE_VARIABLE_A_0_11, STATE_VARIABLE_A_12, STATE_VARIABLE_B_0_13, STATE_VARIABLE_B_14) :-
    STATE_VARIABLE_B_14 = STATE_VARIABLE_B_0_13,
    STATE_VARIABLE_A_12 = STATE_VARIABLE_A_0_11.
maybe.map_fold2_maybe(P_15, maybe.yes(T0_16), maybe.yes(T_17), STATE_VARIABLE_A_0_20, STATE_VARIABLE_A_21, STATE_VARIABLE_B_0_22, STATE_VARIABLE_B_23) :-
    call(P_15, T0_16, T_17, STATE_VARIABLE_A_0_20, STATE_VARIABLE_A_21, STATE_VARIABLE_B_0_22, STATE_VARIABLE_B_23).
maybe.map_fold3_maybe(V_10, maybe.no, maybe.no, STATE_VARIABLE_A_0_14, STATE_VARIABLE_A_15, STATE_VARIABLE_B_0_16, STATE_VARIABLE_B_17, STATE_VARIABLE_C_0_18, STATE_VARIABLE_C_19) :-
    STATE_VARIABLE_C_19 = STATE_VARIABLE_C_0_18,
    STATE_VARIABLE_B_17 = STATE_VARIABLE_B_0_16,
    STATE_VARIABLE_A_15 = STATE_VARIABLE_A_0_14.
maybe.map_fold3_maybe(P_20, maybe.yes(T0_21), maybe.yes(T_22), STATE_VARIABLE_A_0_26, STATE_VARIABLE_A_27, STATE_VARIABLE_B_0_28, STATE_VARIABLE_B_29, STATE_VARIABLE_C_0_30, STATE_VARIABLE_C_31) :-
    call(P_20, T0_21, T_22, STATE_VARIABLE_A_0_26, STATE_VARIABLE_A_27, STATE_VARIABLE_B_0_28, STATE_VARIABLE_B_29, STATE_VARIABLE_C_0_30, STATE_VARIABLE_C_31).
maybe.maybe_is_yes(maybe.yes(X_3), X_3).
:- pragma exceptions(predicate, (maybe.map_maybe), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_maybe), 3, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_maybe), 3, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_maybe), 3, 3, may_throw(user_exception)).
:- pragma exceptions(function, (maybe.map_maybe), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.fold_maybe), 4, 5, may_throw(user_exception)).
:- pragma exceptions(function, (maybe.fold_maybe), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold_maybe), 5, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold2_maybe), 7, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.map_fold3_maybe), 9, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (maybe.maybe_is_yes), 2, 0, will_not_throw).
:- pragma termination_info(maybe.map_maybe((pred((builtin.in), (builtin.out)) is det), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_maybe((pred((builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_maybe((pred((builtin.in), (builtin.out)) is multi), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_maybe((pred((builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_maybe((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.fold_maybe((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold_maybe((pred((builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold2_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(maybe.map_fold3_maybe((pred((builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(maybe.maybe_is_yes((builtin.in), (builtin.out)), finite(-1, [no, yes, no]), cannot_loop).
