% compiler: GNU Prolog 1.4.2
% file    : list.pl


file_name('/home/diaz/GP/src/src/BipsPl/list.pl').


predicate('$use_list'/0,42,static,private,monofile,built_in,[
    proceed]).


predicate(append/3,51,static,private,monofile,built_in,[
    call_c('Pl_Append_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate('$append_alt'/0,55,static,private,monofile,built_in,[
    call_c('Pl_Append_Alt_0',[boolean],[]),
    proceed]).


predicate(member/2,68,static,private,monofile,built_in,[
    call_c('Pl_Member_2',[boolean],[]),
    proceed]).


predicate('$member_alt'/0,71,static,private,monofile,built_in,[
    call_c('Pl_Member_Alt_0',[boolean],[]),
    proceed]).


predicate(memberchk/2,85,static,private,monofile,built_in,[
    call_c('Pl_Memberchk_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(reverse/2,104,static,private,monofile,built_in,[
    call_c('Pl_Reverse_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate('$reverse_alt'/0,107,static,private,monofile,built_in,[
    call_c('Pl_Reverse_Alt_0',[boolean],[]),
    proceed]).


predicate(delete/3,113,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    switch_on_term(2,3,fail,1,fail),

label(1),
    try(5),
    trust(7),

label(2),
    try_me_else(4),

label(3),
    get_nil(0),
    get_nil(2),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_list(0),
    unify_variable(x(4)),
    unify_variable(x(0)),
    call_c('Pl_Blt_Term_Eq',[fast_call,boolean],[x(4),x(1)]),
    cut(x(3)),
    execute(delete/3),

label(6),
    trust_me_else_fail,

label(7),
    get_list(0),
    unify_variable(x(3)),
    unify_variable(x(0)),
    get_list(2),
    unify_value(x(3)),
    unify_variable(x(2)),
    execute(delete/3)]).


predicate(select/3,126,static,private,monofile,built_in,[
    try_me_else(1),
    get_list(1),
    unify_local_value(x(0)),
    unify_local_value(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    get_list(1),
    unify_variable(x(3)),
    unify_variable(x(1)),
    get_list(2),
    unify_value(x(3)),
    unify_variable(x(2)),
    execute(select/3)]).


predicate(permutation/2,135,static,private,monofile,built_in,[
    try_me_else(1),
    get_nil(0),
    get_nil(1),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(2),
    get_variable(x(2),0),
    get_list(1),
    unify_variable(x(0)),
    unify_variable(y(0)),
    put_value(x(2),1),
    put_variable(y(1),2),
    call(select/3),
    put_unsafe_value(y(1),0),
    put_value(y(0),1),
    deallocate,
    execute(permutation/2)]).


predicate(prefix/2,145,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    get_list(0),
    unify_variable(x(2)),
    unify_variable(x(0)),
    get_list(1),
    unify_value(x(2)),
    unify_variable(x(1)),
    execute(prefix/2)]).


predicate(suffix/2,153,static,private,monofile,built_in,[
    try_me_else(1),
    get_value(x(1),0),
    proceed,

label(1),
    trust_me_else_fail,
    get_list(1),
    unify_void(1),
    unify_variable(x(1)),
    execute(suffix/2)]).


predicate(sublist/2,161,static,private,monofile,built_in,[
    try_me_else(1),
    get_value(x(1),0),
    proceed,

label(1),
    trust_me_else_fail,
    get_variable(x(2),0),
    get_list(1),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$sublist1'/3)]).


predicate('$sublist1'/3,167,static,private,monofile,built_in,[
    try_me_else(1),
    get_value(x(2),0),
    proceed,

label(1),
    trust_me_else_fail,
    switch_on_term(3,fail,fail,2,fail),

label(2),
    try(4),
    trust(6),

label(3),
    try_me_else(5),

label(4),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$sublist1'/3),

label(5),
    trust_me_else_fail,

label(6),
    get_variable(x(3),1),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    get_list(2),
    unify_local_value(x(3)),
    unify_variable(x(2)),
    execute('$sublist1'/3)]).


predicate(last/2,178,static,private,monofile,built_in,[
    get_variable(x(2),1),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$last1'/3)]).


predicate('$last1'/3,181,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_value(x(2),1),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$last1'/3)]).


predicate(length/2,216,static,private,monofile,built_in,[
    call_c('Pl_Length_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate('$length_alt'/0,220,static,private,monofile,built_in,[
    call_c('Pl_Length_Alt_0',[boolean],[]),
    proceed]).


predicate(nth/3,254,static,private,monofile,built_in,[
    execute(nth1/3)]).


predicate(nth1/3,257,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    call_c('Pl_Blt_Integer',[fast_call,boolean],[x(0)]),
    cut(x(3)),
    call_c('Pl_Nth0_3',[boolean,by_value],[x(0),x(1),x(2),1]),
    proceed,

label(1),
    trust_me_else_fail,
    get_variable(x(3),0),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(3)]),
    put_value(x(1),0),
    put_value(x(2),1),
    put_integer(1,2),
    execute('$nth_gener'/4)]).


predicate(nth0/3,266,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    call_c('Pl_Blt_Integer',[fast_call,boolean],[x(0)]),
    cut(x(3)),
    call_c('Pl_Nth0_3',[boolean,by_value],[x(0),x(1),x(2),0]),
    proceed,

label(1),
    trust_me_else_fail,
    get_variable(x(3),0),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(3)]),
    put_value(x(1),0),
    put_value(x(2),1),
    put_integer(0,2),
    execute('$nth_gener'/4)]).


predicate('$nth_gener'/4,276,static,private,monofile,built_in,[
    switch_on_term(2,fail,fail,1,fail),

label(1),
    try(3),
    trust(5),

label(2),
    try_me_else(4),

label(3),
    get_value(x(3),2),
    get_list(0),
    unify_local_value(x(1)),
    unify_void(1),
    proceed,

label(4),
    trust_me_else_fail,

label(5),
    get_list(0),
    unify_void(1),
    unify_variable(x(0)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(x(2),2),
    call_c('Pl_Fct_Inc',[fast_call,x(2)],[x(2)]),
    execute('$nth_gener'/4)]).


predicate(max_list/2,286,static,private,monofile,built_in,[
    get_variable(x(2),1),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$max_list1'/3)]).


predicate('$max_list1'/3,289,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    switch_on_term(2,3,fail,1,fail),

label(1),
    try(5),
    trust(7),

label(2),
    try_me_else(4),

label(3),
    get_nil(0),
    get_value(x(2),1),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_list(0),
    unify_variable(x(4)),
    unify_variable(x(0)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[=<,2]),
    math_load_value(x(4),4),
    math_load_value(x(1),5),
    call_c('Pl_Blt_Lte',[fast_call,boolean],[x(4),x(5)]),
    cut(x(3)),
    execute('$max_list1'/3),

label(6),
    trust_me_else_fail,

label(7),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$max_list1'/3)]).


predicate(min_list/2,301,static,private,monofile,built_in,[
    get_variable(x(2),1),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$min_list1'/3)]).


predicate('$min_list1'/3,304,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    switch_on_term(2,3,fail,1,fail),

label(1),
    try(5),
    trust(7),

label(2),
    try_me_else(4),

label(3),
    get_nil(0),
    get_value(x(2),1),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_list(0),
    unify_variable(x(4)),
    unify_variable(x(0)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[>=,2]),
    math_load_value(x(4),4),
    math_load_value(x(1),5),
    call_c('Pl_Blt_Gte',[fast_call,boolean],[x(4),x(5)]),
    cut(x(3)),
    execute('$min_list1'/3),

label(6),
    trust_me_else_fail,

label(7),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(x(0)),
    execute('$min_list1'/3)]).


predicate(sum_list/2,317,static,private,monofile,built_in,[
    put_value(x(1),2),
    put_integer(0,1),
    execute('$sum_list1'/3)]).


predicate('$sum_list1'/3,320,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_value(x(2),1),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    get_list(0),
    unify_variable(x(3)),
    unify_variable(x(0)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(x(3),3),
    math_load_value(x(1),1),
    call_c('Pl_Fct_Add',[fast_call,x(1)],[x(3),x(1)]),
    execute('$sum_list1'/3)]).


predicate(flatten/2,328,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    allocate(3),
    get_variable(y(0),1),
    get_variable(y(1),2),
    put_nil(1),
    put_variable(y(2),2),
    call('$flatten'/3),
    cut(y(1)),
    put_value(y(0),0),
    get_value(y(2),0),
    deallocate,
    proceed]).


predicate('$flatten'/3,332,static,private,monofile,built_in,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    get_list(2),
    unify_local_value(x(0)),
    unify_local_value(x(1)),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(3)),
    proceed,

label(1),
    retry_me_else(6),
    switch_on_term(2,3,fail,5,fail),

label(2),
    try_me_else(4),

label(3),
    get_nil(0),
    get_value(x(2),1),
    cut(x(3)),
    proceed,

label(4),
    trust_me_else_fail,

label(5),
    allocate(3),
    get_variable(y(1),1),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    cut(x(3)),
    put_variable(y(2),1),
    call('$flatten'/3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_unsafe_value(y(2),2),
    deallocate,
    execute('$flatten'/3),

label(6),
    trust_me_else_fail,
    get_list(2),
    unify_local_value(x(0)),
    unify_local_value(x(1)),
    proceed]).


predicate(maplist/2,347,static,private,monofile,built_in,[
    get_variable(x(2),1),
    get_variable(x(1),0),
    put_value(x(2),0),
    execute('$maplist'/2)]).


predicate('$maplist'/2,350,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(2),
    get_variable(y(1),1),
    get_list(0),
    unify_variable(x(1)),
    unify_variable(y(0)),
    put_value(y(1),0),
    call(call/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute('$maplist'/2)]).


predicate(maplist/3,359,static,private,monofile,built_in,[
    get_variable(x(3),2),
    get_variable(x(2),0),
    put_value(x(1),0),
    put_value(x(3),1),
    execute('$maplist'/3)]).


predicate('$maplist'/3,362,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(3),
    get_variable(y(2),2),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(2)),
    unify_variable(y(1)),
    put_value(x(0),1),
    put_value(y(2),0),
    call(call/3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    deallocate,
    execute('$maplist'/3)]).


predicate(maplist/4,371,static,private,monofile,built_in,[
    get_variable(x(4),3),
    get_variable(x(3),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(4),2),
    execute('$maplist'/4)]).


predicate('$maplist'/4,374,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(4),
    get_variable(y(3),3),
    get_list(0),
    unify_variable(x(4)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(0)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(3)),
    unify_variable(y(2)),
    put_value(x(4),1),
    put_value(x(0),2),
    put_value(y(3),0),
    call(call/4),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    deallocate,
    execute('$maplist'/4)]).


predicate(maplist/5,383,static,private,monofile,built_in,[
    get_variable(x(5),4),
    get_variable(x(4),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    put_value(x(5),3),
    execute('$maplist'/5)]).


predicate('$maplist'/5,386,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    get_nil(3),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(5),
    get_variable(y(4),4),
    get_list(0),
    unify_variable(x(6)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(5)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(0)),
    unify_variable(y(2)),
    get_list(3),
    unify_variable(x(4)),
    unify_variable(y(3)),
    put_value(x(6),1),
    put_value(x(5),2),
    put_value(x(0),3),
    put_value(y(4),0),
    call(call/5),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    deallocate,
    execute('$maplist'/5)]).


predicate(maplist/6,395,static,private,monofile,built_in,[
    get_variable(x(6),5),
    get_variable(x(5),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    put_value(x(4),3),
    put_value(x(6),4),
    execute('$maplist'/6)]).


predicate('$maplist'/6,398,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    get_nil(3),
    get_nil(4),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(6),
    get_variable(y(5),5),
    get_list(0),
    unify_variable(x(8)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(7)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(6)),
    unify_variable(y(2)),
    get_list(3),
    unify_variable(x(0)),
    unify_variable(y(3)),
    get_list(4),
    unify_variable(x(5)),
    unify_variable(y(4)),
    put_value(x(8),1),
    put_value(x(7),2),
    put_value(x(6),3),
    put_value(x(0),4),
    put_value(y(5),0),
    call(call/6),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    put_value(y(5),5),
    deallocate,
    execute('$maplist'/6)]).


predicate(maplist/7,407,static,private,monofile,built_in,[
    get_variable(x(7),6),
    get_variable(x(6),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    put_value(x(4),3),
    put_value(x(5),4),
    put_value(x(7),5),
    execute('$maplist'/7)]).


predicate('$maplist'/7,410,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    get_nil(3),
    get_nil(4),
    get_nil(5),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(7),
    get_variable(y(6),6),
    get_list(0),
    unify_variable(x(10)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(9)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(8)),
    unify_variable(y(2)),
    get_list(3),
    unify_variable(x(7)),
    unify_variable(y(3)),
    get_list(4),
    unify_variable(x(0)),
    unify_variable(y(4)),
    get_list(5),
    unify_variable(x(6)),
    unify_variable(y(5)),
    put_value(x(10),1),
    put_value(x(9),2),
    put_value(x(8),3),
    put_value(x(7),4),
    put_value(x(0),5),
    put_value(y(6),0),
    call(call/7),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    put_value(y(5),5),
    put_value(y(6),6),
    deallocate,
    execute('$maplist'/7)]).


predicate(maplist/8,419,static,private,monofile,built_in,[
    get_variable(x(8),7),
    get_variable(x(7),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    put_value(x(4),3),
    put_value(x(5),4),
    put_value(x(6),5),
    put_value(x(8),6),
    execute('$maplist'/8)]).


predicate('$maplist'/8,422,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    get_nil(3),
    get_nil(4),
    get_nil(5),
    get_nil(6),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(8),
    get_variable(y(7),7),
    get_list(0),
    unify_variable(x(12)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(11)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(10)),
    unify_variable(y(2)),
    get_list(3),
    unify_variable(x(9)),
    unify_variable(y(3)),
    get_list(4),
    unify_variable(x(8)),
    unify_variable(y(4)),
    get_list(5),
    unify_variable(x(0)),
    unify_variable(y(5)),
    get_list(6),
    unify_variable(x(7)),
    unify_variable(y(6)),
    put_value(x(12),1),
    put_value(x(11),2),
    put_value(x(10),3),
    put_value(x(9),4),
    put_value(x(8),5),
    put_value(x(0),6),
    put_value(y(7),0),
    call(call/8),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    put_value(y(5),5),
    put_value(y(6),6),
    put_value(y(7),7),
    deallocate,
    execute('$maplist'/8)]).


predicate(maplist/9,431,static,private,monofile,built_in,[
    get_variable(x(9),8),
    get_variable(x(8),0),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    put_value(x(4),3),
    put_value(x(5),4),
    put_value(x(6),5),
    put_value(x(7),6),
    put_value(x(9),7),
    execute('$maplist'/9)]).


predicate('$maplist'/9,434,static,private,monofile,built_in,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    get_nil(2),
    get_nil(3),
    get_nil(4),
    get_nil(5),
    get_nil(6),
    get_nil(7),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(9),
    get_variable(y(8),8),
    get_list(0),
    unify_variable(x(14)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(13)),
    unify_variable(y(1)),
    get_list(2),
    unify_variable(x(12)),
    unify_variable(y(2)),
    get_list(3),
    unify_variable(x(11)),
    unify_variable(y(3)),
    get_list(4),
    unify_variable(x(10)),
    unify_variable(y(4)),
    get_list(5),
    unify_variable(x(9)),
    unify_variable(y(5)),
    get_list(6),
    unify_variable(x(0)),
    unify_variable(y(6)),
    get_list(7),
    unify_variable(x(8)),
    unify_variable(y(7)),
    put_value(x(14),1),
    put_value(x(13),2),
    put_value(x(12),3),
    put_value(x(11),4),
    put_value(x(10),5),
    put_value(x(9),6),
    put_value(x(0),7),
    put_value(y(8),0),
    call(call/9),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    put_value(y(5),5),
    put_value(y(6),6),
    put_value(y(7),7),
    put_value(y(8),8),
    deallocate,
    execute('$maplist'/9)]).
