A theory of direct inference