add missing scripts

This commit is contained in:
Tiago Gomes 2012-04-18 02:52:31 +01:00
parent b7e9245f26
commit d22b5a97fd
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#! /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, 'people(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).

View File

@ -0,0 +1,23 @@
#!/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).