Groupoids And Semigroups In Logic