def update_modified_from_license_info(delta, unique_categories):
    """
    Increase a 'modified' Delta object's 'score' attribute and add
    one or more categories to its 'factors' attribute if there has
    been a license change.
    """
    if not delta.new_file.has_licenses() and delta.old_file.has_licenses():
        delta.update(15, 'license info removed')
        return
    new_licenses = delta.new_file.licenses or []
    old_licenses = delta.old_file.licenses or []
    new_categories = set(license.category for license in new_licenses)
    old_categories = set(license.category for license in old_licenses)
    if delta.new_file.has_licenses() and not delta.old_file.has_licenses():
        delta.update(20, 'license info added')
        for category in new_categories:
            if category in unique_categories:
                delta.update(20, category.lower() + ' added')
        return
    new_keys = set(license.key for license in new_licenses)
    old_keys = set(license.key for license in old_licenses)
    if new_keys != old_keys:
        delta.update(10, 'license change')
        for category in (new_categories - old_categories):
            if len(old_categories & unique_categories
                ) == 0 and category in unique_categories:
                delta.update(20, category.lower() + ' added')
