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


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


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


predicate('.'/2,30,static,private,built_in,[
    get_variable(x(2),0),
    put_list(0),
    unify_local_value(x(2)),
    unify_local_value(x(1)),
    execute(consult/1)]).


predicate(consult/1,36,static,private,built_in,[
    load_cut_level(1),
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_atom(consult,0),
    put_integer(1,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_value(y(0),0),
    call('$check_atom_or_atom_list'/1),
    cut(y(1)),
    put_value(y(0),0),
    deallocate,
    execute('$consult/1_$aux1'/1)]).


predicate('$consult/1_$aux1'/1,36,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Atom',[0]),
    put_nil(2),
    call_c_test('Blt_Term_Neq',[0,2]),
    cut(x(1)),
    execute('$consult2'/1),

label(1),
    trust_me_else_fail,
    execute('$consult1'/1)]).


predicate('$consult1'/1,44,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),
    allocate(1),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    call('$consult2'/1),
    put_value(y(0),0),
    deallocate,
    execute('$consult1'/1)]).


predicate('$consult2'/1,51,static,private,built_in,[
    allocate(2),
    get_variable(x(1),0),
    put_variable(x(0),2),
    call_c_test('Prolog_File_Name_2',[1,2]),
    put_variable(y(0),1),
    call('$$consult2/1_$aux1'/2),
    put_atom('',0),
    put_atom(gplc,1),
    put_variable(y(1),2),
    call(temporary_file/3),
    put_value(y(1),0),
    call(write_pl_state_file/1),
    put_atom(consult,0),
    put_integer(1,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_unsafe_value(y(1),0),
    put_unsafe_value(y(0),1),
    deallocate,
    execute('$$consult2/1_$aux2'/2)]).


predicate('$$consult2/1_$aux2'/2,51,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),2),
    put_value(y(0),0),
    call('$consult3'/2),
    cut(y(1)),
    put_value(y(0),0),
    call('$load_file'/1),
    put_value(y(0),0),
    deallocate,
    execute(unlink/1),

label(1),
    trust_me_else_fail,
    allocate(0),
    call(unlink/1),
    put_atom(top_level_output,0),
    put_atom('compilation failed~n',1),
    put_nil(2),
    call(format/3),
    fail]).


predicate('$$consult2/1_$aux1'/2,51,static,private,built_in,[
    load_cut_level(2),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_atom(user,0),
    cut(x(2)),
    get_value(x(0),1),
    proceed,

label(2),
    trust_me_else_fail,
    get_variable(x(2),1),
    get_variable(x(1),0),
    call_c_test('Absolute_File_Name_2',[1,2]),
    put_value(x(2),0),
    execute('$$consult2/1_$aux3'/2)]).


predicate('$$consult2/1_$aux3'/2,51,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call(file_exists/1),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    put_atom(consult,0),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[0,2]),
    put_atom(source_sink,0),
    execute('$pl_err_existence'/2)]).


predicate('$consult3'/2,76,static,private,built_in,[
    call_c_test('Consult_2',[0,1]),
    proceed]).


predicate('$load_file'/1,92,static,private,built_in,[
    load_cut_level(1),
    allocate(3),
    get_variable(y(0),1),
    put_atom(read,1),
    put_variable(y(1),2),
    call(open/3),
    call(repeat/0),
    put_value(y(1),0),
    put_variable(y(2),1),
    call(read/2),
    put_value(y(2),0),
    put_value(y(0),1),
    put_value(y(1),2),
    call('$$load_file/1_$aux1'/3),
    put_unsafe_value(y(1),0),
    deallocate,
    execute(close/1)]).


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

label(1),
    get_atom(end_of_file,0),
    cut(x(3)),
    cut(x(1)),
    proceed,

label(2),
    trust_me_else_fail,
    allocate(0),
    put_value(x(2),1),
    call('$load_pred'/2),
    fail]).


