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


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


predicate('$term_to_goal'/3,28,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),3),
    put_atom('$call_call_info',3),
    call_c_test('Blt_G_Assign',[3,1]),
    put_atom('$new_term',1),
    put_atom(f,3),
    call_c_test('Blt_G_Assign',[1,3]),
    put_value(x(2),1),
    call('$term_to_goal1'/2),
    put_atom('$new_term',0),
    put_atom(t,1),
    call_c_test('Blt_G_Read',[0,1]),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_value(x(2),0),
    proceed]).


predicate('$term_to_goal1'/2,38,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call('$term_to_goal2'/2),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(callable,0),
    execute('$pl_err_type'/2)]).


predicate('$term_to_goal2'/2,46,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    get_variable(x(3),0),
    call_c_test('Blt_Var',[3]),
    cut(x(2)),
    put_atom('$call_call_info',2),
    put_variable(x(0),4),
    call_c_test('Blt_G_Read',[2,4]),
    put_atom('$new_term',2),
    put_atom(t,4),
    call_c_test('Blt_G_Assign',[2,4]),
    put_value(x(3),2),
    execute('$$term_to_goal2/2_$aux1'/3),

label(1),
    retry_me_else(9),
    switch_on_term(3,fail,fail,fail,2),

label(2),
    switch_on_structure([((->)/2,4),((',')/2,6),((;)/2,8)]),

label(3),
    try_me_else(5),

label(4),
    allocate(2),
    get_structure((->)/2,0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_structure((->)/2,1),
    unify_variable(x(1)),
    unify_variable(y(1)),
    cut(x(2)),
    call('$term_to_goal2'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute('$term_to_goal2'/2),

label(5),
    retry_me_else(7),

label(6),
    allocate(2),
    get_structure((',')/2,0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_structure((',')/2,1),
    unify_variable(x(1)),
    unify_variable(y(1)),
    cut(x(2)),
    call('$term_to_goal2'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute('$term_to_goal2'/2),

label(7),
    trust_me_else_fail,

label(8),
    allocate(2),
    get_structure((;)/2,0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_structure((;)/2,1),
    unify_variable(x(1)),
    unify_variable(y(1)),
    cut(x(2)),
    call('$term_to_goal2'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute('$term_to_goal2'/2),

label(9),
    trust_me_else_fail,
    get_value(x(1),0),
    call_c_test('Blt_Callable',[1]),
    proceed]).


predicate('$$term_to_goal2/2_$aux1'/3,46,static,private,built_in,[
    load_cut_level(3),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_atom(none,0),
    cut(x(3)),
    get_structure(call/1,1),
    unify_local_value(x(2)),
    proceed,

label(2),
    trust_me_else_fail,
    get_structure('$call_internal'/2,1),
    unify_local_value(x(2)),
    unify_local_value(x(0)),
    proceed]).


predicate('$check_list'/1,79,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_List',[0]),
    cut(x(1)),
    proceed,

label(1),
    retry_me_else(2),
    call_c_test('Blt_List_Or_Partial_List',[0]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(2),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(list,0),
    execute('$pl_err_type'/2)]).


predicate('$check_list_or_partial_list'/1,94,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_List_Or_Partial_List',[0]),
    cut(x(1)),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(list,0),
    execute('$pl_err_type'/2)]).


predicate('$check_atom_or_atom_list'/1,104,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Atom',[0]),
    cut(x(1)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(1),
    get_variable(y(0),1),
    call('$check_atom_or_atom_list1'/1),
    cut(y(0)),
    deallocate,
    proceed]).


predicate('$check_atom_or_atom_list1'/1,113,static,private,built_in,[
    try_me_else(1),
    call_c_test('Blt_Var',[0]),
    execute('$pl_err_instantiation'/0),

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),
    proceed,

label(4),
    trust_me_else_fail,

label(5),
    allocate(1),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    call('$check_atom_or_atom_list2'/1),
    put_value(y(0),0),
    deallocate,
    execute('$check_atom_or_atom_list1'/1),

label(6),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(list,0),
    execute('$pl_err_type'/2)]).


predicate('$check_atom_or_atom_list2'/1,127,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Atom',[0]),
    cut(x(1)),
    proceed,

label(1),
    retry_me_else(2),
    call_c_test('Blt_Var',[0]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(2),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(atom,0),
    execute('$pl_err_type'/2)]).


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

label(1),
    get_structure((:-)/2,0),
    unify_local_value(x(1)),
    unify_local_value(x(2)),
    cut(x(3)),
    put_value(x(1),0),
    execute('$check_head'/1),

label(2),
    trust_me_else_fail,
    get_atom(true,2),
    get_value(x(1),0),
    put_value(x(1),0),
    execute('$check_head'/1)]).


predicate('$check_head'/1,152,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Var',[0]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(1),
    trust_me_else_fail,
    execute('$$check_head/1_$aux1'/1)]).


predicate('$$check_head/1_$aux1'/1,157,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Callable',[0]),
    cut(x(1)),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(callable,0),
    execute('$pl_err_type'/2)]).


predicate('$get_pred_indic'/3,164,static,private,built_in,[
    call_c_test('Get_Pred_Indic_3',[0,1,2]),
    proceed]).
