A.43 library(rbtrees): Red black trees
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(rbtrees): Red black trees
          • rb_new/1
          • rb_empty/1
          • rb_lookup/3
          • rb_min/3
          • rb_max/3
          • rb_next/4
          • rb_previous/4
          • rb_update/4
          • rb_update/5
          • rb_apply/4
          • rb_in/3
          • rb_insert/4
          • rb_insert_new/4
          • rb_delete/3
          • rb_delete/4
          • rb_del_min/4
          • rb_del_max/4
          • rb_visit/2
          • rb_map/2
          • rb_map/3
          • rb_fold/4
          • rb_clone/3
          • rb_partial_map/4
          • rb_keys/2
          • list_to_rbtree/2
          • ord_list_to_rbtree/2
          • rb_size/2
          • is_rbtree/1
    • Packages
Availability::- use_module(library(rbtrees)).(can be autoloaded)
Source[semidet]rb_map(+Tree, :G, -NewTree)
For all nodes Key in the tree Tree, if the value associated with key Key is Val0 in tree Tree, and if call(G,Val0,ValF) holds, then the value associated with Key in NewTree is ValF. Fails if call(G,Val0,ValF) is not satisfiable for all Val0. If G is non-deterministic, rb_map/3 will backtrack over all possible values from call(G,Val0,ValF). You should not depend on the order of tree traversal (currently: key order).