predicate('$load_pred'/2,105,static,private,built_in,[
    load_cut_level(2),
    switch_on_term(2,fail,fail,fail,1),

label(1),
    switch_on_structure([(file_name/1,3),(directive/3,5),(predicate/6,7)]),

label(2),
    try_me_else(4),

label(3),
    get_structure(file_name/1,0),
    unify_variable(x(1)),
    put_atom('$pl_file',0),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_structure(directive/3,0),
    unify_variable(x(1)),
    unify_variable(x(2)),
    unify_variable(x(0)),
    execute('$$load_pred/2_$aux1'/3),

label(6),
    trust_me_else_fail,

label(7),
    allocate(9),
    get_structure(predicate/6,0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    unify_variable(y(2)),
    unify_variable(y(3)),
    unify_variable(y(4)),
    unify_variable(y(5)),
    get_variable(y(6),1),
    get_variable(y(7),2),
    put_atom('$pl_file',0),
    put_variable(y(8),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_value(y(0),0),
    put_value(y(8),1),
    put_value(y(1),2),
    call('$check_pred_type'/3),
    put_value(y(0),0),
    put_value(y(8),1),
    put_value(y(1),2),
    call('$check_owner_files'/3),
    put_value(y(0),0),
    get_structure((/)/2,0),
    unify_variable(x(0)),
    unify_variable(x(1)),
    put_value(y(8),2),
    put_value(y(1),3),
    put_value(y(2),4),
    put_value(y(3),5),
    put_value(y(4),6),
    call('$bc_start_pred'/7),
    put_atom('$ctr',0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    call(repeat/0),
    put_atom('$ctr',1),
    put_variable(x(0),2),
    call_c_test('Blt_G_Read',[1,2]),
    put_atom(is,1),
    put_integer(2,2),
    call_c('Set_Bip_Name_2',[1,2]),
    math_load_value(x(0),1),
    function('Fct_Inc',2,[1]),
    put_atom('$ctr',1),
    call_c_test('Blt_G_Assign',[1,2]),
    put_value(y(5),1),
    put_value(y(6),2),
    call('$$load_pred/2_$aux2'/3),
    cut(y(7)),
    deallocate,
    proceed]).


predicate('$$load_pred/2_$aux2'/3,119,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    get_value(x(1),0),
    cut(x(3)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(2),
    put_value(x(2),0),
    put_structure(clause/2,1),
    unify_variable(y(0)),
    unify_variable(y(1)),
    call(read/2),
    put_value(y(0),0),
    put_value(y(1),1),
    call('$add_clause_term_and_bc'/2),
    fail]).


predicate('$$load_pred/2_$aux1'/3,108,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    allocate(1),
    get_variable(x(4),2),
    get_variable(x(5),1),
    get_variable(x(1),0),
    get_variable(y(0),3),
    put_structure(call/1,0),
    unify_local_value(x(1)),
    put_structure('$load_directive_exception'/3,2),
    unify_variable(x(1)),
    unify_local_value(x(5)),
    unify_local_value(x(4)),
    put_atom('$load_pred',3),
    put_integer(2,4),
    put_atom(true,5),
    call('$catch'/6),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_variable(x(0),2),
    put_atom('$pl_file',2),
    put_variable(x(3),4),
    call_c_test('Blt_G_Read',[2,4]),
    put_list(2),
    unify_value(x(3)),
    unify_list,
    unify_local_value(x(1)),
    unify_list,
    unify_local_value(x(0)),
    unify_nil,
    put_atom(top_level_output,0),
    put_atom('warning: ~a:~d: ~a directive failed~n',1),
    execute(format/3)]).


predicate('$load_directive_exception'/3,141,static,private,built_in,[
    get_variable(x(3),2),
    put_atom('$pl_file',2),
    put_variable(x(4),5),
    call_c_test('Blt_G_Read',[2,5]),
    put_list(2),
    unify_value(x(4)),
    unify_list,
    unify_local_value(x(1)),
    unify_list,
    unify_local_value(x(3)),
    unify_list,
    unify_local_value(x(0)),
    unify_nil,
    put_atom(top_level_output,0),
    put_atom('warning: ~a:~d: ~a directive caused exception: ~q~n',1),
    execute(format/3)]).


predicate('$check_pred_type'/3,150,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    put_value(y(0),0),
    put_atom(native_code,1),
    call('$predicate_property_any'/2),
    cut(y(3)),
    put_value(y(0),0),
    get_structure((/)/2,0),
    unify_variable(x(0)),
    unify_void(1),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(0),3),
    call('$$check_pred_type/3_$aux1'/4),
    fail,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$$check_pred_type/3_$aux1'/4,150,static,private,built_in,[
    load_cut_level(4),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),4),
    call('$aux_name'/1),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_variable(x(0),2),
    put_list(2),
    unify_local_value(x(1)),
    unify_list,
    unify_local_value(x(0)),
    unify_list,
    unify_local_value(x(3)),
    unify_nil,
    put_atom(top_level_output,0),
    put_atom('error: ~a:~d: native code procedure ~q cannot be redefined (ignored)~n',1),
    execute(format/3)]).


