Hi,
You can add a run identifier in your fact, and have your rule check that run ID.
So, to illustrate in your minimal example :
- change rule A1 to generate a fresh run ID Fr(~runID), and modified Transfer facts, with TranferA(~runID, a) and TransferB(~runID, b)
- then in rule X2, force the two facts in the premise to have the *same* runID, and you will ensure that both Transfer facts come from the same instance of A1
- later, when you want to start exploring the more complex cases, you can change X2 again to allow different run IDs, and this will go back to the situation you currently have. Note that you can do this JUST by changing X2, you don't have to modify A1 or the arity of the Transfer facts again, so it's relatively easy to do (at least in this minimal example)
It's hard to tell if this is a suitable solution for your *real* case, but I hope it can at least give you some ideas.
(By the way, totally unrelated to your question, but I think in rule A1 you should not force a and b to be fresh. Writing the model like that means that, at the time point when rule A1 is executed, the agent can be sure that a and b are fresh, so check if that is really what you mean.)
Best,
Simon