toTseitinEncode' gs (Not e1) =
    let gl = gs ++ [1]
        w  = newRef gs
        w1 = newRef gl
        in [And (Or (Not w) (Not w1)) (Or w w1) ] ++ (toTseitinEncode' gl e1)
toTseitinEncode' gs (Not e1) =
    let gl = gs ++ [1]
        w  = newRef gs
        w1 = newRef gl
        in [And (Or (Not w) (Not w1)) (Or w w1) ] ++ (toTseitinEncode' gl e1)
toTseitinEncode' gs (Not e1) =
    let gl = gs ++ [1]
        w  = newRef gs
        w1 = newRef gl
        in [And (Or (Not w) (Not w1)) (Or w w1) ] ++ (toTseitinEncode' gl e1)