predicate('$check_owner_files'/3,165,static,private,built_in,[
    load_cut_level(3),
    try_me_else(1),
    allocate(6),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    put_value(y(0),0),
    put_variable(y(4),1),
    put_variable(y(5),2),
    call('$get_predicate_file_info'/3),
    put_value(y(1),0),
    put_unsafe_value(y(4),1),
    call_c_test('Blt_Term_Neq',[0,1]),
    cut(y(3)),
    put_value(y(0),0),
    get_structure((/)/2,0),
    unify_variable(x(0)),
    unify_void(1),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(0),3),
    put_unsafe_value(y(4),4),
    put_unsafe_value(y(5),5),
    deallocate,
    execute('$$check_owner_files/3_$aux1'/6),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$$check_owner_files/3_$aux1'/6,165,static,private,built_in,[
    load_cut_level(6),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),6),
    call('$aux_name'/1),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    allocate(2),
    get_variable(y(0),4),
    get_variable(y(1),5),
    get_variable(x(0),2),
    put_list(2),
    unify_local_value(x(1)),
    unify_list,
    unify_local_value(x(0)),
    unify_list,
    unify_local_value(x(3)),
    unify_nil,
    put_atom(top_level_output,0),
    put_atom('warning: ~a:~d: redefining procedure ~q~n',1),
    call(format/3),
    put_atom(top_level_output,0),
    put_atom('         ~a:~d: previous definition~n',1),
    put_list(2),
    unify_local_value(y(0)),
    unify_list,
    unify_local_value(y(1)),
    unify_nil,
    deallocate,
    execute(format/3)]).


predicate(load/1,183,static,private,built_in,[
    load_cut_level(1),
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_atom(load,0),
    put_integer(1,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_value(y(0),0),
    call('$check_atom_or_atom_list'/1),
    cut(y(1)),
    put_value(y(0),0),
    deallocate,
    execute('$load/1_$aux1'/1)]).


predicate('$load/1_$aux1'/1,183,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Atom',[0]),
    put_nil(2),
    call_c_test('Blt_Term_Neq',[0,2]),
    cut(x(1)),
    execute('$load2'/1),

label(1),
    trust_me_else_fail,
    execute('$load1'/1)]).


predicate('$load1'/1,191,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),
    allocate(1),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    call('$load2'/1),
    put_value(y(0),0),
    deallocate,
    execute('$load1'/1)]).


predicate('$load2'/1,198,static,private,built_in,[
    allocate(3),
    get_variable(y(0),0),
    put_value(y(0),0),
    put_void(1),
    put_void(2),
    put_variable(y(1),3),
    call(decompose_file_name/4),
    put_value(y(1),0),
    put_value(y(0),1),
    put_variable(y(2),2),
    call('$$load2/1_$aux1'/3),
    put_value(y(2),1),
    put_variable(x(0),2),
    call_c_test('Absolute_File_Name_2',[1,2]),
    put_value(y(2),1),
    call('$$load2/1_$aux2'/2),
    put_atom(load,0),
    put_integer(1,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_unsafe_value(y(2),0),
    deallocate,
    execute('$load_file'/1)]).


predicate('$$load2/1_$aux2'/2,198,static,private,built_in,[
    load_cut_level(2),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call(file_exists/1),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    put_atom(load,0),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[0,2]),
    put_atom(source_sink,0),
    execute('$pl_err_existence'/2)]).


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

