Tekstiviesti: An algebraic approach to multi-sorted constraints