:- module tree_bitset.
:- use_module bool, builtin, enum, int, list, maybe, pair, private_builtin, require, set, term.
:- type tree_bitset.tree_bitset(T)
	--->	tree_bitset(tree_bitset.node_list).
:- type tree_bitset.node_list
	--->	leaf_list((tree_bitset.leaf_nodes) :: list.list(tree_bitset.leaf_node))
	;	interior_list((tree_bitset.level) :: int, (tree_bitset.interior_nodes) :: list.list(tree_bitset.interior_node)).
:- type tree_bitset.leaf_node
	--->	leaf_node((tree_bitset.leaf_offset) :: int, (tree_bitset.leaf_bits) :: int).
:- type tree_bitset.interior_node
	--->	interior_node((tree_bitset.init_offset) :: int, (tree_bitset.limit_offset) :: int, (tree_bitset.components) :: tree_bitset.node_list).
:- type tree_bitset.fold_direction
	--->	low_to_high 
	;	high_to_low .
:- func tree_bitset.make_leaf_node(int, int) = tree_bitset.leaf_node.
:- mode tree_bitset.make_leaf_node((builtin.in), (builtin.in)) = (builtin.out) is det.
:- pragma inline((tree_bitset.make_leaf_node)/2).
:- func tree_bitset.index_to_enum(int) = T_1 <= (enum.enum(T_1)).
:- mode tree_bitset.index_to_enum((builtin.in)) = (builtin.out) is det.
:- func tree_bitset.wrap_tree_bitset(tree_bitset.node_list) = tree_bitset.tree_bitset(T_1).
:- mode tree_bitset.wrap_tree_bitset((builtin.in)) = (builtin.out) is det.
:- pragma inline((tree_bitset.wrap_tree_bitset)/1).
:- func tree_bitset.integrity(maybe.maybe(pair.pair(int, int)), tree_bitset.node_list) = bool.bool.
:- mode tree_bitset.integrity((builtin.in), (builtin.in)) = (builtin.out) is det.
:- pred tree_bitset.prune_top_levels(tree_bitset.node_list, tree_bitset.node_list).
:- mode tree_bitset.prune_top_levels((builtin.in), (builtin.out)) is det.
:- pred tree_bitset.leaflist_divide((pred T_1), list.list(tree_bitset.leaf_node), list.list(tree_bitset.leaf_node), list.list(tree_bitset.leaf_node)) <= (enum.enum(T_1)).
:- mode tree_bitset.leaflist_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.out), (builtin.out)) is det.
:- pred tree_bitset.leafnode_divide((pred T_1), int, int, int, int, int, int, int) <= (enum.enum(T_1)).
:- mode tree_bitset.leafnode_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- pred tree_bitset.interiornode_divide((pred T_1), list.list(tree_bitset.interior_node), list.list(tree_bitset.interior_node), list.list(tree_bitset.interior_node)) <= (enum.enum(T_1)).
:- mode tree_bitset.interiornode_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.out), (builtin.out)) is det.
:- func tree_bitset.get_bit(int, int) = int.
:- mode tree_bitset.get_bit((builtin.in), (builtin.in)) = (builtin.out) is det.
:- pragma inline((tree_bitset.get_bit)/2).
:- func tree_bitset.set_bit(int, int) = int.
:- mode tree_bitset.set_bit((builtin.in), (builtin.in)) = (builtin.out) is det.
:- pragma inline((tree_bitset.set_bit)/2).
:- func tree_bitset.mask(int) = int.
:- mode tree_bitset.mask((builtin.in)) = (builtin.out) is det.
:- pragma inline((tree_bitset.mask)/1).
:- pred tree_bitset.do_foldl_pred(pred(T_1, U_2, U_2), list.list(tree_bitset.interior_node), U_2, U_2) <= (enum.enum(T_1)).
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)) is det.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)) is semidet.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)) is semidet.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.mdi), (builtin.muo)) is nondet.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)) is cc_multi.
:- mode tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)) is cc_multi.
:- pragma type_spec((tree_bitset.do_foldl_pred)/4, (T_1 = term.var(V_3)), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldl_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.do_foldl_pred)/4, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldl_pred__[T = int]')).
:- pred tree_bitset.leaf_foldl_pred(pred(T_1, U_2, U_2), list.list(tree_bitset.leaf_node), U_2, U_2) <= (enum.enum(T_1)).
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)) is det.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)) is semidet.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)) is semidet.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.mdi), (builtin.muo)) is nondet.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)) is cc_multi.
:- mode tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)) is cc_multi.
:- pragma type_spec((tree_bitset.leaf_foldl_pred)/4, (T_1 = term.var(V_3)), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldl_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.leaf_foldl_pred)/4, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldl_pred__[T = int]')).
:- pred tree_bitset.do_foldl2_pred(pred(T_1, U_2, U_2, V_3, V_3), list.list(tree_bitset.interior_node), U_2, U_2, V_3, V_3) <= (enum.enum(T_1)).
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.do_foldl2_pred)/6, (T_1 = term.var(V_4)), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldl2_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.do_foldl2_pred)/6, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldl2_pred__[T = int]')).
:- pred tree_bitset.leaf_foldl2_pred(pred(T_1, U_2, U_2, V_3, V_3), list.list(tree_bitset.leaf_node), U_2, U_2, V_3, V_3) <= (enum.enum(T_1)).
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.leaf_foldl2_pred)/6, (T_1 = term.var(V_4)), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldl2_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.leaf_foldl2_pred)/6, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldl2_pred__[T = int]')).
:- pred tree_bitset.do_foldr_pred(pred(T_1, U_2, U_2), list.list(tree_bitset.interior_node), U_2, U_2) <= (enum.enum(T_1)).
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.do_foldr_pred)/4, (T_1 = term.var(V_3)), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldr_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.do_foldr_pred)/4, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldr_pred__[T = int]')).
:- pred tree_bitset.leaf_foldr_pred(pred(T_1, U_2, U_2), list.list(tree_bitset.leaf_node), U_2, U_2) <= (enum.enum(T_1)).
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.leaf_foldr_pred)/4, (T_1 = term.var(V_3)), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldr_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.leaf_foldr_pred)/4, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldr_pred__[T = int]')).
:- pred tree_bitset.do_foldr2_pred(pred(T_1, U_2, U_2, V_3, V_3), list.list(tree_bitset.interior_node), U_2, U_2, V_3, V_3) <= (enum.enum(T_1)).
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.do_foldr2_pred)/6, (T_1 = term.var(V_4)), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldr2_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.do_foldr2_pred)/6, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__do_foldr2_pred__[T = int]')).
:- pred tree_bitset.leaf_foldr2_pred(pred(T_1, U_2, U_2, V_3, V_3), list.list(tree_bitset.leaf_node), U_2, U_2, V_3, V_3) <= (enum.enum(T_1)).
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.leaf_foldr2_pred)/6, (T_1 = term.var(V_4)), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldr2_pred__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.leaf_foldr2_pred)/6, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_foldr2_pred__[T = int]')).
:- pred tree_bitset.fold_bits(tree_bitset.fold_direction, pred(T_1, U_2, U_2), int, int, int, U_2, U_2) <= (enum.enum(T_1)).
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)) is det.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)) is semidet.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)) is semidet.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)) is nondet.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)) is cc_multi.
:- mode tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)) is cc_multi.
:- pragma type_spec((tree_bitset.fold_bits)/7, (T_1 = term.var(V_3)), (tree_bitset.'TypeSpecOf__pred_or_func__fold_bits__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.fold_bits)/7, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__fold_bits__[T = int]')).
:- pred tree_bitset.fold2_bits(tree_bitset.fold_direction, pred(T_1, U_2, U_2, V_3, V_3), int, int, int, U_2, U_2, V_3, V_3) <= (enum.enum(T_1)).
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi.
:- mode tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi.
:- pragma type_spec((tree_bitset.fold2_bits)/9, (T_1 = term.var(V_4)), (tree_bitset.'TypeSpecOf__pred_or_func__fold2_bits__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.fold2_bits)/9, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__fold2_bits__[T = int]')).
:- pred tree_bitset.interior_all_true((pred T_1), list.list(tree_bitset.interior_node)) <= (enum.enum(T_1)).
:- mode tree_bitset.interior_all_true(builtin.in((pred((builtin.in)) is semidet)), (builtin.in)) is semidet.
:- pragma type_spec((tree_bitset.interior_all_true)/2, (T_1 = term.var(V_2)), (tree_bitset.'TypeSpecOf__pred_or_func__interior_all_true__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.interior_all_true)/2, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__interior_all_true__[T = int]')).
:- pred tree_bitset.leaf_all_true((pred T_1), list.list(tree_bitset.leaf_node)) <= (enum.enum(T_1)).
:- mode tree_bitset.leaf_all_true(builtin.in((pred((builtin.in)) is semidet)), (builtin.in)) is semidet.
:- pragma type_spec((tree_bitset.leaf_all_true)/2, (T_1 = term.var(V_2)), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_all_true__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.leaf_all_true)/2, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__leaf_all_true__[T = int]')).
:- pred tree_bitset.all_true_bits((pred T_1), int, int, int) <= (enum.enum(T_1)).
:- mode tree_bitset.all_true_bits(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.in), (builtin.in)) is semidet.
:- pragma type_spec((tree_bitset.all_true_bits)/4, (T_1 = term.var(V_2)), (tree_bitset.'TypeSpecOf__pred_or_func__all_true_bits__[T = var(V_2)]')).
:- pragma type_spec((tree_bitset.all_true_bits)/4, (T_1 = int), (tree_bitset.'TypeSpecOf__pred_or_func__all_true_bits__[T = int]')).
tree_bitset.init = HeadVar__1_1 :-
    HeadVar__1_1 = tree_bitset.wrap_tree_bitset(V_2),
    V_2 = tree_bitset.leaf_list(V_3) : tree_bitset.node_list,
    V_3 = list.[] : list.list(tree_bitset.leaf_node).
