% compiler: GNU Prolog 0.9.0 (Mar 16 1999)
% file    : list.pl
% date    : 4 16 1999
% time    : 15:53:45


file_name('/home/loews/loco/diaz/GNU-Prolog/src/BipsPl/list.pl').


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


predicate(append/3,30,static,private,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)),
    get_list(2),
    unify_value(x(3)),
    unify_variable(x(2)),
    execute(append/3)]).


predicate(member/2,38,static,private,built_in,[
    get_list(1),
    unify_variable(x(1)),
    unify_variable(x(2)),
    execute('$member/2_$aux1'/3)]).


predicate('$member/2_$aux1'/3,38,static,private,built_in,[
    try_me_else(1),
    get_value(x(1),0),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(2),1),
    execute(member/2)]).


predicate(memberchk/2,42,static,private,built_in,[
    load_cut_level(2),
    get_list(1),
    unify_variable(x(1)),
    unify_variable(x(3)),
    execute('$memberchk/2_$aux1'/4)]).


predicate('$memberchk/2_$aux1'/4,42,static,private,built_in,[
    try_me_else(1),
    get_value(x(1),0),
    cut(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(3),1),
    execute(memberchk/2)]).


predicate(reverse/2,48,static,private,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),
    get_list(0),
    unify_variable(x(3)),
    unify_variable(x(0)),
    put_list(2),
    unify_value(x(3)),
    unify_nil,
    execute('$reverse1'/3)]).


predicate('$reverse1'/3,54,static,private,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_variable(x(3),2),
    get_list(0),
    unify_variable(x(4)),
    unify_variable(x(0)),
    put_list(2),
    unify_value(x(4)),
    unify_local_value(x(3)),
    execute('$reverse1'/3)]).


predicate(delete/3,62,static,private,built_in,[
    load_cut_level(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_test('Blt_Term_Eq',[4,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,76,static,private,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,85,static,private,built_in,[
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

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

label(2),
    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,95,static,private,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,103,static,private,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,111,static,private,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,117,static,private,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,128,static,private,built_in,[
    switch_on_term(1,fail,fail,1,fail),

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


predicate('$last1'/3,131,static,private,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,140,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    get_variable(x(3),1),
    get_variable(x(1),0),
    call_c_test('Blt_Integer',[3]),
    cut(x(2)),
    put_atom(>=,0),
    put_integer(2,2),
    call_c('Set_Bip_Name_2',[0,2]),
    math_load_value(x(3),0),
    put_integer(0,2),
    call_c_test('Blt_Gte',[0,2]),
    put_value(x(3),0),
    execute('$make_list'/2),

label(1),
    trust_me_else_fail,
    put_value(x(1),2),
    put_integer(0,1),
    execute('$length'/3)]).


predicate('$length'/3,150,static,private,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_void(1),
    unify_variable(x(0)),
    put_atom(is,3),
    put_integer(2,4),
    call_c('Set_Bip_Name_2',[3,4]),
    math_load_value(x(1),1),
    function('Fct_Inc',1,[1]),
    execute('$length'/3)]).


predicate('$make_list'/2,159,static,private,built_in,[
    load_cut_level(2),
    try_me_else(2),
    switch_on_term(1,fail,1,fail,fail),

label(1),
    get_integer(0,0),
    get_nil(1),
    cut(x(2)),
    proceed,

label(2),
    trust_me_else_fail,
    get_list(1),
    unify_void(1),
    unify_variable(x(1)),
    put_atom(is,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    math_load_value(x(0),0),
    function('Fct_Dec',0,[0]),
    execute('$make_list'/2)]).


predicate(nth/3,169,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    call_c_test('Blt_Integer',[0]),
    cut(x(3)),
    put_atom(>=,3),
    put_integer(2,4),
    call_c('Set_Bip_Name_2',[3,4]),
    math_load_value(x(0),3),
    put_integer(1,4),
    call_c_test('Blt_Gte',[3,4]),
    execute('$nth1'/3),

label(1),
    trust_me_else_fail,
    get_variable(x(3),0),
    call_c_test('Blt_Var',[3]),
    put_value(x(1),0),
    put_value(x(2),1),
    put_integer(1,2),
    execute('$nth2'/4)]).


predicate('$nth1'/3,179,static,private,built_in,[
    load_cut_level(3),
    try_me_else(2),
    switch_on_term(1,fail,1,fail,fail),

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

label(2),
    trust_me_else_fail,
    get_list(1),
    unify_void(1),
    unify_variable(x(1)),
    put_atom(is,3),
    put_integer(2,4),
    call_c('Set_Bip_Name_2',[3,4]),
    math_load_value(x(0),0),
    function('Fct_Dec',0,[0]),
    execute('$nth1'/3)]).


predicate('$nth2'/4,187,static,private,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)),
    put_atom(is,4),
    put_integer(2,5),
    call_c('Set_Bip_Name_2',[4,5]),
    math_load_value(x(2),2),
    function('Fct_Inc',2,[2]),
    execute('$nth2'/4)]).


predicate(max_list/2,196,static,private,built_in,[
    switch_on_term(1,fail,fail,1,fail),

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


predicate('$max_list1'/3,199,static,private,built_in,[
    load_cut_level(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)),
    put_atom(=<,5),
    put_integer(2,6),
    call_c('Set_Bip_Name_2',[5,6]),
    math_load_value(x(4),4),
    math_load_value(x(1),5),
    call_c_test('Blt_Lte',[4,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,212,static,private,built_in,[
    switch_on_term(1,fail,fail,1,fail),

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


predicate('$min_list1'/3,215,static,private,built_in,[
    load_cut_level(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)),
    put_atom(>=,5),
    put_integer(2,6),
    call_c('Set_Bip_Name_2',[5,6]),
    math_load_value(x(4),4),
    math_load_value(x(1),5),
    call_c_test('Blt_Gte',[4,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,229,static,private,built_in,[
    put_value(x(1),2),
    put_integer(0,1),
    execute('$sum_list1'/3)]).


predicate('$sum_list1'/3,232,static,private,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)),
    put_atom(is,4),
    put_integer(2,5),
    call_c('Set_Bip_Name_2',[4,5]),
    math_load_value(x(3),3),
    math_load_value(x(1),1),
    function('Fct_Add',1,[3,1]),
    execute('$sum_list1'/3)]).
