:- module bitmap.
:- use_module bool, builtin, char, exception, int, list, private_builtin, string, table_builtin.
:- type bitmap.slice
	--->	slice_ctor((bitmap.slice_bitmap_field) :: bitmap.bitmap, (bitmap.slice_start_bit_index_field) :: int, (bitmap.slice_num_bits_field) :: int).
:- type bitmap.copy_direction
	--->	left_to_right 
	;	right_to_left .
:- type bitmap.bitmap.
:- pragma foreign_type(il, bitmap.bitmap, "class [mercury]mercury.bitmap__csharp_code.mercury_code.MercuryBitmap")
	where	equality is (bitmap.bitmap_equal),
		comparison is (bitmap.bitmap_compare).
:- pragma foreign_type(c, bitmap.bitmap, "MR_BitmapPtr", [can_pass_as_mercury_type])
	where	equality is (bitmap.bitmap_equal),
		comparison is (bitmap.bitmap_compare).
:- pragma foreign_type(java, bitmap.bitmap, "bitmap.MercuryBitmap")
	where	equality is (bitmap.bitmap_equal),
		comparison is (bitmap.bitmap_compare).
:- pragma foreign_type(csharp, bitmap.bitmap, "bitmap.MercuryBitmap")
	where	equality is (bitmap.bitmap_equal),
		comparison is (bitmap.bitmap_compare).
:- pragma foreign_type(erlang, bitmap.bitmap, "")
	where	equality is (bitmap.bitmap_equal),
		comparison is (bitmap.bitmap_compare).
