A generalized commitment machine for 2CL protocols and its prolog implementation