-- | applies the homomorphism operator to the term when possible
homomorphy_term :: CASLTERM -> CASLTERM
homomorphy_term (Qual_var v s r) = t
      where free_s = mkFreeName s
            v' = Qual_var v free_s r
            ot_hom = Op_type Partial [free_s] s nullRange
            name_hom = mkQualOp homId ot_hom
            t = mkAppl name_hom [v']
homomorphy_term :: CASLTERM -> CASLTERM
homomorphy_term (Qual_var v s r) = t
      where free_s = mkFreeName s
            v' = Qual_var v free_s r
            ot_hom = Op_type Partial [free_s] s nullRange
            name_hom = mkQualOp homId ot_hom
            t = mkAppl name_hom [v']
homomorphy_term (Qual_var v s r) = t
      where free_s = mkFreeName s
            v' = Qual_var v free_s r
            ot_hom = Op_type Partial [free_s] s nullRange
            name_hom = mkQualOp homId ot_hom
            t = mkAppl name_hom [v']