The cohomology of pregroups