The inference algorithm achieving this is an extension of the matching algorithm described above.
It collects all capabilities that are required by A or one of its sub-actions, checks which of these capabilities are unavailable on R and produces a list of missing capabilities MissingCapabilities.
Iteration over MissingCapabilities and collecting all their component dependencies results in the list of missing components. Note that sub-capabilities have to be considered recursively and a component dependency has to be checked if it is really
nonexistent on R as missing capabilities usually depend on existing and nonexistent components.