Implementing the rules on this structure requires a formal definition of the lifting and coe rule checking processes. For the former we first note that we have a nice property of lifting: if any pieces are to be lifted at all they must be or border the piece just played, or else they would have been lifted on a previous turn. We then only have to branch our recursion out from the piece just played.
This algorithm is implemented in figure 1 as Lift. It uses two subroutines, the first of which, isSafe, determines recursively if a block of pieces of like color is safe from lifting. If any piece within the block borders an empty space then the whole block is declared safe. The second is removeBlock, a procedure that gets invoked once we decide that a block of pieces should be lifted. It does the actual removal from the board and updates the prisoner counts. It would be possible to combine these two routines into one procedure for an algorithm faster by a constant, but that would give messier code.
The main routine uses isSafe to check each opposite color piece adjacent to the one that was just played to see if it forms a block that should be lifted, using removeBlock on any that should be. Then it looks at the piece just played to see if it is in a block of same color pieces that should be lifted. If so, it goes ahead and lifts them. This leaves us with updated board and prisoner counts.