:- foreign(babel_c_0(+integer, -integer)). :- foreign(babel_c_1(+string, +integer)). foo(__RETRES3) :- babel_c_0(23 ,TMP), write(TMP),nl, A is TMP, babel_c_1('%d\n', A), __RETRES3 is 0. foo1(N, T) :- BabelExp_0 is N + 1, T is BabelExp_0.