Queues¶
The following queue manipulation routines are available once included with the use_module(library(queues))
command.
Queues are implemented with difference lists.
In this package, a queue is represented as a term Front-Back, where Front is a list and Back is a tail of that list, and is normally a variable. join_queue will only work when the Back is a variable, the other routines will accept any tail. The elements of the queue are the list difference, that is, all the elements starting at Front and stopping at Back. Examples:
[a,b,c,d,e|Z]-Z has elements a,b,c,d,e [a,b,c,d,e]-[d,e] has elements a,b,c Z-Z has no elements [1,2,3]-[1,2,3] has no elements
- list_to_queue/3
- list_jump_queue/4
- list_join_queue/4
- length_queue/3
- jump_queue/4
- join_queue/4
- prolog::queue_to_list/2
- prolog::list_to_queue/2
- prolog::length_queue/2
- prolog::empty_queue/1
- prolog::serve_queue/3
- prolog::head_queue/2
- prolog::list_jump_queue/3
- prolog::jump_queue/3
- prolog::list_join_queue/3
- prolog::join_queue/3
- prolog::make_queue/1