label(1),
    get_atom('',0),
    cut(x(3)),
    put_value(x(1),0),
    put_atom('.wbc',1),
    execute(atom_concat/3),

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


predicate('$bc_start_pred'/7,215,static,private,built_in,[
    call_c('BC_Start_Pred_7',[0,1,2,3,4,5,6]),
    proceed]).


predicate('$bc_start_emit'/0,220,static,private,built_in,[
    call_c('BC_Start_Emit_0',[]),
    proceed]).


predicate('$bc_stop_emit'/0,223,static,private,built_in,[
    call_c('BC_Stop_Emit_0',[]),
    proceed]).


predicate('$bc_emit'/1,226,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),
    allocate(1),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    call('$bc_emit_inst'/1),
    put_value(y(0),0),
    deallocate,
    execute('$bc_emit'/1)]).


predicate('$bc_emit_inst'/1,232,static,private,built_in,[
    call_c('BC_Emit_Inst_1',[0]),
    proceed]).


predicate('$bc_emulate_cont'/0,238,static,private,built_in,[
    call_c_jump('BC_Emulate_Cont_0',[]),
    proceed]).


predicate('$add_clause_term'/1,244,static,private,built_in,[
    put_integer(0,1),
    put_integer(0,2),
    execute('$assert'/3)]).


predicate('$add_clause_term_and_bc'/2,250,static,private,built_in,[
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    call('$bc_start_emit'/0),
    put_value(y(1),0),
    call('$bc_emit'/1),
    call('$bc_stop_emit'/0),
    put_value(y(0),0),
    deallocate,
    execute('$add_clause_term'/1)]).


predicate(listing/0,263,static,private,built_in,[
    put_atom(listing,0),
    put_integer(0,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_void(0),
    execute('$listing_all'/1)]).


predicate(listing/1,269,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    put_atom(listing,2),
    put_integer(1,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Blt_Var',[0]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(1),
    retry_me_else(2),
    get_variable(x(2),0),
    call_c_test('Blt_Atom',[2]),
    cut(x(1)),
    put_structure((/)/2,0),
    unify_local_value(x(2)),
    unify_void(1),
    execute('$listing_all'/1),

label(2),
    trust_me_else_fail,
    execute('$listing_all'/1)]).


predicate('$listing_all'/1,286,static,private,built_in,[
    allocate(2),
    get_variable(y(0),0),
    put_atom(strict_iso,0),
    put_variable(y(1),1),
    call(current_prolog_flag/2),
    put_value(y(0),0),
    put_unsafe_value(y(1),1),
    deallocate,
    execute('$$listing_all/1_$aux1'/2)]).


predicate('$$listing_all/1_$aux1'/2,286,static,private,built_in,[
    try_me_else(1),
    allocate(1),
    get_variable(y(0),0),
    put_atom(strict_iso,0),
    put_atom(off,1),
    call(set_prolog_flag/2),
    put_value(y(0),0),
    call('$current_predicate'/1),
    put_value(y(0),0),
    call('$listing_one'/1),
    fail,

label(1),
    trust_me_else_fail,
    put_atom(strict_iso,0),
    execute(set_prolog_flag/2)]).


predicate('$listing_one'/1,298,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),1),
    put_atom(native_code,1),
    call('$predicate_property_any'/2),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    retry_me_else(2),
    allocate(4),
    put_variable(y(0),1),
    put_variable(y(1),2),
    call('$get_pred_indic'/3),
    put_variable(y(2),0),
    put_value(y(0),1),
    put_value(y(1),2),
    call_c_test('Blt_Functor',[0,1,2]),
    put_atom(top_level_output,0),
    call(nl/1),
    put_value(y(2),0),
    put_variable(y(3),1),
    put_integer(2,2),
    call('$clause'/3),
    put_atom(top_level_output,0),
    put_structure((:-)/2,1),
    unify_local_value(y(2)),
    unify_local_value(y(3)),
    call(portray_clause/2),
    put_atom(top_level_output,0),
    call(nl/1),
    fail,

label(2),
    trust_me_else_fail,
    proceed]).
