The term used is canine cognitive dysfunction syndrome, or CDS.
A dog staring at the wall or a dog staring at nothing are symptoms of this disorder.
The dog may wander into a corner or behind furniture and seem "stuck." Dogs suffering from dementia may forget their house training.