Let $X_1,X_2,X_3,X_4$ be four nonempty sets, and $$A:X_1imes X_2imes X_3\rightarrow X_4$$ then the ordered fivefold $(X_1,X_2,X_3,X_4;A)$ we call $G$-groupoid (generalized ternary groupoid).