  A lifting of a semilattice S is an algebra A such that the semilattice of
compact (=finitely generated) congruences of A is isomorphic to S. The aim of
this work is to give a categorical theory of partial algebras endowed with a
partial subalgebra together with a semilattice-valued distance, that we call
gamps. This part of the theory is formulated in any variety of (universal)
algebras. Let V and W be varieties of algebras (on a finite similarity type).
Let P be a finite lattice of order-dimension d>0. Assume that we have a diagram
of semilattice with a lifting in V, but with no "partial lifting" in the
category of gamps of W, then there is a semilattice S of cardinality aleph (d -
1), such that S has a lifting in V, but S has no lifting in W. We already knew
a similar result for diagrams with no lifting in W, however the semilattice S
constructed here has cardinality aleph d. Gamps are also used to study
congruence-preserving extensions. Denote by M the variety generated by the
lattice of length two, with three atoms. We construct a lattice A in M of
cardinality aleph 1 with no congruence n-permutable, congruence-preserving
extension, for each n > 1.
