A theory of oracle machines