tree_bitset.empty(HeadVar__1_1) :-
    HeadVar__1_1 = tree_bitset.init.
tree_bitset.is_empty(HeadVar__1_1) :-
    HeadVar__1_1 = tree_bitset.init.
tree_bitset.is_non_empty(Set_2) :-
    \+ (
      tree_bitset.is_empty(Set_2)
    ).
tree_bitset.list_to_set(List_3) = HeadVar__2_2 :-
    HeadVar__2_2 = tree_bitset.sorted_list_to_set(V_4),
    V_4 = list.sort(List_3).
tree_bitset.list_to_set(List_3, Set_4) :-
    Set_4 = tree_bitset.list_to_set(List_3).
tree_bitset.sorted_list_to_set(List_3, Set_4) :-
    Set_4 = tree_bitset.sorted_list_to_set(List_3).
tree_bitset.from_set(Set_3) = HeadVar__2_2 :-
    HeadVar__2_2 = tree_bitset.sorted_list_to_set(V_4),
    V_4 = set.to_sorted_list(Set_3).
tree_bitset.to_sorted_list(Set_3) = HeadVar__2_2 :-
    HeadVar__2_2 = tree_bitset.foldr(V_4, Set_3, V_5),
    V_4 = list.cons : (func(T_1, list.list(T_1)) = list.list(T_1)),
    V_5 = list.[] : list.list(T_1).
tree_bitset.to_sorted_list(Set_3, List_4) :-
    List_4 = tree_bitset.to_sorted_list(Set_3).
tree_bitset.to_set(Set_3) = HeadVar__2_2 :-
    HeadVar__2_2 = set.sorted_list_to_set(V_4),
    V_4 = tree_bitset.to_sorted_list(Set_3).
tree_bitset.make_singleton_set(A_3) = HeadVar__2_2 :-
    HeadVar__2_2 = tree_bitset.insert(V_4, A_3),
    V_4 = tree_bitset.init.
tree_bitset.subset(Subset_3, Set_4) :-
    V_5 = Subset_3,
    tree_bitset.intersect(Set_4, Subset_3, V_5).
tree_bitset.superset(Superset_3, Set_4) :-
    tree_bitset.subset(Set_4, Superset_3).
tree_bitset.insert(Elem_4, STATE_VARIABLE_Set_0_6, STATE_VARIABLE_Set_7) :-
    STATE_VARIABLE_Set_7 = tree_bitset.insert(STATE_VARIABLE_Set_0_6, Elem_4).
tree_bitset.insert_list(Set_4, List_5) = HeadVar__3_3 :-
    HeadVar__3_3 = tree_bitset.union(V_6, Set_4),
    V_6 = tree_bitset.list_to_set(List_5).
tree_bitset.insert_list(Elems_4, STATE_VARIABLE_Set_0_6, STATE_VARIABLE_Set_7) :-
    STATE_VARIABLE_Set_7 = tree_bitset.insert_list(STATE_VARIABLE_Set_0_6, Elems_4).
tree_bitset.delete(Elem_4, STATE_VARIABLE_Set_0_6, STATE_VARIABLE_Set_7) :-
    STATE_VARIABLE_Set_7 = tree_bitset.delete(STATE_VARIABLE_Set_0_6, Elem_4).
tree_bitset.delete_list(Set_4, List_5) = HeadVar__3_3 :-
    HeadVar__3_3 = tree_bitset.difference(Set_4, V_6),
    V_6 = tree_bitset.list_to_set(List_5).
tree_bitset.delete_list(Elems_4, STATE_VARIABLE_Set_0_6, STATE_VARIABLE_Set_7) :-
    STATE_VARIABLE_Set_7 = tree_bitset.delete_list(STATE_VARIABLE_Set_0_6, Elems_4).
tree_bitset.remove(Elem_4, STATE_VARIABLE_Set_0_6, STATE_VARIABLE_Set_7) :-
    tree_bitset.contains(STATE_VARIABLE_Set_0_6, Elem_4),
    STATE_VARIABLE_Set_7 = tree_bitset.delete(STATE_VARIABLE_Set_0_6, Elem_4).
