pseudocode for rbn rmi:
pseudocode