We propose a general attention-based approach to thinking and cognition (more specifically reasoning and planning) in cognitive machines as based on the ability to manipulate neural activity in a virtual manner so as to achieve certain goals; this can then lead to decisions to make movements or to no actions whatever. The basic components are proposed to consist of forward/inverse model motor control pairs in an attention-control architecture, in which buffers are used to achieve sequencing by recurrence of virtual actions and attended states. How this model can apply to various reasoning paradigm will be described and first simulations presented using a virtual robot environment.