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/city/gen_city.sh
2013-01-09 15:25:14 +00:00

34 lines
748 B
Bash
Executable File

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