tree_bitset.remove_list(Elems_4, STATE_VARIABLE_Set_0_7, STATE_VARIABLE_Set_8) :-
    ElemsSet_6 = tree_bitset.list_to_set(Elems_4),
    tree_bitset.subset(ElemsSet_6, STATE_VARIABLE_Set_0_7),
    STATE_VARIABLE_Set_8 = tree_bitset.difference(STATE_VARIABLE_Set_0_7, ElemsSet_6).
tree_bitset.union(A_4, B_5, HeadVar__3_3) :-
    HeadVar__3_3 = tree_bitset.union(A_4, B_5).
tree_bitset.union_list(Sets_3) = Set_4 :-
    tree_bitset.union_list(Sets_3, Set_4).
tree_bitset.intersect(A_4, B_5, HeadVar__3_3) :-
    HeadVar__3_3 = tree_bitset.intersect(A_4, B_5).
tree_bitset.intersect_list(Sets_3) = Set_4 :-
    tree_bitset.intersect_list(Sets_3, Set_4).
tree_bitset.difference(A_4, B_5, HeadVar__3_3) :-
    HeadVar__3_3 = tree_bitset.difference(A_4, B_5).
tree_bitset.divide(Pred_5, Set_6, InSet_7, OutSet_8) :-
    Set_6 = tree_bitset.tree_bitset(List_9) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_9 = tree_bitset.leaf_list(LeafNodes_10) : tree_bitset.node_list,
      tree_bitset.leaflist_divide(Pred_5, LeafNodes_10, InList_11, OutList_12),
      InSet_7 = tree_bitset.wrap_tree_bitset(V_19),
      V_19 = tree_bitset.leaf_list(InList_11) : tree_bitset.node_list,
      OutSet_8 = tree_bitset.wrap_tree_bitset(V_20),
      V_20 = tree_bitset.leaf_list(OutList_12) : tree_bitset.node_list
    ;
      List_9 = tree_bitset.interior_list(Level_13, InteriorNodes_14) : tree_bitset.node_list,
      tree_bitset.interiornode_divide(Pred_5, InteriorNodes_14, InInteriorNodes_15, OutInteriorNodes_16),
      InList_21 = tree_bitset.interior_list(Level_13, InInteriorNodes_15) : tree_bitset.node_list,
      tree_bitset.prune_top_levels(InList_21, PrunedInList_17),
      InSet_7 = tree_bitset.wrap_tree_bitset(PrunedInList_17),
      OutList_22 = tree_bitset.interior_list(Level_13, OutInteriorNodes_16) : tree_bitset.node_list,
      tree_bitset.prune_top_levels(OutList_22, PrunedOutList_18),
      OutSet_8 = tree_bitset.wrap_tree_bitset(PrunedOutList_18)
    ).
tree_bitset.count(Set_3) = HeadVar__2_2 :-
    HeadVar__2_2 = tree_bitset.foldl(V_6, Set_3, V_11),
    V_6 = (func(V_7::(builtin.in), V_8::(builtin.in)) = (V_9::(builtin.out)) is det :-
      some [] (
        V_7 = V_12,
        V_8 = Acc_14,
        V_9 = int.(Acc_14 + V_10),
        V_10 = 1 : int
      )
    )
 : (func(T_1, int) = int),
    V_11 = 0 : int.
tree_bitset.foldl(F_5, Set_6, Acc0_7) = Acc_8 :-
    P_9 = (pred(V_13::(builtin.in), V_14::(builtin.in), V_15::(builtin.out)) is det :-
      some [] (
        V_13 = E_16,
        V_14 = PAcc0_17,
        PAcc_18 = apply(F_5, E_16, PAcc0_17),
        V_15 = PAcc_18
      )
    )
 : pred(T_1, U_2, U_2),
    tree_bitset.foldl(P_9, Set_6, Acc0_7, Acc_8).
tree_bitset.foldl(P_5, Set_6, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13) :-
    Set_6 = tree_bitset.tree_bitset(List_8) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_8 = tree_bitset.leaf_list(LeafNodes_9) : tree_bitset.node_list,
      tree_bitset.leaf_foldl_pred(P_5, LeafNodes_9, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13)
    ;
      List_8 = tree_bitset.interior_list(V_10, InteriorNodes_11) : tree_bitset.node_list,
      tree_bitset.do_foldl_pred(P_5, InteriorNodes_11, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13)
    ).
tree_bitset.foldl2(P_7, Set_8, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18) :-
    Set_8 = tree_bitset.tree_bitset(List_11) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_11 = tree_bitset.leaf_list(LeafNodes_12) : tree_bitset.node_list,
      tree_bitset.leaf_foldl2_pred(P_7, LeafNodes_12, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18)
    ;
      List_11 = tree_bitset.interior_list(V_13, InteriorNodes_14) : tree_bitset.node_list,
      tree_bitset.do_foldl2_pred(P_7, InteriorNodes_14, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18)
    ).
tree_bitset.foldr(F_5, Set_6, Acc0_7) = Acc_8 :-
    P_9 = (pred(V_13::(builtin.in), V_14::(builtin.in), V_15::(builtin.out)) is det :-
      some [] (
        V_13 = E_16,
        V_14 = PAcc0_17,
        PAcc_18 = apply(F_5, E_16, PAcc0_17),
        V_15 = PAcc_18
      )
    )
 : pred(T_1, U_2, U_2),
    tree_bitset.foldr(P_9, Set_6, Acc0_7, Acc_8).
tree_bitset.foldr(P_5, Set_6, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13) :-
    Set_6 = tree_bitset.tree_bitset(List_8) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_8 = tree_bitset.leaf_list(LeafNodes_9) : tree_bitset.node_list,
      tree_bitset.leaf_foldr_pred(P_5, LeafNodes_9, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13)
    ;
      List_8 = tree_bitset.interior_list(V_10, InteriorNodes_11) : tree_bitset.node_list,
      tree_bitset.do_foldr_pred(P_5, InteriorNodes_11, STATE_VARIABLE_Acc_0_12, STATE_VARIABLE_Acc_13)
    ).
tree_bitset.foldr2(P_7, Set_8, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18) :-
    Set_8 = tree_bitset.tree_bitset(List_11) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_11 = tree_bitset.leaf_list(LeafNodes_12) : tree_bitset.node_list,
      tree_bitset.leaf_foldr2_pred(P_7, LeafNodes_12, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18)
    ;
      List_11 = tree_bitset.interior_list(V_13, InteriorNodes_14) : tree_bitset.node_list,
      tree_bitset.do_foldr2_pred(P_7, InteriorNodes_14, STATE_VARIABLE_AccA_0_15, STATE_VARIABLE_AccA_16, STATE_VARIABLE_AccB_0_17, STATE_VARIABLE_AccB_18)
    ).
