create_temp_file(ml,Sequent,FileName,OutputFileName) :-
% generate identifiers to remove primes, etc.
temporary_set_preference(bugly_pp_scrambling,true,Chng),
temp_file(S,FileName),
format(S,'THEORY Lemma;Unproved IS\n',[]),
% according to chapter 3 of the manuel_reference_prouveur.pdf the formulas need to be normalised
normalise_bexpr_for_ml(Sequent,SeqML),
translate_subst_or_bexpr_in_mode(atelierb_ml,SeqML,PPSequent),
debug_format(19,'Sending sequent to ML: ~w~n',[PPSequent]),
format(S,'~w\n',PPSequent),
temp_file(STemp,OutputFileName),
format(S, 'WHEN Force IS (0;1;2;3) WHEN FileOut IS "~w"\n', [OutputFileName]),
format(S, 'WHEN Options IS ? & ? & ? & OK & "" & dummy & KO\nEND\n', []),
close(S),
close(STemp),
reset_temporary_preference(bugly_pp_scrambling,Chng).
create_temp_file(pp,Sequent,FileName,OutputFileName) :-
% generate identifiers to remove primes, etc.
temporary_set_preference(bugly_pp_scrambling,true,Chng),
temp_file(S,FileName),
temp_file(STemp,OutputFileName),
format(S,'Flag(FileOn("~w")) & Set(toto | ',[OutputFileName]),
translate_subst_or_bexpr_in_mode(atelierb_pp,Sequent,PPSequent),
format(S, '~w )\n', [PPSequent]),
debug_format(19, 'PP Sequent: ~w~n', [PPSequent]),
close(S),
close(STemp),
reset_temporary_preference(bugly_pp_scrambling,Chng).