Nature of logic and perception