I'm not sure I get it, but this works:
test_property_combined(G1,G2,Q):- assert((g12(Q1,Q2) :- combine(G1,G2,Q1,Q2))), some_property(g12,Q).
Ok maybe something like this
:- use_module(library(lambda)). test_property_combined(G1,G2,Q):- % (g12(Q1,Q2) :- combine(G1,G2,Q1,Q2)), Pred = \Z^T^combine(G1,G2,Z,T), some_property(Pred,Q). combine(G1,G2,(Q1,Q2),(Q3,Q4)):- Goal1 =.. [G1,Q1,Q3], Goal2 =.. [G2,Q2,Q4], call(Goal1), call(Goal2). some_property(G,Q):- call(G, Q, C), call(G, C, Q).
Last edit (hope so) with full code:
test_property_combined(G1,G2,Q):- some_property(combine(G1,G2),Q). combine(G1,G2,(Q1,Q2),(Q3,Q4)):- call(G1,Q1,Q3), call(G2,Q2,Q4). some_property(G,Q):- call(G, Q, C), call(G, C, Q). g1(a,b). g1(b,a). g2(c,d). g2(d,c).
@false => useful notes as usual!