Networks of constraints: Fundamental properties and applications to picture processing