This inference is implemented using a beam search that looks at arguments in a fixed order and roles from A0 up.
in the case of ties there is a preference for first seen solutions, meaning A0A1 in this case.