tree_bitset.all_true(P_3, Set_4) :-
    Set_4 = tree_bitset.tree_bitset(List_5) : tree_bitset.tree_bitset(T_1),
    ( % disjunction
      List_5 = tree_bitset.leaf_list(LeafNodes_6) : tree_bitset.node_list,
      tree_bitset.leaf_all_true(P_3, LeafNodes_6)
    ;
      List_5 = tree_bitset.interior_list(V_7, InteriorNodes_8) : tree_bitset.node_list,
      tree_bitset.interior_all_true(P_3, InteriorNodes_8)
    ).
tree_bitset.filter(Pred_4, Set_5) = TrueSet_6 :-
    SortedList_7 = tree_bitset.to_sorted_list(Set_5),
    SortedTrueList_8 = list.filter(Pred_4, SortedList_7),
    TrueSet_6 = tree_bitset.sorted_list_to_set(SortedTrueList_8).
tree_bitset.filter(Pred_5, Set_6, TrueSet_7, FalseSet_8) :-
    SortedList_9 = tree_bitset.to_sorted_list(Set_6),
    list.filter(Pred_5, SortedList_9, SortedTrueList_10, SortedFalseList_11),
    TrueSet_7 = tree_bitset.sorted_list_to_set(SortedTrueList_10),
    FalseSet_8 = tree_bitset.sorted_list_to_set(SortedFalseList_11).
:- pragma inline((tree_bitset.make_leaf_node)/2).
tree_bitset.make_leaf_node(Offset_4, Bits_5) = tree_bitset.leaf_node(Offset_4, Bits_5).
:- pragma inline((tree_bitset.wrap_tree_bitset)/1).
tree_bitset.wrap_tree_bitset(NodeList_3) = Set_4 :-
    (
      % trace
      % compiletime(flag(tree-bitset-integrity))
      % quantified vars 
      (if
        V_5 = tree_bitset.integrity(V_6, NodeList_3),
        V_6 = maybe.no : maybe.maybe(pair.pair(int, int)),
        V_5 = bool.no : bool.bool
      then
        V_7 = "tree_bitset" : string,
        V_8 = "function `tree_bitset.wrap_tree_bitset\'/1" : string,
        V_9 = "integrity failed" : string,
        require.unexpected(V_7, V_8, V_9)
      else
        true
      )
    ),
    Set_4 = tree_bitset.tree_bitset(NodeList_3) : tree_bitset.tree_bitset(T_1).
tree_bitset.leaflist_divide(_Pred_5, list.[], list.[], list.[]).
tree_bitset.leaflist_divide(Pred_6, list.[Head_7 | Tail_8], InList_9, OutList_10) :-
    tree_bitset.leaflist_divide(Pred_6, Tail_8, InTail_11, OutTail_12),
    Head_7 = tree_bitset.leaf_node(Offset_13, Bits_14) : tree_bitset.leaf_node,
    V_19 = 0 : int,
    V_20 = 0 : int,
    V_21 = 0 : int,
    tree_bitset.leafnode_divide(Pred_6, Offset_13, V_19, Bits_14, V_20, InBits_15, V_21, OutBits_16),
    (if
      InBits_15 = 0 : int
    then
      InList_9 = InTail_11
    else
      InHead_17 = tree_bitset.make_leaf_node(Offset_13, InBits_15),
      InList_9 = list.[InHead_17 | InTail_11] : list.list(tree_bitset.leaf_node)
    ),
    (if
      OutBits_16 = 0 : int
    then
      OutList_10 = OutTail_12
    else
      OutHead_18 = tree_bitset.make_leaf_node(Offset_13, OutBits_16),
      OutList_10 = list.[OutHead_18 | OutTail_12] : list.list(tree_bitset.leaf_node)
    ).
tree_bitset.leafnode_divide(Pred_9, Offset_10, WhichBit_11, Bits_12, STATE_VARIABLE_InBits_0_17, STATE_VARIABLE_InBits_18, STATE_VARIABLE_OutBits_0_19, STATE_VARIABLE_OutBits_20) :-
    (if
      V_21 = int.bits_per_int,
      int.(WhichBit_11 < V_21)
    then
      SelectedBit_15 = tree_bitset.get_bit(Bits_12, WhichBit_11),
      (if
        SelectedBit_15 = 0 : int
      then
        STATE_VARIABLE_OutBits_24_24 = STATE_VARIABLE_OutBits_0_19,
        STATE_VARIABLE_InBits_23_23 = STATE_VARIABLE_InBits_0_17
      else
        Elem_16 = tree_bitset.index_to_enum(V_22),
        V_22 = int.(Offset_10 + WhichBit_11),
        (if
          call(Pred_9, Elem_16)
        then
          STATE_VARIABLE_InBits_23_23 = tree_bitset.set_bit(STATE_VARIABLE_InBits_0_17, WhichBit_11),
          STATE_VARIABLE_OutBits_24_24 = STATE_VARIABLE_OutBits_0_19
        else
          STATE_VARIABLE_OutBits_24_24 = tree_bitset.set_bit(STATE_VARIABLE_OutBits_0_19, WhichBit_11),
          STATE_VARIABLE_InBits_23_23 = STATE_VARIABLE_InBits_0_17
        )
      ),
      V_25 = int.(WhichBit_11 + V_28),
      V_28 = 1 : int,
      tree_bitset.leafnode_divide(Pred_9, Offset_10, V_25, Bits_12, STATE_VARIABLE_InBits_23_23, STATE_VARIABLE_InBits_18, STATE_VARIABLE_OutBits_24_24, STATE_VARIABLE_OutBits_20)
    else
      STATE_VARIABLE_OutBits_20 = STATE_VARIABLE_OutBits_0_19,
      STATE_VARIABLE_InBits_18 = STATE_VARIABLE_InBits_0_17
    ).
