There is nothing difficult in writing functions in the bases of Sheffer and Pierce, but the results are probably going to be too long. For Sheffer stroke | (NAND) we have , and . For Peirce arrow (NOR) we have , and . You see that formulas occur two times in the translation. I would write a program in some language that can handle inductive datatypes (such as ML or Scheme) to convert formulas to Sheffer and Pierce bases.