Hello,

I’d like to generate a rule with variables, based on ground facts.

Suppose I have:

R = rule(x,z) :- fact(x, y), fact(y,z), transform(R, R_out).

R_out = rule(X-x, Z-z) :- fact(X-x, Y-y), fact(Y-y, Z-z).

The idea is that R_out becomes a callable rule.

Essentially, generating corresponding variables, but retaining the source grounds for each via pair.

Its a kind of complication steps, to turn data into a rule.

I guess it required the ability to generate variables, store and retrieve them as new term is constructed.

Can something like this be done.

thanks,

Dan