Infer dependencies