Reverse Matter?

I would like to do something rather odd in my game, and while it may be possible I expect it would be way too much work... regardless, this is the place I should come to ask. Bare with me if I am confusing...
I would like to use some bodies in an opposite fashon... I would like some bodies to have other bodies inside of them, which collide with their edges as if they were outside of them... thus containing them. Perhaps I would be better describing it more along the lines of: 'if colliding with body, move freely; if not colliding with body, do not move freely'... though doing something like that would just have it drift out of the edge and thus get stuck... I would rather have it collide with the edge, and bounce back. The reason I want to do this is because I want to have a cave-like level which shifts around... it would be rather difficult especially in the manner I want to do it... to do it otherwise... that being said, it would be desirable to also ignore the edges of this 'empty space' body, that are within another 'empty space' body.
Does anyone understand what I am trying to ask for, and does anyone have a good idea on a relatively simplistic way to do this? I have an idea, but my experiance with Box2D is limited, so I am looking for someone with more experiance's suggestion.
Currently you'll have to compose the walls / ceilings / floor of the "cave" as a bunch of separate shapes (within one static body). There's no way to "carve out" a space within a shape.

This actually hints at something I've had on my personal "wish list" for a while but never mentioned - boolean shapes (like the "boolean objects" you'll find in many 3d authoring tools). For example, say you've got a giant box shape, and you want to "carve" out a circle in the middle of it within which bodies can move. So you'd have a "positive space" giant-box, then a "negative-space" circle within the same body. BorisTheBrave's custom "ConcaveArc" shape seems to kinda do this, although I haven't actually played around with it.

Consider the test-bed examples, which have 4 boxes to define the floor, ceiling and 2 walls. With "boolean shapes" you could define this with 2 shapes - one negative box and one slightly bigger positive box.
I've been working on a convex arc as well as a concave arc for precisely this reason. When the two objects are completed, the set of possible bodies that can be made is closed under the operations of intersection, union and subtraction, which I think is a pretty neat property.
But the union and subtraction code would not be written, and some outlines, e.g. rainbows, would require absurd numbers of shapes to represent.

As for negative shapes, I have a few ideas, but this is basically something you cannot do.
Firstly, stick with polygons. Without my shapes, inverting circles is impossible, and even then very hard.
Secondly, I have a suggestion that may or may not work, which is usually means it doesn't. If your cave is desribed by shapes s1, s2, ... then you were looking for the shape inverse(s1 union s2 union ... sn), where inverse(s) is the collection of shapes that match a very large square with s subtracted. Calculating unions and inverses is hard stuff (though i'm sure you can find algorithms on the internet), so it looks unappealing. But with boolean logic, we know this is the same as inverse(s1) intersect inverse(s2) intersect ... inverse(sn). So you calculate (or premake) inverse(si) out of shapes, and then whenever you detect a collision for any of these inverse shapes, ignore it for that frame if the collision point is not also inside inverse(si) for every other i. "poor mans intersection" if you will.

Original thread: https://box2d.org/forum/viewtopic.php?t=716