teakS :: Width -> Slice Int -> [Slice Int] -> [[Implicant]] -> Chan -> [Chan] ->
        MkPNMonad SimFlow SimValue ()
    teakS inpWidth guardSlice outSlices impss ((inpR, inpA),_) out = withLabel "S" $ do
        reqPlace <- withLabel "r" $ newNumericPlace inpWidth []
        ackPlace <- withLabel "a" $ newBlackPlace []
        withLabel "ir" $ newTrans [inpR] [reqPlace] [PNInput 0]
        withLabel "ia" $ newTrans [ackPlace] [inpA] [PNLiteral token]
        let
            makeOut (_, (outR, outA)) (i, outSlice, imps) = withLabel ("o" ++ show i) $ do
                withLabel "r" $ newCondTrans canFire [reqPlace] [outR] [pnBitfield outSlice (PNInput 0)]
                withLabel "a" $ newTrans [outA] [ackPlace] [PNLiteral token]
                where
                    -- canFire inp = any (impIsCoveredByImp (sliceWidth guardSlice) (Imp guard 0)) imps
                    canFire = PNMatch guardSlice imps $ PNInput 0

        zipWithM makeOut out $ zip3 [(0::Int)..] outSlices impss
        return ()
teakS :: Width -> Slice Int -> [Slice Int] -> [[Implicant]] -> Chan -> [Chan] ->
        MkPNMonad SimFlow SimValue ()
teakS inpWidth guardSlice outSlices impss ((inpR, inpA),_) out = withLabel "S" $ do
        reqPlace <- withLabel "r" $ newNumericPlace inpWidth []
        ackPlace <- withLabel "a" $ newBlackPlace []
        withLabel "ir" $ newTrans [inpR] [reqPlace] [PNInput 0]
        withLabel "ia" $ newTrans [ackPlace] [inpA] [PNLiteral token]
        let
            makeOut (_, (outR, outA)) (i, outSlice, imps) = withLabel ("o" ++ show i) $ do
                withLabel "r" $ newCondTrans canFire [reqPlace] [outR] [pnBitfield outSlice (PNInput 0)]
                withLabel "a" $ newTrans [outA] [ackPlace] [PNLiteral token]
                where
                    -- canFire inp = any (impIsCoveredByImp (sliceWidth guardSlice) (Imp guard 0)) imps
                    canFire = PNMatch guardSlice imps $ PNInput 0

        zipWithM makeOut out $ zip3 [(0::Int)..] outSlices impss
        return ()
teakS inpWidth guardSlice outSlices impss ((inpR, inpA),_) out = withLabel "S" $ do
        reqPlace <- withLabel "r" $ newNumericPlace inpWidth []
        ackPlace <- withLabel "a" $ newBlackPlace []
        withLabel "ir" $ newTrans [inpR] [reqPlace] [PNInput 0]
        withLabel "ia" $ newTrans [ackPlace] [inpA] [PNLiteral token]
        let
            makeOut (_, (outR, outA)) (i, outSlice, imps) = withLabel ("o" ++ show i) $ do
                withLabel "r" $ newCondTrans canFire [reqPlace] [outR] [pnBitfield outSlice (PNInput 0)]
                withLabel "a" $ newTrans [outA] [ackPlace] [PNLiteral token]
                where
                    -- canFire inp = any (impIsCoveredByImp (sliceWidth guardSlice) (Imp guard 0)) imps
                    canFire = PNMatch guardSlice imps $ PNInput 0

        zipWithM makeOut out $ zip3 [(0::Int)..] outSlices impss
        return ()