Can't grate those buildings, though hm...Can build them over unfloored downstairs. Do they leave water if flooded to swimming level?
Have a library with purple ponderer inside™.
Result:
Gonna keep pondering while in 6/7 water. Though they got pushed around and eventually left the library, still pondering. Drank, and returned to pondering, still outside the library zone. Though they returned to other locations after sleeping, and I believe didn't gain exp outside (only 5 exp total inside+outside)
So, making their location unpathable may not completely shake them free from the job.
EDIT: Experiments with overlapping temples and taverns:
Quick test with hacking a dwarf to be badly distracted without a prayer, then placing a temple over the tavern/meeting area resulted in them keeping on doing socializing jobs, even after being interrupted by drinking, sleeping and gathering plants, and even felling a tree outside both zones, even after retiring the temple and planting a new one. Only got prayers after retired both, then first planted temple, then planted tavern.
Which seemed to be less persistent with just praying, though still quite sticky (expect for dubious worshipper, who never prayed) and while everyone managed to do socializing job they tended to go right back to sticky-praying afterwards.
Hm...
Wait a sec!
Worship song
Worship poetry
that should change values (but found no change over the year and half of testing)
They never do any tavern labours when temple is first, I guess. Thanks for telling me about non-praying jobs, FantasticDorf; I had given up on them completely.
Overall, while praying is still sticky/#1 activity in temples, could be that I just made too small temples before after seeing only praying?
It's over a millennia old world here, though, so time for them to emerge.
It's inconsistent enough to drive some needs to brown and
doesn't fulfil some needs (though at least 1 singer could argue and meet friends later,
somehow, while listeners
couldn't [Seems only some dwarves performed, with others just listening. Indication of needing to worship the god you're singing to?]),
but I guess temples are more useful than I previously thought,
to the point of being capable of replacing tavern in its' entirety for {your citizens who are not dubious worshippers and know and like to perform religious performances generated in worldgen}, and if you lay tavern over temple, allow dubious worshippers to socialize between themselves (creating cliques who never communicate in same 10x10 meter space!).
However. What if the location was partially on youngest, partially oldest zone?
A quick test confirms that it's about the lowest numbered activity zone, not location.
Another quick test shows that two adjacent 5x5 zones don't get merged into 10x5 floor space (drat).
A third test shows that insufficient floor space temple(d-x dots)-tavern-sufficient floor space temple does allow them to keep and repeat religious performances
A fourth test with checkerboard temple-tavern-temple resulted in mostly praying, but at least 1 socializer moving to temple part of checkerboard, and starting praying after a nap, and much rarer other way around.
One could ensure "accidentally" moving around by making them dodge (via sparring, wooden ballista, lowest-speed roller minecarts or whatnot), though if they get observer experience it's going to contaminate your scholars.
However. I definitely know/have a new idea on how to define temple/tavern zones (Albeit aesthetically, this doesn't play too well with individual temples.)
{All testing done in 43.03}