The Pragmatic Roots of Logic and Metaphysics