This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/benchmarks/smokers/gen_people.sh
2012-05-23 17:27:21 +01:00

24 lines
465 B
Bash
Executable File

#!/home/tgomes/bin/yap -L --
:- initialization(main).
main :-
unix(argv([N])),
atomic_concat(['pop', N, '.yap'], FileName),
open(FileName, 'write', S),
atom_number(N, N2),
generate_people(S, N2, 4),
write(S, '\n'),
close(S).
generate_people(S, N, Counting) :-
Counting > N, !.
generate_people(S, N, Counting) :-
format(S, 'people(p~w).~n', [Counting]),
Counting1 is Counting + 1,
generate_people(S, N, Counting1).