:- type bitmap.bit_index_in_byte == int.
:- pragma foreign_import_module("C", bitmap).
:- pragma foreign_import_module("C#", bitmap).
:- pragma foreign_import_module("Java", bitmap).
:- pragma foreign_import_module("IL", bitmap).
:- pragma foreign_import_module("Erlang", bitmap).
:- pragma foreign_import_module("C", table_builtin).
:- pragma foreign_import_module("IL", table_builtin).
:- pragma foreign_import_module("C", table_builtin).
:- pragma foreign_import_module("IL", table_builtin).
:- pragma foreign_import_module("C", io).
:- pragma foreign_import_module("C#", io).
:- pragma foreign_import_module("Java", io).
:- pragma foreign_import_module("IL", io).
:- pragma foreign_import_module("Erlang", io).
:- pragma foreign_import_module("C", io).
:- pragma foreign_import_module("C#", io).
:- pragma foreign_import_module("Java", io).
:- pragma foreign_import_module("IL", io).
:- pragma foreign_import_module("Erlang", io).
:- pragma foreign_import_module("C", time).
:- pragma foreign_import_module("C", string).
:- pragma foreign_import_module("C", time).
:- pragma foreign_import_module("C#", time).
:- pragma foreign_import_module("Java", time).
:- pragma foreign_import_module("IL", time).
:- pragma foreign_import_module("Erlang", time).
:- pragma foreign_import_module("C", time).
:- pragma foreign_import_module("C#", time).
:- pragma foreign_import_module("Java", time).
:- pragma foreign_import_module("IL", time).
:- pragma foreign_import_module("Erlang", time).
:- pragma foreign_import_module("C#", rtti_implementation).
:- pragma foreign_import_module("Java", rtti_implementation).
:- pragma foreign_import_module("C#", rtti_implementation).
:- pragma foreign_import_module("Java", rtti_implementation).
:- pragma foreign_import_module("C", stm_builtin).
:- pragma foreign_import_module("C", stm_builtin).
:- pragma foreign_import_module("C", store).
:- pragma foreign_import_module("C#", store).
:- pragma foreign_import_module("Java", store).
:- pragma foreign_import_module("IL", store).
:- pragma foreign_import_module("Erlang", store).
:- pragma foreign_import_module("C", store).
:- pragma foreign_import_module("C#", store).
:- pragma foreign_import_module("Java", store).
:- pragma foreign_import_module("IL", store).
:- pragma foreign_import_module("Erlang", store).
:- pragma foreign_import_module("C", array).
:- pragma foreign_import_module("C#", array).
:- pragma foreign_import_module("Java", array).
:- pragma foreign_import_module("IL", array).
:- pragma foreign_import_module("Erlang", array).
:- pragma foreign_import_module("C", array).
:- pragma foreign_import_module("C#", array).
:- pragma foreign_import_module("Java", array).
:- pragma foreign_import_module("IL", array).
:- pragma foreign_import_module("Erlang", array).
:- pred bitmap.extract_bits_from_bytes(int, int, int, bitmap.bitmap, int, int).
:- mode bitmap.extract_bits_from_bytes((builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)) is det.
:- func bitmap.quotient_bits_per_byte_with_rem_zero(string, int) = int.
:- mode bitmap.quotient_bits_per_byte_with_rem_zero((builtin.in), (builtin.in)) = (builtin.out) is det.
:- func bitmap.copy_bits(int, bitmap.bitmap, int, bitmap.bitmap, int, int) = bitmap.bitmap.
:- mode bitmap.copy_bits((builtin.in), (builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo) is det.
:- func bitmap.copy_bytes(int, bitmap.bitmap, int, bitmap.bitmap, int, int) = bitmap.bitmap.
:- mode bitmap.copy_bytes((builtin.in), (builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo) is det.
:- func bitmap.bitmap_to_byte_strings(bitmap.bitmap) = list.list(string).
:- mode bitmap.bitmap_to_byte_strings((builtin.in)) = (builtin.out) is det.
:- func bitmap.bitmap_to_byte_strings(bitmap.bitmap, int, list.list(string)) = list.list(string).
:- mode bitmap.bitmap_to_byte_strings((builtin.in), (builtin.in), (builtin.in)) = (builtin.out) is det.
:- pred bitmap.bitmap_equal(bitmap.bitmap, bitmap.bitmap).
:- mode bitmap.bitmap_equal((builtin.in), (builtin.in)) is semidet.
:- pragma terminates((bitmap.bitmap_equal)/2).
:- pred bitmap.bitmap_compare(builtin.comparison_result, bitmap.bitmap, bitmap.bitmap).
:- mode bitmap.bitmap_compare((builtin.uo), (builtin.in), (builtin.in)) is det.
:- pragma terminates((bitmap.bitmap_compare)/3).
:- func bitmap.byte_index_for_bit(int) = int.
:- mode bitmap.byte_index_for_bit((builtin.in)) = (builtin.out) is det.
:- func bitmap.bit_index_in_byte(int) = int.
:- mode bitmap.bit_index_in_byte((builtin.in)) = (builtin.out) is det.
:- func bitmap.throw_bounds_error(bitmap.bitmap, string, int) = V_1.
:- mode bitmap.throw_bounds_error((builtin.in), (builtin.in), (builtin.in)) = (builtin.out) is erroneous.
bitmap.init(N_3) = HeadVar__2_2 :-
    HeadVar__2_2 = bitmap.init(N_3, V_4),
    V_4 = bool.no : bool.bool.
:- pragma foreign_proc("C", bitmap.copy(BM0 :: (builtin.in)) = (BM :: (bitmap.bitmap_uo)), [will_not_call_mercury, thread_safe, not_tabled_for_io, promise_pure, will_not_modify_trail], "
    MR_allocate_bitmap_msg(BM, BM0->num_bits, MR_ALLOC_ID);
    MR_copy_bitmap(BM, BM0);
").
bitmap.in_range(BM_3, I_4) :-
    V_5 = 0 : int,
    int.(V_5 =< I_4),
    V_6 = bitmap.num_bits(BM_3),
    int.(I_4 < V_6).
:- pragma foreign_proc("C", bitmap.num_bits(BM :: (builtin.in)) = (NumBits :: (builtin.out)), [will_not_call_mercury, thread_safe, not_tabled_for_io, promise_pure, will_not_modify_trail], "
    NumBits = BM->num_bits;
").
bitmap.bits_per_byte = 8.
bitmap.bit(I_5, BM_4) = HeadVar__3_3 :-
    (if
      bitmap.in_range(BM_4, I_5)
    then
      HeadVar__3_3 = bitmap.unsafe_bit(I_5, BM_4)
    else
      HeadVar__3_3 = bitmap.throw_bounds_error(BM_4, V_6, I_5),
      V_6 = "bitmap.bit" : string
    ).
bitmap.unsafe_bit(I_5, BM_4) = HeadVar__3_3 :-
    (if
      bitmap.unsafe_is_set(BM_4, I_5)
    then
      HeadVar__3_3 = bool.yes : bool.bool
    else
      HeadVar__3_3 = bool.no : bool.bool
    ).
bitmap.'bit :='(I_6, BM_5, B_7) = HeadVar__4_4 :-
    (if
      bitmap.in_range(BM_5, I_6)
    then
      HeadVar__4_4 = bitmap.'unsafe_bit :='(I_6, BM_5, B_7)
    else
      HeadVar__4_4 = bitmap.throw_bounds_error(BM_5, V_8, I_6),
      V_8 = "bitmap.\'bit :=\'" : string
    ).
bitmap.unsafe_bits(FirstBit_6, NumBits_7, BM_5) = Bits_8 :-
    FirstByteIndex_9 = bitmap.byte_index_for_bit(FirstBit_6),
    FirstBitIndex_10 = bitmap.bit_index_in_byte(FirstBit_6),
    V_11 = 0 : int,
    bitmap.extract_bits_from_bytes(FirstByteIndex_9, FirstBitIndex_10, NumBits_7, BM_5, V_11, Bits_8).
:- pragma foreign_proc("C", bitmap.unsafe_byte(N :: (builtin.in), BM :: (builtin.in)) = (Byte :: (builtin.out)), [will_not_call_mercury, thread_safe, not_tabled_for_io, promise_pure, will_not_modify_trail], "
    Byte = (MR_Integer) BM->elements[N];
").
:- pragma foreign_proc("C", bitmap.'unsafe_byte :='(N :: (builtin.in), BM0 :: (bitmap.bitmap_di), Byte :: (builtin.in)) = (BM :: (bitmap.bitmap_uo)), [will_not_call_mercury, thread_safe, not_tabled_for_io, promise_pure, will_not_modify_trail], "
    BM = BM0;
    BM->elements[N] = (MR_uint_least8_t) Byte;
").
bitmap.byte_slice(BM_5, StartByte_6, NumBytes_7) = HeadVar__4_4 :-
    HeadVar__4_4 = bitmap.slice(BM_5, V_8, V_10),
    V_8 = int.(StartByte_6 * V_9),
    V_9 = bitmap.bits_per_byte,
    V_10 = int.(NumBytes_7 * V_11),
    V_11 = bitmap.bits_per_byte.
bitmap.slice_bitmap(Slice_3) = HeadVar__2_2 :-
    Slice_3 = bitmap.slice_ctor(HeadVar__2_2, V_4, V_5) : bitmap.slice.
bitmap.slice_start_bit_index(Slice_3) = HeadVar__2_2 :-
    Slice_3 = bitmap.slice_ctor(V_4, HeadVar__2_2, V_5) : bitmap.slice.
bitmap.slice_num_bits(Slice_3) = HeadVar__2_2 :-
    Slice_3 = bitmap.slice_ctor(V_4, V_5, HeadVar__2_2) : bitmap.slice.
bitmap.slice_start_byte_index(Slice_3) = HeadVar__2_2 :-
    HeadVar__2_2 = bitmap.quotient_bits_per_byte_with_rem_zero(V_4, V_5),
    V_4 = "bitmap.slice_start_byte_index" : string,
    V_5 = bitmap.slice_start_bit_index(Slice_3).
bitmap.slice_num_bytes(Slice_3) = HeadVar__2_2 :-
    HeadVar__2_2 = bitmap.quotient_bits_per_byte_with_rem_zero(V_4, V_5),
    V_4 = "bitmap.slice_num_bytes" : string,
    V_5 = bitmap.slice_num_bits(Slice_3).
bitmap.flip(BM_4, I_5) = HeadVar__3_3 :-
    (if
      bitmap.in_range(BM_4, I_5)
    then
      HeadVar__3_3 = bitmap.unsafe_flip(BM_4, I_5)
    else
      HeadVar__3_3 = bitmap.throw_bounds_error(BM_4, V_6, I_5),
      V_6 = "bitmap.flip" : string
    ).
bitmap.copy_bits(SrcBM_7, SrcStartBit_8, DestBM_9, DestStartBit_10, NumBits_11) = HeadVar__6_6 :-
    HeadVar__6_6 = bitmap.copy_bits(V_12, SrcBM_7, SrcStartBit_8, DestBM_9, DestStartBit_10, NumBits_11),
    V_12 = 0 : int.
bitmap.copy_bits_in_bitmap(SrcBM_6, SrcStartBit_7, DestStartBit_8, NumBits_9) = HeadVar__5_5 :-
    HeadVar__5_5 = bitmap.copy_bits(V_10, SrcBM_6, SrcStartBit_7, V_11, DestStartBit_8, NumBits_9),
    V_10 = 1 : int,
    V_11 = SrcBM_6.
bitmap.copy_bytes(SrcBM_7, SrcStartByteIndex_8, DestBM_9, DestStartByteIndex_10, NumBytes_11) = HeadVar__6_6 :-
    HeadVar__6_6 = bitmap.copy_bytes(V_12, SrcBM_7, SrcStartByteIndex_8, DestBM_9, DestStartByteIndex_10, NumBytes_11),
    V_12 = 0 : int.
bitmap.copy_bytes_in_bitmap(SrcBM_6, SrcStartByteIndex_7, DestStartByteIndex_8, NumBytes_9) = HeadVar__5_5 :-
    HeadVar__5_5 = bitmap.copy_bytes(V_10, SrcBM_6, SrcStartByteIndex_7, V_11, DestStartByteIndex_8, NumBytes_9),
    V_10 = 1 : int,
    V_11 = SrcBM_6.
bitmap.to_byte_string(BM_3) = HeadVar__2_2 :-
    HeadVar__2_2 = string.join_list(V_4, V_5),
    V_4 = "." : string,
    V_5 = bitmap.bitmap_to_byte_strings(BM_3).
bitmap.set(BM_4, I_5) = HeadVar__3_3 :-
    (if
      bitmap.in_range(BM_4, I_5)
    then
      HeadVar__3_3 = bitmap.unsafe_set(BM_4, I_5)
    else
      HeadVar__3_3 = bitmap.throw_bounds_error(BM_4, V_6, I_5),
      V_6 = "bitmap.set" : string
    ).
bitmap.clear(BM_4, I_5) = HeadVar__3_3 :-
    (if
      bitmap.in_range(BM_4, I_5)
    then
      HeadVar__3_3 = bitmap.unsafe_clear(BM_4, I_5)
    else
      HeadVar__3_3 = bitmap.throw_bounds_error(BM_4, V_6, I_5),
      V_6 = "bitmap.clear" : string
    ).
bitmap.unsafe_set(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.unsafe_set(BM_5, I_4).
bitmap.unsafe_clear(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.unsafe_clear(BM_5, I_4).
bitmap.unsafe_flip(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.unsafe_flip(BM_5, I_4).
bitmap.unsafe_is_set(BM_3, I_4) :-
    \+ (
      bitmap.unsafe_is_clear(BM_3, I_4)
    ).
bitmap.set(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.set(BM_5, I_4).
bitmap.clear(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.clear(BM_5, I_4).
bitmap.flip(I_4, BM_5, HeadVar__3_3) :-
    HeadVar__3_3 = bitmap.flip(BM_5, I_4).
bitmap.bitmap_to_byte_strings(BM_3) = Strs_4 :-
    NumBits_5 = bitmap.num_bits(BM_3),
    Strs_4 = bitmap.bitmap_to_byte_strings(BM_3, NumBits_5, V_6),
    V_6 = list.[] : list.list(string).
bitmap.bit_index_in_byte(I_3) = HeadVar__2_2 :-
    HeadVar__2_2 = int.unchecked_rem(I_3, V_4),
    V_4 = bitmap.bits_per_byte.
:- pragma exceptions(function, (bitmap.init), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.init), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.resize), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.shrink_without_copying), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.in_range), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.byte_in_range), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.num_bits), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.num_bytes), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.det_num_bytes), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.bits_per_byte), 1, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.bit), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.unsafe_bit), 3, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.'bit :='), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.'unsafe_bit :='), 4, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.bits), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.unsafe_bits), 4, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.'bits :='), 5, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.'unsafe_bits :='), 5, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.byte), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.unsafe_byte), 3, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.'byte :='), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.'unsafe_byte :='), 4, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.slice), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.byte_slice), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.slice_bitmap), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.slice_start_bit_index), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.slice_num_bits), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.slice_start_byte_index), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.slice_num_bytes), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.flip), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.unsafe_flip), 3, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.complement), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.union), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.intersect), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.difference), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.xor), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.append_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bits), 6, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bits_in_bitmap), 5, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bytes), 6, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bytes_in_bitmap), 5, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.to_string), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.from_string), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.to_byte_string), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.hash), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.set), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.clear), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.is_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.is_clear), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.unsafe_set), 3, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.unsafe_clear), 3, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.unsafe_set), 3, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.unsafe_clear), 3, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.unsafe_flip), 3, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.unsafe_is_set), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.unsafe_is_clear), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.set), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.clear), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.flip), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.throw_bounds_error), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.extract_bits_from_bytes), 6, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.quotient_bits_per_byte_with_rem_zero), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bits), 7, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.copy_bytes), 7, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.bitmap_to_byte_strings), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (bitmap.bitmap_to_byte_strings), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (bitmap.bitmap_equal), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (bitmap.bitmap_compare), 3, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.byte_index_for_bit), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.bit_index_in_byte), 2, 0, will_not_throw).
:- pragma exceptions(function, (bitmap.throw_bounds_error), 4, 0, may_throw(user_exception)).
:- pragma termination_info(bitmap.init((builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.init((builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy((builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.resize((bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.shrink_without_copying((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.in_range((builtin.in), (builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.byte_in_range((builtin.in), (builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.num_bits((builtin.in)) = (builtin.out), infinite, cannot_loop).
:- pragma termination_info(bitmap.num_bytes((builtin.in)) = (builtin.out), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.det_num_bytes((builtin.in)) = (builtin.out), finite(0, [no, no]), can_loop).
:- pragma termination_info((bitmap.bits_per_byte) = (builtin.out), finite(0, [no]), cannot_loop).
:- pragma termination_info(bitmap.bit((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(bitmap.unsafe_bit((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), cannot_loop).
:- pragma termination_info(bitmap.'bit :='((builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.'unsafe_bit :='((builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.bits((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no, no]), can_loop).
:- pragma termination_info(bitmap.unsafe_bits((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no, no]), can_loop).
:- pragma termination_info(bitmap.'bits :='((builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.'unsafe_bits :='((builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.byte((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(bitmap.unsafe_byte((builtin.in), (builtin.in)) = (builtin.out), infinite, cannot_loop).
:- pragma termination_info(bitmap.'byte :='((builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.'unsafe_byte :='((builtin.in), (bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.slice((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), finite(3, [yes, yes, yes, no]), can_loop).
:- pragma termination_info(bitmap.byte_slice((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), finite(3, [yes, no, no, no]), can_loop).
:- pragma termination_info(bitmap.slice_bitmap((builtin.in)) = (builtin.out), finite(-3, [yes, no]), cannot_loop).
:- pragma termination_info(bitmap.slice_start_bit_index((builtin.in)) = (builtin.out), finite(-3, [yes, no]), cannot_loop).
:- pragma termination_info(bitmap.slice_num_bits((builtin.in)) = (builtin.out), finite(-3, [yes, no]), cannot_loop).
:- pragma termination_info(bitmap.slice_start_byte_index((builtin.in)) = (builtin.out), finite(0, [no, no]), can_loop).
:- pragma termination_info(bitmap.slice_num_bytes((builtin.in)) = (builtin.out), finite(0, [no, no]), can_loop).
:- pragma termination_info(bitmap.flip((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.unsafe_flip((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.complement((bitmap.bitmap_di)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.union((builtin.in), (bitmap.bitmap_di)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.intersect((builtin.in), (bitmap.bitmap_di)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.difference((builtin.in), (bitmap.bitmap_di)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.xor((builtin.in), (bitmap.bitmap_di)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.append_list((builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy_bits((builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy_bits_in_bitmap((bitmap.bitmap_di), (builtin.in), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy_bytes((builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy_bytes_in_bitmap((bitmap.bitmap_di), (builtin.in), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.to_string((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(bitmap.from_string((builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.to_byte_string((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(bitmap.hash((builtin.in)) = (builtin.out), finite(0, [no, no]), can_loop).
:- pragma termination_info(bitmap.set((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.clear((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.is_set((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(bitmap.is_clear((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(bitmap.unsafe_set((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.unsafe_clear((bitmap.bitmap_di), (builtin.in)) = (bitmap.bitmap_uo), infinite, cannot_loop).
:- pragma termination_info(bitmap.unsafe_set((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, cannot_loop).
:- pragma termination_info(bitmap.unsafe_clear((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, cannot_loop).
:- pragma termination_info(bitmap.unsafe_flip((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, cannot_loop).
:- pragma termination_info(bitmap.unsafe_is_set((builtin.in), (builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.unsafe_is_clear((builtin.in), (builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.set((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, can_loop).
:- pragma termination_info(bitmap.clear((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, can_loop).
:- pragma termination_info(bitmap.flip((builtin.in), (bitmap.bitmap_di), (bitmap.bitmap_uo)), infinite, can_loop).
:- pragma termination_info(bitmap.throw_bounds_error((builtin.in), (builtin.in), (builtin.in), (builtin.in)), infinite, can_loop).
:- pragma termination_info(bitmap.extract_bits_from_bytes((builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)), finite(0, [no, no, no, no, yes, no]), can_loop).
:- pragma termination_info(bitmap.quotient_bits_per_byte_with_rem_zero((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(bitmap.copy_bits((builtin.in), (builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.copy_bytes((builtin.in), (builtin.in), (builtin.in), (bitmap.bitmap_di), (builtin.in), (builtin.in)) = (bitmap.bitmap_uo), infinite, can_loop).
:- pragma termination_info(bitmap.bitmap_to_byte_strings((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(bitmap.bitmap_to_byte_strings((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(bitmap.bitmap_equal((builtin.in), (builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.bitmap_compare((builtin.uo), (builtin.in), (builtin.in)), infinite, cannot_loop).
:- pragma termination_info(bitmap.byte_index_for_bit((builtin.in)) = (builtin.out), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.bit_index_in_byte((builtin.in)) = (builtin.out), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(bitmap.throw_bounds_error((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