tree_bitset.interiornode_divide(_Pred_5, list.[], list.[], list.[]).
tree_bitset.interiornode_divide(Pred_6, list.[Head_7 | Tail_8], InNodes_9, OutNodes_10) :-
    tree_bitset.interiornode_divide(Pred_6, Tail_8, InTail_11, OutTail_12),
    Head_7 = tree_bitset.interior_node(InitOffset_13, LimitOffset_14, SubNodes_15) : tree_bitset.interior_node,
    ( % disjunction
      SubNodes_15 = tree_bitset.leaf_list(SubLeafNodes_16) : tree_bitset.node_list,
      tree_bitset.leaflist_divide(Pred_6, SubLeafNodes_16, InLeafNodes_17, OutLeafNodes_18),
      ( % disjunction
        InLeafNodes_17 = list.[] : list.list(tree_bitset.leaf_node),
        InNodes_9 = InTail_11
      ;
        InLeafNodes_17 = list.[V_19 | V_20] : list.list(tree_bitset.leaf_node),
        InHead_21 = tree_bitset.interior_node(InitOffset_13, LimitOffset_14, V_35) : tree_bitset.interior_node,
        V_35 = tree_bitset.leaf_list(InLeafNodes_17) : tree_bitset.node_list,
        InNodes_9 = list.[InHead_21 | InTail_11] : list.list(tree_bitset.interior_node)
      ),
      ( % disjunction
        OutLeafNodes_18 = list.[] : list.list(tree_bitset.leaf_node),
        OutNodes_10 = OutTail_12
      ;
        OutLeafNodes_18 = list.[V_22 | V_23] : list.list(tree_bitset.leaf_node),
        OutHead_24 = tree_bitset.interior_node(InitOffset_13, LimitOffset_14, V_36) : tree_bitset.interior_node,
        V_36 = tree_bitset.leaf_list(OutLeafNodes_18) : tree_bitset.node_list,
        OutNodes_10 = list.[OutHead_24 | OutTail_12] : list.list(tree_bitset.interior_node)
      )
    ;
      SubNodes_15 = tree_bitset.interior_list(Level_25, SubInteriorNodes_26) : tree_bitset.node_list,
      tree_bitset.interiornode_divide(Pred_6, SubInteriorNodes_26, InSubInteriorNodes_27, OutSubInteriorNodes_28),
      ( % disjunction
        InSubInteriorNodes_27 = list.[] : list.list(tree_bitset.interior_node),
        InNodes_9 = InTail_11
      ;
        InSubInteriorNodes_27 = list.[V_29 | V_30] : list.list(tree_bitset.interior_node),
        InHead_37 = tree_bitset.interior_node(InitOffset_13, LimitOffset_14, V_33) : tree_bitset.interior_node,
        V_33 = tree_bitset.interior_list(Level_25, InSubInteriorNodes_27) : tree_bitset.node_list,
        InNodes_9 = list.[InHead_37 | InTail_11] : list.list(tree_bitset.interior_node)
      ),
      ( % disjunction
        OutSubInteriorNodes_28 = list.[] : list.list(tree_bitset.interior_node),
        OutNodes_10 = OutTail_12
      ;
        OutSubInteriorNodes_28 = list.[V_31 | V_32] : list.list(tree_bitset.interior_node),
        OutHead_39 = tree_bitset.interior_node(InitOffset_13, LimitOffset_14, V_34) : tree_bitset.interior_node,
        V_34 = tree_bitset.interior_list(Level_25, OutSubInteriorNodes_28) : tree_bitset.node_list,
        OutNodes_10 = list.[OutHead_39 | OutTail_12] : list.list(tree_bitset.interior_node)
      )
    ).
:- pragma inline((tree_bitset.get_bit)/2).
tree_bitset.get_bit(Int_4, Bit_5) = HeadVar__3_3 :-
    HeadVar__3_3 = int.(Int_4 /\ V_6),
    V_6 = int.unchecked_left_shift(V_7, Bit_5),
    V_7 = 1 : int.
:- pragma inline((tree_bitset.set_bit)/2).
tree_bitset.set_bit(Int0_4, Bit_5) = HeadVar__3_3 :-
    HeadVar__3_3 = int.(Int0_4 \/ V_6),
    V_6 = int.unchecked_left_shift(V_7, Bit_5),
    V_7 = 1 : int.
:- pragma inline((tree_bitset.mask)/1).
tree_bitset.mask(N_3) = HeadVar__2_2 :-
    HeadVar__2_2 = int.(\ V_4),
    V_4 = int.unchecked_left_shift(V_5, N_3),
    V_5 = int.(\ V_6),
    V_6 = 0 : int.
tree_bitset.do_foldl_pred(V_5, list.[], STATE_VARIABLE_Acc_0_7, STATE_VARIABLE_Acc_8) :-
    STATE_VARIABLE_Acc_8 = STATE_VARIABLE_Acc_0_7.
tree_bitset.do_foldl_pred(P_9, list.[H_10 | T_11], STATE_VARIABLE_Acc_0_17, STATE_VARIABLE_Acc_18) :-
    H_10 = tree_bitset.interior_node(V_22, V_23, Components_13) : tree_bitset.interior_node,
    ( % disjunction
      Components_13 = tree_bitset.leaf_list(LeafNodes_14) : tree_bitset.node_list,
      tree_bitset.leaf_foldl_pred(P_9, LeafNodes_14, STATE_VARIABLE_Acc_0_17, STATE_VARIABLE_Acc_20_20)
    ;
      Components_13 = tree_bitset.interior_list(V_15, InteriorNodes_16) : tree_bitset.node_list,
      tree_bitset.do_foldl_pred(P_9, InteriorNodes_16, STATE_VARIABLE_Acc_0_17, STATE_VARIABLE_Acc_20_20)
    ),
    tree_bitset.do_foldl_pred(P_9, T_11, STATE_VARIABLE_Acc_20_20, STATE_VARIABLE_Acc_18).
tree_bitset.leaf_foldl_pred(V_5, list.[], STATE_VARIABLE_Acc_0_7, STATE_VARIABLE_Acc_8) :-
    STATE_VARIABLE_Acc_8 = STATE_VARIABLE_Acc_0_7.
tree_bitset.leaf_foldl_pred(P_9, list.[H_10 | T_11], STATE_VARIABLE_Acc_0_13, STATE_VARIABLE_Acc_14) :-
    V_15 = tree_bitset.low_to_high : tree_bitset.fold_direction,
    H_10 = tree_bitset.leaf_node(V_16, V_21) : tree_bitset.leaf_node,
    H_10 = tree_bitset.leaf_node(V_22, V_17) : tree_bitset.leaf_node,
    V_18 = int.bits_per_int,
    tree_bitset.fold_bits(V_15, P_9, V_16, V_17, V_18, STATE_VARIABLE_Acc_0_13, STATE_VARIABLE_Acc_19_19),
    tree_bitset.leaf_foldl_pred(P_9, T_11, STATE_VARIABLE_Acc_19_19, STATE_VARIABLE_Acc_14).
tree_bitset.do_foldl2_pred(V_7, list.[], STATE_VARIABLE_AccA_0_10, STATE_VARIABLE_AccA_11, STATE_VARIABLE_AccB_0_12, STATE_VARIABLE_AccB_13) :-
    STATE_VARIABLE_AccB_13 = STATE_VARIABLE_AccB_0_12,
    STATE_VARIABLE_AccA_11 = STATE_VARIABLE_AccA_0_10.
tree_bitset.do_foldl2_pred(P_14, list.[H_15 | T_16], STATE_VARIABLE_AccA_0_23, STATE_VARIABLE_AccA_24, STATE_VARIABLE_AccB_0_25, STATE_VARIABLE_AccB_26) :-
    H_15 = tree_bitset.interior_node(V_33, V_34, Components_19) : tree_bitset.interior_node,
    ( % disjunction
      Components_19 = tree_bitset.leaf_list(LeafNodes_20) : tree_bitset.node_list,
      tree_bitset.leaf_foldl2_pred(P_14, LeafNodes_20, STATE_VARIABLE_AccA_0_23, STATE_VARIABLE_AccA_29_29, STATE_VARIABLE_AccB_0_25, STATE_VARIABLE_AccB_30_30)
    ;
      Components_19 = tree_bitset.interior_list(V_21, InteriorNodes_22) : tree_bitset.node_list,
      tree_bitset.do_foldl2_pred(P_14, InteriorNodes_22, STATE_VARIABLE_AccA_0_23, STATE_VARIABLE_AccA_29_29, STATE_VARIABLE_AccB_0_25, STATE_VARIABLE_AccB_30_30)
    ),
    tree_bitset.do_foldl2_pred(P_14, T_16, STATE_VARIABLE_AccA_29_29, STATE_VARIABLE_AccA_24, STATE_VARIABLE_AccB_30_30, STATE_VARIABLE_AccB_26).
