He is about 4 yrs old. I know he is demented, but I don't think it is dementia!

He has always been a sound sleeper and when I was looking online, there are quite a few dogs that have strange behavior like that and then go back to sleep. Maybe he is having a nightmare, but I will call my vet. Thank you for responding so quickly.