The foundations of plant intelligence