tree_bitset.leaf_foldl2_pred(V_7, list.[], STATE_VARIABLE_AccA_0_10, STATE_VARIABLE_AccA_11, STATE_VARIABLE_AccB_0_12, STATE_VARIABLE_AccB_13) :-
    STATE_VARIABLE_AccB_13 = STATE_VARIABLE_AccB_0_12,
    STATE_VARIABLE_AccA_11 = STATE_VARIABLE_AccA_0_10.
tree_bitset.leaf_foldl2_pred(P_14, list.[H_15 | T_16], STATE_VARIABLE_AccA_0_19, STATE_VARIABLE_AccA_20, STATE_VARIABLE_AccB_0_21, STATE_VARIABLE_AccB_22) :-
    V_23 = tree_bitset.low_to_high : tree_bitset.fold_direction,
    H_15 = tree_bitset.leaf_node(V_24, V_31) : tree_bitset.leaf_node,
    H_15 = tree_bitset.leaf_node(V_32, V_25) : tree_bitset.leaf_node,
    V_26 = int.bits_per_int,
    tree_bitset.fold2_bits(V_23, P_14, V_24, V_25, V_26, STATE_VARIABLE_AccA_0_19, STATE_VARIABLE_AccA_27_27, STATE_VARIABLE_AccB_0_21, STATE_VARIABLE_AccB_28_28),
    tree_bitset.leaf_foldl2_pred(P_14, T_16, STATE_VARIABLE_AccA_27_27, STATE_VARIABLE_AccA_20, STATE_VARIABLE_AccB_28_28, STATE_VARIABLE_AccB_22).
tree_bitset.do_foldr_pred(V_5, list.[], STATE_VARIABLE_Acc_0_7, STATE_VARIABLE_Acc_8) :-
    STATE_VARIABLE_Acc_8 = STATE_VARIABLE_Acc_0_7.
tree_bitset.do_foldr_pred(P_9, list.[H_10 | T_11], STATE_VARIABLE_Acc_0_17, STATE_VARIABLE_Acc_18) :-
    tree_bitset.do_foldr_pred(P_9, T_11, STATE_VARIABLE_Acc_0_17, STATE_VARIABLE_Acc_19_19),
    H_10 = tree_bitset.interior_node(V_22, V_23, Components_13) : tree_bitset.interior_node,
    ( % disjunction
      Components_13 = tree_bitset.leaf_list(LeafNodes_14) : tree_bitset.node_list,
      tree_bitset.leaf_foldr_pred(P_9, LeafNodes_14, STATE_VARIABLE_Acc_19_19, STATE_VARIABLE_Acc_18)
    ;
      Components_13 = tree_bitset.interior_list(V_15, InteriorNodes_16) : tree_bitset.node_list,
      tree_bitset.do_foldr_pred(P_9, InteriorNodes_16, STATE_VARIABLE_Acc_19_19, STATE_VARIABLE_Acc_18)
    ).
tree_bitset.leaf_foldr_pred(V_5, list.[], STATE_VARIABLE_Acc_0_7, STATE_VARIABLE_Acc_8) :-
    STATE_VARIABLE_Acc_8 = STATE_VARIABLE_Acc_0_7.
tree_bitset.leaf_foldr_pred(P_9, list.[H_10 | T_11], STATE_VARIABLE_Acc_0_13, STATE_VARIABLE_Acc_14) :-
    tree_bitset.leaf_foldr_pred(P_9, T_11, STATE_VARIABLE_Acc_0_13, STATE_VARIABLE_Acc_15_15),
    V_16 = tree_bitset.high_to_low : tree_bitset.fold_direction,
    H_10 = tree_bitset.leaf_node(V_17, V_21) : tree_bitset.leaf_node,
    H_10 = tree_bitset.leaf_node(V_22, V_18) : tree_bitset.leaf_node,
    V_19 = int.bits_per_int,
    tree_bitset.fold_bits(V_16, P_9, V_17, V_18, V_19, STATE_VARIABLE_Acc_15_15, STATE_VARIABLE_Acc_14).
tree_bitset.do_foldr2_pred(V_7, list.[], STATE_VARIABLE_AccA_0_10, STATE_VARIABLE_AccA_11, STATE_VARIABLE_AccB_0_12, STATE_VARIABLE_AccB_13) :-
    STATE_VARIABLE_AccB_13 = STATE_VARIABLE_AccB_0_12,
    STATE_VARIABLE_AccA_11 = STATE_VARIABLE_AccA_0_10.
tree_bitset.do_foldr2_pred(P_14, list.[H_15 | T_16], STATE_VARIABLE_AccA_0_23, STATE_VARIABLE_AccA_24, STATE_VARIABLE_AccB_0_25, STATE_VARIABLE_AccB_26) :-
    tree_bitset.do_foldr2_pred(P_14, T_16, STATE_VARIABLE_AccA_0_23, STATE_VARIABLE_AccA_27_27, STATE_VARIABLE_AccB_0_25, STATE_VARIABLE_AccB_28_28),
    H_15 = tree_bitset.interior_node(V_33, V_34, Components_19) : tree_bitset.interior_node,
    ( % disjunction
      Components_19 = tree_bitset.leaf_list(LeafNodes_20) : tree_bitset.node_list,
      tree_bitset.leaf_foldr2_pred(P_14, LeafNodes_20, STATE_VARIABLE_AccA_27_27, STATE_VARIABLE_AccA_24, STATE_VARIABLE_AccB_28_28, STATE_VARIABLE_AccB_26)
    ;
      Components_19 = tree_bitset.interior_list(V_21, InteriorNodes_22) : tree_bitset.node_list,
      tree_bitset.do_foldr2_pred(P_14, InteriorNodes_22, STATE_VARIABLE_AccA_27_27, STATE_VARIABLE_AccA_24, STATE_VARIABLE_AccB_28_28, STATE_VARIABLE_AccB_26)
    ).
tree_bitset.leaf_foldr2_pred(V_7, list.[], STATE_VARIABLE_AccA_0_10, STATE_VARIABLE_AccA_11, STATE_VARIABLE_AccB_0_12, STATE_VARIABLE_AccB_13) :-
    STATE_VARIABLE_AccB_13 = STATE_VARIABLE_AccB_0_12,
    STATE_VARIABLE_AccA_11 = STATE_VARIABLE_AccA_0_10.
