-- toTseitinEncode' _  (FeatureRef e) = []

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