2015-11-18 15:06:25 +00:00
|
|
|
/**
|
|
|
|
* @file rltree.yap
|
|
|
|
* @author Nuno A. Fonseca
|
|
|
|
* @date 2008-03-26 23:05:22
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2008-03-26 23:05:22 +00:00
|
|
|
|
|
|
|
:- module(rltree, [
|
2018-05-01 23:25:58 +01:00
|
|
|
rl_new/2, % (+Maximum Interval value, -Range-List Id)
|
|
|
|
rl_free/1, % (+Range-List Id)
|
|
|
|
rl_size/2, % (+Range-List Id,-Size in bytes)
|
|
|
|
rl_copy/2, % (+Range-List Id,-New Range-List Id) - copies one rl_tree
|
|
|
|
rl_set_out/2, %(+Range-List Id,+Number) - removes Number from the range-list
|
|
|
|
rl_in/2, %(+Range-List Id,?Number) - checks if a number is in the rl-tree
|
|
|
|
rl_set_in/2, %(+Range-List Id,+Number)
|
|
|
|
rl_set_all_in/1,%(+Range-List Id)
|
|
|
|
rl_print/1, %(+Range-List Id)
|
|
|
|
rl_freeze/1 %(+Range-List Id)
|
2008-03-26 23:05:22 +00:00
|
|
|
]).
|
|
|
|
|
2015-11-18 15:06:25 +00:00
|
|
|
|
|
|
|
/**
|
2017-04-07 23:10:59 +01:00
|
|
|
* @defgroup rltrees Range-List (RL) trees
|
2015-11-18 15:06:25 +00:00
|
|
|
* @ingroup library
|
|
|
|
*
|
2017-04-07 23:10:59 +01:00
|
|
|
* @brief Range-List (RL) tree data structure implementation for YAP
|
2015-11-18 15:06:25 +00:00
|
|
|
*/
|
|
|
|
|
2018-05-01 23:25:58 +01:00
|
|
|
%% @pred rl_new(+Maximum Interval value, -Range-List Id)
|
|
|
|
%%
|
|
|
|
%% Create a _Range-List Id_, with keyInfoFromExprList frp, 0 to Maximum Interval value
|
2015-11-18 15:06:25 +00:00
|
|
|
|
2018-05-01 23:25:58 +01:00
|
|
|
%% @pred rl_free(+Range-List Id)
|
|
|
|
%%
|
|
|
|
%% close tree _Range-List Id_.
|
2015-11-18 15:06:25 +00:00
|
|
|
|
2018-05-01 23:25:58 +01:00
|
|
|
%% @pred rl_size(+Range-List Id,-Size in bytes)
|
|
|
|
%%
|
|
|
|
%% Unify _Range-List Id_ withDup the storage needed for _Size in bytes_.
|
|
|
|
|
|
|
|
%% @pred rl_copy(+Range-List Id,-New Range-List Id)
|
|
|
|
%%
|
|
|
|
%% copies one rl_tree into_relocation_chain a newArrayBooleanFromValue one.
|
|
|
|
|
|
|
|
%% @pred rl_set_out(+Range-List Id,+Number)
|
|
|
|
%%
|
|
|
|
%% removes Number from the range-list.
|
|
|
|
|
|
|
|
%% @pred rl_in(+Range-List Id,?Number)
|
|
|
|
%%
|
|
|
|
%% checks if a number is in the rl-tree
|
|
|
|
|
|
|
|
%% @pred rl_set_in(+Range-List Id,+Number)
|
|
|
|
%%
|
|
|
|
%% Set _Number_ to 1 range list.
|
|
|
|
|
|
|
|
%% @pred rl_set_all_in(+Range-List Id)
|
|
|
|
%%
|
|
|
|
%% Set all bits to one.
|
|
|
|
|
|
|
|
%% @pred rl_print(+Range-List Id)
|
|
|
|
%%
|
|
|
|
%% Output the data-structure
|
|
|
|
|
|
|
|
%% @pred rl_freeze(+Range-List Id)
|
|
|
|
%%
|
|
|
|
%% close
|
2015-11-18 15:06:25 +00:00
|
|
|
|
2008-03-26 23:05:22 +00:00
|
|
|
:- load_foreign_files([yap_rl], [], init_rl).
|