tree_bitset.leaf_foldr2_pred(P_14, list.[H_15 | T_16], STATE_VARIABLE_AccA_0_19, STATE_VARIABLE_AccA_20, STATE_VARIABLE_AccB_0_21, STATE_VARIABLE_AccB_22) :-
    tree_bitset.leaf_foldr2_pred(P_14, T_16, STATE_VARIABLE_AccA_0_19, STATE_VARIABLE_AccA_23_23, STATE_VARIABLE_AccB_0_21, STATE_VARIABLE_AccB_24_24),
    V_25 = tree_bitset.high_to_low : tree_bitset.fold_direction,
    H_15 = tree_bitset.leaf_node(V_26, V_31) : tree_bitset.leaf_node,
    H_15 = tree_bitset.leaf_node(V_32, V_27) : tree_bitset.leaf_node,
    V_28 = int.bits_per_int,
    tree_bitset.fold2_bits(V_25, P_14, V_26, V_27, V_28, STATE_VARIABLE_AccA_23_23, STATE_VARIABLE_AccA_20, STATE_VARIABLE_AccB_24_24, STATE_VARIABLE_AccB_22).
tree_bitset.fold_bits(Dir_8, P_9, Offset_10, Bits_11, Size_12, STATE_VARIABLE_Acc_0_19, STATE_VARIABLE_Acc_20) :-
    (if
      Bits_11 = 0 : int
    then
      STATE_VARIABLE_Acc_20 = STATE_VARIABLE_Acc_0_19
    else
      (if
        Size_12 = 1 : int
      then
        Elem_14 = tree_bitset.index_to_enum(Offset_10),
        call(P_9, Elem_14, STATE_VARIABLE_Acc_0_19, STATE_VARIABLE_Acc_20)
      else
        HalfSize_15 = int.unchecked_right_shift(Size_12, V_22),
        V_22 = 1 : int,
        Mask_16 = tree_bitset.mask(HalfSize_15),
        LowBits_17 = int.(Mask_16 /\ Bits_11),
        HighBits_18 = int.(Mask_16 /\ V_23),
        V_23 = int.unchecked_right_shift(Bits_11, HalfSize_15),
        ( % disjunction
          Dir_8 = tree_bitset.low_to_high : tree_bitset.fold_direction,
          tree_bitset.fold_bits(Dir_8, P_9, Offset_10, LowBits_17, HalfSize_15, STATE_VARIABLE_Acc_0_19, STATE_VARIABLE_Acc_27_27),
          V_28 = int.(Offset_10 + HalfSize_15),
          tree_bitset.fold_bits(Dir_8, P_9, V_28, HighBits_18, HalfSize_15, STATE_VARIABLE_Acc_27_27, STATE_VARIABLE_Acc_20)
        ;
          Dir_8 = tree_bitset.high_to_low : tree_bitset.fold_direction,
          V_24 = int.(Offset_10 + HalfSize_15),
          tree_bitset.fold_bits(Dir_8, P_9, V_24, HighBits_18, HalfSize_15, STATE_VARIABLE_Acc_0_19, STATE_VARIABLE_Acc_25_25),
          tree_bitset.fold_bits(Dir_8, P_9, Offset_10, LowBits_17, HalfSize_15, STATE_VARIABLE_Acc_25_25, STATE_VARIABLE_Acc_20)
        )
      )
    ).
tree_bitset.fold2_bits(Dir_10, P_11, Offset_12, Bits_13, Size_14, STATE_VARIABLE_AccA_0_22, STATE_VARIABLE_AccA_23, STATE_VARIABLE_AccB_0_24, STATE_VARIABLE_AccB_25) :-
    (if
      Bits_13 = 0 : int
    then
      STATE_VARIABLE_AccB_25 = STATE_VARIABLE_AccB_0_24,
      STATE_VARIABLE_AccA_23 = STATE_VARIABLE_AccA_0_22
    else
      (if
        Size_14 = 1 : int
      then
        Elem_17 = tree_bitset.index_to_enum(Offset_12),
        call(P_11, Elem_17, STATE_VARIABLE_AccA_0_22, STATE_VARIABLE_AccA_23, STATE_VARIABLE_AccB_0_24, STATE_VARIABLE_AccB_25)
      else
        HalfSize_18 = int.unchecked_right_shift(Size_14, V_28),
        V_28 = 1 : int,
        Mask_19 = tree_bitset.mask(HalfSize_18),
        LowBits_20 = int.(Mask_19 /\ Bits_13),
        HighBits_21 = int.(Mask_19 /\ V_29),
        V_29 = int.unchecked_right_shift(Bits_13, HalfSize_18),
        ( % disjunction
          Dir_10 = tree_bitset.low_to_high : tree_bitset.fold_direction,
          tree_bitset.fold2_bits(Dir_10, P_11, Offset_12, LowBits_20, HalfSize_18, STATE_VARIABLE_AccA_0_22, STATE_VARIABLE_AccA_35_35, STATE_VARIABLE_AccB_0_24, STATE_VARIABLE_AccB_36_36),
          V_37 = int.(Offset_12 + HalfSize_18),
          tree_bitset.fold2_bits(Dir_10, P_11, V_37, HighBits_21, HalfSize_18, STATE_VARIABLE_AccA_35_35, STATE_VARIABLE_AccA_23, STATE_VARIABLE_AccB_36_36, STATE_VARIABLE_AccB_25)
        ;
          Dir_10 = tree_bitset.high_to_low : tree_bitset.fold_direction,
          V_30 = int.(Offset_12 + HalfSize_18),
          tree_bitset.fold2_bits(Dir_10, P_11, V_30, HighBits_21, HalfSize_18, STATE_VARIABLE_AccA_0_22, STATE_VARIABLE_AccA_31_31, STATE_VARIABLE_AccB_0_24, STATE_VARIABLE_AccB_32_32),
          tree_bitset.fold2_bits(Dir_10, P_11, Offset_12, LowBits_20, HalfSize_18, STATE_VARIABLE_AccA_31_31, STATE_VARIABLE_AccA_23, STATE_VARIABLE_AccB_32_32, STATE_VARIABLE_AccB_25)
        )
      )
    ).
tree_bitset.interior_all_true(_P_3, list.[]).
tree_bitset.interior_all_true(P_4, list.[H_5 | T_6]) :-
    H_5 = tree_bitset.interior_node(V_11, V_12, Components_7) : tree_bitset.interior_node,
    ( % disjunction
      Components_7 = tree_bitset.leaf_list(LeafNodes_8) : tree_bitset.node_list,
      tree_bitset.leaf_all_true(P_4, LeafNodes_8)
    ;
      Components_7 = tree_bitset.interior_list(V_9, InteriorNodes_10) : tree_bitset.node_list,
      tree_bitset.interior_all_true(P_4, InteriorNodes_10)
    ),
    tree_bitset.interior_all_true(P_4, T_6).
tree_bitset.leaf_all_true(_P_3, list.[]).
tree_bitset.leaf_all_true(P_4, list.[H_5 | T_6]) :-
    H_5 = tree_bitset.leaf_node(V_7, V_10) : tree_bitset.leaf_node,
    H_5 = tree_bitset.leaf_node(V_11, V_8) : tree_bitset.leaf_node,
    V_9 = int.bits_per_int,
    tree_bitset.all_true_bits(P_4, V_7, V_8, V_9),
    tree_bitset.leaf_all_true(P_4, T_6).
