Defining Relations and Algorithmic Problems for Groups and Semigroups