Hi passerby,
It normally takes specialized equipment to slit foam horizontally but you could try using an exacto knife or razor blade or very sharp paring knife (or an electric carving knife) to cut very carefully and slowly in between the foam layers where they are glued while you are also “pulling up” on the upper layer to separate the foam layers. You may find that the edges are glued more strongly and that the areas more inside the mattress either don’t have glue (hopefully) or are glued less firmly. I would “expect” some tearing of the foam but if you are very careful and move slowly you can help to minimize rips and tearing.
If you need to cut through a foam layer rather than where two layers are glued together this will be much more difficult without specialized equipment but I would try an electric knife and again go very slowly and carefully so that your cut lines will be as straight as possible although this will be very difficult. You could try a setup such as this and work with just a few inches at a time and then move foam layer up inside the frame each time you have cut a few inches.
You could also take the foam layer (or layers) to a local foam shop or upholstery store that cuts foam that may be able to slit the layer for you which would be much easier and more effective than trying to do it yourself.
Phoenix