tree_bitset.all_true_bits(P_5, Offset_6, Bits_7, Size_8) :-
    (if
      Bits_7 = 0 : int
    then
      true
    else
      (if
        Size_8 = 1 : int
      then
        Elem_9 = tree_bitset.index_to_enum(Offset_6),
        call(P_5, Elem_9)
      else
        HalfSize_10 = int.unchecked_right_shift(Size_8, V_14),
        V_14 = 1 : int,
        Mask_11 = tree_bitset.mask(HalfSize_10),
        LowBits_12 = int.(Mask_11 /\ Bits_7),
        HighBits_13 = int.(Mask_11 /\ V_15),
        V_15 = int.unchecked_right_shift(Bits_7, HalfSize_10),
        tree_bitset.all_true_bits(P_5, Offset_6, LowBits_12, HalfSize_10),
        V_16 = int.(Offset_6 + HalfSize_10),
        tree_bitset.all_true_bits(P_5, V_16, HighBits_13, HalfSize_10)
      )
    ).
:- pragma exceptions(function, (tree_bitset.init), 1, 0, will_not_throw).
:- pragma exceptions(predicate, (tree_bitset.empty), 1, 0, may_throw(type_exception)).
:- pragma exceptions(predicate, (tree_bitset.empty), 1, 1, will_not_throw).
:- pragma exceptions(predicate, (tree_bitset.is_empty), 1, 0, may_throw(type_exception)).
:- pragma exceptions(predicate, (tree_bitset.is_non_empty), 1, 0, may_throw(type_exception)).
:- pragma exceptions(predicate, (tree_bitset.equal), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.list_to_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.list_to_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.sorted_list_to_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.sorted_list_to_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.from_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.to_sorted_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.to_sorted_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.to_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.make_singleton_set), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.is_singleton), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.subset), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.superset), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.contains), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.member), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.member), 2, 1, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.insert), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.insert), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.insert_new), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.insert_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.insert_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.delete), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.delete), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.delete_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.delete_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.remove), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.remove_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.remove_leq), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.remove_gt), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.remove_least), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.union), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.union), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.union_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.union_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.intersect), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.intersect), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.intersect_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.intersect_list), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.difference), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.difference), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.divide), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.divide_by_set), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.count), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.foldl), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 8, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl), 4, 9, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldl2), 6, 7, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.foldr), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.foldr2), 6, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.all_true), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.filter), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.filter), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.make_leaf_node), 3, 0, will_not_throw).
:- pragma exceptions(function, (tree_bitset.index_to_enum), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.wrap_tree_bitset), 2, 0, will_not_throw).
:- pragma exceptions(function, (tree_bitset.integrity), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.prune_top_levels), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (tree_bitset.leaflist_divide), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leafnode_divide), 8, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.interiornode_divide), 4, 0, may_throw(user_exception)).
:- pragma exceptions(function, (tree_bitset.get_bit), 3, 0, will_not_throw).
:- pragma exceptions(function, (tree_bitset.set_bit), 3, 0, will_not_throw).
:- pragma exceptions(function, (tree_bitset.mask), 2, 0, will_not_throw).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 8, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl_pred), 4, 9, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 8, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl_pred), 4, 9, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldl2_pred), 6, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldl2_pred), 6, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr_pred), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr_pred), 4, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.do_foldr2_pred), 6, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_foldr2_pred), 6, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 8, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold_bits), 7, 9, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 1, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 2, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 3, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 4, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 5, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 6, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.fold2_bits), 9, 7, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.interior_all_true), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.leaf_all_true), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (tree_bitset.all_true_bits), 4, 0, may_throw(user_exception)).
:- pragma termination_info((tree_bitset.init) = (builtin.out), finite(2, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.empty((builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.empty((builtin.out)), finite(2, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.is_empty((builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.is_non_empty((builtin.in)), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.equal((builtin.in), (builtin.in)), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.list_to_set((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.list_to_set((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.sorted_list_to_set((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.sorted_list_to_set((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.from_set((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.to_sorted_list((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.to_sorted_list((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.to_set((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.make_singleton_set((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.is_singleton((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.subset((builtin.in), (builtin.in)), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.superset((builtin.in), (builtin.in)), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.contains((builtin.in), (builtin.in)), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.member((builtin.in), (builtin.in)), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.member((builtin.out), (builtin.in)), infinite, can_loop).
:- pragma termination_info(tree_bitset.insert((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.insert((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.insert_new((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.insert_list((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.insert_list((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.delete((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.delete((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.delete_list((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.delete_list((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.remove((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.remove_list((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.remove_leq((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.remove_gt((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.remove_least((builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.union((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.union((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.union_list((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.union_list((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.intersect((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.intersect((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.intersect_list((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.intersect_list((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.difference((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.difference((builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.out), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.divide_by_set((builtin.in), (builtin.in), (builtin.out), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.count((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldl2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((builtin.in), (builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.foldr2((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.all_true(builtin.in((pred((builtin.in)) is semidet)), (builtin.in)), infinite, can_loop).
:- pragma termination_info(tree_bitset.filter((pred((builtin.in)) is semidet), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.filter((pred((builtin.in)) is semidet), (builtin.in), (builtin.out), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.make_leaf_node((builtin.in), (builtin.in)) = (builtin.out), finite(2, [yes, yes, no]), cannot_loop).
:- pragma termination_info(tree_bitset.index_to_enum((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(tree_bitset.wrap_tree_bitset((builtin.in)) = (builtin.out), finite(1, [no, yes, no]), cannot_loop).
:- pragma termination_info(tree_bitset.integrity((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), can_loop).
:- pragma termination_info(tree_bitset.prune_top_levels((builtin.in), (builtin.out)), finite(1, [yes, no]), cannot_loop).
:- pragma termination_info(tree_bitset.leaflist_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.out), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leafnode_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.interiornode_divide(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.out), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.get_bit((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.set_bit((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.mask((builtin.in)) = (builtin.out), finite(0, [no, no]), cannot_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldl2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr_pred((pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.do_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_foldr2_pred((pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.mdi), (builtin.muo)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.mdi), (builtin.muo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is det), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is semidet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is nondet), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.di), (builtin.uo), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(tree_bitset.fold2_bits((builtin.in), (pred((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)) is cc_multi), (builtin.in), (builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(tree_bitset.interior_all_true(builtin.in((pred((builtin.in)) is semidet)), (builtin.in)), infinite, can_loop).
:- pragma termination_info(tree_bitset.leaf_all_true(builtin.in((pred((builtin.in)) is semidet)), (builtin.in)), infinite, can_loop).
:- pragma termination_info(tree_bitset.all_true_bits(builtin.in((pred((builtin.in)) is semidet)), (builtin.in), (builtin.in), (builtin.in)), infinite, can_loop).
