I’m using: SWI-Prolog version 9.3.6-22-g94ee9ff79
I’m finding differences in maplist and concurrent_maplist: the same goal using the first succeeds while using the latter fails.
The code to reproduce it is at lp4kg/fbk237 at main · friguzzi/lp4kg · GitHub
The predicates main
and mainc
differ only because the first uses maplist
while the latter concurrent_maplist
.
This is what I get:
[rzf@hnode01 fbk237]$ swipl computeinst_oi_100_order.pl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.6-22-g94ee9ff79)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- main.
tt(1,/m/040b5k,/film/film/other_crew./film/film_crew_gig/film_crew_role,/m/01pvkk) n(42)
tt(1,/m/085h1,/user/ktrueman/default_domain/international_organization/member_states,/m/06t8v) n(100)
tt(1,/m/050r1z,/film/film/other_crew./film/film_crew_gig/film_crew_role,/m/0ch6mp2) n(36)
qui
true.
?-
% halt
[rzf@hnode01 fbk237]$ swipl computeinst_oi_100_order.pl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.6-22-g94ee9ff79)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- mainc.
tt(1,/m/040b5k,/film/film/other_crew./film/film_crew_gig/film_crew_role,/m/01pvkk) tt(1,/m/085h1,/user/ktrueman/default_domain/international_organization/member_states,/m/06t8v) tt(1,/m/050r1z,/film/film/other_crew./film/film_crew_gig/film_crew_role,/m/0ch6mp2) n(39)
n(100)
n(42)
false.
?-
The code for the two predicates is
mainc:-
findall(tt(1,S,R,T),t(2,S,R,T),TestAtoms),
out(R00),
maplist(generate_cl,R00,Prog),
%maplist(write_ins(Prog),TestAtoms).
concurrent_maplist(write_ins(Prog),TestAtoms),
writeln(qui).
main:-
findall(tt(1,S,R,T),t(2,S,R,T),TestAtoms),
out(R00),
maplist(generate_cl,R00,Prog),
%maplist(write_ins(Prog),TestAtoms).
maplist(write_ins(Prog),TestAtoms),
writeln(qui).