I’m using: SWI-Prolog version 8.1.10 for x86_64-linux
The following code:
test(Included) :-
Names = [a,b,c],
Objects = [_{name: a}, _{name : f}, _{name : c}, _{name : g}],
include({Names}/[Object]>>(memberchk(Object.name, Names)),
Objects, Included).
Has a listing of:
test(E) :-
A=[a, b, c],
D=[_{name:a}, _{name:f}, _{name:c}, _{name:g}],
'.'(B, name, C),
include({A}/[B]>>memberchk(C, A), D, E).
This transformation should happen internal to the yall predicate or we are never going to find the dictionary!