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


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


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


predicate(expand_term/2,49,static,private,monofile,built_in,[
    allocate(2),
    get_variable(y(0),1),
    put_variable(y(1),1),
    call('$expand_term1'/2),
    put_unsafe_value(y(1),0),
    get_value(y(0),0),
    deallocate,
    proceed]).


predicate('$expand_term1'/2,53,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    allocate(1),
    get_variable(y(0),2),
    call('$$expand_term1/2_$aux1'/2),
    cut(y(0)),
    deallocate,
    proceed]).


predicate('$$expand_term1/2_$aux1'/2,53,static,private,monofile,local,[
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    get_value(x(0),1),
    proceed,

label(1),
    retry_me_else(2),
    execute('$call_term_expansion'/2),

label(2),
    retry_me_else(3),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[expand_term,2]),
    execute('$dcg_trans_rule'/2),

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


predicate('$call_term_expansion'/2,65,static,private,monofile,built_in,[
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_structure((/)/2,0),
    unify_atom(term_expansion),
    unify_integer(2),
    call(current_predicate/1),
    put_structure(term_expansion/2,0),
    unify_local_value(y(0)),
    unify_local_value(y(1)),
    put_atom('$call_term_expansion',1),
    put_integer(2,2),
    put_atom(true,3),
    deallocate,
    execute('$call'/4)]).


predicate(phrase/2,72,static,private,monofile,built_in,[
    put_nil(2),
    put_integer(2,3),
    execute('$phrase'/4)]).


predicate(phrase/3,78,static,private,monofile,built_in,[
    put_integer(3,3),
    execute('$phrase'/4)]).


predicate('$phrase'/4,84,static,private,monofile,built_in,[
    allocate(6),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    put_atom(phrase,0),
    put_value(y(3),1),
    call_c('Pl_Set_Bip_Name_2',[],[x(0),x(1)]),
    put_value(y(0),0),
    call('$$phrase/4_$aux1'/1),
    put_value(y(0),0),
    put_value(y(1),1),
    put_variable(y(4),2),
    put_variable(y(5),3),
    call('$dcg_trans_body'/4),
    put_value(y(5),0),
    put_atom(phrase,1),
    put_value(y(3),2),
    put_atom(true,3),
    call('$call'/4),
    put_value(y(2),0),
    get_value(y(4),0),
    deallocate,
    proceed]).


predicate('$$phrase/4_$aux1'/1,84,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$dcg_trans_rule'/2,100,static,private,monofile,built_in,[
    call_c('Pl_Dcg_Trans_Rule_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate('$dcg_trans_body'/4,106,static,private,monofile,built_in,[
    call_c('Pl_Dcg_Trans_Body_4',[boolean],[x(0),x(1),x(2),x(3)]),
    proceed]).
