-- | main function, in charge of computing the quotient term algebra
quotientTermAlgebra :: CASLMor -- sigma : Sigma -> SigmaM
                    -> [Named CASLFORMULA] -- Th(M)
                    -> Result (CASLSign, {- SigmaK
                               CASLMor, -- iota : SigmaM' -> SigmaK -}
                               [Named CASLFORMULA] -- Ax(K)
                              )
quotientTermAlgebra sigma sens =
                  let
                    sigma_0 = msource sigma
                    ss_0 = sortSet sigma_0
                    sigma_m = mtarget sigma
                    sigma_k = create_sigma_k ss_0 sigma_m
                    axs = create_axs ss_0 sigma_m sigma_k sens
                  in return (sigma_k, axs)
quotientTermAlgebra :: CASLMor -- sigma : Sigma -> SigmaM
                    -> [Named CASLFORMULA] -- Th(M)
                    -> Result (CASLSign, {- SigmaK
                               CASLMor, -- iota : SigmaM' -> SigmaK -}
                               [Named CASLFORMULA] -- Ax(K)
                              )
quotientTermAlgebra sigma sens =
                  let
                    sigma_0 = msource sigma
                    ss_0 = sortSet sigma_0
                    sigma_m = mtarget sigma
                    sigma_k = create_sigma_k ss_0 sigma_m
                    axs = create_axs ss_0 sigma_m sigma_k sens
                  in return (sigma_k, axs)
quotientTermAlgebra sigma sens =
                  let
                    sigma_0 = msource sigma
                    ss_0 = sortSet sigma_0
                    sigma_m = mtarget sigma
                    sigma_k = create_sigma_k ss_0 sigma_m
                    axs = create_axs ss_0 sigma_m sigma_k sens
                  in return (sigma_k, axs)