maplist( GoalName, [In|RestIn], [Out|RestOut], Extras ) :- !, Goal =.. [GoalName,In,Out|Extras], Goal, maplist(GoalName, RestIn, RestOut, Extras). maplist(_, [], [], _Extras).