{- | computes the first part of the conjunction of the formula "largerThanKerH"
from the kernel of H for a concrete sort -}
ltkh_sort :: SORT -> CASLFORMULA
ltkh_sort s = imp'
     where free_s = mkFreeName s
           v1 = newVarIndex 1 free_s
           v2 = newVarIndex 2 free_s
           phi = phiName s
           pt = Pred_type [free_s, free_s] nullRange
           ps = mkQualPred phi pt
           ot_hom = Op_type Partial [free_s] s nullRange
           name_hom = mkQualOp homId ot_hom
           t1 = mkAppl name_hom [v1]
           t2 = mkAppl name_hom [v2]
           prem = mkExEq t1 t2
           concl = mkPredication ps [v1, v2]
           imp = mkImpl prem concl
           imp' = quantifyUniversally imp

-- | generates the axioms for satThM
ltkh_sort :: SORT -> CASLFORMULA
ltkh_sort s = imp'
     where free_s = mkFreeName s
           v1 = newVarIndex 1 free_s
           v2 = newVarIndex 2 free_s
           phi = phiName s
           pt = Pred_type [free_s, free_s] nullRange
           ps = mkQualPred phi pt
           ot_hom = Op_type Partial [free_s] s nullRange
           name_hom = mkQualOp homId ot_hom
           t1 = mkAppl name_hom [v1]
           t2 = mkAppl name_hom [v2]
           prem = mkExEq t1 t2
           concl = mkPredication ps [v1, v2]
           imp = mkImpl prem concl
           imp' = quantifyUniversally imp

-- | generates the axioms for satThM
ltkh_sort s = imp'
     where free_s = mkFreeName s
           v1 = newVarIndex 1 free_s
           v2 = newVarIndex 2 free_s
           phi = phiName s
           pt = Pred_type [free_s, free_s] nullRange
           ps = mkQualPred phi pt
           ot_hom = Op_type Partial [free_s] s nullRange
           name_hom = mkQualOp homId ot_hom
           t1 = mkAppl name_hom [v1]
           t2 = mkAppl name_hom [v2]
           prem = mkExEq t1 t2
           concl = mkPredication ps [v1, v2]
           imp = mkImpl prem concl
           imp' = quantifyUniversally imp

-- | generates the axioms for satThM